
evalp - evaluates a polynomial

Calling sequence:

evalp(poly, expr_2 = expr_3, ...)
evalp(expr [ , indets ], expr_2 = expr_3, ...)
indets  ---> [ expr_1 ...]

Parameter:
poly                            --  polynomial
expr, expr_1, expr_2, expr_3    --  expressions

Overloading:

1

Summary:

evalp(p, x1=y1,..., xn=yn) evaluates the polynomial p for the values
x1=y1, ..., xn=yn.  xi are variables of the polynomial and yi their values.
The values yi may be expressions that could also be used as coefficients.

The variables are evaluated in the sequence given by the equations using
Horners rule; polynomials in the remaining variables occur as intermediate
results.  The evaluation of variables with the value 0 is most effective and
should take place first.  After that the remaining main variable should be
evaluated first.

The first argument of evalp is allowed to be a polynomial or an expression
and optionally a listof indeterminates.  An expression is converted into a
polynomial in the specified indeterminates (see function poly). evalp returns
FAIL if the expression cannot be converted into a polynomial.

If the polynomial still has free variables after evaluation, the result is a
polynomial in these variables. In this case the type of the result is dependent
on the first argument. If the argument is a polynomial then a polynomial is
returned as result.

If all variables are evaluated then the result is an expression from the coefficient
ring of the polynomial. evalp is a kernel function.

>>  evalp(x^2+2*x+3, x=a+2);

      (a+2)*(a+4)+3

>>  p := poly(x^2+x*y+2, [x,y]): evalp(p, x=3);

      poly(3*y + 11, [y])

>>  p := poly(x^2+x*y+2, [x,y]): evalp(p, x=3, y=2);

      17

>>  evalp(x*y*z+x^2+y^2+z^2, x=1, y=1);

      z^2 + z + 2

See also:  coeff , poly

