The function may be called by the names: e01bgc, nag_interp_dim1_monotonic_deriv or nag_monotonic_deriv.
e01bgc evaluates a piecewise cubic Hermite interpolant, as computed by the NAG function 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, e01bfc should be used.
Fritsch F N (1982) PCHIP final specifications Report UCID-30194 Lawrence Livermore National Laboratory
1: – IntegerInput
On entry: n must be unchanged from the previous call of e01bec.
2: – const doubleInput
3: – const doubleInput
4: – const doubleInput
On entry: x, f and d must be unchanged from the previous call of e01bec.
5: – IntegerInput
On entry: , the number of points at which the interpolant is to be evaluated.
6: – const doubleInput
On entry: the values of at which the interpolant is to be evaluated.
7: – doubleOutput
On exit: contains the value of the interpolant evaluated at the point , for .
8: – doubleOutput
On exit: contains the first derivative of the interpolant evaluated at the point , for .
9: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
On entry, .
On entry, .
On entry, for : , .
The values of , for , are not in strictly increasing order.
Warning – some points in array px lie outside the range . Values at these points are unreliable as they have been computed by extrapolation.
The computational errors in the arrays pf and pd should be negligible in most practical situations.
8Parallelism and Performance
e01bgc is not threaded in any implementation.
The time taken by 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 e01bgc with is more efficient than several calls with .
This example program reads in values of n, x, f and d and calls e01bgc to compute the values of the interpolant and its derivative at equally spaced points.