1 SEQUENCE_OPTIMIZE(exp or eqns) is a function that optimizes a code sequence
2 (list of equations at MACSYMA level) much the same way OPTIMIZE handles
3 a single expression. However, only lists are treated specially. All other
4 input will return MACSYMA BLOCK forms, just as OPTIMIZE does. Besides
5 allowing the user to deal with code sequences, SEQUENCE_OPTIMIZE differs
6 from OPTIMIZE in principally two ways:
8 1) It performs "exponent gathering" of terms in a product. Exponents
9 which are not integers are processed first. After differences are
10 collapsed, a search is done for any remaining non-unity GCDs of
11 the exponents, and the appropriate power within power structure
12 generated. The strategy is then repeated for integer exponents.
13 It is important to note that the gathering of these terms within
14 a new power occurs only if it reduces the operations count in a
15 CRAY FORTRAN environment(For detailed usage in other environments,
16 send mail to GCOOK@MIT-MC).
18 2) It allows the user to save the list of optimized temporaries found
19 by SEQUENCE_OPTIMIZE in the list OPTIM_EQUIVS. This is accomplished
20 by setting SAVE_OPTIM_INFO[FALSE] to TRUE.
21 WARNING : do not allow the value of OPTIM_EQUIVS to be resimplified
22 by doing an EV or similar operation on it. This could render it
23 useless to SEQUENCE_OPTIMIZE.
25 Globals besides OPTIM_EQUIVS and SAVE_OPTIM_INFO which affect the
26 operation of SEQUENCE_OPTIMIZE are:
28 SEQUENCE_OPTIM_PREFIX['opt] is the character string used to prefix
29 all symbols generated by SEQUENCE_OPTIMIZE to represent common subexpressions.
31 SEQUENCE_OPTIM_COUNTER[1] is the integer index used to identify by
32 unique symbols the common subexpressions found by SEQUENCE_OPTIMIZE.
34 SEQUENCE_OPTIM_SUFFIX[?'s] is the string used to suffix all optimized
35 temporaries arising from a call to SEQUENCE_OPTIMIZE(The "?" removes the
38 SEQUENCE_OPTIMIZE is accessed by doing LOAD(SEQOPT)$ . A demonstration
39 is available in SHARE1;SEQOPT DEMO . Bugs to GCOOK@MIT-MC .