XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ chfev()

void chfev ( double  x1,
double  x2,
double  f1,
double  f2,
double  d1,
double  d2,
int  ne,
double  xe[],
double  fe[],
int  next[],
int *  info 
)

Cubic Hermite function values

Purpose
This routine evaluates a cubic polynomial given in Hermite form at an array of points, i.e. evaluates the cubic polynomial determined by function values f1, f2 and derivatives d1, d2 on interval [x1, x2] at the points xe[j], j=1 to ne.

While designed for use by pchfe, it may be useful directly as an evaluator for a piecewise cubic Hermite function in applications, such as graphing, where the interval is known in advance.
Parameters
[in]x1Endpoint of interval of definition of cubic. (x1 != x2)
[in]x2Endpoint of interval of definition of cubic. (x1 != x2)
[in]f1Value of function at x1.
[in]f2Value of function at x2.
[in]d1Value of derivative at x1.
[in]d2Value of derivative at x2.
[in]neNumber of evaluation points. (ne >= 1)
[in]xe[]Array xe[lxe] (lxe >= ne)
Points at which the function is to be evaluated. If any of the xe[] are outside the interval [x1, x2], a warning error is returned in next[].
[out]fe[]Array fe[lfe] (lfe >= ne)
Values of the cubic function defined by x1, x2, f1, f2, d1, d2 at the points xe[].
[out]next[]Array next[lnext] (lnext >= 2)
Number of extrapolation points.
next[0] = number of evaluation points to left of interval
next[1] = number of evaluation points to right of interval
[out]info= 0: Successful exit
= -2: The argument x2 had an illegal value (x2 = x1)
= -7: The argument ne had an illegal value (ne < 1)
Reference
SLATEC (PCHIP)