%File: CLES4.ALG (c) 10/30/79 The Soft Warehouse % LINELENGTH (78)$ #ECHO: ECHO$ ECHO: TRUE$ % This is the fourth of a sequence of muMATH calculator-mode lessons. There are some other algebraic control variables besides PWREXPD, NUMNUM, DENDEN, and DENNUM; and they are occasionally crucial for achieving a desired effect. One of these, named NUMDEN, provides the logical completion of the latter three, by controlling the distribution of factors in numerators over the terms of denominator sums. NUMDEN is initially 0, but integer numerators are distributed over denominator sums when NUMDEN is a positive integer multiple of 2, monomial numerators are distributed over denominator sums when NUMDEN is a positive integer multiple of 3, and numerator sums are distributed over denominator sums when NUMDEN is a positive integer multiple of 5. For example: % NUMNUM: DENDEN: DENNUM: 0 $ NUMDEN: 30 $ X / (X^3 + X + 1) / (Y + 1) ; EG: (X+Y) / (1+X+Y) / (Y+1) ; % Isn't that intriguing? It yields a sort of "continued-fraction" representation. Now for the reverse direction, which performs a denesting of denominators which is less drastic than a single common denominator: % NUMDEN: -6 $ Z + 1 / (1/X + 1/Y) / (1+Y) ; % See if you can devise examples exhibiting dramatic simplifications arising from either direction for this novel transformation. The fact that it so naturally complements NUMNUM, DENDEN, and DENNUM suggests that it must be useful for something! % RDS: FALSE $ % Another control variable named BASEXP controls distribution of a BASe over terms in an EXPonent which is a sum, or controls the reverse process which is collection of similar factors. As might be expected, integer bases are distributed over exponent sums when BASEXP is a positive integer multiple of 2, monomial bases are distributed over exponent sums when BASEXP is a positive integer multiple of 3, and base sums are distributed over exponent sums when BASEXP is a positive integer multiple of 5. Morever, the corresponding negative values cause collection of similar factors having the corresponding types of bases. BASEXP is initially -30. However, distribution (followed perhaps by collection) is sometimes necessary to let some of the terms in an exponent sum combine with the base. For example: % EG: 2^(2+X) / 4 ; BASEXP: 2 ; EVAL (EG) ; % See if you can devise an example which requires evaluating an expression first with sufficiently positive BASEXP, then reevaluating with sufficiently negative BASEXP, or vice-versa: % RDS: FALSE $ % Another control variable named EXPBAS controls the distribution of EXPonents over BASes which are PRODUCTS. Integer exponents are distributed over base products when EXPBAS is a positive integer multiple of 2, monomial exponents are distributed over base products when EXPBAS is a positive integer multiple of 3, and exponent sums are distributed over base products when EXPBAS is a positive integer multiple of 5. Naturally, the corresponding negative multiples request collection of bases which have similar exponents of the indicated type. The initial value is 30, and here are some examples where distribution permits net simplification: % (X^(1/2) * Y) ^ 2 ; (X*Y)^2 - X^2*Y^2 ; (4*X^2*Y) ^ (1/2) ; % However, the user should beware that as with manual computation, distribution of noninteger exponents is not always valid. Consequently, conservative users may prefer to generally operate with EXPBAS being 2. Moreover, distribution of exponents tends to make expressions more bulky when no cancellations occur. For example % (X * Y * Z) ^ (1/2) ; % In fact, there are instances where negative settings of EXPBAS are necessary to acheive a desired result. For example: % EG: 2^X * 3^X + (1+X)^(1/2) * (1-X)^(1/2) - (1-X^2)^(1/2) ; EXPBAS: -6 ; NUMNUM: 30 ; EVAL (EG) ; % See if you can devise an example which requires evaluating an expression first with sufficiently positive EXPBAS, then reevaluating with sufficiently negative EXPBAS, or vice-versa, in order to simplify acceptably: % RDS: FALSE $ % The variable named PBRCH, already discussed in conjunction with fractional powers of numbers, also controls transformations of the form u^v^w --> u^(v*w). PBRCH is initially TRUE, but when PBRCH is FALSE, the transformation occurs only for integer w. Otherwise the transformation occurs for any w. The user should be aware that in some circumstances the selected branch is an inappropriate one, so that it may sometimes be necessary to set PBRCH to FALSE. See if you can devise such an instance: % RDS: FALSE $ % Now, try the examples 0^X and X^0, to see what happens: % RDS: FALSE $ % The reason that 0^X is not automatically simplified to;)$ O .  .^0^001 566667[\a''''''r7''X7 ''(''0''8''@''H''P''JX'' `''oh''p''x''&''1''<''C''M''T'' \''g''%r''y'')''/''''N''O''5''('(' (' (' ('.!(('0('k8('@@('wH('P('X(' `('% h('X p('u x(' %(' ,(' 9(' A(' L('H R''q[8*'a('h('7o''7z''(' ('0'('0('H)'\'')' )'< )'()' 0)'d 8)';@)''H)'[P)'< X)'`)'h)'o!"p)'!(x)'81)'1)' 1)'1)'1)'1)'1)'1'' 1)X]=%1)'7-1(]'418*'81)'<1)'A1)'7R1)'Z1`'&8^1*'h1*'m1*'u1 *'~1(*'10*'818*'1@*'1H*'1P*':81X*'1`*';1h*'1p*'1x*_1*\1*'81*]1*`1*'1*'1*'91*'&:2*' 2*'^: 2*'2*':2*':$2*':-2*'72*'<2''B2+'HF2+'H20'J2 +'L2(+':Aa20+'~Ac28+0]BFe2@+'LFg2H+P]Hi2P+'Hk2X+'zIm2`+'`CC3,'XCK3,'CQ3,'CX3,'Ea3,'zEk3,'u3,'z3,'E3,'F3,'hF3,'.G3,'3,'jH3,'H3,'3,'Q3-'$I3''3''30'30'30-'30-'3\'@[4@-'4H-' 4P-'4X-'4`-'S4''4p-'`L4x-'U%4-'L+4-'M44\'=4-'ND4-'I4-'M4-'Q4-'`OU4\'Z4-'`4-'Od4-'zPk4-'Pr4-'t4-'y4-'4.'0Q4v0'R4v0'+-*/^PRTSPACEPRTPARENLOP1PRTLISTPOINTNUMBERDENNUMPRTDIG w++  >+  6*%4FNxI > ii#  , xHI AO:%2%*%qyO 7?\ w++X s w+ i *%5w *%6;’ ;> 2%7^0'6d0'6j0'6p0'6v0'6|0'60'60'60'60'60'60'60'60'60'60'60'60'60'60'60'60'60'60'60'60'60'6PARSEMUSRPAR)LPAR(COMMA,BELLPRTMATHMAKDEFEX1EX2LEX1 *** REDEFINED: PUTPROPEX3DELIMITEREXITENDLOOPENDBLOCKENDFUNENDSUBTERMINATOR;$&MATCHDELIMSYNTAXNOT FOUNDMISSING COMMAINFIXLBPMATCHNOPPREFIXRBPUSED ASOPERATORREADLISTREADREST.PUTPARSEPROPERTYDEFFUNIDENTITYWHENPARSEWHENBLOCKERR?@ *** SYNTAX ERROR: <>+-*/^PRTSPACEPRTPARENLOP1PRTLISTPOINTNUMBERDENNUMPRTDIGARITHMULTIPLEPOSMULTNEGMULTSUBEVSUBSUMPRODUCTPOWERRECIPNEGCOEFMKSUMMKPRODNUM1DEN1MINSIMPUARGEXABSGCDLCMCODIVCOEFFBASEEXPONDENOMARGLISTMKRATRATSUMADDTERMSINJECTERMMERGETERMLEX2LEX3MERGESUMSUMLEXMULTFACTSMERGEFACTEX4MERGEPRODPRODLEX *** WARNING: SQUAREEXPTZEROBASEZEROEXPTTRGEXPDLOGEXPDLOGBAS#EFLAGS#ICOSSINLOG*^PBRCHBASE^BASE*PRTMATH*PRTMATH^PRIMESROOTEX5EX6EX7FREEPION2#PIEXPON*EXPON^!STOPALGEBRAARIPRTMATH+NUMNUMDENNUMDISTRIBLEX4*+DENDENNUMDENBASEXPEXPBASEXPON+PWREXPDBASE+EXPANDCONTENTCONTENT1CANCELCANCEL1FACTOR+*+^EXPDFCTR = TpThTdTZTVT:T6T2T(((-CT>T(+QTFT)+--'')8*(-!(+`T))( ((lT)+T|TvT?PzT(!(+`T')@*TRzT(+T(8QT?P2T!()Ty)PQ-!()T?PTVTTTT(+ ( P)(T)+!(+!((!(()')4U.UzT*UUzTTTzT!(('1)UUU(9Q UU((U (((1)$UUVT( Ui))'U')( +!(+'7U)+'SHUBU())QULUq()')'S