Skip to content

Commit fd8529f

Browse files
authored
Merge pull request #66 from JuliaMath/oscardssmith-sinpi-tweak
improve accuracy of `besselk_power_series`
2 parents c99a050 + 9b06a72 commit fd8529f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/besselk.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ function besselk_power_series(v, x::ComplexOrReal{T}) where T
453453
# use the reflection identify to calculate gamma(-v)
454454
# use relation gamma(v)*v = gamma(v+1) to avoid two gamma calls
455455
gam_v = gamma(v)
456-
xp1 = abs(v) + one(S)
457-
gam_nv = π / (sinpi(xp1) * gam_v * v)
456+
gam_nv = π / (sinpi(-abs(v)) * gam_v * v)
458457
gam_1mv = -gam_nv * v
459458
gam_1mnv = gam_v * v
460459

0 commit comments

Comments
 (0)