Brief
Build a differential-testing harness. It compares scipy.special and scipy.stats distribution functions (CDFs, inverse CDFs, log-pdfs, incomplete gamma/beta) with mpmath computing at 50 digits, which serves as the ground truth. Test on adversarial grids: deep tails, near-cancellation regions (where subtracting close numbers destroys digits) and extreme parameters. Produce ULP-error heatmaps (a ULP, unit in the last place, is the gap between adjacent floating-point numbers, so 1 ULP of error is about the best possible). Then fix at least one root cause in SciPy or its xsf C++ library. Typical root causes are a badly placed series/continued-fraction switch point (two ways of evaluating the same function, each accurate in a different region), a missing asymptotic expansion (a formula that is accurate for very large or very small inputs), or a computation that needs a log-space reformulation.
VICTORY CONDITIONS
- >= 3 reproducible accuracy bugs filed; >= 1 merged PR that brings max error on its domain to <= 10 ULP (Max relative error (ULPs) on the affected domain, before vs after the fix).
- A public repository with a README that shows your result and how to reproduce it.
Terms in plain words
- Differential testing
- Finding bugs by running two implementations of the same function on many inputs and flagging where they disagree.
- ULP (unit in the last place)
- The spacing between a floating-point number and the next one; errors measured in ULPs show how many of the last bits are wrong.
- Continued fraction
- A nested-fraction way of evaluating special functions that is often accurate where the power series converges slowly.
- Asymptotic expansion
- A formula that approximates a function very well when an argument is very large (or very small), used in regions where other methods fail.
- mpmath
- A Python library for arbitrary-precision arithmetic, used here as the trusted reference.
Why it rates ★★★★☆
A merged numerical-accuracy PR in SciPy is verifiable, rare, and exactly the rigour labs want.