Repository navigation
Read a vanishing absolute value as vanishing from above - #2364
Merged
Merged
Conversation
1/abs(x) at 0 was NaN -- the claim that the limit does not exist -- where it is +oo. The sign a vanishing divisor keeps was read off its derivatives, and the derivative of abs(x) is sgn(x), 0 at 0, with nothing after it, so each side was left unevaluated and the two descents not matching made the two-sided limit NaN. Same on 2.6.0. An absolute value, and a real power, a product or a quotient of such things, is now never negative by its form: a divisor of that kind vanishes from above, and a power of it to an exponent tending to a negative number tends to +oo. Two sides that agree were promoted to the two-sided limit only for an expression shown real on both, which knew nothing of an absolute value, a sine, a cosine, an arctangent or an arcsine, nor of a real power of something never negative: sin(arcsin(x)) * (tan(-1) + 2/x) is 2 from each side and was NaN, and sqrt(x^2)^(-3/2) +oo. Those are read now. That makes tan(x/2) at pi real on both sides, and it asked its two sides in full again each time, though the descent had answered them +oo and -oo -- the one-sided path returns the descent's value first, so they differ again -- and the definite integral of 1/(2 + cos(x)) over [0, pi] ran out of its budget of limits. Both sides are asked again only where one came back NaN. limitcheck, DEPTH=3, seeds 14, 16, 19, 23, 26, 29 against master 53ce725: compared 30980 -> 30987, the limit is NaN where the values settle 79 -> 75, the wrong values unchanged. Found at SEED=29; no issue was filed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2364 +/- ##
==========================================
- Coverage 86.79% 86.79% -0.01%
==========================================
Files 312 312
Lines 68825 68855 +30
Branches 20053 20063 +10
==========================================
+ Hits 59735 59761 +26
- Misses 4907 4910 +3
- Partials 4183 4184 +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.
1/abs(x)at 0 wasNaN, which claims the limit does not exist. It is+oo, and 2.6.0 saysNaNtoo.The sign a vanishing divisor keeps was read off its derivatives. The derivative of
abs(x)issgn(x), 0 at 0, and there is nothing after it. So each side was left unevaluated, and the two descents not matching made the two-sided limitNaN.An absolute value is now never negative by its form, and so is a real power, product or quotient of such things. A divisor of that kind vanishes from above, and a power of it to an exponent tending to a negative number tends to
+oo.Two sides that agree are promoted to the two-sided limit only for an expression shown real on both sides. That check knew nothing of an absolute value, a sine, a cosine, an arctangent or an arcsine, nor of a real power of something never negative. So
sin(arcsin(x)) * (tan(-1) + 2/x), which is 2 from each side, wasNaN, andsqrt(x^2)^(-3/2), which is+oo, wasNaNtoo. Those are read now. Where the sides differ, as forx / abs(x), the limit is stillNaN. The test pins five such cases, including thex^xconvention.One cost had to be paid back. Reading the sine and cosine as real makes
tan(x/2)atpireal on both sides. Each time, it then asked its two sides in full again, though the descent had already answered them+ooand-oo. The one-sided path returns the descent's value first, so asking again can only give the same pair. The definite integral of1/(2 + cos(x))over[0, pi]ran out of its budget of limits on that. Both sides are now asked again only where one of them came backNaN.limitcheck, DEPTH=3, seeds 14, 16, 19, 23, 26 and 29, against master 53ce725:
Every answer that changed is recorded in BREAKING-CHANGES.md. Suite, AOT and the harnesses are green locally.
Found by limitcheck at
SEED=29; no issue was filed.🤖 Generated with Claude Code