Repository navigation
Ask a quotient factor whole before l'Hopital's rule splits it - #2382
Merged
Merged
Conversation
l'Hopital's rule takes out of each side a factor that tends to a finite number other than 0, since the product rule only carries it along. The factors were read after flattening the product, which takes a quotient apart: tanh(x) written through exponentials is (e^(2x) - 1) / (e^(2x) + 1), which tends to 1 at +oo, while its parts tend to +oo and to 0 and neither was taken out. tanh(x) * x / (x + tanh(x)) at +oo then differentiated the whole of tanh and did not finish. A quotient is now asked whole first, and taken apart only where it does not settle at such a number. tanh(x) * x / (x + tanh(x)) at +oo: did not finish in 60 s -> 1. 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 #2382 +/- ##
==========================================
- Coverage 86.77% 86.77% -0.01%
==========================================
Files 312 312
Lines 69095 69107 +12
Branches 20151 20155 +4
==========================================
+ Hits 59957 59967 +10
- Misses 4921 4923 +2
Partials 4217 4217
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.
tanh(x) * x / (x + tanh(x))at +oo is 1, but the limit did not finish (60 s on 2.6.0, 30 s on master).l'Hopital's rule takes out a factor that tends to a finite number other than 0, since differentiating only carries it along (#2377). It read the factors after flattening the product, and flattening takes a quotient apart. tanh(x) written through exponentials is
(e^(2x) - 1) / (e^(2x) + 1): the whole tends to 1, but its parts tend to +oo and to 0, so neither was taken out and the whole of tanh was differentiated over and over.A quotient factor is now asked whole first, and split only when the whole does not settle at such a number.
tanh(x) * x / (x + tanh(x)), +oo1(0.35 s)At -oo the limit is still -1. #2377's code comment named this case but tested only -oo; this PR adds +oo to
LhopitalKeepsTheDerivativesSmallTest.Measured
DEPTH=3, across 42 seeds against master: identical on every seed. The generator does not build this quotient shape, so the test is the evidence for the change.Found while tracing a limitcheck row; no issue was filed.
🤖 Generated with Claude Code