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
AssertionError in real_roots.real_roots() #20390
Comments
comment:1
|
comment:2
|
comment:3
bug is still present in 9.2.beta2 |
comment:5
FWIW you can change this to a recursion error by increasing the precision: diff --git a/src/sage/rings/polynomial/real_roots.pyx b/src/sage/rings/polynomi$
index ba57c1ba4f..e0226fc53a 100644
--- a/src/sage/rings/polynomial/real_roots.pyx
+++ b/src/sage/rings/polynomial/real_roots.pyx
@@ -2864,6 +2864,7 @@ def split_for_targets(context ctx, interval_bernstein_pol$
goal = Integer(65535)/65536
else:
goal = Integer(255)/256
+ goal = Integer(4294967296)/Integer(4294967295)
if ntargs == 1 and not(out_of_bounds) and split_targets[1][0] - split_targ$
return [bp]
Maybe that helps debug it. Or maybe this polynomial is just too crazy. |
This comment has been minimized.
This comment has been minimized.
comment:8
Moving to 9.4, as 9.3 has been released. |
Here are the corresponding logs (extracted by patching the code so that it returns the context object on error):
|
Does anyone understand the code, or at least the algorithm, well enough to stand a chance of understanding the issue? (@zimmermann6 maybe??) The code is quite well documented, but it is a bit much for me to digest. |
who is the author of that code ? Where is it located ? Is there a simpler example (I cannot copy&paste the long input) ? |
It is located in |
No simpler example, unfortunately, but here is this one as a |
Actually some other examples are listed at #26957, but none of them fails on my system. However, @fchapoton mentioned a few years ago that they did fail on his. This could point at an issue with the use of hardware floating-point numbers... |
I cloned Sage from github (revision 84eebf0). I see two assert(msign == sign) lines in real_roots.pyx: one at line 736 and one at line 1606. Is that the one at line 736 that fails? (I cannot build that version from source.) |
@mezzarobba please can you create a Sage file with the inputs to the |
Yes, the failing assertion is the one on line 736. Here is a script that reproduces just the failing call to |
thanks. Assuming the polynomial corresponds to the list [-1, -1, -1, ...] with low-order coefficients first, the given value of
|
so the question is: which routine did compute that wrong msign value? It seems to me that the routine |
Thanks a lot for taking a look.
I don't think this is the case, but maybe I don't understand what you are saying. According to the docstring of
I was hoping that you understood the algorithm well enough to make a plausible guess... :-)
Then I get
And the call to
while there are only 11 real roots. The interval is |
|
See also #26955.
CC: @videlec @dimpase @orlitzky @sagetrac-cwitty
Component: algebra
Issue created by migration from https://trac.sagemath.org/ticket/20390
The text was updated successfully, but these errors were encountered: