function norm_loo_test ( )

%*****************************************************************************80
%
%  norm_loo_test() tests norm_loo().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 July 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../norm_loo' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'norm_loo_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  norm_loo() estimates ||f(x)||_1.\n' );
%
%  Function name.
%
  f_string = 'humps_fun(x)';
  a = 0.0;
  b = 2.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  f(x) = "%s"\n', f_string );
  fprintf ( 1, '  %g <= x <= %g\n', a, b );
  n = 11;
  for i = 1 : 5
    fprintf ( 1, '  Using %d sample values\n', n );
    [ value, location ] = norm_loo ( f_string, a, b, n );
    fprintf ( 1, '  ||f(x)||_oo = abs ( f (%24.16g) ) = %24.16g\n', location, value );
    n = 10 * ( n - 1 ) + 1;
  end
%
%  Function formula.
%
  f_string = 'x/10 + cos(x) + sin(1.0) + pi';
  a = -10.0;
  b = +10.0;
  n = 10001;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  f(x) = "%s"\n', f_string );
  fprintf ( 1, '  %g <= x <= %g\n', a, b );
  fprintf ( 1, '  Using %d sample values\n', n );
  [ value, location ] = norm_loo ( f_string, a, b, n );
  fprintf ( 1, '  ||f(x)||_oo = abs ( f (%24.16g) ) = %24.16g\n', location, value );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'norm_loo_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../norm_loo' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

