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
Fixes invert on a symbol returns 0 #24399
base: master
Are you sure you want to change the base?
Conversation
✅ Hi, I am the SymPy bot (v169). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.
Click here to see the pull request description that was parsed.
|
The slow tests failed showing that something somewhere depends on this. That needs further investigation. |
This is the code in question: if invert:
h_lc = Poly(h.as_poly(DE.t).LC(), DE.t, field=True, expand=False)
inv, coeffs = h_lc.as_poly(z, field=True).invert(s), [S.One]
for coeff in h.coeffs()[1:]:
L = reduced(inv*coeff.as_poly(inv.gens), [s])[1]
coeffs.append(L.as_expr())
h = Poly(dict(list(zip(h.monoms(), coeffs))), DE.t) In this example, |
The code comes from 8079e44 and isn't strictly part of the pseudocode in the book. I don't remember exactly why this was added, but it seems likely enough to me that the logic there is simply incorrect. |
I guess the book does state, "we can make |
This is in |
The example from the book,
But if you change the default to
which doesn't even split out the non-elementary integral from the rational integral correctly (differentiating confirms both answers are correct). Apparently this integral isn't tested in test_risch.py. When I changed the default, the only non-slow test in sympy/integrals that failed was a direct test for the |
So can we add tests here of this example |
@asmeurer I think that unless you say precisely how the risch code could be fixed this PR will stall. |
This looks like one of those issues caused by the gcd of polynomials being different over field and non-field coefficients. This is a possible fix:
|
There are assertion failures in |
References to other Issues or PRs
Fixes #24394
Brief description of what is fixed or changed
Other comments
Release Notes
NO ENTRY