function cc_test ( )

%*****************************************************************************80
%
%% CC_TEST uses a sequence of Clenshaw-Curtis rules on a test integrand.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    16 February 2013
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CC_TEST:\n' );
  fprintf ( 1, '  Clenshaw-Curtis rules of increasing order.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   N     Q(N)      Err(N)\n' );
  fprintf ( 1, '\n' );

  t = 0.5 * erf ( 50.0 * sqrt ( 2.0 * pi ) );
  alpha = 2.0;
  t = pi * besselj ( 0.0, 2.0^alpha );

  for n = 1 : 21

    [ x, w ] = clenshaw_curtis_compute ( n );
%
%  Shift X and W from [-1,+1] to [0,pi].
%
    x = pi * ( x + 1.0 ) / 2.0;
    w = pi * ( w / 2.0 );
%
%  Evaluate function, compute quadrature formula and error.
%
    fx = cos ( 2.0 * alpha * sin ( x ) );
    q = w' * fx;
    e = abs ( q - t );
    fprintf ( 1, '  %2d  %12f  %12g\n', n, q, e );

  end

  return
end


