function nonlin_regula_test ( )

%*****************************************************************************80
%
%% nonlin_regula_test() tests nonlin_regula().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 July 2023
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../nonlin_regula' );

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

  a = 0.0;
  b = 8.0;
  [ a, b, fa, fb ] = nonlin_regula ( 'x^2 - 2*x - 15', a, b );

  a = 0.0;
  b = 1.0;
  [ a, b, fa, fb ] = nonlin_regula ( 'cos(x) - x', a, b );

  a = 0.5;
  b = 1.5;
  [ a, b, fa, fb ] = nonlin_regula ( 'x^5 - 2.0', a, b );

  a = 0.0;
  b = 10.0;
  [ a, b, fa, fb ] = nonlin_regula ( 'kepler(x)', a, b );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'nonlin_regula_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../nonlin_regula' );

  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

