Opened 5 years ago

Closed 5 years ago

#24332 closed defect (duplicate)

Pari overflow with simple complex root finding

Reported by: Thierry Monteil Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: numerical Keywords: cypari2, pari
Cc: Vincent Delecroix, Luca De Feo, vklein, Jeroen Demeyer, François Bissey Merged in:
Authors: Reviewers:
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

Reported at this ask question:

sage: R.<x> = QQ[]
....: poly = x^7 - 6*x^6 + 15*x^5 - 20*x^4 + 15*x^3 - 6*x^2 + x
....: poly.roots(ring=CC)
---------------------------------------------------------------------------
PariError                                 Traceback (most recent call last)
<ipython-input-1-04b1981b5dbe> in <module>()
      1 R = QQ['x']; (x,) = R._first_ngens(1)
      2 poly = x**Integer(7) - Integer(6)*x**Integer(6) + Integer(15)*x**Integer(5) - Integer(20)*x**Integer(4) + Integer(15)*x**Integer(3) - Integer(6)*x**Integer(2) + x
----> 3 poly.roots(ring=CC)

/usr/local/src/sage-config/src/sage/rings/polynomial/polynomial_element.pyx in sage.rings.polynomial.polynomial_element.Polynomial.roots (build/cythonized/sage/rings/polynomial/polynomial_element.c:70160)()
   7574                     real_field = RealField(L.prec())
   7575 
-> 7576                 return self.change_ring(real_field).roots(ring=L, multiplicities=multiplicities, algorithm=algorithm)
   7577             elif is_pAdicRing(L) or is_pAdicField(L):
   7578                 p = L.prime()

/usr/local/src/sage-config/src/sage/rings/polynomial/polynomial_element.pyx in sage.rings.polynomial.polynomial_element.Polynomial.roots (build/cythonized/sage/rings/polynomial/polynomial_element.c:66462)()
   7464                 if not input_arbprec:
   7465                     self = self.change_ring(CC if input_complex else RR)
-> 7466                 ext_rts = self.__pari__().polroots(precision=L.prec())
   7467 
   7468             if output_complex:

cypari2/gen.pyx in cypari2.gen.Gen.polroots()

cypari2/handle_error.pyx in cypari2.handle_error._pari_err_handle()

PariError: overflow in expo()

Upstream report: https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1995

Same with, say, RealField(123), no problem with RDF.

Change History (9)

comment:1 Changed 5 years ago by Thierry Monteil

Cc: Jeroen Demeyer added
Keywords: cypari2 pari added

comment:2 Changed 5 years ago by Jeroen Demeyer

Priority: blockermajor

Ordinary bugs are not blockers...

comment:3 Changed 5 years ago by Jeroen Demeyer

Description: modified (diff)

comment:4 Changed 5 years ago by Jeroen Demeyer

Description: modified (diff)
Report Upstream: N/AReported upstream. No feedback yet.

comment:5 Changed 5 years ago by Jeroen Demeyer

Description: modified (diff)

comment:6 Changed 5 years ago by Jeroen Demeyer

Report Upstream: Reported upstream. No feedback yet.Fixed upstream, but not in a stable release.

comment:7 Changed 5 years ago by Jeroen Demeyer

Is this fix very important to you? Should we fix this bug in Sage right now or is it fine to wait for a future PARI/GP upgrade?

comment:8 Changed 5 years ago by François Bissey

Cc: François Bissey added

comment:9 Changed 5 years ago by Jeroen Demeyer

Milestone: sage-8.2sage-duplicate/invalid/wontfix
Resolution: duplicate
Status: newclosed

This will be fixed in Sage by the next PARI upgrade.

Note: See TracTickets for help on using tickets.