Repository navigation
An identity only the simplifier shows is solved to every value - #1562
Merged
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1420: its first defect, an identity not recognised before the numerical search.
sqrt(x)^2 = xreachedAnalyticalEquationSolver'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 = 1went 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 withCC, asx + 1 = x + 1already 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 - 1simplifies to0 provided not x - 1 = 0, andCCwould be wrong at 1. That equation,abs(x) - x = 0andln(e^x) = xstill 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."sqrt(x)^2 = x".ToEntity().Solve("x"){ -10, -49/5, -48/5, …, -8 - 8i, … }, 191 numbersCC"sin(x)^2 + cos(x)^2 = 1".ToEntity().Solve("x")CCIdentityEquationTest.EveryValueSatisfiesAnIdentityTheSimplifierShowspins 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