# HERMITE_CUBIC Hermite Cubic Polynomial Evaluation, Interpolation, Integration, Splines

HERMITE_CUBIC is a FORTRAN90 library which demonstrates the use of cubic polynomials in the Hermite form.

### The Hermite Cubic

The Hermite form of a cubic polynomial defines the polynomial p(x) by specifying two distinct points x1 and x2, and providing values for the following four items:

```        f1 = p(x1)
d1 = p'(x1)
f2 = p(x2)
d2 = p'(x2)
```
The locations of the abscissas and the four data values are enough to uniquely define a cubic polynomial, known as the Hermite cubic.

From the Hermite cubic representation, it is possible to determine the standard power series form:

```        p(x) = c0 + c1 * x + c2 * x2 + c3 * x3
```

It is possible, given any value of the argument x and the data values that define the Hermite cubic polynomial, to determine the value of p(x), as well as the values of the first, second and third derivatives.

It is possible, given two values of the argument x3 and x4, and the data values that define the Hermite cubic polynomial, to determine the value of the integral of p(x) over the interval [x3,x4].

### Hermite Cubic Splines:

A sequence of Hermite cubic polynomials can be used to produce a piecewise cubic Hermite interpolant, if we are given a strictly increasing sequence of n nodes x(1:n), and corresponding data vectors f(1:n) and d(1:n). This is done by defining n-1 cubic Hermite polynomials, with the i-th polynomial defined using the data at nodes x(i) and x(i+1). The resulting function interpolates the value and derivative data, and is continuous and continuously differentiable everywhere, and in particular, at the nodes.

### Languages:

HERMITE_CUBIC is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

BERNSTEIN_POLYNOMIAL, a FORTRAN90 library which evaluates the Bernstein polynomials, useful for uniform approximation of functions;

CHEBYSHEV, a FORTRAN90 library which computes the Chebyshev interpolant/approximant to a given function over an interval.

DIVDIF, a FORTRAN90 library which computes divided difference polynomials from data;

HERMITE, a FORTRAN90 library which computes the Hermite interpolant, a polynomial that matches function values and derivatives.

NMS, a FORTRAN90 library which includes a wide variety of numerical software, including solvers for linear systems of equations, interpolation of data, numerical quadrature, linear least squares data fitting, the solution of nonlinear equations, ordinary differential equations, optimization and nonlinear least squares, simulation and random numbers, trigonometric approximation and Fast Fourier Transforms.

SPLINE, a FORTRAN90 library which includes many routines to construct and evaluate spline interpolants and approximants.

TOMS446, a FORTRAN90 library which manipulates Chebyshev series for interpolation and approximation;
this is a version of ACM TOMS algorithm 446, by Roger Broucke.

### Reference:

1. Fred Fritsch, Ralph Carlson,
Monotone Piecewise Cubic Interpolation,
SIAM Journal on Numerical Analysis,
Volume 17, Number 2, April 1980, pages 238-246.

### List of Routines:

• HERMITE_CUBIC_INTEGRAL returns the integral of a Hermite cubic polynomial.
• HERMITE_CUBIC_INTEGRATE integrates a Hermite cubic polynomial from A to B.
• HERMITE_CUBIC_LAGRANGE_INTEGRAL: Hermite cubic Lagrange integrals.
• HERMITE_CUBIC_LAGRANGE_INTEGRATE integrates Hermite cubic Lagrange polynomials.
• HERMITE_CUBIC_LAGRANGE_VALUE evaluates the Hermite cubic Lagrange polynomials.
• HERMITE_CUBIC_SPLINE_INTEGRAL: Hermite cubic spline integral.
• HERMITE_CUBIC_SPLINE_INTEGRATE integrates a Hermite cubic spline over [A,B].
• HERMITE_CUBIC_SPLINE_VALUE evaluates a Hermite cubic spline.
• HERMITE_CUBIC_TO_POWER_CUBIC converts a Hermite cubic to power form.
• HERMITE_CUBIC_VALUE evaluates a Hermite cubic polynomial.
• POWER_CUBIC_TO_HERMITE_CUBIC converts a power cubic to Hermite form.
• R8_UNIFORM_01 returns a unit pseudorandom R8.
• R8VEC_BRACKET3 finds the interval containing or nearest a given value.
• R8VEC_EVEN returns an R8VEC of evenly spaced values.
• TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the FORTRAN90 source codes.