-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add elliptic integrals to ArbFloats.jl? #20
Comments
The elliptic functions that Arb implements are over the domain of Arb's
version of complex variables. ArbFloats has no support for
ArbComplex today. Nonetheless, the lack of support for Elliptic functions
has bothered me for some time. I will take another look at it and let you
know.
Thanks for the inquiry,
Jeffrey Sarnoff
…On Wed, Oct 18, 2017 at 12:48 PM, Jorge Pérez ***@***.***> wrote:
Hi Jeffrey! I'm looking for a way to evaluate the complete elliptic
integral of the first kind, K(k), in Julia; there is Elliptic.jl but that
package only allows double precision output. @simonbyrne
<https://github.com/simonbyrne> and @ChrisRackauckas
<https://github.com/chrisrackauckas> pointed to me that in the Arb
library there is support for elliptic functions
<http://fredrikj.net/blog/2017/02/arb-2-10-0-released/> so I wanted to
ask you if this could be added to ArbFloats.jl? Many thanks in advance!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#20>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ABmqxnlKANF7I-5mdnFU4wTfS4vvMQT_ks5stivwgaJpZM4P-BQk>
.
|
meanwhile, for x in 0..1
|
Thanks a lot Jeffrey!! Works like a charm!! |
I am happy to know that. |
notes to myself this version is better when called with an ArbFloat using ArbFloats
function ellipticK(x::T) where T
!(zero(T) <= x <= one(T)) && throw(DomainError())
x == 1.0 && return ArbFloat(Inf)
arb_one = one(ArbFloat)
arb_halfpi = ArbFloat(pi)/2
k = T<:ArbFloat ? x : ArbFloat(x)
k = arb_one - k
k = sqrt(k)
k = agm(arb_one, k)
k = arb_halfpi / k
return k
end
setprecision(ArbFloat, 256) # bits
x = ArbFloat(0.5)
k = ellipticK(x)
string("K(", x, ") = ", smartstring(K_onehalf))
"1.854074677301371918433850347195260046217598823521766905585928045056021777₋" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Jeffrey! I'm looking for a way to evaluate the complete elliptic integral of the first kind, K(k), in Julia; there is
Elliptic.jl
but that package only allows double precision output. @simonbyrne and @ChrisRackauckas pointed to me that in the Arb library there is support for elliptic integrals so I wanted to ask you if this could be added to ArbFloats.jl? Many thanks in advance!The text was updated successfully, but these errors were encountered: