[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

Pull Request Overview

  • Opened on October 21, 2026
  • Status Merged
  • Commit count 1 with first commit October 22, 2026

Total Delta

0 Total Diff Delta

Open Days

Open 17 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Data pending calculation for pull request

Author avatar

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

[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

PR was closed without comments.