POLYVAL

Purpose:

Calculates P(x) for a polynomial P with coefficients a and values x.

Syntax:

POLYVAL(a, x, form)

a

-

A series, the polynomial coefficients.

x

-

A scalar or series. The values where the polynomial will be evaluated.

form

-

Optional. An integer, the polynomial coefficient form:

0:

ascending powers, lowest degree to highest

1:

descending powers, highest degree to lowest (default)

Returns:

A scalar or series, the value of the polynomial for the input x values.

Example:

polyval({1, 2, -1}, 2)

 

returns 7, the value of:

 

image\polyv01.gif

Example:

polyval({1, 2, 3}, 0..3)

 

returns the series {-1, 2, 7, 14}.

Remarks:

For polynomial P(x) with coefficients a, the polynomial is specified in descending powers of x:

 

image\polyv02.gif

 

If the input x is a series, then y[j] is the jth point in the output series generated by POLYVAL with:

 

image\polyv03.gif

 

If form is 0, the polynomial is specified in ascending powers of x:

 

image\polyv04.gif

 

POLYVAL is similar to POLYGRAPH except the default form is in decreasing powers (highest degree to lowest). Unlike POLYGRAPH, POLYVAL returns a scalar for a scalar input.

See Also:

POLY

POLYDER

POLYFIT

POLYGRAPH

POLYINT

POLYSTAB

ROOTS