LCM INDEX

LCM _ _ _ _ _ _ _ _ _ _ _ _ switch

The lcm switch instructs REDUCE to compute the least common multiple of denominators whenever rational expressions occur. Default is on.

examples:


off lcm; 

z := 1/(x**2 - y**2) + 1/(x-y)**2;  
			 


              2*X*(X - Y)
  Z := ------------------------- 
        4      3          3    4
       X  - 2*X *Y + 2*X*Y  - Y


on lcm; 

z; 

         2*X*(X - Y)
  ------------------------- 
   4      3          3    4
  X  - 2*X *Y + 2*X*Y  - Y


zz := 1/(x**2 - y**2) + 1/(x-y)**2;
			 


                 2*X
  ZZ := --------------------- 
         3    2        2    3
        X  - X *Y - X*Y  + Y


on gcd; 

z; 

           2*X
  ----------------------
   3    2        2    3
  X  - X *Y - X*Y  + Y

Note that lcm has effect only when rational expressions a re first combined. It does not examine existing structures for simplifications on display. That is shown above when z is entered with lcm off. It remains unsimplified even after lcm is turned back on. However, a new variable containing the same expression is simplified on entry. The switch gcd does examine existing structures, as shown in the last example line above.

Full greatest common divisor calculations become expensive if work with large rational expressions is required. A considerable savings of time can be had if a full gcd check is made only when denominators are combined, and only a partial check for numerators. This is the effect of the lcm switch.