Repository navigation
Decline where rounding reached a root, rather than drop it (#2627) - #2631
Merged
Merged
Conversation
y^2 - 2 = 0, x^2 + (P - Q y) x - c = 0, with (1 + sqrt(2))^n = P + Q sqrt(2), has four solutions. Since #2612 the eliminator also solves for y from the second equation, through ((x^2 + P x - c)/(Q x))^2 = 2, a quartic in x with coefficients near Q^2. At n = 90 the small root of that quartic, exact, evaluated to a residual of -0.042 against terms of 3 at a hundred digits, and no interval enclosure of it could be worked out. It was dropped as spurious, and the system was answered with three rows. Master answers three rows of four at n = 80, 90, 100 and 120 for several c. 2.10.0 declined all of them. Merged with #2620, which keeps P + Q sqrt(2) exact, the same happens at n = 70 in the system's own row check: the row's residual evaluates to -7.2e-21, while its enclosure leaves zero out by only about 6e-53. StatementSolver.Weigh now reads such a residual as rounding having reached the root, and whether it is one cannot be told. That is so where an enclosure leaves zero out but is within what IsEvidenceAgainst lets rounding leave, and where no enclosure can be worked out and twice the digits evaluate the residual to something else. A one-variable solve then declines the equation, as ShownNotARoot already did, and a system declines in RowsThatHold. A residual that more digits leave where it was is still evidence, so an extraneous root is still dropped. Every case measured is now four rows or a decline, on master and on master merged with #2620. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2631 +/- ##
==========================================
- Coverage 86.72% 86.72% -0.01%
==========================================
Files 345 345
Lines 75366 75429 +63
Branches 22026 22044 +18
==========================================
+ Hits 65360 65413 +53
- Misses 5400 5404 +4
- Partials 4606 4612 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
y^2 - 2 = 0, x^2 + (P - Q y) x - c = 0, with(1 + sqrt(2))^n = P + Q sqrt(2), has four solutions. Since #2612 the eliminator also solves foryfrom the second equation, through((x^2 + P x - c)/(Q x))^2 = 2. At largenthat quartic's small root, exact, evaluates at a hundred digits to a residual that rounding made, and it was dropped as spurious. There were two variants:n = 90the residual is-0.042against terms of 3, and twice the digits evaluate it to something else.-7.2e-21, while its enclosure leaves zero out by only about6e-53. The row is exact and not zero, which means the elimination rounded.StatementSolver.Weighnow returns cannot tell in both cases. A one-variable solve then declines the equation (ShownNotARoot, as it already did for a row that passes the tolerance but whose enclosure excludes zero), and a system declines inRowsThatHold. A residual that twice the digits leave where it was is still evidence, so extraneous roots are still dropped.Solve("x", "y")fc8aaf4c22.10.0 declines every row above n = 60. The three-row answers came in with #2612 and have not been released, so there is no
BREAKING-CHANGES.mdentry.Tests:
ARowIsNotDroppedOnARoundedResidualTest, 8 cases. Each must be four rows that hold within1e-60by a 300-digit enclosure, or a decline.Issue2446(n: 70).The full UnitTests suite (net10.0) passes: 21757 passed, 0 failed, 13 skipped. The library builds with 0 errors for every target framework.
Closes #2627.
🤖 Generated with Claude Code