XLPack 6.1
Excel Worksheet Function Numerical Library Reference Manual
Loading...
Searching...
No Matches

◆ WPchfe()

Function WPchfe ( Ne As  Long,
Xe As  Variant,
N As  Long,
X As  Variant,
Y As  Variant,
D As  Variant 
)

Piecewise cubic Hermite (or cubic spline) function evaluator

Purpose
WPchfe evaluates a piecewise cubic Hermite function at an array of points. This function can be used as an evaluator for WPchse.
Returns
Ne+1 x 1
Column 1
Rows 1 to NeEvaluated values of the cubic spline function
Row Ne+1Return code

Return code
= 0: Successful exit
= i > 0: Extrapolation was performed at i points
Parameters
[in]NeNumber of evaluation points. (Ne >= 1)
[in]Xe(Ne) Points at which the function is to be evaluated.
Notes 1: The evaluation will be most efficient if the elements of Xe are increasing relative to X; that is, Xe(j) >= X(i) implies Xe(k) >= X(i), all k >= j.
Note 2: If any of the Xe are outside the interval [ X(0), X(n-1) ], values are extrapolated from the nearest extreme cubic, and a return code > 0 will be returned.
[in]NNumber of data points (which were used by Pchse to compute coefficients). (N >= 2)
[in]X(N) The data abscissas (which were used by Pchse to compute coefficients).
[in]Y(N) The data ordinates (which were used by Pchse to compute coefficients).
[in]D(N) An array of cubic spline coefficients computed by Pchse.
Reference
SLATEC (PCHIP)
Example
Interpolate the following natural logarithm table by WPchse. And compute ln(0.115) and ln(0.125) by WPchfe.
x ln(x)
------ --------
0.10 2.3026
0.11 2.2073
0.12 2.1203
0.13 2.0402
------ --------

WPchfe