jax
90fd7f0a - Implement `jax.scipy.special.jn` for static integer orders and real/complex arguments

Commit
23 days ago
Implement `jax.scipy.special.jn` for static integer orders and real/complex arguments Implementation details: - Reduces negative integer orders via `J_{-n}(z) = (-1)^n J_n(z)` and maps real/complex `z` to the first quadrant `w = |Re(z)| + i|Im(z)|`. - For `n <= 1`, evaluates via ascending power series (`|w| <= 2`), Miller's backward recurrence (`2 < |w| < rl`), and Hankel's asymptotic expansion (`|w| >= rl`). - For `n >= 2`, uses exact power-of-2 prefactor scaling in the ascending power series (`|w| <= max(2, sqrt(2*(n+1)))`), Miller's backward recurrence for intermediate `|w| < rl`, direct Hankel asymptotic expansion for `|w| >= rl + 0.5*n^2`, and `(J_0, J_1)` + recurrence (with backward continued-fraction ratios across the turning point or away from the real axis) for `rl <= |w| < rl + 0.5*n^2`. - Adds envelope precision, complex-argument, and gradient tests in `tests/lax_scipy_special_functions_test.py`. PiperOrigin-RevId: 1009666734
Author
Jake VanderPlas
Parents
Loading