Repository navigation
Over the complex numbers, an equation in and out of a modulus is solved in the parts of x - #2309
Conversation
…ed in the parts of x #2307 left an equation with x inside abs, sgn, conj, Re, Im or arg and outside it too unsolved over the complex numbers, since Newton's method assumes a holomorphic function and its near-copies of a root came back as roots. Leaving it unsolved is not solving it. With x = a + b i and each |u| a real t >= 0 with t^2 = (Re u)^2 + (Im u)^2, the real and imaginary parts of the equation and one equation per modulus are a polynomial system in as many unknowns, which the Groebner solver answers exactly and completely or not at all. The roots are its solutions with a, b and every t real and no t negative, each put back into the equation as written, since clearing the denominators can add a pole. conj, Re and Im split directly. sgn(u) is u/|u| where u is not zero, and the case where it is zero is solved on its own. x^2/|1 - x^2| = x is { 0, (1 + sqrt(5))/2, (sqrt(5) - 1)/2 }, x |x| = 4 is { 2 }, x + sgn(x) = 3 is { 2 } again, and x^2 + 1 = |x| is +-i (sqrt(5) - 1)/2, which neither the search nor a split by the sign found. Left unsolved: infinitely many solutions (|x| = Re x), roots with no exact form (x^5 = |x| + 1), arg, and a system above 32 solutions by Bezout's bound, past which x^7 = |x| + 1 spent over 20 s declining. The route runs once, on the equation as asked and ahead of the spelling loop, whose spellings would each be the same system: asked of every one, x^5 = |x^3 + 1| + 1 ran it dozens of times. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2309 +/- ##
==========================================
- Coverage 86.78% 86.75% -0.03%
==========================================
Files 311 311
Lines 68032 68199 +167
Branches 19763 19821 +58
==========================================
+ Hits 59039 59164 +125
- Misses 4872 4893 +21
- Partials 4121 4142 +21
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
It is asked of every equation the solver is given, ahead of the spelling loop. Enumerating Nodes allocates an iterator at each level, and that was 4.5 MB of the kernel benchmark's SolveHard, 45% of it, which has no modulus in it. The walk allocates nothing: SolveHard allocates 187,558,968 bytes per solve on master and on the branch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Should simplification of a conditional set like this call solve? |
|
Not as It would be sound for the routes that are complete by construction: polynomials, the Gröbner route here, and the exponentiated logarithms in #2316. That needs |
#2307 left these equations unsolved over the complex numbers, and as Happypig375 said there, that isn't solving them. This solves them exactly.
With
x = a + b iand each|u|a realt ≥ 0witht^2 = (Re u)^2 + (Im u)^2, the equation's real and imaginary parts and one equation per modulus make a polynomial system in as many unknowns. The Gröbner solver (#2127) answers it exactly and completely, or not at all. The roots are its solutions witha,band everytreal and notnegative.conj,ReandImsplit directly.sgn(u)isu/|u|whereu ≠ 0, and the caseu = 0is solved on its own.Solve("x")x^2/abs(1-x^2) = x{ 0, 0.618…, 1.618…, 1.618… + 1.7E-9i, 1.618… + 9.9E-8i }{ 0, (1 + sqrt(5)) / 2, (sqrt(5) - 1) / 2 }abs(x^2 - 4) = 3x{ 1, 4, 4.0000000000000062… + 1.6E-7i }{ 1, 4 }1/abs(x) = x^2{ -1, 1 }and six near-copies{ 1, -1 }x * abs(x) = 4{ 2 }{ 2 }x + sgn(x) = 3{ 2 }{ 2 }x^2 + 1 = abs(x){ ±i (sqrt(5) - 1) / 2 }conj(x) = x^2conjread as a variable{ 0, 1, -1/2 ± i sqrt(3) / 2 }|x| = Re x, a ray;x^5 = |x| + 1, whose roots have modulus the real root ofr^5 - r - 1;arg;x^7 = |x| + 1ran past 20 s before declining, and every case solved here is at 24 or below. The slowest decline within the bound was 1.9 s (x^4 = |x| + 1).x^5 = |x^3 + 1| + 1asked it dozens of times.Nodesfor it added 4.5 MB (45%) to the kernel benchmark's SolveHard, which CI's Benchmark job caught. It now walksDirectChildrenby hand, and SolveHard allocates 187,558,968 bytes per solve on master and on the branch.abs,sgn,conj,ReandImof polynomials. It solved 199 and 190, and every root it answered is a root. The search found no root missing from any answer. The one point it flagged in each batch is where the equation has no value:0/0at 0, approached along a line.Solveis 35 ms, the 90th percentile 0.46 s and the slowest 3.1 s. The slow ones are mostly declines of a quotient by the modulus of a complex quadratic, where the roots can't be proved exactly. master (Over the complex numbers, an equation in and out of a modulus is left unsolved #2307) leaves all of these unsolved at once.BREAKING-CHANGES.mdentry from Over the complex numbers, an equation in and out of a modulus is left unsolved #2307 is rewritten as the change from 2.6.0.Follows #2307, for #2139.
🤖 Generated with Claude Code