Skip to content

Commit

Permalink
Merge pull request #98 from yha/hypergeom-tests
Browse files Browse the repository at this point in the history
Hypergeom 1F1 tests
  • Loading branch information
ludvigak authored Feb 19, 2019
2 parents 0d53507 + df369b2 commit dba2aad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/hypergeom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ using SpecialFunctions
@test log(1+complex(x)) x*hypergeom([1.0, 1.0], 2.0, -x)
@test (1-x)^-a hypergeom([a, 1.0], 1.0, x)
@test asin(x) x*hypergeom([0.5, 0.5], 1.5, x^2)
@test (exp(x)-1)/x hypergeom(1.0, 2.0, x)
@test (1+x)*exp(x) hypergeom(2.0, 1.0, x)

#gsl function is unstable for b=2
#@test x*sf_hyperg_U(1.0, 2.0, x) ≈ 1.0
Expand All @@ -35,6 +37,9 @@ using SpecialFunctions
res = hypergeom_e([a, b], 1+a-b, -1.0)
@test isapprox(res.val, (gamma(1+a-b)*gamma(1+a/2)/(gamma(1+a)*gamma(1+a/2-b))), atol=res.err)

#Kummer's transformation
@test hypergeom(a,b,x) exp(x)*hypergeom(b-a,b,-x)

#NaN handling
for (h, condition) in ((hypergeom, isnan), (hypergeom_e, r->isnan(r.val)))
@test all(condition,
Expand Down

0 comments on commit dba2aad

Please sign in to comment.