#4132: [with patch, needs review] complex arithmetic passes via pari
------------------------------+---------------------------------------------
Reporter: robertwb | Owner: AlexGhitza
Type: enhancement | Status: assigned
Priority: major | Milestone: sage-3.1.3
Component: basic arithmetic | Resolution:
Keywords: |
------------------------------+---------------------------------------------
Changes (by AlexGhitza):
* summary: [with patch, needs work] complex arithmetic passes via pari
=> [with patch, needs review] complex
arithmetic passes via pari
Comment:
I have replaced the old patch with one that addresses the first two points
made above. I had actually done benchmarks while writing the code, and
they're now listed further down in this comment.
As for the point on accuracy: I guess the issue is elliptic_logarithm,
which was somewhat broken before this patch and is still broken now (see
#4214); this has nothing to do with this ticket, though.
Timings after/before the patch (z was chosen randomly):
{{{
sage: z = CC(0.588296734970724 - 0.918562568630843*I)
sage: z
0.588296734970724 - 0.918562568630843*I
sage: timeit("z.is_zero()")
625 loops, best of 3: 901 ns per loop # was 11.7 µs
sage: timeit("z^(2/3)")
625 loops, best of 3: 80 µs per loop # was 110 µs
sage: timeit("z.csch()")
625 loops, best of 3: 18.2 µs per loop # was 70.4 µs
sage: timeit("z.sech()")
625 loops, best of 3: 18.3 µs per loop # was 70.2 µs
sage: timeit("z.cotan()")
625 loops, best of 3: 24.6 µs per loop # was 52.5 µs
sage: timeit("z.cos()")
625 loops, best of 3: 21.9 µs per loop # was 50.2 µs
sage: timeit("z.cosh()")
625 loops, best of 3: 16.9 µs per loop # was 50.9 µs
sage: timeit("z.sin()")
625 loops, best of 3: 22.1 µs per loop # was 50.2 µs
sage: timeit("z.sinh()")
625 loops, best of 3: 17.2 µs per loop # was 51.3 µs
sage: timeit("z.tan()")
625 loops, best of 3: 22.9 µs per loop # was 52.8 µs
sage: timeit("z.tanh()")
625 loops, best of 3: 17.8 µs per loop # was 51.8 µs
sage: timeit("z.argument()")
625 loops, best of 3: 26.4 µs per loop # was 36.3 µs
sage: timeit("z.exp()")
625 loops, best of 3: 10.8 µs per loop # was 49.2 µs
sage: timeit("z.sqrt()")
625 loops, best of 3: 34.4 µs per loop # was 44.1 µs
sage: timeit("z.nth_root(20)")
625 loops, best of 3: 56 µs per loop # was 94.1 µs
sage: timeit("z.nth_root(20, all=True)")
625 loops, best of 3: 232 µs per loop # was 537 µs
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4132#comment:7>
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
-~----------~----~----~----~------~----~------~--~---