Skip to content

Commit 3252399

Browse files
committed
rm extra division
1 parent 71de923 commit 3252399

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/besselk.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ end
279279
# arXiv preprint arXiv:2201.00090 (2022).
280280
function besselk_power_series(v, x::T) where T
281281
MaxIter = 1000
282-
# precompute a handful of things:
283282
xd2 = x / 2
284283
xd22 = xd2 * xd2
285284
half = one(T) / 2
@@ -291,10 +290,10 @@ function besselk_power_series(v, x::T) where T
291290
# use the gamma function a couple times to start:
292291
gam_v = gamma(v)
293292
xp1 = abs(v) + one(T)
294-
gam_nv = π / sinpi(xp1) / _gamma(xp1)
293+
gam_nv = π / (sinpi(xp1) * _gamma(xp1))
295294
gam_1mv = -gam_nv*v # == gamma(one(T)-v)
296295
gam_1mnv = gam_v*v # == gamma(one(T)+v)
297-
296+
298297
# One final re-compression of a few things:
299298
_t1 = gam_v*xd2_nv*gam_1mv
300299
_t2 = gam_nv*xd2_v*gam_1mnv

0 commit comments

Comments
 (0)