Opened 8 years ago
Last modified 4 years ago
#16202 new enhancement
implement the agm(x,y) function
Reported by: | rws | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.2 |
Component: | calculus | Keywords: | |
Cc: | mforets | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
https://en.wikipedia.org/wiki/Arithmetic-geometric_mean
Pari has a numeric implementation:
? 1/agm(1,sqrt(2)) %1 = 0.83462684167407318628142973279904680900
but Wikipedia provides a closed form integral expression, and if we had the "complete elliptic integral of the first kind" this would be even simpler.
Numerically there is sage.rings.real_mpfr.RealNumber
.
Change History (8)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Sorry, to clarify - if we implement elliptic_kc
as a symbolic function, you could do this easily as you say, or we can try to combine this with mpmath as well.
comment:3 Changed 8 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:4 Changed 8 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:5 Changed 7 years ago by
- Description modified (diff)
comment:6 Changed 5 years ago by
- Cc mforets added
- Milestone changed from sage-6.4 to sage-8.2
comment:7 Changed 4 years ago by
There is already
sage: a=CDF(1) sage: b=CDF(sqrt(2)) sage: 1/a.agm(b) 0.834626841674073
comment:8 Changed 4 years ago by
Also
sage: RBF(sqrt(2)).agm(1)^(-1) [0.83462684167407 +/- 3.9...e-15]
Note: See
TracTickets for help on using
tickets.
Do you mean elliptic_kc? This is indeed in Maxima, though not yet a "Sage symbolic function". See also the symbolics page on Trac where a few things about this are mentioned.
Oh, I see what you mean about the elliptic - like this Rosetta stone. Anyway, I would think that we can do this fairly easily - also note mpmath has the agm and the elliptic integral in question, and mpmath is probably a go-to for numerical evaluation of our most recent implementations of special functions.