Opened 3 years ago

Closed 3 years ago

#24332 closed defect (duplicate)

Pari overflow with simple complex root finding

Reported by: tmonteil Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: numerical Keywords: cypari2, pari
Cc: vdelecroix, defeo, vklein, jdemeyer, fbissey Merged in:
Authors: Reviewers:
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

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 3 years ago by tmonteil

  • Cc jdemeyer added
  • Keywords cypari2 pari added

comment:2 Changed 3 years ago by jdemeyer

  • Priority changed from blocker to major

Ordinary bugs are not blockers...

comment:3 Changed 3 years ago by jdemeyer

  • Description modified (diff)

comment:4 Changed 3 years ago by jdemeyer

  • Description modified (diff)
  • Report Upstream changed from N/A to Reported upstream. No feedback yet.

comment:5 Changed 3 years ago by jdemeyer

  • Description modified (diff)

comment:6 Changed 3 years ago by jdemeyer

  • Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.

comment:7 Changed 3 years ago by jdemeyer

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 3 years ago by fbissey

  • Cc fbissey added

comment:9 Changed 3 years ago by jdemeyer

  • Milestone changed from sage-8.2 to sage-duplicate/invalid/wontfix
  • Resolution set to duplicate
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.