function hermite_cubic_test15 ( )

%*****************************************************************************80
%
%% HERMITE_CUBIC_TEST15 tests HERMITE_CUBIC_SPLINE_QUAD_RULE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    29 March 2011
%
%  Author:
%
%    John Burkardt
%
  n = 11;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'HERMITE_CUBIC_TEST15:\n' );
  fprintf ( 1, '  HERMITE_CUBIC_SPLINE_QUAD_RULE returns a quadrature rule\n' );
  fprintf ( 1, '  for Hermite cubic splines.\n' );

  seed = 123456789;
  [ r, seed ] = r8vec_uniform_01 ( n, seed );

  x(1) = r(1);
  for j = 2 : n
    x(j) = x(j-1) + r(j);
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Random spacing\n' );
  fprintf ( 1, '  Number of points N = %d\n', n );
  fprintf ( 1, '  Interval = [%f,%f]\n', x(1), x(n) );

  w = hermite_cubic_spline_quad_rule ( n, x );

  [ fn, dn, s, t ] = cubic_value ( x(1:n) );

  q = w(1,1:n) * fn(1:n) + w(2,1:n) * dn(1:n);

  q_exact = cubic_integrate ( x(1), x(n) );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Q         = %f\n', q );
  fprintf ( 1, '  Q (exact) = %f\n', q_exact );

  return
end
