Repository navigation
Do not read an infinity in an expression as a coefficient - #2374
Merged
Merged
Conversation
log(x, 0) is ln(0) / ln(x), and ln(0) is -oo, so between 0 and 1 it is +oo at every point; its limit at 0 from the right was 0. An infinity that does not depend on the variable was read as a coefficient: the polynomial readers took -oo / x for a constant over a line, which tends to 0, and the product and quotient descents put the other part's limit in its place, so +oo * x at 0 became +oo * 0, which folds to 0. The polynomial reader now declines a monomial whose coefficient evaluates to an infinity, and the descent answers such an infinity with its sign times the sign the other part keeps on the way in. Where that sign changes at the destination nothing is claimed one-sidedly, and two-sided the sides disagree and the limit is NaN. A coefficient that evaluates to NaN is declined too: 1 ^ log(1 - x, x - x) near 1/2 is 1 at every point and was answered NaN; it is left unevaluated now. limitcheck at DEPTH=3 over 27 seeds: one "another value" removed (seed 57), eleven NaN answers where the values settle removed (seeds 19, 45 and 56), no case lost. Found by limitcheck at SEED=55 and SEED=57; 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 #2374 +/- ##
=======================================
Coverage 86.76% 86.77%
=======================================
Files 312 312
Lines 68953 68979 +26
Branches 20096 20107 +11
=======================================
+ Hits 59828 59854 +26
+ Misses 4921 4920 -1
- Partials 4204 4205 +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.
log(x, 0)isln(0) / ln(x). Sinceln(0)is-oo, it is+ooat every point between 0 and 1, but its limit at 0 from the right was0. An infinity that does not depend on the variable was read as a coefficient:-oo / xfor a constant over a line, which tends to 0.+oo * xat 0 became+oo * 0, which folds to 0.The polynomial reader now declines a monomial whose coefficient evaluates to an infinity. The descent answers such an infinity with its own sign times the sign the other part keeps on the way in. Where that sign changes at the destination, nothing is claimed one-sidedly, and the two-sided limit is NaN.
A coefficient that evaluates to NaN is declined too. Near 1/2,
1 ^ log(1 - x, x - x)is 1 at every point, but it was answered NaN. It is now left unevaluated.log(x, 0)at 0, right0+oolog(x, 0)at +oo0-oo-oo / xat +oo0-oo+oo * xat 0, right0+ooarctan(log(sinh(x), 0))at 0, rightpi / 21 ^ log(1 - x, x - x)at 1/2NaNUnchanged:
+oo * xat 0, two-sided, is NaN.5 / xat +oo is 0.x * ln(x)at 0, two-sided, is NaN.The entry is in
BREAKING-CHANGES.md.Tests:
AnInfinityIsNotACoefficientTesthas 13 cases. 9 of them fail on master.Measured:
DEPTH=3over 27 seeds, against master: one "another value" gone (seed 57), eleven NaN answers where the values settle gone (seeds 19, 45 and 56), no case lost.Not fixed:
log(log(2x, 0), x)at 0 from the right is still+oowhere it should be 0. Its inner part is+ooat every point, which is infinity arithmetic proper (#1019).Found by limitcheck at
SEED=55andSEED=57. No issue was filed.🤖 Generated with Claude Code