#7719: Improvements to complex AGM
--------------------------------+-------------------------------------------
Reporter: cremona | Owner: AlexGhitza
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.3.1
Component: basic arithmetic | Keywords: complex agm
Work_issues: | Author:
Upstream: N/A | Reviewer:
Merged: |
--------------------------------+-------------------------------------------
Comment(by robertwb):
The speed disparity between AGM over CC and over CDF was bugging me, so I
decided to code the arbitrary-precision case directly against mpfr
tonight. Made me wish we had mpc ;), or even better if sage/cython could
unroll CC arithmetic like this already (though there are several other
optimizations)
In any case, now we have
{{{
sage: a = CC(-0.95,-0.65)
sage: b = CC(0.683,0.747)
sage: %timeit a.agm(b, algorithm="optimal")
10000 loops, best of 3: 37.9 µs per loop
sage: %timeit aa.agm(bb)
10000 loops, best of 3: 35.2 µs per loop
}}}
The difference may be due to pari's stack-based rather than heap-based
memory management. Note, we're getting closer to optimal with this
algorithm as good chunk of the time is due to just taking the square
roots:
{{{
sage: %timeit [a.sqrt() for k in range(6)]
10000 loops, best of 3: 25.9 µs per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7719#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
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.