Repository navigation
Read a limit of a quotient over a quotient as a quotient of products - #2394
Merged
Merged
Conversation
The descent read a / (b / c) as written. x^(-pi) / (ln(2) / ln(x)) at +oo is then 0/0, and l'Hopital's rule makes each step another 0 * oo with a higher power of ln(x), so it was left unevaluated where x^(-pi) ln(x) / ln(2), the same function, is 0. log(x, 2) is ln(2) / ln(x), so x^(-pi) / log(x, 2) was left unevaluated too. Where b is a constant, the quotient is now read first as a c / b, which it equals wherever it has a value, and that reading is kept only where it gives one. x ln(x) at 0 comes back from the descent as 0 * (-oo), and taking that as the answer made x / log(x, 2) from both sides of 0 NaN where it is 0; there the quotient is read as written, as before. Over a b that is not constant, x^x / (x / x) read as x^x x / x took twenty times as long. 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 #2394 +/- ##
==========================================
- Coverage 86.81% 86.80% -0.01%
==========================================
Files 312 312
Lines 69224 69228 +4
Branches 20186 20187 +1
==========================================
- Hits 60097 60096 -1
- Misses 4912 4916 +4
- Partials 4215 4216 +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.
In a limit,
a / (b / c)withbconstant is now read first asa c / b, which it equals wherever it has a value. That reading is kept only where it gives a value.Why. Read as written,
x^(-pi) / (ln(2) / ln(x))at +oo is 0/0. Each l'Hôpital step gives another 0·∞ with a higher power ofln x, so the limit was left unevaluated. The same function writtenx^(-pi) ln(x) / ln(2)is 0 at once.log(x, 2)isln(2) / ln(x), so any logarithm in a divisor ran into this.Why only a value is kept. The descent returns
x ln(x)at 0 as0 * (-oo). Returning that madex / log(x, 2)NaN from both sides of 0, where it is 0. That would have been nine losses in limitcheck, all two-sided at a finite point. In those cases the quotient is read as written, as before.Why only over a constant
b. Read as a product,x^x / (x / x)becamex^x x / x. That took twenty times as long, and it answered 1 from both sides of 0, wherex^xitself is NaN.x^(-pi) / log(x, 2)at +oo0x^(-pi) / (ln(2) / ln(x))at +oo0(1/x)^pi / log(1/x, 2)at +oo0(0.2 s)arcsin(pi + x) / (1/x)at 0, either side or both0tan(1/2) / log(x, -1) / tanh(sin(x))at 1 from the left0tan(1/2) / log(x, -1) / tanh(sin(x))at 1NaNNaN0tanh(exp(pi)) / log(log(-1, x), 2)at −10NaN0Measured
floor(sinh(2)^log(2, x))at 0 from the right still answers 0, but now takes 6.8 s where master takes 5.7 s (three runs each). It crossed limitcheck's 5 s cap.x^pi / log(x, 2) - 2at 0 from the right still takes 12 s. The product reading's descent gives0 * (-oo)there.Tests:
AQuotientOverAQuotientTestpins the new answers. It also pins two two-sided rows that must stay as master reads them:x / log(x, 2)at 0 andx ^ log(pi + 1, x - 1)at 1.BREAKING-CHANGES.md has an entry. Found by limitcheck; no issue was filed.
🤖 Generated with Claude Code