function zero_rc_test ( )

%*****************************************************************************80
%
%% ZERO_RC_TEST tests ZERO_RC.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    19 January 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../zero_rc' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ZERO_RC_TEST\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  ZERO_RC seeks a root of a function F(X)\n' );
  fprintf ( 1, '  in an interval [A,B] using reverse communication.\n' );

  machep = eps;
  t = machep;

  a = 1.0;
  b = 2.0;

  example_test ( a, b, machep, t, @f_01, ...
    'f_01(x) = sin ( x ) - x / 2' );

  a = 0.0;
  b = 1.0;

  example_test ( a, b, machep, t, @f_02, ...
    'f_02(x) = 2 * x - exp ( - x )' );

  a = -1.0;
  b =  0.5;

  example_test ( a, b, machep, t, @f_03, ...
    'f_03(x) = x * exp ( - x )' );

  a =  0.0001;
  b =  20.0;

  example_test ( a, b, machep, t, @f_04, ...
    'f_04(x) = exp ( x ) - 1 / ( 100 * x * x )' );

  a = -5.0;
  b =  2.0;

  example_test ( a, b, machep, t, @f_05, ...
    'f_05(x) = (x+3) * (x-1) * (x-1)' );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ZERO_RC_TEST\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../zero_rc' );

  return
end
