Previous: Polynomial and rational function manipulation Up: Polynomial and rational function manipulation Next: Builtin operations for CRE
Conversion between General Representation and CRE
In the lisp-level of Macsyma it is sometimes more convenient to
deal with CRE and polynomial forms in implementing certain
algorithms. If you decide the computation in your
algorithm is best done in polynomial representation you
can take user input expressions,
- Convert them to CRE and polynomial form.
- Perform the computation.
- Convert your final answers back to the general representation.
Converting into CRE form:
- [a] prog bind the global variables genvar and varlist to nil,
- [b] do (newvar expression) to collect variables on the varlist and genvar.
This must be done on enough expressions so that all variables
involved in subsequent computations are collected before step (3)
is performed.
- [c] use (cre expression) to convert expression to CRE form
- [e] use (crenum CRE) to obtain the numerator polynomial
- [f] use (credenom CRE) to obtain the denominator polynomial
Converting into general representation
(ratdisrep {\it CRE}) to convert a {\it CRE}
(pdis {\it poly}) to convert a {\it poly}