Skip to content

Commit 2b47e2f

Browse files
add Tricomi's U through rational approximation of its asymptotic expansion
1 parent 251d422 commit 2b47e2f

File tree

6 files changed

+37
-17
lines changed

6 files changed

+37
-17
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
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.7"
3+
version = "0.3.8"
44

55
[deps]
66
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
A Julia package for calculating hypergeometric functions
66

7-
This package implements the generalized hypergeometric function `pFq([a1,…,am], [b1,…,bn], z)`. In particular, the Gauss hypergeometric function is available as `_₂F₁(a, b, c, z)`, Kummer's confluent hypergeometric function is available as `_₁F₁(a, b, z)` and `HypergeometricFunctions.M(a, b, z)`, as well as `_₃F₂([a1, a2, a3], [b1, b2], z)`.
7+
This package implements the generalized hypergeometric function `pFq([a1,…,am], [b1,…,bn], z)`. In particular, the Gauss hypergeometric function is available as `_₂F₁(a, b, c, z)`, confluent hypergeometric function is available as `_₁F₁(a, b, z) ≡ HypergeometricFunctions.M(a, b, z)` and `HypergeometricFunctions.U(a, b, z)`, as well as `_₃F₂([a1, a2, a3], [b1, b2], z)`.

src/HypergeometricFunctions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export _₁F₁, _₂F₁, _₃F₂, pFq
1111

1212
include("specialfunctions.jl")
1313
include("gauss.jl")
14-
include("kummer.jl")
14+
include("confluent.jl")
1515
include("generalized.jl")
1616
include("drummond.jl")
1717
include("weniger.jl")

src/confluent.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Compute Kummer's confluent hypergeometric function `M(a, b, z) = ₁F₁(a; b; z)`.
3+
"""
4+
function _₁F₁(a, b, z)
5+
if real(z) 0
6+
return _₁F₁maclaurin(a, b, z)
7+
else
8+
return exp(z)*_₁F₁(b-a, b, -z)
9+
end
10+
end
11+
12+
"""
13+
Compute Kummer's confluent hypergeometric function `M(a, b, z) = ₁F₁(a; b; z)`.
14+
"""
15+
const M = _₁F₁
16+
17+
"""
18+
Compute Tricomi's confluent hypergeometric function `U(a, b, z) ∼ z⁻ᵃ ₂F₀([a, a-b+1]; []; -z⁻¹)`.
19+
"""
20+
function U(a, b, z)
21+
return z^-a*pFq([a, a-b+1], typeof(z)[], -inv(z))
22+
end

src/generalized.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ function pFq(α::AbstractVector, β::AbstractVector, z; kwds...)
1414
return _₁F₁(α[1], β[1], float(z))
1515
elseif length(α) == 2 && length(β) == 1
1616
return _₂F₁(α[1], α[2], β[1], float(z))
17-
elseif abs(z) ρ
18-
return pFqmaclaurin(α, β, float(z); kwds...)
17+
elseif length(α) length(β)
18+
if real(z) 0
19+
return pFqmaclaurin(α, β, float(z); kwds...)
20+
else
21+
return pFqweniger(α, β, float(z); kwds...)
22+
end
23+
elseif length(α) == length(β) + 1
24+
if abs(z) ρ
25+
return pFqmaclaurin(α, β, float(z); kwds...)
26+
else
27+
return pFqweniger(α, β, float(z); kwds...)
28+
end
1929
else
2030
return pFqweniger(α, β, float(z); kwds...)
2131
end

src/kummer.jl

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)