E01BGF evaluates a piecewise cubic Hermite interpolant and its first derivative at a set of points.
E01BGF evaluates a piecewise cubic Hermite interpolant, as computed by
E01BEF, at the points
${\mathbf{PX}}\left(\mathit{i}\right)$, for
$\mathit{i}=1,2,\dots ,m$. The first derivatives at the points are also computed. If any point lies outside the interval from
${\mathbf{X}}\left(1\right)$ to
${\mathbf{X}}\left({\mathbf{N}}\right)$, values of the interpolant and its derivative are extrapolated from the nearest extreme cubic, and a warning is returned.
If values of the interpolant only, and not of its derivative, are required,
E01BFF should be used.
The routine is derived from routine PCHFD in
Fritsch (1982).
If on entry
${\mathbf{IFAIL}}={\mathbf{0}}$ or
${-{\mathbf{1}}}$, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
The computational errors in the arrays
PF and
PD should be negligible in most practical situations.
The time taken by E01BGF is approximately proportional to the number of evaluation points,
$m$. The evaluation will be most efficient if the elements of
PX are in nondecreasing order (or,
more generally, if they are grouped in increasing order of the intervals
$\left[{\mathbf{X}}\left(r-1\right),{\mathbf{X}}\left(r\right)\right]$). A
single call of E01BGF with
$m>1$ is more efficient than several calls with
$m=1$.
This example reads in values of
N,
X,
F and
D, and calls
E01BGF to compute the values of the interpolant and its derivative at equally spaced points.