|
D.15.13.3 evaluatepfd
Procedure from library pfd.lib (see pfd_lib).
- Usage:
- evaluatepfd(dec, values[, mode]); dec list, values ideal, mode int
- Return:
- the number gotten by substituting the numbers generating the ideal
values for the variables in the partial fraction decomposition
dec . The list dec has to have the same structure as the
output of pfd.
mode=1 : raise Error in case of division by 0 (default)
mode=2 : return a second integer which is 1 if the denominator
becomes 0, and 0 otherwise.
Example:
| LIB "pfd.lib";
ring R = 0,(x,y),dp;
poly f = x+2*y;
poly g = x^2-y^2;
// partial fraction decomposition of f/g:
list dec = pfd(f,g);
==> (-1/2) / (q2)
==> + (3/2) / (q1)
==> where
==> q1 = x-y
==> q2 = x+y
==> (2 terms)
==>
displaypfd_long(dec);
==> (-1/2)/((x+y))
==> + (3/2)/((x-y))
==> (2 terms)
==>
// evaluation at x=2, y=1:
ideal values = 2,1;
evaluatepfd(dec,values);
==> 4/3
// compare: f(2,1)/g(2,1) = (2+2*1)/(2^2-1^1) = 4/3
| See also:
pfd.
|