Skip to content

A polynomial is not answered with no roots - #2317

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-polynomial-is-not-answered-with-no-roots
Nov 1, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-polynomial-is-not-answered-with-no-roots

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Every root a solver finds goes 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's no root. For a polynomial of degree one or more over the complex numbers that is never true, so what failed was the solver. Such a polynomial is now left as the set of the x that satisfy it, which claims only that its roots weren't found.

Solve("x"), with neither #2314 nor #2315 before now
(x + 1)^3 = 2 { } { x : (x + 1) ^ 3 = 2 }
31x^4 - 62x^3 + 33x^2 - 2x - 1 = 0 { } { x : 31 * x ^ 4 - … = 0 }
sqrt(x) = -1 { } { }: not a polynomial, and it has no root
  • It applies only to a polynomial with numbers for coefficients, over the complex numbers. An equation that isn't a polynomial can have no root, and so can a polynomial over the reals: x^2 + 1 = 0.
  • It's a guard, not a fix. The two { } answers above come from defects A quartic that is biquadratic once depressed is solved #2314 and A cube shifted is solved #2315 fix, and with those merged no equation I know of reaches this, so no answer changes and there's no BREAKING-CHANGES.md entry. It turns the next such defect into "unsolved" rather than a wrong answer. The tests ask WithoutSpuriousRoots directly, with candidates that fail.
  • The suite, the trio, F#, AOT and the eight harnesses pass.

No issue was filed.

🤖 Generated with Claude Code

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>
@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

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.75%. Comparing base (5f7a0de) to head (6477079).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ontinuous/Solvers/EquationSolver/SolveStatement.cs 75.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2317      +/-   ##
==========================================
- Coverage   86.76%   86.75%   -0.02%     
==========================================
  Files         311      311              
  Lines       68216    68225       +9     
  Branches    19827    19832       +5     
==========================================
- Hits        59191    59189       -2     
- Misses       4882     4891       +9     
- Partials     4143     4145       +2     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.30% <75.00%> (-0.02%) ⬇️
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 Δ
...ontinuous/Solvers/EquationSolver/SolveStatement.cs 83.69% <75.00%> (-0.88%) ⬇️

... and 2 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 96f4c4c 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-polynomial-is-not-answered-with-no-roots branch November 1, 2026 18:42
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