[JAX] Fix jax.scipy.special.loggamma nan at zero (jax-ml/jax#38240) #41864

Merged
copybara-service[bot] opened 3:27pm on October 21, 2026 wanted to merge 1 commit into google/jax main from
test_1004112690
copybara-service[bot] authored commits starting at October 22
Diff Delta:
0
Classified as:  Bug Fix

copybara-service[bot]'s Description of Work

[JAX] Fix jax.scipy.special.loggamma nan at zero (jax-ml/jax#38240)

Problem:
In jax-ml/jax#38240 (https://github.com/jax-ml/jax/issues/38240), jax.scipy.special.loggamma incorrectly returns nan at x=0.0 and x=-0.0 due to a strict x > 0 filter, whereas SciPy returns inf.

Solution:
Changed the filter in loggamma to use x >= 0 instead of x > 0 to correctly return inf at 0.0 and -0.0. Added a specific boundary value test in lax_scipy_special_functions_test.py.

Fixes https://github.com/jax-ml/jax/issues/38240

2 total changed files
Loading changes...
Youโ€™ve reached the end
Thus concludes todayโ€™s episode of โ€œJust One Small Changeโ€