Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement the agm(x,y) function #16202

Open
rwst opened this issue Apr 22, 2014 · 5 comments
Open

implement the agm(x,y) function #16202

rwst opened this issue Apr 22, 2014 · 5 comments

Comments

@rwst
Copy link

rwst commented Apr 22, 2014

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.

CC: @mforets

Component: calculus

Issue created by migration from https://trac.sagemath.org/ticket/16202

@rwst rwst added this to the sage-6.2 milestone Apr 22, 2014
@kcrisman
Copy link
Member

comment:1

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.

@kcrisman
Copy link
Member

comment:2

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.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@rwst

This comment has been minimized.

@mforets mforets mannequin modified the milestones: sage-6.4, sage-8.2 Nov 24, 2017
@fchapoton
Copy link
Contributor

comment:7

There is already

sage: a=CDF(1)
sage: b=CDF(sqrt(2))
sage: 1/a.agm(b)
0.834626841674073

@rwst
Copy link
Author

rwst commented Jun 30, 2018

comment:8

Also

            sage: RBF(sqrt(2)).agm(1)^(-1)
            [0.83462684167407 +/- 3.9...e-15]

@mkoeppe mkoeppe removed this from the sage-8.2 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants