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

Bone and BInf are not fully accurate in BigFloat #68

Closed
MikaelSlevinsky opened this issue Jul 27, 2023 · 1 comment
Closed

Bone and BInf are not fully accurate in BigFloat #68

MikaelSlevinsky opened this issue Jul 27, 2023 · 1 comment

Comments

@MikaelSlevinsky
Copy link
Collaborator

julia> using HypergeometricFunctions

julia> a, b, c = (big(1)/2, big(1)/2, big"1.0")
(0.5, 0.5, 1.0)

julia> α = big"1e4"
10000.0

julia> z = 1-1/α^2
0.9999999900000000000000000000000000000000000000000000000000000000000000000000026

julia> F = _₂F₁(a, b, c, z)
6.746027206919546933185707950465181792044092589816046355200686957659126835747708

julia> W = HypergeometricFunctions.pFqweniger((a, b), (c, ), z)
6.746027206919546933185707368349657796992000329097040770443860355283388186516648

julia> G2 = HypergeometricFunctions._₂F₁general2(a, b, c, z)
6.746027206919546933185707368349657796992000329097040770443860355283388258457107

julia> F-W
5.821155239950520922607190055847568266023757386492310599016275842944951993501008e-25

julia> F-G2
5.821155239950520922607190055847568266023757385772906013187673677205578357891202e-25

julia> W-G2
-7.194045858286021657393736356098066928173795481180378727151581313017631264882825e-71

The issue is that the tolerance is fixed to Float64

@MikaelSlevinsky
Copy link
Collaborator Author

Now the three methods agree

julia> using HypergeometricFunctions
[ Info: Precompiling HypergeometricFunctions [34004b35-14d8-5ef3-9330-4cdb6864b03a]

julia> a, b, c = (big(1)/2, big(1)/2, big"1.0")
(0.5, 0.5, 1.0)

julia> α = big"1e4"
10000.0

julia> z = 1-1/α^2
0.9999999900000000000000000000000000000000000000000000000000000000000000000000026

julia> F = _₂F₁(a, b, c, z)
6.746027206919546933185707368349657796992000329097040770443860355283388258457591

julia> W = HypergeometricFunctions.pFqweniger((a, b), (c, ), z)
6.746027206919546933185707368349657796992000329097040770443860355283388186516648

julia> G2 = HypergeometricFunctions._₂F₁general2(a, b, c, z)
6.746027206919546933185707368349657796992000329097040770443860355283388258457107

julia> F-W
7.194094220829930186283638519668498610411393730782419570327337445757064208996922e-71

julia> F-G2
4.836254390852888990216357043168223759824960204084317575613273943294411409770959e-76

julia> W-G2
-7.194045858286021657393736356098066928173795481180378727151581313017631264882825e-71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant