function local_min_example ( a, b, f, title )

%*****************************************************************************80
%
%% local_min_example() tests local_min() on one test function.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 May 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A, B, the endpoints of the interval.
%
%    real value = F ( x ), the name of a user-supplied
%    function whose local minimum is being sought.
%
%    string TITLE, a title for the problem.
%
  epsi = eps;
  t = sqrt ( eps );

  [ x, fx, calls ] = local_min ( a, b, epsi, t, f );
  fa = f ( a );
  fb = f ( b );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  %s\n', title );
  fprintf ( 1, '\n' );
  fprintf ( 1, '      A                 X             B\n' );
  fprintf ( 1, '    F(A)              F(X)          F(B)\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  %14f  %14f  %14f\n',  a,  x,  b );
  fprintf ( 1, '  %14e  %14e  %14e\n', fa, fx, fb );
  fprintf ( 1, '  Number of calls to F = %d\n', calls );

  return
end
