Opened 8 years ago

Closed 7 years ago

#14955 closed defect (fixed)

HeilbronnMerel(50000) raises a RuntimeError

Reported by: tian Owned by:
Priority: minor Milestone: sage-6.2
Component: modular forms Keywords: sd51
Cc: Merged in:
Authors: Peter Bruin Reviewers: Alex Ghitza
Report Upstream: N/A Work issues:
Branch: 8fde195 (Commits, GitHub, GitLab) Commit: 8fde195d7610e81dbba78fe5c062652a02b780f7
Dependencies: Stopgaps:

Status badges


sage: H=HeilbronnMerel(50000)
RuntimeError Traceback (most recent call last)
/home/guests/sage-5.4.1/<ipython console=""> in <module>()
/home/guests/sage-5.4.1/local/lib/python2.7/site-packages/sage/modular/modsym/ in sage.modular.modsym.heilbronn.HeilbronnMerel.__init__ (sage/modular/modsym/heilbronn.c:5185)()
/home/guests/sage-5.4.1/local/lib/python2.7/site-packages/sage/modular/modsym/ in sage.modular.modsym.heilbronn.HeilbronnMerel._initialize_list (sage/modular/modsym/heilbronn.c:5343)()
RuntimeError: Floating point exception

Change History (7)

comment:1 follow-up: Changed 8 years ago by AlexGhitza

For the record, HeilbronnMerel(46342) seems to be the earliest point of failure.

comment:2 Changed 8 years ago by davidloeffler

  • Keywords sd51 added

comment:3 in reply to: ↑ 1 Changed 7 years ago by pbruin

Replying to AlexGhitza:

For the record, HeilbronnMerel(46342) seems to be the earliest point of failure.

This looks like an integer overflow. The method HeilbronnMerel._initialize_list() sets bc = a*d - n, where a and d are <= n, and bc is an int.

sage: n = 46342
sage: n^2 - n < 2^31
sage: (n-1)^2 - (n-1) < 2^31

I guess making bc a long long will solve this.

comment:4 Changed 7 years ago by pbruin

  • Authors set to Peter Bruin
  • Branch set to u/pbruin/14955-HeilbronnMerel_overflow
  • Commit set to 8fde195d7610e81dbba78fe5c062652a02b780f7
  • Status changed from new to needs_review

Indeed it does. (Note about the patch: llong is defined as long long earlier in the file.) I have tested this, but have not added any doctests, since any example would take much longer than the longest currently existing doctests.

comment:5 Changed 7 years ago by AlexGhitza

Looks good to me. For the record, under sage-6.2.beta8 running on sage.math, HeilbronnMerel(46342) finishes (successfully) in about 5 minutes, and HeilbronnMerel(50000) in about 6 minutes.

comment:6 Changed 7 years ago by AlexGhitza

  • Milestone set to sage-6.2
  • Reviewers set to Alex Ghitza
  • Status changed from needs_review to positive_review

comment:7 Changed 7 years ago by vbraun

  • Branch changed from u/pbruin/14955-HeilbronnMerel_overflow to 8fde195d7610e81dbba78fe5c062652a02b780f7
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.