POLY

The POLY general subroutine evaluates a polynomial.

Use

Called By

Any user-written subroutine

Prerequisite

None

Calling Sequence

CALL POLY (x, x0, par, npar, iord, value, errflg)

Input Arguments

 
iord
An integer variable that defines the order of the derivative that POLY is to return. The order is usually zero, but it can be one or two.
npar
An integer variable that indicates the number of coefficients specified. The primary purpose of npar is to provide POLY with the number of values stored in the par array.
par
A double-precision array of any number of coefficients (a0,...,an).
x
A double-precision variable that specifies the independent variable.
x0
A double-precision variable that specifies a shift in the polynomial.

Output Arguments

 
errflg
A logical (true or false) variable that POLY returns to the calling subroutine. If POLY detects an error in the subroutine call statement, it sets errflg to true before it returns errflg to the calling subroutine.
value
A double-precision value the subroutine returns. If iord equals zero, value is the function evaluated at x. If iord equals one, value is the first derivative of F(x) with respect to the independent variable x. If iord equals two, value is the second derivative of F(x) with respect to the independent variable x. Value is:

Extended Definition

A POLY general subroutine evaluates a polynomial. The following equation defines POLY: