DBLPOLY Function

Evaluates a polynomial function in double precision using Horner’s method.

Usage

result = DBLPOLY(x, coefficients)

Input Parameters

x—A scalar or array variable used to evaluate the polynomial.

coefficients—An array containing the coefficients of the polynomial which has one more element than the degree of the polynomial function.

Returned Value

result—An array with the same dimensions as the input parameter x, containing the polynomial function evaluated at x.

Keywords

None.

Discussion

DBLPOLY evaluates the polynomial function

c(x) = c0 + c1x + c2x2 + ... + cn–1xn–1 ,

where n is the dimension of c(x), and c0, c1, ..., cn–1 are the elements of the input parameter coefficients.

DBLPOLY returns an array with the same dimensions as x.

DBLPOLY uses Horner’s method to evaluate a polynomial. The routine is the same as the PV-WAVE POLY function, except when either parameter is complex. If either parameter is complex, the result is computed with double-precision, as opposed to the single precision arithmetic performed in POLY.

Example

Evaluate the polynomial c(z) = 1 + z3 at  z = (1 + j).

PRINT, DBLPOLY(COMPLEX(1, 1), [1, 0, 0, 1])
; PV-WAVE prints: -1.00000,      2.00000

See Also

In the PV‑WAVE Reference: POLY