function nonlin_newton_test ( )

%*****************************************************************************80
%
%% nonlin_newton_test() tests nonlin_newton().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 July 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../nonlin_newton' );

  timestamp ( );
  fprintf ( 1, 'nonlin_newton_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  nonlin_newton() is an interactive program to seek\n' );
  fprintf ( 1, '  a root of an equation using Newton''s method.\n' );

  a = 0.0;
  [ a, fa, it ] = nonlin_newton ( 'cos(x)-x', '-sin(x)-1.0', a );

  a = 2.0;
  [ a, fa, it ] = nonlin_newton ( 'x.^2 -5.0', '2.0*x', a );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'nonlin_newton_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../nonlin_newton' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

