compact.tex 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. \chapter[COMPACT: Compacting expressions]{COMPACT: Package for compacting expressions}
  2. \label{COMPACT}
  3. \typeout{{COMPACT: Package for compacting expressions}}
  4. {\footnotesize
  5. \begin{center}
  6. Anthony C. Hearn\\
  7. RAND\\
  8. Santa Monica \\
  9. CA 90407-2138, U.S.A. \\[0.05in]
  10. e--mail: hearn@rand.org
  11. \end{center}
  12. }
  13. \ttindex{COMPACT}\index{COMPACT package}\index{side relations}
  14. \index{relations ! side}
  15. {COMPACT} is a package of functions for the reduction of a polynomial in
  16. the presence of side relations. The package defines one operator {COMPACT}
  17. \index{COMPACT operator}
  18. whose syntax is:
  19. \begin{quote}
  20. \k{COMPACT}(\s{expression}, \s{list}):\s{expression}
  21. \end{quote}
  22. \s{expression} can be any well-formed algebraic expression, and
  23. \s{list} an expression whose value is a list
  24. of either expressions or equations. For example
  25. \begin{verbatim}
  26. compact(x**2+y**3*x-5y,{x+y-z,x-y-z1});
  27. compact(sin(x)**10*cos(x)**3+sin(x)**8*cos(x)**5,
  28. {cos(x)**2+sin(x)**2=1});
  29. let y = {cos(x)**2+sin(x)**2-1};
  30. compact(sin(x)**10*cos(x)**3+sin(x)**8*cos(x)**5,y);
  31. \end{verbatim}
  32. {COMPACT} applies the relations to the expression so that an equivalent
  33. expression results with as few terms as possible. The method used is
  34. briefly as follows:
  35. \begin{enumerate}
  36. \item Side relations are applied separately to numerator and denominator, so
  37. that the problem is reduced to the reduction of a polynomial with respect to
  38. a set of polynomial side relations.
  39. \item Reduction is performed sequentially, so that the problem is reduced
  40. further to the reduction of a polynomial with respect to a single
  41. polynomial relation.
  42. \item The polynomial being reduced is reordered so that the variables
  43. (kernels) occurring in the side relation have least precedence.
  44. \item Each coefficient of the remaining kernels (which now only contain
  45. the kernels
  46. in the side relation) is reduced with respect to that side relation.
  47. \item A polynomial quotient/remainder calculation is performed on the
  48. coefficient. The remainder is
  49. used instead of the original if it has fewer terms.
  50. \item The remaining expression is reduced with respect to the side relation
  51. using a ``nearest neighbour'' approach.
  52. \end{enumerate}