Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ad65eb9db | ||
|
|
0f09382219 | ||
|
|
7e40b92db1 | ||
|
|
3acffc54b4 |
@@ -515,6 +515,10 @@ def simplify(expr, ratio=1.7, measure=count_ops, rational=False, inverse=False):
|
||||
kwargs = dict(ratio=ratio, measure=measure,
|
||||
rational=rational, inverse=inverse)
|
||||
|
||||
# no routine for Expr needs to check for is_zero
|
||||
if isinstance(expr, Expr) and expr.is_zero and expr*0 is S.Zero:
|
||||
return S.Zero
|
||||
|
||||
_eval_simplify = getattr(expr, '_eval_simplify', None)
|
||||
if _eval_simplify is not None:
|
||||
return _eval_simplify(ratio=ratio, measure=measure, rational=rational, inverse=inverse)
|
||||
|
||||
@@ -806,3 +806,9 @@ def test_issue_15965():
|
||||
assert simplify(A + B) == anew + bnew
|
||||
assert simplify(A) == anew
|
||||
assert simplify(B) == bnew
|
||||
|
||||
|
||||
def test_issue_7971():
|
||||
z = Integral(x, (x, 1, 1))
|
||||
assert z != 0
|
||||
assert simplify(z) is S.Zero
|
||||
|
||||
Reference in New Issue
Block a user