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
Integration of certain cubic rational functions is incorrect #13460
Comments
Apparently, issue is not in the definite integration:
|
The antiderivative should be a sum of three logarithms since the denominator has three simple roots. It seems that
|
I would be careful about using chop=True in library code. I think the option only works when you know the value you are working with and know that it should go to 0. As far as I understand, it uses a method based on absolute value, which can easily lead to false positives if you actually do have a small but nonzero value (e.g., |
That looks like a 0 with no precision -- and like using |
Probably, best you can do here to test for zero - call evalf with strict=True and "pass" if it throw a PrecisionExhausted exception. Similar heuristics I use in diofant/diofant#430. We can exactly solve zero-decision problem for algebraic numbers, but that seems to slow for me, at least with current polys module. |
More examples:
1/(40*x**3 + 34*x**2 - 30*x - 28)
,1/(-(x**3) - 15*x**2 + 17*x - 18)
,1/(-(x**3) - 15*x**2 + 23*x + 40)
.I've verified the numerical result with other tools, so I'm pretty sure the error isn't in mpmath.
The text was updated successfully, but these errors were encountered: