DADiSP Worksheet Functions > Function Categories > Polynomials > POLYVAL
Calculates P(x) for a polynomial P with coefficients a and values x.
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:
|
A scalar or series, the value of the polynomial for the input x values.
polyval({1, 2, -1}, 2)
returns 7, the value of:
polyval({1, 2, -1}, 0..3)
returns the series {-1, 2, 7, 14}.
For polynomial P(x) with coefficients a, the polynomial is specified in descending powers of x:
If the input x is a series, then y[j] is the jth point in the output series generated by POLYVAL with:
If form is 0, the polynomial is specified in ascending powers of x:
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.