Repository navigation
The square root taken after solving for x^2 is exact where it can be - #2173
Merged
Rafael-SOWNet merged 1 commit intoOct 27, 2026
Merged
Rafael-SOWNet merged 1 commit into
Rafael-SOWNet merged 1 commit into
Conversation
A polynomial whose powers share a factor is solved in x^gcd, and its roots are the gcd-th roots of what that gives. With the factor 2 that is a square root, written sqrt(y) whatever y was, so an equation with no term in x kept the square under the root that #2170 took out of the formula: x^2 = (a + b)^2 was { sqrt((a + b)^2), -sqrt((a + b)^2) }. x^2 = y is the quadratic x^2 - y = 0, so with the factor 2 each y goes through the same exact root as the formula, and keeps sqrt where it is not a rational number times a square. The parity check in front refuses a y of odd degree in a symbol, such as x^2 = a, before any polynomial is built. On 2.6.0 and on this branch, Solve: x^2 = (a + b)^2 sqrt form -> { -a - b, a + b } x^4 - (a^2 + b^2)*x^2 + a^2*b^2 = 0 nested sqrt -> { -b, b, -a, a } sin(x)^2 = (a + 1)^2 arcsin(sqrt((a + 1)^2)) -> arcsin(a + 1) The eigenvalues of [[0, J], [J, 0]] are J and -J instead of +-sqrt(J^2); Eigenvalues is new since 2.6.0, so its test and doc comment are updated and no released answer changes there. Twenty-three equations had every root substituted back at sampled values of the other symbols, with residual 0. Unit suite 17,144 passed, 0 failed; RootCheck 596/596 clean; CasBench 120/121, unchanged. Part of #2140 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2173 +/- ##
==========================================
- Coverage 86.43% 86.42% -0.02%
==========================================
Files 295 295
Lines 64881 64886 +5
Branches 19084 19084
==========================================
- Hits 56081 56077 -4
- Misses 4770 4780 +10
+ Partials 4030 4029 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
deleted the
a-square-root-of-a-square-is-taken-when-a-power-is-inverted
branch
October 28, 2026 10:28
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.
The follow-up #2170 recorded under Not in this PR.
The defect: a polynomial whose powers share a factor is solved in
x^gcd, and its roots are the gcd-th roots of what that gives. With the factor 2 that is a square root, writtensqrt(y)whateverywas. So an equation with no term inxkept the square under the root that #2170 took out of the formula.The change:
x^2 = yis the quadraticx^2 - y = 0. So with the factor 2, eachygoes through the same exact root as the formula, and keepssqrtwhere it is not a rational number times a square. The parity check in front refuses ayof odd degree in a symbol, such asx^2 = a, before any polynomial is built.Solvex^2 = (a + b)^2{ sqrt((a + b) ^ 2), -sqrt((a + b) ^ 2) }{ -a - b, a + b }x^4 - (a^2 + b^2)*x^2 + a^2*b^2 = 0{ sqrt((a ^ 2 + b ^ 2 - sqrt(…)) / 2), … }{ -b, b, -a, a }sin(x)^2 = (a + 1)^2{ arcsin(sqrt((a + 1) ^ 2)) + 2 * pi * n_1, … }{ arcsin(-a - 1) + 2 * pi * n_1, … }x^2 + (p - q)^2/4 = 0{ sqrt(-(p - q) ^ 2 / 4), … }{ -i * (1/2 * p - 1/2 * q), … }The eigenvalues of
[[0, J], [J, 0]]are nowJand-J, not±sqrt(J^2).Eigenvaluesis new since 2.6.0, so its test and doc comment are updated, and no released answer changes there.Checked:
SquareDiscriminantTesthas four more rows.Not in this PR: the inversion of
f(x)^2 = vinInvertNodehas the same shape. I found no equation that reaches it, so it is left as it is rather than changed untested.Part of #2140.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura