function zero_brent_test ( )

%*****************************************************************************80
%
%% zero_brent_test() tests zero_brent().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 May 2021
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../zero_brent' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'zero_brent_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  zero_brent() seeks a root of a function F(X)\n' );
  fprintf ( 1, '  in an interval [A,B].\n' );

  a = 1.0;
  b = 2.0;
  f = @f_01;
  title = 'f_01(x) = sin ( x ) - x / 2';
  zero_example ( a, b, f, title );

  a = 0.0;
  b = 1.0;
  f = @f_02;
  title = 'f_02(x) = 2 * x - exp ( - x )';
  zero_example ( a, b, f, title );

  a = -1.0;
  b =  0.5;
  f = @f_03;
  title = 'f_03(x) = x * exp ( - x )';
  zero_example ( a, b, f, title );

  a =  0.0001;
  b =  20.0;
  f = @f_04;
  title = 'f_04(x) = exp ( x ) - 1 / ( 100 * x * x )';
  zero_example ( a, b, f, title );

  a = -5.0;
  b =  2.0;
  f = @f_05;
  title = 'f_05(x) = (x+3) * (x-1) * (x-1)';
  zero_example ( a, b, f, title );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'zero_brent_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../zero_brent' )

  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

