# Evaluating polynomials: peval polyEval

### 5.27.12 Evaluating polynomials: peval polyEval

The peval command evaluates polynomials.
polyEval is a synonym for peval.

- 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.

- Input:
  peval([1,0,-1],sqrt(2))
  Output:

  √

  2

  √

  2

  −1

  then input:
  normal(sqrt(2)*sqrt(2)-1)
  Output:

  1

- Input:
  peval([1,0,-1],1.4)
  Output:

  0.96