function secant_test ( )

%*****************************************************************************80
%
%% secant_test tests secant.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 June 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'secant_test:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Test secant():\n' );
%
%  f(x) = x^6-x-1
%
  x0 = 0.5;
  x1 = 1.0;
  error_bound = 1.0e-12;
  max_iterate = 50;
  index_f = 1;
  x = secant ( x0, x1, error_bound, max_iterate, index_f );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Estimated root is x = %g\n', x );
  fprintf ( 1, '  f(x) = %g\n', x^6 - x - 1 );
%
%  f(x) = x - exp(-x)
%
  x0 = 0.0;
  x1 = 1.0;
  error_bound = 1.0e-12;
  max_iterate = 50;
  index_f = 2;
  x = secant ( x0, x1, error_bound, max_iterate, index_f );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Estimated root is x = %g\n', x );
  fprintf ( 1, '  f(x) = %g\n', x - exp(-x) );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'secant_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

