besselExpK1¶
Evaluates the exponentially scaled modified Bessel function of the second kind of order one.
Synopsis¶
besselExpK1 (x)
Required Arguments¶
- float
x
(Input) - Point at which the Bessel function is to be evaluated.
Return Value¶
The value of the scaled Bessel function exK1(x). If no solution can be computed, NaN is returned.
Description¶
The result
besselExpK1=eXK1(x)≈1x
overflows if x is too close to zero. The definition of the Bessel function
K1(x)=∫∞0sin(xsinht)sinht.dt
Example¶
The expression
√eK1(0.5)
is computed directly by calling besselExpK1
and indirectly by calling
besselK1
. The absolute difference is printed. For large x
, the
internal scaling provided by besselExpK1
avoids underflow that may occur
in besselK1
.
from __future__ import print_function
from numpy import *
from pyimsl.math.besselExpK1 import besselExpK1
from pyimsl.math.besselK1 import besselK1
x = 0.5
ans = besselExpK1(x)
print("(e**(0.5))K1(0.5) = %f" % (ans))
error = abs(ans - (exp(x) * besselK1(x)))
print("Error = %e" % (error))
Output¶
(e**(0.5))K1(0.5) = 2.731010
Error = 0.000000e+00