Exun.Simpl (exun v0.5.2)
Simplify expressions
Link to this section Summary
Functions
Extract common factors from mult
Change power sign of AST (expon * -1 or 1/tree)
Change sign of AST
Reduce literals to one unit or one constant if possible
For convenience, creates ast {{:m,:mult},[a,b^-1]}
For convenience, creates ast {:elev,a,b}
Try to keep at least 3 decimals of precission
Recursively try to simplify expression. Multiple tries are performed. For a more agressive simplify, use Exun.Collect.coll
For convenience, creates ast {{:m,:mult},[a,b]}
Normalize some structs, mainly {{:m,op},l} so signs can be comparables
For convenience, creates ast {{:m,:mult},[a,-b]}
Returns normalized sign of ast
For convenience, creates ast {{:m,:suma},[a,b]}
Link to this section Functions
add_opand(atom, a, arg3)
cfactor(arg)
Extract common factors from mult
chpow(ast)
Change power sign of AST (expon * -1 or 1/tree)
chsign(ast)
Change sign of AST
collect_literals(arg)
Reduce literals to one unit or one constant if possible
divi(a, b)
For convenience, creates ast {{:m,:mult},[a,b^-1]}
elev(a, b)
For convenience, creates ast {:elev,a,b}
exp(a, b)
is_gtzero(arg)
is_par(ast)
ln(a)
minus(a)
mk(ast)
mknum(n, d)
Try to keep at least 3 decimals of precission
mkrec(ast)
Recursively try to simplify expression. Multiple tries are performed. For a more agressive simplify, use Exun.Collect.coll
mult(a, a)
For convenience, creates ast {{:m,:mult},[a,b]}
normalize(ast)
Normalize some structs, mainly {{:m,op},l} so signs can be comparables
rest(a, b)
For convenience, creates ast {{:m,:mult},[a,-b]}
signof(ast)
Returns normalized sign of ast
subst(op, pivot, opand)
suma(u1, u2)
For convenience, creates ast {{:m,:suma},[a,b]}