nag_monotonic_deriv (e01bgc) evaluates a piecewise cubic Hermite interpolant and its first derivative at a set of points.
nag_monotonic_deriv (e01bgc) evaluates a piecewise cubic Hermite interpolant, as computed by the NAG function
nag_monotonic_interpolant (e01bec), at the points
, for
. The first derivatives at the points are also computed. If any point lies outside the interval from
to
, 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,
nag_monotonic_evaluate (e01bfc) should be used.
The function is derived from routine PCHFD in
Fritsch (1982).
The computational errors in the arrays
pf and
pd should be negligible in most practical situations.
nag_monotonic_deriv (e01bgc) is not threaded in any implementation.
The time taken by nag_monotonic_deriv (e01bgc) is approximately proportional to the number of evaluation points,
. 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
). A single call of nag_monotonic_deriv (e01bgc) with
is more efficient than several calls with
.
This example program reads in values of
n,
x,
f and
d and calls nag_monotonic_deriv (e01bgc) to compute the values of the interpolant and its derivative at equally spaced points.