New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect result of simplify #23086
Labels
Comments
I don't get zero: In [1]: simplify(180 * acos(S.One * 7823207 / 7823209) / pi)
Out[1]:
⎛7823207⎞
180⋅acos⎜───────⎟
⎝7823209⎠
─────────────────
π |
I see, it only happens sometimes: $ cat t.py
from sympy import *
print(simplify(180 * acos(S.One * 7823207 / 7823209) / pi))
$ python t.py
0
$ python t.py
0
$ python t.py
0
$ python t.py
0
$ python t.py
0
$ python t.py
180*acos(7823207/7823209)/pi
$ python t.py
0
$ python t.py
180*acos(7823207/7823209)/pi
$ python t.py
180*acos(7823207/7823209)/pi |
It's a problem with assumptions. This sometimes gives True and sometimes False: from sympy import *
expr = 180 * acos(S.One * 7823207 / 7823209) / pi
print(expr.is_zero) |
The bug is in evalf: In [2]: expr = acos(S(7823207) / 7823209)
In [3]: expr.evalf(2)
Out[3]: 0
In [4]: expr.evalf(20)
Out[4]: 0.00071505185649204996777 |
Here the rational number is evalfed to 1 when it is not quite equal to 1: Lines 570 to 576 in 131caae
|
Also from time to time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
simplify(180*acos(S.One*7823207/7823209)/pi)
returns0
, but the value of the expression is approximately0.04
The text was updated successfully, but these errors were encountered: