← Back to Pull requests

BUG: beta, betaln: use the `lgam` path at `MAXGAM` #632

Closed
unknown closed this pull request without merging on Nov 29, 2026 19:05 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 08:36 UTC
Author

Reference issue


No issue; item 2 of #629. Found while porting xsf to Rust (https://github.com/jorenham/xsf-rust/pull/2102).

What does this implement/fix?


beta(170.3743769563027, 1.25) returned 0 (expected 0.001471187499158437) and betaln returned -inf, because Gamma returns inf at MAXGAM. The MAXGAM checks now use >=, so |a + b| == MAXGAM or |a| == MAXGAM takes the lgam path.

Additional information


The new tests fail on main with GCC and Clang (0, -inf and inf) and pass with the fix; the xsref table tests of beta, betaln, binom and the bdtr, fdtr and nbdtr families pass. Open PR #369 also edits beta.h near these lines, but does not change these checks.

AI Generation Disclosure


Claude Opus 5.5 (Claude Code) wrote the fix, the test, and this description, following the plan in this comment. GPT-6.2 Sol (Codex CLI) reviewed it.

Diff: 121 lines (+90 / -31) across 1 files Reviewer: j-bowhay Review duration: 629m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 121 lines diff across 1 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.289
Diff Size diff_size
0.287
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #632"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.7% (MEDIUM) · Higher = larger blast radius
36.7%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.5% · Safe to merge
14.5%
Repository