Skip to content

Commit 1b21871

Browse files
committed
Faster sub for abs.
1 parent 0671f11 commit 1b21871

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modifiedsphericalbessel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function _sphericalbesselk(nu, x::T) where T
1414
# = (...)*K_{|n| - 1/2}
1515
# = (...)*K_{|n|-1 + 1/2}
1616
# = k_{|n|-1}
17-
_nu = ifelse(nu<zero(nu), abs(nu)-one(nu), nu)
17+
_nu = ifelse(nu<zero(nu), -one(nu)-nu, nu)
1818
return sphericalbesselk_int(Int(_nu), x)
1919
else
2020
return inv(SQRT_PID2(T)*sqrt(x))*besselk(nu+1/2, x)

0 commit comments

Comments
 (0)