function hermite_interpolant_test03 ( )

%*****************************************************************************80
%
%% hermite_interpolant_test03() uses f(x) = r1 + r2x + r3x^2 + r4x^3 + r5x^4 + r6x^5 at x = r7 r8 r9
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 May 2011
%
%  Author:
%
%    John Burkardt
%
  n = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'hermite_interpolant_test03():\n' );
  fprintf ( 1, '  hermite() computes the Hermite interpolant to data.\n' );
  fprintf ( 1, '  Here, f(x) is a fifth order polynomial with random\n' );
  fprintf ( 1, '  coefficients, and the abscissas are random.\n' );

  x = rand ( n, 1 );
  r8vec_print ( n, x, '  Random abscissas' );

  c = rand ( 2 * n, 1 );
  r8vec_print ( 2 * n, c, '  Random polynomial coefficients.' );

  y = zeros ( n, 1 );
  yp = zeros ( n, 1 );

  for i = 1 : 3

    y(i) = c(0+1) + x(i) * ( ...
           c(1+1) + x(i) * ( ...
           c(2+1) + x(i) * ( ...
           c(3+1) + x(i) * ( ...
           c(4+1) + x(i) * ( ...
           c(5+1) ) ) ) ) );

    yp(i) = c(1+1)       + x(i) * ( ...
            c(2+1) * 2.0 + x(i) * ( ...
            c(3+1) * 3.0 + x(i) * ( ...
            c(4+1) * 4.0 + x(i) *   ...
            c(5+1) * 5.0 ) ) );
  end

  hermite_demo ( n, x, y, yp );

  return
end
