Skip to content

An identity only the simplifier shows is solved to every value - #1562

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
an-identity-is-every-x
Sep 29, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
an-identity-is-every-x

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #1420: its first defect, an identity not recognised before the numerical search.

sqrt(x)^2 = x reached AnalyticalEquationSolver's Newton fallback, since nothing analytical read it. Its residual is zero wherever it is evaluated, so every start of Newton's grid converged at once and each was kept: 191 numbers on 2.5.0, printed as decimals on master. sin(x)^2 + cos(x)^2 = 1 went the same way. Where every analytical route has declined, the equation is now simplified once, just before Newton's method, and an unconditional zero is answered with CC, as x + 1 = x + 1 already is. The simplification is paid only by equations that were about to start a numerical search.

A zero with a condition is not taken, and goes on to Newton's method as before: (x^2 - 1)/(x - 1) - x - 1 simplifies to 0 provided not x - 1 = 0, and CC would be wrong at 1. That equation, abs(x) - x = 0 and ln(e^x) = x still come back as the grid, which is #1420's second defect, the Newton fallback keeping one root per starting point where the solutions are a continuum. That stays open.

Input Was (2.5.0) Now
"sqrt(x)^2 = x".ToEntity().Solve("x") { -10, -49/5, -48/5, …, -8 - 8i, … }, 191 numbers CC
"sin(x)^2 + cos(x)^2 = 1".ToEntity().Solve("x") the same 191 numbers CC

IdentityEquationTest.EveryValueSatisfiesAnIdentityTheSimplifierShows pins both.

Measured against master 260d87d: the unit tests pass (net10.0, 13333 passed), every target builds, and the allocation gate passes on this tree: allocation is what the baseline says on all 19 gated benchmarks.

🤖 Generated with Claude Code

`sqrt(x)^2 = x` and `sin(x)^2 + cos(x)^2 = 1` reached Newton's method unread:
their residual is zero wherever it is evaluated, so every start of its grid
converged at once, and each was kept, 191 numbers for an equation every number
satisfies. Where every analytical route has declined, the equation is simplified
once before Newton's method is tried, and an unconditional zero is answered with
CC, as `x + 1 = x + 1` already was. A zero with a condition goes on to Newton's
method as before: `(x^2 - 1)/(x - 1) - x - 1` is zero for every x but 1.

The unit tests pass (net10.0, 13333), every target builds, and the allocation
gate passes.

Part of #1420.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rafael-SOWNet
Rafael-SOWNet merged commit 4411d02 into master Sep 29, 2026
31 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the an-identity-is-every-x branch October 29, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant