Repository navigation
Two roots of linears with one slope are rationalised together by their sum - #1576
Merged
Merged
Conversation
…r sum sqrt(L1) and sqrt(L2) with L1 - L2 = k a constant are rational in their sum v = sqrt(L1) + sqrt(L2): the difference is k/v, sqrt(L1) = (v + k/v)/2, sqrt(L2) = (v - k/v)/2, and dx = (v^4 - k^2)/(2 m v^3) dv for the slope m. The identities hold for the principal roots wherever v is not zero, so nothing is assumed about signs. An inverse function of the difference was declined where it is elementary -- Charlwood's arcsin(sqrt(1 + x) - sqrt(x)) after five seconds, which is what ABareInverseFunctionByPartsTest's TheRemainderMayBeOutOfReach timed on macOS at 63.8 s against a 60 s bound -- and under v it is arcsin(1/v) beside a rational function of v, which parts closes. The sum and the difference are taken whole before the roots, so the rules in v see 1/v, and on the way back 1/v is written as the difference over k, so the answer holds the difference as the integrand does; v is positive wherever the integrand is real, so its sign is one. At the question asked or one below it, since it lands on the chain in v. TwoLinearRadicalsIntegralTest and ABareInverseFunctionByPartsTest pass (net10.0), and every target builds. Part of #718. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Holding this: the corpus check found three losses. The rule also fired on integrands other rules already answer quickly, and ran them past the 3 s budget:
The fix narrows the rule to where the sum or difference of the two roots stands inside an inverse trigonometric function or a logarithm. That keeps the arcsine and arctangent gains. It will be pushed as a follow-up commit, and re-measured before merging. |
…function The corpus run found three losses. x^2/(sqrt(a + b x) + sqrt(c + b x)) ran out the budget under v where the conjugate answers it in 37 ms, and sqrt(x - 1) sqrt(x + 1)/(1 + x - x^2) where the quotient of the two roots answers it in 244 ms; so did Timofeev's arccos(sqrt(x/(1 + x))), a quotient of the two roots under the function, which the rule sees as two roots of one slope. A rational function of the two roots is the radical rules' already. So the sum is taken only where the sum or the difference of the two roots stands inside an inverse trigonometric function or a logarithm, which nothing else reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
Rafael-SOWNet
added a commit
that referenced
this pull request
Sep 29, 2026
Brings in #1576, which retires the macOS flake in ABareInverseFunctionByPartsTest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #718: two square roots of linears with one slope, rationalised together by their sum. It also removes the cause of the macOS flake in
ABareInverseFunctionByPartsTest.TheRemainderMayBeOutOfReach.sqrt(L1)andsqrt(L2)withL1 - L2 = ka constant are rational inv = sqrt(L1) + sqrt(L2):k/v, since the sum times the difference isL1 - L2for any values of the two roots;sqrt(L1) = (v + k/v)/2andsqrt(L2) = (v - k/v)/2;x = ((v - k/v)^2/4 - n2)/m, sodx = (v^4 - k^2)/(2 m v^3) dvfor the slopem.These hold for the principal roots wherever
vis not zero, so nothing is assumed about signs.What it answers. An inverse function of the difference was declined where it is elementary. Charlwood's
arcsin(sqrt(1 + x) - sqrt(x))isarcsin(1/v) (v^4 - 1)/(2 v^3)underv, which parts closes; asked as written, the remainder parts leaves in x is a nested root no rule reads. Rubi's 5.3.7 has the arctangent's powers of x beside it. The sum and the difference are taken whole before the roots are, so the rules invsee1/v. On the way back1/vis written as the difference overk, so the answer holdsarcsin(sqrt(1 + x) - sqrt(x))as the integrand does, andsgn(v)is one, sincevis positive wherever the integrand is real. Scoped to the question asked or one below it, since it lands on the chain inv.Only inside an inverse function or a logarithm. The rule takes the sum only where the sum or the difference of the two roots stands inside an inverse trigonometric function or a logarithm, which nothing else reads. A rational function of the two roots is the radical rules' already. The first version took the sum everywhere, and the corpus run found three losses:
x^2/(sqrt(a + b x) + sqrt(c + b x)), which the conjugate answers in 37 ms;sqrt(x - 1) sqrt(x + 1)/(1 + x - x^2), which the quotient of the two roots answers in 244 ms;arccos(sqrt(x/(1 + x))), a quotient of the two roots under the function.Asked under
vfirst, each ran out the budget. The narrowing also gives up three powers of the sum below the bar that the first version answered,x/(sqrt(a + b x) + sqrt(c + b x))^3among them; master declines those too.TwoLinearRadicalsIntegralTestpins the three losses as answered.The flake.
TheRemainderMayBeOutOfReachboundsIntegratebyIntegrationDecline.Guard, 60 s, and itsasin(sqrt(1 + x) - sqrt(x))row was declined in 4.8 to 5.4 s here, three fresh processes each at 68e231d (passed on macOS), 8c964e7 (failed there at 63.8 s) and a8a2b7e. It was never a regression: the macOS runner took thirteen times as long. The row is now answered in half a second, and the test differentiates the answer back.asin(sqrt(1 + x) - sqrt(x))integral(...)x^3*atan(-sqrt(x)+sqrt(1+x))integral(...)TwoLinearRadicalsIntegralTesthas six new rows differentiated back: the three inverse functions, and the three the narrowing leaves to the other rules.ABareInverseFunctionByPartsTestpasses with the arcsine answered. The two classes pass (net10.0, 28 tests, 6 s), and every target builds.Measured with
work/intbenchagainst master ata8a2b7e7, the commit this is cut from, 3 s a problem (5 s in family 0), on this branch with the narrowing (9aecf64c). Every problem that moved was then re-run on both:🤖 Generated with Claude Code