From 9b06a72112709dc3b80e382835747bbdf84051fd Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Mon, 7 Nov 2022 10:42:44 -0500 Subject: [PATCH] fix for positive `v` --- src/besselk.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/besselk.jl b/src/besselk.jl index 9d2224f..fa8e750 100644 --- a/src/besselk.jl +++ b/src/besselk.jl @@ -453,7 +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) - gam_nv = π / (sinpi(v) * gam_v * v) + gam_nv = π / (sinpi(-abs(v)) * gam_v * v) gam_1mv = -gam_nv * v gam_1mnv = gam_v * v