Skip to content

Commit 46d4155

Browse files
fix some issues
#75 #86
1 parent ccf311f commit 46d4155

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "HypergeometricFunctions"
22
uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
3-
version = "0.3.27"
3+
version = "0.3.28"
44

55
[deps]
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/gauss.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ function _₂F₁(a, b, c, z; method::Symbol = :general, kwds...)
88
if real(b) < real(a)
99
return _₂F₁(b, a, c, z; method = method, kwds...) # ensure a ≤ b
1010
elseif isequal(a, c) # 1. 15.4.6
11-
return exp(-b*log1p(-z))
11+
return pFq((b, ), (), z)
1212
elseif isequal(b, c) # 1. 15.4.6
13-
return exp(-a*log1p(-z))
13+
return pFq((a, ), (), z)
14+
elseif isequal(a, 0) || isequal(b, 0)
15+
return one(z)
1416
elseif isequal(c, 0.5)
1517
if isequal(a+b, 0) # 31. 15.4.11 & 15.4.12
1618
return cosnasinsqrt(2b, z)

src/generalized.jl

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pFq
5454

5555
pFq(::Tuple{}, ::Tuple{}, z; kwds...) = exp(z)
5656
pFq::NTuple{1}, ::Tuple{}, z; kwds...) = exp(-α[1]*log1p(-z))
57+
pFq::NTuple{1, <: Integer}, ::Tuple{}, z; kwds...) = (1-z)^-α[1]
5758
pFq::NTuple{1}, β::NTuple{1}, z; kwds...) = _₁F₁(α[1], β[1], z; kwds...)
5859
pFq::NTuple{2, Any}, β::NTuple{1}, z; kwds...) = _₂F₁(α[1], α[2], β[1], z; kwds...)
5960

test/runtests.jl

+9
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,15 @@ end
527527
@testset "Integer arguments" begin
528528
@test _₂F₁(1, 0, 3, -1) _₂F₁(1.0, 0, 3, -1) 1.0
529529
end
530+
531+
@test "a or b == c" begin
532+
pFq((-1, 0), (-1, ), 2) == 1.0 # From #86
533+
end
534+
535+
@testset "a or b == 0" begin
536+
@test pFq((0, 0), (1/2, ), 5/4) == 1.0 # From #75
537+
@test pFq((0.5, 0.0), (1.5, ), 1) == 1.0 # From #75
538+
end
530539
end
531540

532541
@testset "₅F₄" begin # Tests the generic algorithms for pFqdrummond and pFqweniger

0 commit comments

Comments
 (0)