Skip to content

Route the gcd and lowest-terms calls added since #2003 through GreatestCommonDivisors - #2006

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
route-new-gcd-calls-through-euclid
Oct 21, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
route-new-gcd-calls-through-euclid

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

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 call EInteger.Gcd and ERational.ToLowestTerms directly again. They are in PartialFractions (#2001), IndefiniteIntegralSolver (#1960, #1961, #1981, #1997) and RothsteinTrager (#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

…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
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 21, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 08a3c49 into master Oct 21, 2026
36 of 37 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant