← Back to Pull requests

Compute the generic Tsit5 interpolant coefficients to full precision #5131

Open
unknown opened this pull request with 240 lines diff across 3 files
View on GitHub
unknown unknown commented on Dec 02, 2026 13:24 UTC
Author

The generic Tsit5Interp(::Type{T}), used for every T other than Float32/Float64, has coefficients that are accurate to only about 1e-17. They are the paper's factored polynomials, whose roots are printed to 16–19 digits, multiplied out. For example, r11 is 0.99999999999999997428… where the exact value is 1, and r14 and r24 are Float64 literals. As a result, BigFloat dense output (saveat, sol(t), continuous callbacks) stops improving at about 1e-22 while the steps reach the tolerance. Example: u' = u at 128 bits with abstol = reltol = 1e-24. The step error is 7.8e-26 and the saveat error is 5.9e-22, or 1.2e-25 with this PR.

This PR recomputes the coefficients from the tableau and the conditions that define the dense output: order 4 for every Θ, bᵢ(1) = bᵢ, continuous derivatives at both ends of the step, and the paper's choice b₇Θ = 5/2 Θ²(Θ - 1)(Θ - 3/5). Seven coefficients are exact rationals (r11 = 1, r22, r23, r24 = 0.1317, -0.2234, 0.1017, and r72, r73, r74). The others are given to 86 digits, like the tableau. The Float32/Float64 method is unchanged.

Checklist

  • Appropriate tests were added

  • Any code changes were done in a way that does not break public API

  • All documentation related to code changes were updated

  • The new code follows the

  • contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API
  • Additional context

    Both new tests fail on master. The interpolant conditions have a residual of 7.2e-17, against the 1e-70 bound. The saveat error is 5.9e-22, against the 1e-23 bound.

    The Float64 r22 = 0.13169999999999998 is 1 ulp from 0.1317. It is left unchanged so that Float64 results stay bit-identical.

    Diff: 240 lines (+180 / -60) across 3 files Reviewer: oscardssmith Review duration: 1455m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 240 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.344
    Diff Size diff_size
    0.328
    Real PR Conversation Timeline
    1 comments
    "Review active on #5131"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 38.7% (MEDIUM) · Higher = larger blast radius
    38.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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 20.6% · Safe to merge
    20.6%