X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fsymbolic.py;h=992260efb9aaedadf187e06f4db6941d5055cb7e;hb=1ce1d354d9442cf64cb61d41b3354f55b8a4331d;hp=e4c6d23faef7117bcd7807da3d95d84a39fd18ad;hpb=3a61b951df61f4175bcf61700454ed978b63b2ef;p=sage.d.git diff --git a/mjo/symbolic.py b/mjo/symbolic.py index e4c6d23..992260e 100644 --- a/mjo/symbolic.py +++ b/mjo/symbolic.py @@ -9,7 +9,23 @@ def set_simplification_domain(d): INPUT: - - d -- The domain, either 'real' or 'complex'. + - ``d`` -- The domain, either 'real' or 'complex'. + + TESTS: + + With the default 'complex' domain, we don't simplify this:: + + sage: sqrt(x^2).simplify() + sqrt(x^2) + + But in the 'real' domain, we do:: + + sage: set_simplification_domain('real') + 'real' + sage: sqrt(x^2).simplify() + abs(x) + sage: set_simplification_domain('complex') + 'complex' """ cmd = 'domain: %s;' % d @@ -28,18 +44,3 @@ def safe_simplify(expr): expr = expr.simplify_factorial() expr = expr.simplify_log() return expr - - -def medium_simplify(expr): - """ - A reasonably-safe set of simplifications, much better than - simplify() and safer than simplify_full() - - Uses a top-level function because we can't monkey-patch Cython - classes. - """ - expr = expr.simplify_factorial() - expr = expr.simplify_trig() - expr = expr.simplify_rational() - expr = expr.simplify_log() - return expr