Skip to content
fn

modified_bessel_k1

→Tensor
modified_bessel_k1(input: Tensor)

Modified Bessel function of the second kind, order 1.

Computes K1(x)K_1(x), the order-one analogue of K0K_0. Diverges as 1/x1/x near the origin and decays exponentially for large argument. Appears in Generalised-Inverse-Gaussian and Normal-Inverse-Gaussian log-densities.

Parameters

inputTensor
Input tensor; only x>0x > 0 is in the domain.

Returns

Tensor

K1(x)K_1(x) element-wise, same shape and dtype as input.

Notes

Asymptotic forms:

K1(x)∼1x  as x→0+,K1(x)∼π2x e−x  as x→∞.K_1(x) \sim \frac{1}{x} \;\text{as } x \to 0^+, \qquad K_1(x) \sim \sqrt{\frac{\pi}{2x}}\, e^{-x} \;\text{as } x \to \infty.

Implementation: Abramowitz & Stegun §9.8 two-branch polynomial, accurate to ≈10−7\approx 10^{-7}; a float64 input takes the Cephes double-precision series instead. Use scaled_modified_bessel_k1 for numerically stable evaluation at large x.

Examples

>>> import lucid
>>> from lucid.special import modified_bessel_k1
>>> modified_bessel_k1(lucid.tensor([0.5, 1.0, 5.0]))
tensor([1.656, 0.6019, 0.004045])