pub fn bessel_jy_real<P, E, V, const NH: usize, const NE: usize, const NO: usize, const FN: LargeInt, const FD: LargeInt>(
nu: V,
x: V,
x_lo: V,
t: &LogGamma1p<E, NE, NO>,
) -> (V, V)where
E: FloatElement,
V: FloatVector<Element = E> + TranscendentalMathWithPolicy + SpecializedTranscendentalMath<E> + SpecializedSpecialMath<E>,
P: Policy,Expand description
$(J_\nu(x), Y_\nu(x))$ at arbitrary real order, over the whole positive axis.
The region select over the four arms. Everything above this line is a piece. This is the function.
§Three regions, chosen to avoid overlap rather than to minimise cost
x | J | Y |
|---|---|---|
<= 2 | series_j_nu | temme_y_nu + upward recurrence |
2 .. gate | steed_jy_nu | same pass |
>= gate | hankel_jy_nu | same pass |
gate is hankel_usable_from. The ascending series is usable to about x = 6 and Steed
from about 0.5, so the 2 boundary sits inside both their ranges. It is where Steed
stops being cheap (its CF2 needs 42 iterations at x = 2 and 5392 at 0.01) rather than
where it stops being right. Boost splits at the same place for the same reason.
Every lane pays for every region any lane is in. Each arm therefore receives the mask
of lanes that actually want it, so a lane bound elsewhere cannot extend an iteration. See
iterate.
§Negative order, and why it is a rotation rather than a sign
At non-integer $\nu$, $J_\nu$ and $J_{-\nu}$ are linearly independent (not a sign
apart, as they are at whole orders), so the pair rotates:
J_{-\nu} = J_\nu\cos\nu\pi - Y_\nu\sin\nu\pi, \qquad
Y_{-\nu} = J_\nu\sin\nu\pi + Y_\nu\cos\nu\piEverything is computed at $\lvert\nu\rvert$ and rotated once at the end. At whole orders
$\sin\nu\pi$ vanishes and this collapses to the familiar $(-1)^n$.
§Order reduction, and only where it is needed
temme_y_nu requires $\lvert\nu\rvert \le 1/2$. So in the small-x region the order is
split as $\nu = m + u$ with $m$ whole and $\lvert u\rvert \le 1/2$, Temme evaluated at
$u$, and $Y$ walked up $m$ steps by $Y_{k+1} = (2k/x)Y_k - Y_{k-1}$. That direction
is stable because $Y$ is the dominant solution, the mirror of $J$, where the same
direction is the unstable one.
The other two regions need no reduction. Steed and the Hankel expansion take $\nu$
directly.