function hermite_cubic_test15 ( )

%*****************************************************************************80
%
%% hermite_cubic_test15() tests hermite_cubic_spline_quad_rule().
%
%  Licensing:
%
%    This code is distributed under the MIT 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' );

  r = rand ( 1, n );

  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
