Skip to content
fn

bessel_y0

→Tensor
bessel_y0(input: Tensor)

Bessel function of the second kind, order 0.

Computes Y0(x)Y_0(x), the singular-at-origin partner of J0J_0. Together J0J_0 and Y0Y_0 span the solution space of Bessel's equation at order 0; Y0Y_0 is the one that diverges (logarithmically) at the origin.

Parameters

inputTensor
Input tensor; only x>0x > 0 is in the domain. Any floating-point dtype.

Returns

Tensor

Y0(x)Y_0(x) element-wise, same shape and dtype as input.

Notes

Asymptotic behaviour:

Y0(x)∼2π(log⁡x2+γ)  as x→0+,Y0(x)∼2πxsin⁡ ⁣(x−π4)  as x→∞.Y_0(x) \sim \frac{2}{\pi}\left(\log\frac{x}{2} + \gamma\right) \; \text{as } x \to 0^+, \qquad Y_0(x) \sim \sqrt{\frac{2}{\pi x}} \sin\!\left(x - \frac{\pi}{4}\right) \;\text{as } x \to \infty.

Implementation: Numerical Recipes §6.5 rational fit on (0,8](0, 8] with the J0log⁡J_0 \log Wronskian term, and the standard A&S 9.4.5 trigonometric asymptotic on (8,∞)(8, \infty). Accuracy is ≈10−7\approx 10^{-7}; a float64 input takes the Cephes double-precision series instead. Y_0 diverges to −∞-\infty as x→0+x \to 0^+.

Examples

>>> import lucid
>>> from lucid.special import bessel_y0
>>> bessel_y0(lucid.tensor([1.0, 5.0, 10.0]))
tensor([0.08826, -0.3085, 0.05567])