e01bf evaluates a piecewise cubic Hermite interpolant at a set of points.

Syntax

C#
public static void e01bf(
	int n,
	double[] x,
	double[] f,
	double[] d,
	int m,
	double[] px,
	double[] pf,
	out int ifail
)
Visual Basic
Public Shared Sub e01bf ( _
	n As Integer, _
	x As Double(), _
	f As Double(), _
	d As Double(), _
	m As Integer, _
	px As Double(), _
	pf As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void e01bf(
	int n, 
	array<double>^ x, 
	array<double>^ f, 
	array<double>^ d, 
	int m, 
	array<double>^ px, 
	array<double>^ pf, 
	[OutAttribute] int% ifail
)
F#
static member e01bf : 
        n : int * 
        x : float[] * 
        f : float[] * 
        d : float[] * 
        m : int * 
        px : float[] * 
        pf : float[] * 
        ifail : int byref -> unit 

Parameters

n
Type: System..::..Int32
An array of size []
On entry: n, x, f and d must be unchanged from the previous call of e01be.
x
Type: array<System..::..Double>[]()[][]
An array of size []
On entry: n, x, f and d must be unchanged from the previous call of e01be.
f
Type: array<System..::..Double>[]()[][]
An array of size []
On entry: n, x, f and d must be unchanged from the previous call of e01be.
d
Type: array<System..::..Double>[]()[][]
An array of size []
On entry: n, x, f and d must be unchanged from the previous call of e01be.
m
Type: System..::..Int32
On entry: m, the number of points at which the interpolant is to be evaluated.
Constraint: m1.
px
Type: array<System..::..Double>[]()[][]
An array of size [m]
On entry: the m values of x at which the interpolant is to be evaluated.
pf
Type: array<System..::..Double>[]()[][]
An array of size [m]
On exit: pf[i-1] contains the value of the interpolant evaluated at the point px[i-1], for i=1,2,,m.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

e01bf evaluates a piecewise cubic Hermite interpolant, as computed by e01be, at the points px[i-1], for i=1,2,,m. If any point lies outside the interval from x[0] to x[n-1], a value is extrapolated from the nearest extreme cubic, and a warning is returned.
The method is derived from method PCHFE in Fritsch (1982).

References

Fritsch F N (1982) PCHIP final specifications Report UCID-30194 Lawrence Livermore National Laboratory

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,n<2.
ifail=2
The values of x[r-1], for r=1,2,,n, are not in strictly increasing order.
ifail=3
On entry,m<1.
ifail=4
At least one of the points px[i-1], for i=1,2,,m, lies outside the interval [x[0],x[n-1]], and extrapolation was performed at all such points. Values computed at such points may be very unreliable.
ifail=-9000
An error occured, see message report.
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

The computational errors in the array pf should be negligible in most practical situations.

Parallelism and Performance

None.

Further Comments

The time taken by e01bf 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 x[r-1],x[r]). A single call of e01bf with m>1 is more efficient than several calls with m=1.

Example

This example reads in values of n, x, f and d, and then calls e01bf to evaluate the interpolant at equally spaced points.

Example program (C#): e01bfe.cs

Example program data: e01bfe.d

Example program results: e01bfe.r

See Also