Skip to content

Stop promoting double and round discrete quantiles up by default - #1554

Merged
NAThompson merged 1 commit into
developfrom
no-double-promotion
Oct 12, 2026
Merged

NAThompson merged 1 commit into
developfrom
no-double-promotion

Conversation

@NAThompson

@NAThompson NAThompson commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Two breaking default changes, each restorable with one macro:

  • promote_double now defaults to false on every platform, so double is evaluated in double; define BOOST_MATH_PROMOTE_DOUBLE_POLICY true to get the old behavior. Builds on @rdoeffinger's Update tests to take promote_double policy into account #1214 and Change BOOST_MATH_PROMOTE_DOUBLE_POLICY to false for non-x86 #1220. Promotion was hiding a polygamma underflow bug (fixed on develop in Keep ibeta monotonic under -ffp-contract=fast and fix develop's CI #1561); the remaining newly visible test errors (Legendre near zeros, Bessel Y'/I' near negative orders, 1F1 near b = 0, nc_t at tiny non-centrality) are all within the condition number times eps.
  • Discrete quantiles now default to integer_round_up, the definition R, SciPy, Julia and Mathematica use (they agree on all 264 cases tested; Boost's old integer_round_outwards matched about half). Geometric and hypergeometric now honor the policy at exact cdf steps, and Bernoulli's complement quantile is fixed. Define BOOST_MATH_DISCRETE_QUANTILE_POLICY integer_round_outwards to get the old behavior.
  • discrete_legendre (lanczos_smoothing) now uses explicit fma wherever a product meets a sum. Contraction could fuse one inlined copy of the recurrence and not another, so dlp(x, k) and dlp.next() disagreed by up to hundreds of ulps on MSVC and clang-18. Develop's CI fails the same way.

Closes #1211
Closes #1203

🤖 Generated with Claude Code

@NAThompson

NAThompson commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

@jzmaddock , @mborland , @ckormanyos : This is the "big one", as they say. Hopefully the ulps triage merge will make this painless for everyone.

@NAThompson
NAThompson force-pushed the no-double-promotion branch 3 times, most recently from eeda001 to 3df4084 Compare October 11, 2026 20:11
@NAThompson
NAThompson force-pushed the no-double-promotion branch 2 times, most recently from e0b2eca to 5761ef9 Compare October 11, 2026 23:42
@NAThompson NAThompson changed the title Do not promote double to long double by default Stop promoting double and round discrete quantiles up by default Oct 11, 2026
promote_double is now false, with the test tables keyed on it; integer_round_up is the default discrete quantile; discrete_legendre uses explicit fma, so contraction can't make it disagree with itself.
Closes #1211 Closes #1203
Co-authored-by: Reimar Döffinger <reimar.doeffinger@arm.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NAThompson
NAThompson merged commit e123a3b into develop Oct 12, 2026
43 of 50 checks passed
@NAThompson
NAThompson deleted the no-double-promotion branch October 12, 2026 02:47
NAThompson added a commit that referenced this pull request Oct 12, 2026
Special functions and distributions in nanobind/ (not built by CI); test_interior_velocity_filter tolerance doubled for x87 long double after #1554.
Closes #1508

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

boost/math defaulting to slow 128-bit float on aarch64 boost::math::quantile() incorrect for poisson_distribution

1 participant