up previous next
2.11.2 Evaluation of Polynomials
The cleanest and most efficient way to evaluate polynomials is defining the appropriate PolyAlgebraHom . However there are some handy shortcuts: subst and eval .

Example
/**/  Use R ::= QQ[x,y,z];
/**/  f := x+y+z;  --> let x=2 and y=1 in f
/**/  phi := PolyAlgebraHom(R, R, [2,1,z]);  phi(f);
z +3
/**/  eval(f, [2,1]);
z +3
/**/  subst(f, [[x,2],[y,1]]);
z +3