← Back to Pull requests

BUG: hyp2f1: fix infinite recursion for large `c` #655

Merged
jorenham merged 2 files (12 lines) on Nov 30, 2026 16:27 UTC
View on GitHub
jorenham jorenham commented on Nov 30, 2026 15:13 UTC
Author

Reference issue


No issue; item 37 of #629.

What does this implement/fix?


The real hyp2f1(1e17, 0.5, 1e17, nan) overflows the stack (in SciPy 1.18.1 too); expected nan. When the series fails for c - a - b < 0, the recurrence on c (AMS55 15.2.27) restarts from c + (2 - round(c - a - b)), which rounds back to c for large c, so it called itself with the same arguments. This skips the recurrence in that case and keeps the series result.

Additional information


Finite x hit the same loop: hyp2f1(1e17 - 1e7, 1e7 + 0.5, 1e17, 0.5) now returns inf, and hyp2f1(1e17 - 16, 16.5, 1e17, 0.9999) returns nan instead of crashing. Only inputs that used to recurse forever change. The new test crashes (SIGSEGV) on main with GCC and Clang and passes with the fix; the hyp2f1 xsref table tests pass.

AI Generation Disclosure


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

Diff: 12 lines (+11 / -1) across 2 files Reviewer: j-bowhay Review duration: 74m
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.25) × (1 − Review Confidence (0.48)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.25 · 12 lines diff across 2 files
0.25
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.00 · 1 substantive comment(s)
0.00
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
48%
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.350
Diff Size diff_size
0.153
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
2 items
j-bowhay j-bowhay approved these changes on Nov 30, 2026 16:27 UTC
Approved Reviewer

Approved these changes.

Reviewers
Assignees
jorenham jorenham
Labels
risk: low confidence: 48.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: 24.8% (LOW) · Higher = larger blast radius
24.8%
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: 48.5% · Lower = rushed or shallow review
48.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: 12.8% · Safe to merge
12.8%
Repository