Skip to content

A quartic that is biquadratic once depressed is solved - #2314

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-biquadratic-quartic-is-shifted-by-b-over-4a
Nov 1, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-biquadratic-quartic-is-shifted-by-b-over-4a

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

SolveQuartic depresses a x^4 + b x^3 + … by y = x + b/(4a). Where the depressed form has no cubic term, it solves the quadratic in y^2 and shifts back. The shift was written -b / 4 * a, which is -a b / 4, where it is -b / (4 a), as in the general branch just below. With a leading coefficient of 1 or -1 the two agree, so it went unseen. With any other, every candidate was off, failed its check against the equation, and the empty set that was left claimed there was no root.

Solve("x") 2.6.0 and master now
31x^4 - 62x^3 + 33x^2 - 2x - 1 = 0 { } 1/2 ± sqrt((27/62 ± 8/31 * sqrt(2)) / 2), four real roots
2x^4 - 8x^3 + 10x^2 - 4x - 1 = 0 { } 1 ± sqrt((1 ± sqrt(3)) / 2)
x^2 - x - 1 = 4x * sqrt(2x^2 - 4x + 2) { } { 1/2 - sqrt((27/62 + 8/31 * sqrt(2)) / 2) }, which is -0.1326
(2x^2 + 4x - 2) / sqrt(-2x - x^2) = -2 { } -1 ± sqrt((3 ± sqrt(-3)) / 2)
  • Found by a cross-check of random equations in square and cube roots against a Newton search. The two root equations came up as { } there, and each squares to such a quartic. Both quartics are irreducible over the rationals, so no factoring answers them first.
  • Every new case fails on master. The suite, the trio, F#, AOT and the eight harnesses pass. BREAKING-CHANGES.md has an entry. No issue was filed.

🤖 Generated with Claude Code

SolveQuartic depresses a x^4 + b x^3 + c x^2 + d x + e by y = x + b/(4a), and where the
depressed form has no cubic term it solves the quadratic in y^2 and shifts back. The shift
was written -b / 4 * a, which is -a b / 4, where it is -b / (4 a), as the general branch
below it has it. With a leading coefficient of 1 or -1 the two agree, so it went unseen;
with any other every candidate was off by a multiple of b, failed its check against the
equation, and the empty set that was left claimed there was no root.
31x^4 - 62x^3 + 33x^2 - 2x - 1 = 0 has four real roots, 1/2 +- sqrt((27/62 +- 8 sqrt(2)/31)/2),
and was answered { }.

An equation in a square root whose squared form is such a quartic was answered { } with it:
x^2 - x - 1 = 4x sqrt(2x^2 - 4x + 2), which has the root -0.1326, and
(2x^2 + 4x - 2)/sqrt(-2x - x^2) = -2, which has four complex ones. Both were found by a
cross-check of equations in roots against a Newton search, and 2.6.0 answers them the same.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Nov 1, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Nov 1, 2026
@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.76%. Comparing base (3fc4022) to head (6bbc4ef).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2314   +/-   ##
=======================================
  Coverage   86.76%   86.76%           
=======================================
  Files         311      311           
  Lines       68199    68199           
  Branches    19821    19823    +2     
=======================================
+ Hits        59175    59176    +1     
+ Misses       4881     4880    -1     
  Partials     4143     4143           
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.31% <100.00%> (+<0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...tinuous/Solvers/EquationSolver/PolynomialSolver.cs 85.88% <100.00%> (+1.20%) ⬆️

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rafael-SOWNet
Rafael-SOWNet merged commit b20a516 into master Nov 1, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 1, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the a-biquadratic-quartic-is-shifted-by-b-over-4a branch November 1, 2026 16:54
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>
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