function bracket_test ( )

%*****************************************************************************80
%
%% bracket_test tests bracket.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    14 September 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'bracket_test\n' );
  fprintf ( 1, '  bracket seeks points a, b, c which bracket a minimizer\n' );
  fprintf ( 1, '  of a function f(x) so that f(a) > f(b) < f(c).\n' );

  x1 = 2.0;
  x2 = 2.5;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Search begins with:\n' );
  fprintf ( 1, '  x1: f(%g) = %g\n', x1, sag(x1) );
  fprintf ( 1, '  x2: f(%g) = %g\n', x2, sag(x2) );

  [ a, b, c ] = bracket ( @sag, x1, x2 );

  fprintf ( 1, '\n' ); 
  fprintf ( 1, '  bracket returns (a,b,c):\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  a: f(%g) = %g\n', a, sag(a) );
  fprintf ( 1, '  b: f(%g) = %g\n', b, sag(b) );
  fprintf ( 1, '  c: f(%g) = %g\n', c, sag(c) );

  return
end

