e01bgf evaluates a piecewise cubic Hermite interpolant, as computed by e01bef, 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,
e01bff should be used.
Fritsch F N (1982) PCHIP final specifications Report UCID-30194 Lawrence Livermore National Laboratory
1: – IntegerInput
2: – Real (Kind=nag_wp) arrayInput
3: – Real (Kind=nag_wp) arrayInput
4: – Real (Kind=nag_wp) arrayInput
On entry: n, x, f and d must be unchanged from the previous call of e01bef.
5: – IntegerInput
On entry: , the number of points at which the interpolant is to be evaluated.
6: – Real (Kind=nag_wp) arrayInput
On entry: the values of at which the interpolant is to be evaluated.
7: – Real (Kind=nag_wp) arrayOutput
On exit: contains the value of the interpolant evaluated at the point , for .
8: – Real (Kind=nag_wp) arrayOutput
On exit: contains the first derivative of the interpolant evaluated at the point , for .
9: – IntegerInput/Output
On entry: ifail must be set to , . If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, if you are not familiar with this argument, the recommended value is . When the value is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
The values of , for , are not in strictly increasing order.
At least one of the points , for , lies outside the interval , and extrapolation was performed at all such points. Values computed at these points may be very unreliable.
An unexpected error has been triggered by this routine. Please
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.
The computational errors in the arrays pf and pd should be negligible in most practical situations.
Parallelism and Performance
e01bgf is not threaded in any implementation.
The time taken by e01bgf 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 e01bgf with is more efficient than several calls with .
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.