]>
gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/symbolic.py
2 from sage
.interfaces
.maxima_lib
import maxima_lib
3 from sage
.symbolic
.expression
import Expression
6 def set_simplification_domain(d
):
8 Set Maxima's simplification domain.
12 - d -- The domain, either 'real' or 'complex'.
15 cmd
= 'domain: %s;' % d
16 result
= maxima_lib
._eval
_line
(cmd
)
20 def safe_simplify(expr
):
22 What should be a totally safe simplification operation that works
23 a little better than the plain simplify().
25 Uses a top-level function because we can't monkey-patch Cython
28 expr
= expr
.simplify_factorial()
29 expr
= expr
.simplify_log()
33 def medium_simplify(expr
):
35 A reasonably-safe set of simplifications, much better than
36 simplify() and safer than simplify_full()
38 Uses a top-level function because we can't monkey-patch Cython
41 expr
= expr
.simplify_factorial()
42 expr
= expr
.simplify_trig()
43 expr
= expr
.simplify_rational()
44 expr
= expr
.simplify_log()