Skip to content

Commit 52587f5

Browse files
authored
improve accuracy of besselk_power_series
`sinpi(1-x)==sinpi(x)`
1 parent c99a050 commit 52587f5

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(v) * gam_v * v)
458457
gam_1mv = -gam_nv * v
459458
gam_1mnv = gam_v * v
460459

0 commit comments

Comments
 (0)