REDUCE

16.15 COMPACT: Package for compacting expressions

COMPACT is a package of functions for the reduction of a polynomial in the presence of side relations. COMPACT applies the side relations to the polynomial so that an equivalent expression results with as few terms as possible. For example, the evaluation of

     compact(s*(1-sin x^2)+c*(1-cos x^2)+sin x^2+cos x^2,  
             {cos x^2+sin x^2=1});

yields the result

              2           2  
        SIN(X) *C + COS(X) *S + 1 .

The switch TRCOMPACT can be used to trace the operation.

Author: Anthony C. Hearn.