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
mpmath and math make different result #363
Comments
The issue is that in the |
I will make a pull request later that helps with this issue (basically I added a check so that all positive and negative values get added separately until the end). It still fails for math.cos, but there is not much else to do. Even sorting the values and adding them in the best order still doesn't work, because the final results are just too close. The only answer is to find a way to do it without the subtraction of similarly sized numbers. |
The only solution to this problem is to find another way to estimate the nth derivative of a function other than the current method (which is based around interpolating a degree-n polynomial around function points near the point of interest and getting the derivative of that from the leading coefficient). Generally, it is expected that machine precision will not yield enough accuracy for good results, and I would recommend closing this issue. |
Not a bug, as explained above. |
math.cos gives wrong answer.
says
The text was updated successfully, but these errors were encountered: