Skip to content

Commit 1db8f56

Browse files
import isalmostwellpoised
1 parent 501b9af commit 1db8f56

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/specialfunctions.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ function _₂F₁maclaurin(a::Number, b::Number, c::Number, z::Number)
404404
T = float(promote_type(typeof(a), typeof(b), typeof(c), typeof(z)))
405405
S₀, S₁, j = one(T), one(T)+a*b*z/c, 1
406406
while errcheck(S₀, S₁, 10eps(real(T)))
407-
rⱼ = (a+j)/(j+1)*(b+j)/(c+j)
408-
S₀, S₁ = S₁, S₁+(S₁-S₀)*rⱼ*z
407+
rⱼ = (a+j)*z/(j+1)*(b+j)/(c+j)
408+
S₀, S₁ = S₁, S₁+(S₁-S₀)*rⱼ
409409
j += 1
410410
end
411411
return S₁
@@ -500,27 +500,27 @@ function _₁F₁maclaurin(a::Number, b::Number, z::Number)
500500
T = float(promote_type(typeof(a), typeof(b), typeof(z)))
501501
S₀, S₁, j = one(T), one(T)+a*z/b, 1
502502
while errcheck(S₀, S₁, 10eps(real(T)))
503-
rⱼ = (a+j)/((b+j)*(j+1))
504-
S₀, S₁ = S₁, S₁+(S₁-S₀)*rⱼ*z
503+
rⱼ = (a+j)*z/((b+j)*(j+1))
504+
S₀, S₁ = S₁, S₁+(S₁-S₀)*rⱼ
505505
j += 1
506506
end
507507
return S₁
508508
end
509509

510510
function pFqmaclaurin::NTuple{p, Any}, β::NTuple{q, Any}, z; kwds...) where {p, q}
511-
T1 = mapreduce(typeof, promote_type, α)
512-
T2 = mapreduce(typeof, promote_type, β)
511+
T1 = isempty(α) ? Any : mapreduce(typeof, promote_type, α)
512+
T2 = isempty(β) ? Any : mapreduce(typeof, promote_type, β)
513513
pFqmaclaurin(T1.(α), T2.(β), z; kwds...)
514514
end
515515

516516
function pFqmaclaurin(a::NTuple{p, S}, b::NTuple{q, U}, z::V) where {p, q, S, U, V}
517517
T = float(promote_type(eltype(a), eltype(b), V))
518518
S₀, S₁, j = one(T), one(T)+prod(a)*z/prod(b), 1
519519
while errcheck(S₀, S₁, 10eps(real(T)))
520-
rⱼ = inv(j+one(T))
520+
rⱼ = z/(j+one(T))
521521
for i=1:p rⱼ *= a[i]+j end
522522
for i=1:q rⱼ /= b[i]+j end
523-
S₀, S₁ = S₁, S₁+(S₁-S₀)*rⱼ*z
523+
S₀, S₁ = S₁, S₁+(S₁-S₀)*rⱼ
524524
j += 1
525525
end
526526
return S₁

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using HypergeometricFunctions, Test
22
import LinearAlgebra: norm
3-
import HypergeometricFunctions: _₂F₁general, iswellpoised, M, U,
4-
pFqdrummond, pFqweniger
3+
import HypergeometricFunctions: iswellpoised, isalmostwellpoised, M, U,
4+
_₂F₁general, pFqdrummond, pFqweniger
55

66
const rtol = 1.0e-3
77
const NumberType = Float64

0 commit comments

Comments
 (0)