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
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