Repository navigation
Route the gcd and lowest-terms calls added since #2003 through GreatestCommonDivisors - #2006
Merged
Merged
Conversation
…stCommonDivisors #2003 put the library's 177 gcd and lowest-terms call sites through GreatestCommonDivisors, whose results are PeterO's and whose large-operand case is about 800 times faster. Seventeen sites written since, in PartialFractions, IndefiniteIntegralSolver and RothsteinTrager, called EInteger.Gcd and ERational.ToLowestTerms directly again. On the 35 rows the PRs that wrote them moved, the answers and allocation are identical: the operands those rows see are small. The change keeps the contract in one place for the operands that are not. Part of #233. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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.
Part of #233.
#2003 routed the library's 177 gcd and lowest-terms call sites through
GreatestCommonDivisors. Its results match PeterO's, and it is about 800 times faster on large operands. Seventeen sites written since then callEInteger.GcdandERational.ToLowestTermsdirectly again. They are inPartialFractions(#2001),IndefiniteIntegralSolver(#1960, #1961, #1981, #1997) andRothsteinTrager(#1998). This puts them through the helper.On the 35 rows that #1981, #1982, #1983, #1997, #1998, #1999 and #2001 moved (#1960 and #1961 were not sampled), answers and allocation are identical between master a567c8b and this branch: 7.5 GB on both, and the five rows that hit the probe's 8 s cap hit it on both. The operands on these rows are small, so this keeps the contract in one place for the operands that are not. It is not a measured speed-up.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura