#5732: digits,exact_log,ndigits speed overhaul
------------------------------+---------------------------------------------
Reporter: jbmohler | Owner: somebody
Type: enhancement | Status: new
Priority: major | Milestone: sage-3.4.1
Component: basic arithmetic | Keywords:
------------------------------+---------------------------------------------
Comment(by jbmohler):
Some timings:
{{{
new patch
sage: n=5^1000
sage: m=2975982357823879528793587928793592
sage: timeit("n.exact_log(m)")
625 loops, best of 3: 714 ns per loop
sage: n=5^50
sage: m=33
sage: timeit("n.exact_log(m)")
625 loops, best of 3: 2.49 µs per loop
}}}
{{{
Vanilla sage 3.4
sage: n=5^1000
sage: m=2975982357823879528793587928793592
sage: timeit("n.exact_log(m)")
625 loops, best of 3: 620 µs per loop
sage: n=5^50
sage: m=33
sage: timeit("n.exact_log(m)")
625 loops, best of 3: 92.2 µs per loop
}}}
I really like the first example :), but it's a bit of a pathology.
There's a relatively narrow band of cases where the log base 2 estimate is
quickly provable and exactly correct.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5732#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---