Skip to content

Commit

Permalink
Merge pull request #66 from JuliaMath/oscardssmith-sinpi-tweak
Browse files Browse the repository at this point in the history
improve accuracy of `besselk_power_series`
  • Loading branch information
heltonmc authored Nov 7, 2022
2 parents c99a050 + 9b06a72 commit fd8529f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/besselk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ function besselk_power_series(v, x::ComplexOrReal{T}) where T
# use the reflection identify to calculate gamma(-v)
# use relation gamma(v)*v = gamma(v+1) to avoid two gamma calls
gam_v = gamma(v)
xp1 = abs(v) + one(S)
gam_nv = π / (sinpi(xp1) * gam_v * v)
gam_nv = π / (sinpi(-abs(v)) * gam_v * v)
gam_1mv = -gam_nv * v
gam_1mnv = gam_v * v

Expand Down

0 comments on commit fd8529f

Please sign in to comment.