Skip to content

Judge a circle of roots of a modulus by one member - #2727

Open
Rafael-SOWNet wants to merge 1 commit into
masterfrom
fix-2712-sqrt-abs-negative
Open

Rafael-SOWNet wants to merge 1 commit into
masterfrom
fix-2712-sqrt-abs-negative

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

sqrt(abs(x)) = -1 is raised to abs(x) = 1, and its roots e^(i r) were answered. The verification after solving checks each root by substituting it. It judges a family over the integers by one member, but it kept any family with a real parameter. So the roots that raising added stayed in the answer.

Where every x in the equation is inside one modulus |u|, the equation is a function of |u|. That value is the same at every member of the family the modulus is inverted into (u = c e^(i r)), so every member is a root or none is. Verdict now puts the real angle at 0 under that condition (SolutionParameters.AtAMember(root, angles: true)). Nothing else changes.

.Solve("x") master 409d68805 this branch
sqrt(abs(x)) = -1 { e^(i r_1) provided r_1 in RR } { }
sqrt(abs(x - 4) - 3) = -5 { 28 e^(i r_1) + 4 … } { }
sqrt(abs(x) + 1) = -1 { 0 provided r_1 in RR } { }
abs(x)^(1/4) = -1, abs(x)^(3/2) = -8 a circle { }
sqrt(abs(x)) = abs(x) - 2 circles of radius 1 and 4 radius 4 only
sqrt(abs(x)) = -abs(x) 0 and the unit circle 0 only
sqrt(abs(x)) = 2, abs(x) = 4, abs(x)^(3/2) = 8, sqrt(abs(x-4)-3) = 5 a circle unchanged
sqrt(x) = -1, abs(x) = -1, sqrt(abs(x)) = a unchanged

What was measured:

  • mpmath check (dps 50). Every dropped family's members fail the equation at several angles: the residual is 2 for sqrt(abs(x)) = -1 and 10 for the second issue row. Every kept family's members have a residual of 0. A complex grid search finds no root for the { } rows.
  • Generated sweep. 90 equations covering sqrt, 4th, 6th, 3/4, 3/2 and 1/3 powers of moduli of linear and quadratic arguments, with negative, imaginary, zero and abs right-hand sides. 27 answers changed, each to { } or to the old answer without its non-roots, and all 27 were checked with mpmath. One equation, abs(2x+1)^(3/4) = abs(x) - 2, timed out at 20 s on both builds under load, so the sweep tells us nothing about it.
  • Harnesses. RootCheck gives 596/596 clean before and after. CasBench gives 120/121 before and after, 0 wrong, with identical verdicts.
  • Unit suite. 22334 passed, 0 failed.

Entry added to BREAKING-CHANGES.md.

Fixes #2712

🤖 Generated with Claude Code

sqrt(abs(x)) = -1 is raised to abs(x) = 1, whose roots e^(i r) were
answered: a family with a real parameter was never checked against the
equation, so the roots the raising added stayed. A root of a modulus is
real and not negative, and no member of the circle is a root.

Where every x in the equation is inside one modulus |u|, the equation is
a function of |u|, and |u| is the same at every member of the family the
modulus is inverted into (u = c e^(i r)). So one member decides the
family, as one member already decides a family over the integers. The
real angle parameter is put at 0 only under that condition.

Measured over 90 generated equations of roots of moduli: 27 answers
change, each to { } or to the old answer without its non-roots, checked
with mpmath. RootCheck and CasBench verdicts unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.66%. Comparing base (409d688) to head (d52be2c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2727   +/-   ##
=======================================
  Coverage   86.65%   86.66%           
=======================================
  Files         346      346           
  Lines       76959    76971   +12     
  Branches    22644    22650    +6     
=======================================
+ Hits        66692    66705   +13     
  Misses       5534     5534           
+ Partials     4733     4732    -1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.15% <100.00%> (+<0.01%) ⬆️
fsharp 32.79% <ø> (ø)
interactive 40.09% <ø> (ø)

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

Files with missing lines Coverage Δ
...nuous/Solvers/EquationSolver/SolutionParameters.cs 81.96% <100.00%> (ø)
...ontinuous/Solvers/EquationSolver/SolveStatement.cs 84.93% <100.00%> (+0.50%) ⬆️

... and 1 file with indirect coverage changes

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

sqrt(abs(x)) = -1 is solved by squaring and gives e^(i r_1) instead of { }

1 participant