function bisect_test ( )

%*****************************************************************************80
%
%% bisect_test tests bisect.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 June 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'bisect_test:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Test bisect():\n' );
%
%  f(x) = x^6-x-1
%
  a0 = 0.0;
  b0 = 2.0;
  ep = 1.0e-12;
  max_iterate = 50;
  index_f = 1;
  x = bisect ( a0, b0, ep, 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)
%
  a0 = 0.0;
  b0 = 5.0;
  ep = 1.0e-12;
  max_iterate = 50;
  index_f = 2;
  x = bisect ( a0, b0, ep, 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, 'bisect_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

