function nonlin_secant_test ( )

%*****************************************************************************80
%
%% nonlin_secant_test() tests nonlin_secant().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 June 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../nonlin_secant' );

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

  a = 0.0;
  b = 1.0;
  [ a, b, fa, fb, it ] = nonlin_secant ( 'x.^2 - 2*x - 15', a, b );

  a = 0.0;
  b = 10.0;
  [ a, b, fa, fb, it ] = nonlin_secant ( 'kepler(x)', a, b );

  a = 2.0;
  b = 3.0;
  [ a, b, fa, fb, it ] = nonlin_secant ( 'cos(x) - x', a, b );

  a = 1.0;
  b = 2.0;
  [ a, b, fa, fb, it ] = nonlin_secant ( 'x.^2 + 1', a, b );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'nonlin_secant_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../nonlin_secant' );

  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

