Repository navigation
Do not simplify a substitution's quotient that still varies with x, which no rewriting can take out - #2035
Merged
Rafael-SOWNet merged 1 commit intoOct 22, 2026
Conversation
…hich no rewriting can take out The substitution search simplified every candidate's quotient with symbols in it before refusing the ones that kept an x, and some of those simplifications ran past any budget: tan(c + d x)^(11/2)/(a + b tan(c + d x))^3 spent 31 s on one candidate under u = t^(3/2). Where the quotient in u and x, the two read as independent, takes two values at two points, a rewriting that keeps its value cannot take the x out; the simplification is not tried there, nor in the step that writes the integrand as a polynomial in the candidate, nor in the pass in the complement, and the scaling of the variable reads at two points first whether the integrand is homogeneous. A quotient that does not vary is simplified as before, and so is one whose candidate has a symbolic factor and may leave a power of itself. Kept, the quotient's sums in x alone have their like terms collected, and a constant condition is read past: under u = t^2, what Rubi's 1/((d + e x) (a + b (d + e x)^2 + c (d + e x)^4)^3) leaves in t = d + e x is (d + t - d) 2 t (a + b u + c u^2)^3 below the bar, whose t^2 is the candidate, and read with the d in it, it was refused and 1.2.3.2:854 was lost in the first chain. Kept, the quotient also has a condition over the whole of it taken off, as the simplification takes its own, and where an x is still left that may be a power of the candidate, it is simplified after all and read again. Without either, the first composite of the open branches lost eight rows master solves: the shifted linear's d^0 is 1 provided not d = 0 inner-simplified, and under u = t^3 Rubi's 1/((c + d x) (a + b (c + d x)^3)) left 1/(3 u (a + b u)) provided not d = 0, whose integral in u was declined; and beside u = x^x, e^(x^x) x^(2 x) (1 + ln(x)) kept an x/x the inner simplification leaves standing, and the u^2 in it was not seen. That second step is taken only where the quotient by the power is read at two points and is one value, and not beside a special function of x: read for every kept candidate beside erf(b x), Rubi's x^5 erf(b x)^2 took 4.85 GB where it takes 1.63. Chain against master f7f2a7a: pocket of 571 rows, 517 -> 524 solved, 0 wrong; families 3 and 6's samples 222 -> 223 and 471 -> 472, the others unchanged; of the 16 rows that moved, alone, master solved 5 and this solves 11, every one of master's among them, and 1.1.2.4:1197 and 3.3:246 in 4.7 s and 0.2 s where master took 19.6 s and 15.8 s. 6,048 rows compared for allocation: two grew past 1.3x, tanh(x)/sqrt(a + b cosh(x)^n) and coth(c + d x)^3/(a + b sech(c + d x))^(3/2), +0.75 and +0.44 GB, each answered in another spelling (777 characters where master gives 589, and 9,095 where it gives 8,290); 2.5.0 answers neither. 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
force-pushed
the
do-not-simplify-a-quotient-that-still-varies-with-x-aj
branch
from
October 21, 2026 23:36
c009073 to
a803baf
Compare
Rafael-SOWNet
marked this pull request as ready for review
October 22, 2026 00:39
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.
The change. The substitution search simplified every candidate's quotient with symbols in it before refusing the ones that kept an x. Some of those simplifications ran past any budget:
tan(c + d x)^(11/2)/(a + b tan(c + d x))^3spent 31 s on one candidate underu = t^(3/2). Where the quotient, with u and x read as independent, takes two values at two points, no rewriting that keeps its value can take the x out, so the simplification is skipped. The same check now runs:A quotient that does not vary is simplified as before, and so is one whose candidate has a symbolic factor and may leave a power of itself.
Found by the first chain. It lost 1.2.3.2:854,
1/((d + e x) (a + b (d + e x)^2 + c (d + e x)^4)^3). Underu = t^2, the kept spelling left(d + t - d) 2 tbelow the bar, which is the candidate. Read with thedin it, the power of the candidate was not recognised. The kept quotient's sums in x alone now have their like terms collected, and a constantprovidedis read past. The row comes back in 1.0 s, against 1.1 s on master.Chain against master f7f2a7a, after the fix:
One trade, kept on purpose. Two rows that master answers come back in longer spellings, with more allocation:
tanh(x)/sqrt(a + b cosh(x)^n)coth(c + d x)^3/(a + b sech(c + d x))^(3/2)Both are right, and v2.5.0 answers neither. Each comes from a candidate in the exponential rewrite whose leftover x is a rational function equal to a power of the candidate, in a spelling none of the cheap readings recognise. I tried and measured three narrower fences, and none separated these two rows from the gains:
Five of the six gains depend on the skip.
Found by the full corpus on the composite of the open PRs. Eight rows that master solves were declined on this branch alone: 1.1.3.2:3483/3509, 1.2.3.2:836/861 and 2.3:213/421/422/805. Every other open PR's build solved them. None was in this branch's pocket or samples. There were two causes, each a way the kept spelling differed from the simplified one:
c + d^0 (t - c), which inner-simplifies to1 provided not d = 0. Underu = t^3,1/((c + d x) (a + b (c + d x)^3))left1/(3 u (a + b u)) provided not d = 0, and its integral in u was declined. The simplification takes such a condition off; the kept spelling now does too.x/x, which the inner simplification leaves standing. Besideu = x^x,e^(x^x) x^(2 x) (1 + ln(x))kept(1 + ln(x))/(x/x + ln(x)), and theu^2in it was not seen. Where an x is still left and the quotient by a power of the candidate is read at two points as one value, the kept spelling is now simplified after all and read again. That step is skipped beside a special function of x, whose value in decimals is a series: read for every kept candidate,x^5 erf(b x)^2took 4.85 GB where master takes 1.42.All eight come back, the earlier gains stay, and the erf rows allocate as before the fix (1.636 GB).
Chain against master 2a98be4, after both fixes:
The full unit suite passed locally before the fallback's fence (16,462 passed, 0 failed); this class passes on the final version, and the BREAKING-CHANGES lengths were re-measured on it. Rebased onto 78cd31b.
The full unit suite passes locally: 16287 passed, 0 failed. The branch is rebased onto 2a98be4, below master's new special-function refusal, and the gains still answer there.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura