Skip to content

detail::inverse_beta_i: absolute 1e-8 stopping rule + [1e-8, 1−1e-8] clamp make Beta quantiles unusable beyond p ~ 1e-8 #137

Description

@OldCrow

Found during v2.4.0 #56 (FDistribution), documented in-tree, deliberately not patched there

detail::inverse_beta_i stops on an absolute residual of 1e-8 from a start clamped into [1e-8, 1−1e-8], so for target probabilities below ~1e-8 (either tail) it can simply return its clamp value. BetaDistribution::getQuantile inherits this directly — tail quantiles beyond p ~ 1e-8 are not merely inaccurate but pinned.

Blast radius: Beta only. The v2.4.0 FDistribution deliberately avoided it — its quantile is a safeguarded log-x bisection against the tail-steered CDF/survival (see src/fisher_f.cpp), measured to 3e-12 relative at p = 1e-12; that solver is a working in-tree reference for the fix. StudentT's CDF machinery is separate (verify at fix time whether its quantile shares the pattern).

Contract relevance: #104 finite-best-effort — never NaN is honoured, but 'finite yet pinned to the clamp' needs either fixing or explicit per-family documentation, and fixing is clearly achievable (F does it against the same beta_i core).

Suggested remedy path

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions