Add convergence-tapered direct recurrence for D2 - #9
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Convergence-Tapered Direct Recurrence (CTDR) specifically to the original scalar/direct D2 evaluator, with no binary splitting and no exact quadratic-field product tree in the series. The formula and recurrence stay unchanged; only the recurrence working precision falls as term magnitude decreases, while the F and theta-F accumulators remain at full target precision.
The same CTDR schedule is applied to D2 and to the D=163 / Chudnovsky direct recurrence for a matched comparison. At 200,000 digits with a 16-term taper block, D2 direct falls from 22.369212151 s to 9.841870785 s (~2.27x faster), while Chud direct falls from 39.258158445 s to 17.253968477 s. D2 CTDR / Chud CTDR = 0.570412x, preserving almost all of the formula-level ~0.568 term-count advantage. Every reported accelerated output is byte-identical to the Chudnovsky-BS reference.
A more aggressive local low-precision window accumulator was tested and rejected because it lost deep mantissa digits. The merged candidate keeps only the valid precision-tapering part. Results and claim boundaries are documented in validation/direct_convergence_taper_results.md; make d2directtaperbench reproduces the direct-state benchmark.