function ccii_test ( )

%*****************************************************************************80
%
%% ccii_test() uses ccii() for 1D quadrature over (-oo,+oo).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 May 2014
%
%  Author:
%
%    John Burkardt
%
  d = 1;
  exact = hermite_integral ( d );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'ccii_test():\n' );
  fprintf ( 1, '  ccii() builds a sparse grid.\n' );
  fprintf ( 1, '  Boyd''s Clenshaw-Curtis based rule for quadrature of\n' );
  fprintf ( 1, '    1/sqrt(2*pi) * integral ( -oo < x < +oo ) f(x) exp(-0.5*x^2) dx\n' );
  fprintf ( 1, '  Exact integral value is %g\n', exact );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   Level   Nodes    Estimate  Error\n' );
  fprintf ( 1, '\n' );

  for l = 1 : 7
    n = ccii_order ( l );
    [ x, w ] = ccii ( l );
    fx = hermite_integrand ( d, n, x );
    q = w' * fx;
    e = sqrt ( ( q - exact ).^2 ) / exact;

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

  end

  return
end
