Repository navigation
A cube shifted is solved - #2315
Merged
Merged
Conversation
SolveCubic takes Cardano's C as a cube root of (D1 + sqrt(D1^2 - 4 D0^3)) / 2, either root
of C^6 - D1 C^3 + D0^3 = 0 doing as long as it is not 0, since the roots divide by C. A
cube shifted, a(x + h)^3 = k written out, has D0 = b^2 - 3ac = 0, and then the square root
is |D1|, so for a negative D1 the sum is 0 and C was 0. Every root was taken for -b/(3a),
the branch for a triple root, none of them was a root, and the empty set that was left
claimed there was none: (x + 1)^3 = 2 and 3x^3 + 9x^2 + 9x + 1 = 0 were answered { }.
With D0 = 0, C is a cube root of D1 itself, and the roots are -(b + u C)/(3a), D0/C being
0. For a negative D1 it is written as the negative of the cube root of -D1, a cube root of
D1 whichever root of a negative number a power is read as.
Found by a cross-check of equations in logarithms, one of which exponentiates to
3x^3 + 9x^2 + 9x + 1. 2.6.0 answers them the same.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2315 +/- ##
==========================================
- Coverage 86.77% 86.75% -0.02%
==========================================
Files 311 311
Lines 68199 68221 +22
Branches 19823 19828 +5
==========================================
+ Hits 59177 59187 +10
- Misses 4880 4892 +12
Partials 4142 4142
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Nov 1, 2026
Rafael-SOWNet
added a commit
that referenced
this pull request
Nov 1, 2026
An equation in two or more logarithms of x had no route of its own, and came to Newton's
method, which answered it in decimals and left out the roots it did not reach:
ln(x) + ln(x + 1) = 0 was { 0.618... } and ln(1 + 3x^2) - ln(4x) = 1 was { 3.53 }, without
0.0944.
k_1 log_b(P_1) + ... + k_n log_b(P_n) = c, for polynomials P_i, rational k_i and one base,
holds only where P_1^(k_1 L) ... P_n^(k_n L) = b^(c L), L being the common denominator of
the k_i: a polynomial equation, whose roots are found exactly. Each is put back into the
equation as written under the principal logarithm and kept only where it holds, since over
the complex numbers ln(u) + ln(v) is ln(u v) only up to 2 pi i: at (-1 - sqrt(5))/2 both
logarithms of ln(x) + ln(x + 1) carry i pi, and the sum is 2 pi i. Over the reals each
argument is to be positive as well. A residual too small to tell from rounding, or a candidate that is not a root of the
polynomial, leaves the equation to the routes after, since the roots the polynomial solver
missed would be left out: 3x^3 + 9x^2 + 9x + 1, a shifted cube, comes back as -1 three
times until #2315.
On 400 random equations of this kind, checked against a Newton search under the principal
logarithm, master answers 292, leaves 108 unsolved and misses 25 roots in 22 of its
answers; this answers all 400, none unsound and none missing a root.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet
added a commit
that referenced
this pull request
Nov 1, 2026
Every root a solver finds is put back into the equation as written, and the ones that fail
are dropped. Where all of them failed, the empty set was left, and the empty set claims
there is no root. For a polynomial of degree one or more, read over the complex numbers,
that is never true, so what failed was the solver: (x + 1)^3 = 2 came back { } while
Cardano's C was 0 for a shifted cube (#2315), and 31x^4 - 62x^3 + 33x^2 - 2x - 1 = 0 while a
biquadratic quartic was shifted by -b a / 4 (#2314). Such a polynomial is now left as the
set of the x that satisfy it, which claims only that its roots were not found.
Only a polynomial with numbers for coefficients and over the complex numbers: an equation
that is not a polynomial can have no root, as sqrt(x) = -1 has none, and so can a
polynomial over the reals.
With those two fixed, no equation known reaches this, so nothing answered changes.
Co-Authored-By: Claude Opus 5.5 (1M context) <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.
SolveCubictakes Cardano'sCas a cube root of(D1 + sqrt(D1^2 - 4 D0^3)) / 2. Either root ofC^6 - D1 C^3 + D0^3 = 0will do, as long as it isn't 0, since the roots divide byC. A shifted cube,a(x + h)^3 = kwritten out, hasD0 = b^2 - 3ac = 0. The square root is then|D1|, so for a negativeD1the sum is 0 andCwas 0. Every root was taken for-b/(3a), the triple-root branch, none of them was a root, and the empty set that was left claimed there was none.Solve("x")(x + 1)^3 = 2{ }{ -(3 + -3 * 2 ^ (1/3)) / 3, … }, the three cube roots of 2 less 1x^3 - 3x^2 + 3x - 3 = 0{ }1plus the three cube roots of 23x^3 + 9x^2 + 9x + 1 = 0{ }-1plus the three cube roots of 2/3x^3 + 3x^2 + 3x + 3 = 0D1is positiveD0 = 0,Cis a cube root ofD1itself, and the roots are-(b + u C)/(3a), sinceD0/Cis 0. For a negativeD1it's written as-(-D1)^(1/3), which is a cube root ofD1whichever root of a negative number a power is read as.3x^3 + 9x^2 + 9x + 1. No issue was filed.BREAKING-CHANGES.mdhas an entry.🤖 Generated with Claude Code