Routine ID: E105 | |
---|---|
Author(s): F. James | Library: KERNLIB |
Submitter: G.A. Erskine | Submitted: 19.07.1973 |
Language: Fortran | Revised: 27.11.1984 |
Function subprogram DIVDIF interpolates in a table of arguments $a$_{j} and function values $f$_{j}= f(a_{j}) , using an interpolating polynomial of specified degree which passes through tabular points which are symmetrically-positioned around the interpolation argument. The table arguments $a$_{j} need not be equidistant.
Structure:
FUNCTION subprogram
User Entry Names: DIVDIF
Files Referenced: Printer
External References: KERMTR (N001), ABEND (Z035)
Usage:
In any arithmetic expression, DIVDIF(F,A,N,X,M)
has an approximate value of $f(X)$ .
instead of M. The original value of M is unchanged on exit.
Method:
Newton's divided difference formula is used.
Except when X lies near one end of the table (in which
case unsymmetrically-situated interpolation points are used),
the interpolation procedure is as follows:
M odd:
An interpolating polynomial passing through
$M+1$
successive points $(a$_{j},f_{j})
symmetrically placed with
respect to X is used.
M even:
The mean of two interpolating polynomials is used, each passing through
$M+1$
successive points $(a$_{j},f_{j})
,
one polynomial having an extra point to the left of X, the other
having an extra point to the right of X.
If X lies too close to either end of the table for
symmetrically-positioned tabular values to be used, the $M+1$
values at the end of the table are used. If X lies outside the range of the table, the interpolation becomes an extrapolation, with corresponding loss of accuracy.
Restrictions:
The argument values $A(1),A(2),...$ must be in either strictly increasing order or strictly decreasing order. No error message is printed if this is not true.
Error handling:
Error E105.1: $N<2$ or $M<1$ . DIVDIF is set equal to zero and a message is printed unless subroutine KERSET (N001) has been called.
Notes:
See also the write-up for POLINT (E100).
$\u2022$