Repository navigation
Cancel any factor written on both sides of a l'Hopital quotient - #2378
Merged
Merged
Conversation
l'Hopital's rule turns ln(sinh(x)^3) into a quotient with (e^x - e^(-x))^2 above and (e^x - e^(-x))^3 below, and the shared factor was differentiated with everything else until the budget ran out: (sinh(x)^3)^tan(x) at 0, which is 1, was unevaluated from each side, and NaN in 2.6.0. A factor that is not a polynomial is now divided out where it is built from functions analytic where they are defined -- no abs, sign, step or piecewise, which can be 0 on one side only -- and is plainly not 0 at a sample point, so an identity that evaluates to a rounding error is not cancelled. Such a factor's zeros fill no interval, so where the cancelled quotient has a limit the original has the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2378 +/- ##
==========================================
- Coverage 86.77% 86.76% -0.02%
==========================================
Files 312 312
Lines 69033 69036 +3
Branches 20133 20134 +1
==========================================
- Hits 59906 59898 -8
- Misses 4918 4928 +10
- Partials 4209 4210 +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.
l'Hopital's rule turns
ln(sinh(x)^3)into a quotient with(e^x - e^(-x))^2above and(e^x - e^(-x))^3below. #2377 divides out a factor written on both sides, but only a polynomial one, so this shared factor was differentiated with everything else until the rule's budget ran out.(sinh(x)^3)^tan(x)at 0 was left unevaluated from each side, where it is 1. 2.6.0 answered NaN.A factor that is not a polynomial is now cancelled the same way, on two conditions:
abs(x) - xis, so a factor holding one is not cancelled.sin(x)^2 + cos(x)^2 - 1is 0 but may evaluate to a rounding error, and it is not cancelled.(sinh(x)^3) ^ tan(x), from the leftNaN1(sinh(x)^3) ^ tan(x), from the rightNaN1x / cos(x) * ln(sinh(x)^3), from the rightNaN0sin(x) / cos(x) * ln((e^x - 1)^3), from the rightNaN0The two-sided limit of the first stays NaN. The base is negative on the left, so the power takes the complex branch there, and the two-sided convention for that is #2365's open question.
Measured
DEPTH=3, across 39 seeds against master: two more limits answered atSEED=62, both agreeing with the values, and nothing else moved.Found by limitcheck at
SEED=62; no issue was filed.🤖 Generated with Claude Code