function rc_test ( )

%*****************************************************************************80
%
%% rc_test() tests rc().
%
%  Discussion:
%
%    This driver tests the real ( kind = 8 ) function subroutine for the
%    integral RC(X,Y).  The first six sets of values of X and Y are
%    extreme points of the region of valid arguments defined by the
%    machine-dependent constants LOLIM and UPLIM.  The values of LOLIM,
%    UPLIM, X, Y, and ERRTOL (see comments in subroutine) may be used on
%    most machines but provide a severe test of robustness only on the
%    ibm 360/370 series.  The seventh set tests the failure exit.  The
%    next three sets are check values: RC(0,0.25) = RC(0.0625,0.125) = PI
%    and RC(2.25,2) = LN(2).  The remaining sets show the dependence on X
%    when Y = 1.  Fixing Y entails no loss here because RC is homogeneous.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 May 2018
%
%  Author:
%
%    Original FORTRAN77 version by Bille Carlson, Elaine Notis.
%    This MATLAB version by John Burkardt.
%
  x = [ ...
   1.51E-78, ...
   3.01E-78, ...
   0.00E+00, ...
   0.99E+75, ...
   0.00E+00, ...
   0.99E+75, ...
   0.00E+00, ...
   0.00E+00, ...
   6.25E-02, ...
   2.25E+00, ...
   0.01E+00, ...
   0.02E+00, ...
   0.05E+00, ...
   0.10E+00, ...
   0.20E+00, ...
   0.40E+00, ...
   0.60E+00, ...
   0.80E+00, ...
   1.00E+00, ...
   1.20E+00, ...
   1.50E+00, ...
   2.00E+00, ...
   3.00E+00, ...
   4.00E+00, ...
   5.00E+00, ...
   1.00E+01, ...
   2.00E+01, ...
   5.00E+01, ...
   1.00E+02, ...
   1.00E+03, ...
   1.00E+04, ...
   1.00E+05, ...
   1.00E+06, ...
   1.00E+07, ...
   1.00E+08, ...
   1.00E+09, ...
   1.00E+10, ...
   1.00E+12, ...
   1.00E+15, ...
   1.00E+20, ...
   1.00E+30, ...
   1.00E+40, ...
   1.00E+50 ];

  y = [ ...
   1.51E-78, ...
   0.55E-78, ...
   3.01E-78, ...
   0.55E-78, ...
   0.99E+75, ...
   0.99E+75, ...
   2.00E-78, ...
   2.50E-01, ...
   1.25E-01, ...
   2.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00, ...
   1.00E+00 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'rc_test():\n' );
  fprintf ( 1, '  rc() evaluates the elementary integral RC(X,Y)\n' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '              X                          Y' );
  fprintf ( 1, '                         RC(X,Y)\n' );
  fprintf ( 1, '\n' );

  errtol = 1.0E-3;

  for i = 1 : 43
    [ eliptc, ierr ] = rc ( x(i), y(i), errtol );
    if ( ierr == 0 )
      fprintf ( 1, '  %27.16g%27.16g%27.16g\n', x(i), y(i), eliptc );
    else
      fprintf ( 1, '  %27.16g%27.16g  **Error***\n', x(i), y(i) );
    end
  end

  return
end
