fn

i1

Tensor
i1(x: Tensor)
source

Modified Bessel function of the first kind, order 1.

Computes I1(x)I_1(x), the order-one solution of the modified Bessel equation x2y+xy(x2+1)y=0x^2 y'' + x y' - (x^2 + 1) y = 0 that is regular at the origin. Used in Rician statistics, Bessel / von Mises – Fisher distributions, and rotational-symmetric kernels.

Parameters

xTensor
Input tensor; any floating-point dtype.

Returns

Tensor

I1(x)I_1(x) element-wise, same shape and dtype as x.

Notes

Series definition:

I1(x)=k=01k!(k+1)!(x2)2k+1.I_1(x) = \sum_{k=0}^\infty \frac{1}{k!\,(k+1)!}\left(\frac{x}{2}\right)^{2k+1}.

The implementation uses the two-branch Abramowitz & Stegun §9.8 polynomial approximation: a power series in (x/3.75)2(x/3.75)^2 for x3.75|x| \le 3.75, and an asymptotic expansion in 3.75/x3.75/|x| scaled by ex/xe^{|x|}/\sqrt{|x|} for x>3.75|x| > 3.75. Accuracy is roughly 10710^{-7} over the real line. I_1 is odd, I_1(0) = 0, and I1(x)ex/2πxI_1(x) \sim e^{x}/\sqrt{2\pi x} as xx \to \infty.

Examples

>>> import lucid
>>> from lucid.special import i1
>>> i1(lucid.tensor([0.0, 1.0, 5.0]))
Tensor([0.0000, 0.5652, 24.3356])