fn

bessel_y0

Tensor
bessel_y0(x: Tensor)
source

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

xTensor
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 x.

Notes

Asymptotic behaviour:

Y0(x)2π(logx2+γ)  as x0+,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 J0logJ_0 \log Wronskian term, and the standard A&S 9.4.5 trigonometric asymptotic on (8,)(8, \infty). Accuracy is 107\approx 10^{-7}. Y_0 diverges to -\infty as x0+x \to 0^+.

Examples

>>> import lucid
>>> from lucid.special import bessel_y0
>>> bessel_y0(lucid.tensor([1.0, 5.0, 10.0]))
Tensor([0.0883, -0.3085, 0.0557])