Skip to content

Commit ad66a26

Browse files
committed
compute 2 / x
1 parent 5c740da commit ad66a26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/besselk.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ end
164164
(iszero(k0) || iszero(k1)) && return zero(x)
165165

166166
k2 = k0
167+
x2 = 2 / x
167168
for n in 1:nu-1
168-
a = 2 * n / x
169+
a = x2 * n
169170
k2 = muladd(a, k1, k0)
170171
k0 = k1
171172
k1 = k2

0 commit comments

Comments
 (0)