Repository navigation
Read the sign of a difference with 0 in a limit as that of what it subtracts from - #2400
Merged
Merged
Conversation
…btracts from A step function at a jump of 0 and a comparison with 0 ask for the sign of g - 0, which is not simplified on the way, and every reading of that sign carried the 0 along. The structural reading that strips it came last, after the slope, so floor(sinh(2)^log(2, x)) at 0 from the right asked for the limit of (g - 0) / (x - 0), which l'Hopital's rule took seven seconds to decline, where g / x is declined in under half a second. The answer, 0, came from the reading after it. The 0 is now stripped once, where the sign is asked for, and the slope at 0 is taken over x itself. Found by limitcheck; no issue was filed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2400 +/- ##
=======================================
Coverage 86.80% 86.80%
=======================================
Files 312 312
Lines 69330 69332 +2
Branches 20230 20232 +2
=======================================
+ Hits 60182 60187 +5
+ Misses 4921 4919 -2
+ Partials 4227 4226 -1
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.
floor(sinh(2)^log(2, x))at 0 from the right is 0, and took 7 s to say so, wheresgnof the same argument takes 0.4 s. At a jump of 0,floorasks for the sign ofg - 0. The sign is then read from the slope, which divides byx - 0. Neither- 0is simplified away inside a limit, and l'Hopital's rule spent 6.9 s on(g - 0) / (x - 0)before declining, against 0.4 s ong / x.The fix.
SignNeardrops a- 0where it starts, in place of the arm inSignOfTheFactorsthat handled it one level down. The slope at 0 divides byxitself.Read as
g / x, a derivatives' quotient no longer fits the bound l'Hopital's rule sets on growth by the two nodes the zeros added. Sofloor(sqrt(x) - erf(x))at 0 from the right was lost on the first run of this branch, until #2399 read such a quotient by its terms. This branch is rebased on that merge, and the row answers 0 as on master.Measured on master (b1d0c22) and this branch, at 0 from the right:
floor(sinh(2)^log(2, x))0, 7.0 s0, 0.42 sfloor(sqrt(x) - erf(x))0, 0.21 s0, 0.19 sThe other step-function limits probed are unchanged in answer and time, and no answer changes against master.
limitcheck, 42 seeds at depth 3 with 600 expressions each, against master: the one row above no longer times out, with no losses, wrong answers or new timeouts.
Checks: the full suite passed (19205 tests), as did the MCP, terminal, interactive and F# wrapper suites, the AOT build and the eight harnesses.
New test:
ASignIsReadWithoutAZeroOffsetTest. It asserts that the floor finishes within a minute, and pins the step limits read through the same path.🤖 Generated with Claude Code