function ccfi_test ( )

%*****************************************************************************80
%
%% ccfi_test() uses ccfi() for 1D quadrature over [0,+oo).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 May 2014
%
%  Author:
%
%    John Burkardt
%

%
%  Get the exact result.
%
  exact = laguerre_integral ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'ccfi_test():\n' );
  fprintf ( 1, '  ccfi() performs Boyd''s quadrature over [0,+oo):\n' );
  fprintf ( 1, '  Exact integral is %16.8g\n', exact );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   Level   Nodes         Estimate    Error\n' );
  fprintf ( 1, '\n' );

  for l = 1 : 5

    n = ccfi_order ( l );

    [ x, w ] = ccfi ( n );

    fx = laguerre_integrand ( x );
 
    q = w' * fx;
    e = sqrt ( ( q - exact ).^2 ) / exact;

    fprintf( '  %2d     %6d  %16.8g  %6.2e\n', l, n, q, e )

  end

  return
end
