1
1
2
+ """
3
+ sphericalbesselk(nu, x::T) where T <: {Float32, Float64}
4
+
5
+ Computes `k_{ν}(x)`, the modified second-kind spherical Bessel function, and offers special branches for integer orders.
6
+ """
7
+ sphericalbesselk (nu, x) = _sphericalbesselk (nu, float (x))
8
+
9
+ function _sphericalbesselk (nu, x:: T ) where T
10
+ if isinteger (nu) && nu < 41.5
11
+ return sphericalbesselk_int (nu, x)
12
+ else
13
+ return inv (SQRT_PID2 (T)* sqrt (x))* besselk (nu+ 1 / 2 , x)
14
+ end
15
+ end
16
+
2
17
function sphericalbesselk_int (v:: Int , x)
3
18
b0 = inv (x)
4
19
b1 = (x+ one (x))/ (x* x)
@@ -12,21 +27,3 @@ function sphericalbesselk_int(v::Int, x)
12
27
exp (- x)* b1
13
28
end
14
29
15
- function _sphericalbesselk (nu, x:: T ) where T
16
- if isinteger (nu) && nu < 41.5
17
- return sphericalbesselk_int (nu, x)
18
- else
19
- return inv (SQRT_PID2 (T)* sqrt (x))* besselk (nu+ 1 / 2 , x)
20
- end
21
- end
22
-
23
-
24
- """
25
- sphericalbesselk(nu, x::T) where T <: {Float32, Float64}
26
-
27
- Computes `k_{ν}(x)`, the modified second-kind spherical Bessel function, and offers special branches for integer orders.
28
- """
29
- sphericalbesselk (nu, x) = _sphericalbesselk (nu, float (x))
30
-
31
-
32
-
0 commit comments