function search_test ( )

%*****************************************************************************80
%
%% search_test tests search.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    23 March 2019
%
%  Author:
%
%    John Burkardt
%
  a = 1;
  b = 2147483647;
  c = 45;

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'search_test:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Search the integers from A to B\n' );
  fprintf ( 1, '  for a value J such that F(J) = C.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A           = %d\n', a );
  fprintf ( 1, '  B           = %d\n', b );
  fprintf ( 1, '  C           = %d\n', c );

  tic

  j = search ( a, b, c );

  wtime = toc;

  if ( j == -1 )
    fprintf ( 1, '\n' );
    fprintf ( 1, '  No solution was found.\n' );
  else
    fprintf ( 1,  '\n' );
    fprintf ( 1, '  Found     J = %d\n', j );
    fprintf ( 1, '  Verify F(J) = %d\n', f ( j ) );
  end

  fprintf ( 1, '  Elapsed CPU time is %g\n', wtime );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'search_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  return
end

