Opened 4 years ago

Last modified 3 years ago

#26925 new enhancement

nf -> RR conversion should not be slower than nf -> RIF

Reported by: vdelecroix Owned by:
Priority: major Milestone:
Component: number theory Keywords:
Cc: slelievre Merged in:
Authors: Vincent Delecroix Reviewers:
Report Upstream: N/A Work issues:
Branch: u/vdelecroix/26925 (Commits, GitHub, GitLab) Commit: ab8a836c33b7793b2f25485f514181d9ea3d8e8b
Dependencies: Stopgaps:

Status badges

Description (last modified by vdelecroix)

Given a quadratic number field, conversion to MPFR floating point is terribly slow compared to the more complicated MPFI interval floating point conversion

sage: %timeit RR(a)
1000 loops, best of 3: 224 µs per loop
sage: %timeit RIF(a)
1000000 loops, best of 3: 919 ns per loop
  • same purpose ticket for Python floating point #26927
  • related old ticket: #21991

Change History (8)

comment:1 Changed 4 years ago by vdelecroix

  • Description modified (diff)

comment:2 Changed 4 years ago by vdelecroix

  • Branch set to u/vdelecroix/26925
  • Commit set to 1cc3774aa50a211f22863a8972de64f248fb0f3d

Implementing _mpfr_ is a complete failure (for now)...


New commits:

9faa25626839: fix evaluation of lazy constants
c4cde9e26839: get rid of _is_special
1cc3774_mpfr_ method on element of quad nf

comment:3 Changed 4 years ago by git

  • Commit changed from 1cc3774aa50a211f22863a8972de64f248fb0f3d to ab8a836c33b7793b2f25485f514181d9ea3d8e8b

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

ab8a836_mpfr_ method on element of quad nf

comment:4 Changed 4 years ago by vdelecroix

Declaring a _mpfr_ method is not enough to get a direct coercion path from K -> RR... see discussion at this sage-devel thread.

comment:5 Changed 4 years ago by vdelecroix

  • Description modified (diff)

comment:6 Changed 3 years ago by embray

  • Milestone changed from sage-8.6 to sage-8.7

Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist.

comment:7 Changed 3 years ago by embray

  • Milestone changed from sage-8.7 to sage-8.8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

comment:8 Changed 3 years ago by embray

  • Milestone sage-8.8 deleted

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

Note: See TracTickets for help on using tickets.