simplify/constant  simplify constant expressions typically containing radicals and functions with exact numeric arguments

Calling Sequence


simplify(expr, constant)


Parameters


expr



expression

constant



literal name; constant





Description



The approach used consists of applying a set of simplification procedures (SP) in two steps:


1) The constant objects, in the form of sums, products, or function calls, are simplified using SP, starting with the inner most one and composing simplifications at each step. The routines can handle with reasonable efficiency products of fractional powers, exponentials, and various functions calls together with their multiplicative inverses.


2) When the resulting expression still contains radicals, the simplification procedure applied to each object in the previous step is applied once more, this time to the whole expression.

•

The simplification procedures SP used in the itemization above consist of analyzing the Real and Imaginary parts of the expression in order to conclude about possible cancellations or simpler representations. In addition, if the expression or subexpression can be evaluated numerically fast, using hardware floats, this information is used as a starting point to determine an exact rational value for the object, if that value exists.


The simplify/constant routines do take assumptions into account up to the point Re, Im, and abs take them.


The simplification of constant subexpressions entering input for simplify is performed automatically. However, to invoke this set of simplification routines, call simplify with the extra argument constant.



Examples


>


 (1) 
>


 (2) 
How it works.
>


 (3) 
The following example has a more complex step.
>


 (4) 
>


 (5) 
Manipulate the real and imaginary parts.
>


 (6) 
This example shows that these simple manipulations of the real and imaginary parts are not enough, but the expression is (in this case by construction) equal to a rational number.
>


 (7) 
>


 (8) 
The following example has nonelementary functions.
>


 (9) 
>


 (10) 
The following example has powers of trigonometric functions.
>


 (11) 
>


 (12) 
In cases as the following one (extracted from some integration problems):
>


 (13) 
The whole expression cannot be simplified by means of Re, Im, or abs.
>


 (14) 
It cannot be evaluated using hardware floats.
>


Some subexpressions of it can be simplified by properly manipulating these procedures and that suffices to collapse the original problem into something within the scope of these simpler manipulations, here leading to the following.
>


 (15) 
The simplification routines for constant expressions is also used by simplify to simplify certain type of constant subexpressions found inside nonconstant expressions
>


 (16) 
>


 (17) 
>


 (18) 


Download Help Document
Was this information helpful?