10.2 Declaring Expressions Positive or Negative

Detailed knowlege about the sign of expressions allows REDUCE to simplify expressions involving exponentials or ABS. You can express assumptions about the positivity or negativity of expressions by rules for the operator SIGN. Examples:

         let sign(a)=>1,sign(b)=>1; abs(a*b*c);  
         on precise; sqrt(x^2-2x+1);  
            abs(x - 1)  
         ws where sign(x-1)=>1;  
            x - 1

Here factors with known sign are factored out of an ABS expression.

         on precise; on factor;  
           ((x - 2)*q)  
         ws where sign(x-2)=>1;  
            w        w  
           q *(x - 2)  

In this case the factor (x - 2)w may be extracted from the base of the exponential because it is known to be positive.

Note that REDUCE knows a lot about sign propagation. For example, with x and y also x + y, x + y + π and (x + e)∕y2 are known as positive. Nevertheless, it is often necessary to declare additionally the sign of a combined expression. E.g. at present a positivity declaration of x- 2 does not automatically lead to sign evaluation for x- 1 or for x.