JuliaMath / HypergeometricFunctions.jl

A Julia package for calculating hypergeometric functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_₂F₁(-n,1.5,2.5,2) loses accuracy for large n

putianyi889 opened this issue · comments

These two expressions should be identical,

a=[2*sqrt(2)/(n+1)*_₂F₁(1,n+2.5,n+2,-1)+(-1)^n*beta(n+1,1.5) for n=0:100]
c=[2*sqrt(2)*(-1)^n*beta(1.5,1)*_₂F₁(-n,1.5,2.5,2) for n=0:100]

But it turns out that a is more accurate:

plot(abs.([a c]), yaxis=:log, labels=["a" "c"])

image