function r8_csevl_test ( )

%*****************************************************************************80
%
%% R8_CSEVL_TEST tests R8_CSEVL.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    22 April 2016
%
%  Author:
%
%    John Burkardt
%
  expcs = [ ...
   2.532131755504016E+00, ...
   1.130318207984970E+00, ...
   0.271495339534077E+00, ...
   0.044336849848664E+00, ...
   0.005474240442094E+00, ...
   0.000542926311914E+00, ...
   0.000044977322954E+00, ...
   0.000003198436462E+00, ...
   0.000000199212481E+00, ...
   0.000000011036772E+00, ...
   0.000000000550590E+00, ...
   0.000000000024980E+00, ...
   0.000000000001039E+00, ...
   0.000000000000040E+00, ...
   0.000000000000001E+00 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8_CSEVL_TEST:\n' );
  fprintf ( 1, '  R8_CSEVL evaluates a Chebyshev approximant\n' );
  fprintf ( 1, '  of N terms at a point X.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Here we use an approximant to the exponential function.\n' );
  fprintf ( 1, '  and average the absolute error at 21 points.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   N    error\n' );
  fprintf ( 1, '\n' );

  for n = 1 : 12
    err = 0.0;
    for i = -10 : 10
      x = i / 10.0;
      s = r8_csevl ( x, expcs, n );
      err = err + abs ( s - exp ( x ) );
    end
    err = err / 21.0;
    fprintf ( 1, '  %2d  %14.6g\n', n, err );
  end

  return
end