Polynomial evaluation

### 11.1.12 Polynomial evaluation

The peval or polyEval command evaluates polynomials.

- peval takes two arguments:
  - P, a polynomial given by the list of its coefficients.
  - a, a real number.
- peval(P,a) returns the exact or numeric value of P(a), calculated using Horner’s method.

#### Examples

peval([1,0,-1],sqrt(2))

| √ |
2
|  | √ |
2
| −1

normal(sqrt(2)*sqrt(2)-1)

1 |  |  |  |  |  |  |  |  |  |

peval([1,0,-1],1.4)

0.96 |  |  |  |  |  |  |  |  |  |