Repository navigation
Take a derivative before its limit, and put no limit in a bound variable - #2390
Merged
Merged
Conversation
A limit of a derivative is the limit of the function the derivative is. Read as a node, the point was put in before differentiating, and the variable differentiated by, or the one an inner limit is taken in, was read as a value to put a limit in. Three wrong answers came of it at 0 from the right: derivative(ln(x y), y) was 0, the derivative of the constant ln(0), where it is 1 / y; derivative(ln(sqrt(x) cos(x)), x) was 0, where it tends to +oo; and derivative(sqrt(x), x) came back derivative(0, 0). derivative(sin(x) / x, x) at 0 came back derivative(1, 0), and limit(sqrt(x) cos(x) / x, x, 0) at 1 came back limit(cos(1), 1, 0). A derivative that closes is now taken at the entry, inner-simplified, and the condition differentiating states for it is dropped where it holds on each side approached: 1 / x provided not x = 0 is 1 / x on the way in to 0. One that does not close is no longer read through its parts. A limit in the variable approaching is its own limit, and the variable of any inner limit is left as it is. derivative(ln(x y), y) at 0 is left unevaluated: whether x y is 0 near x = 0 depends on y. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2390 +/- ##
==========================================
+ Coverage 86.79% 86.80% +0.01%
==========================================
Files 312 312
Lines 69213 69223 +10
Branches 20181 20186 +5
==========================================
+ Hits 60073 60092 +19
+ Misses 4923 4915 -8
+ Partials 4217 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.
A limit of a
derivativeorlimitnode put the point into the node's own variable. A derivative becamederivative(0, 0), a derivative by a number, or a constant differentiated to 0. An inner limit becamelimit(cos(1), 1, 0). 2.6.0 had wrong answers on the same inputs.derivative(sqrt(x), x)at 0+0derivative(0, 0)+ooderivative(ln(sqrt(x) cos x), x)at 0+00+ooderivative(sin(x)/x, x)at 0NaNderivative(1, 0)0derivative(abs(x), x)at 0+1derivative(0, 0)1derivative(x^3, x, 2)at 1+oo66derivative(ln(x y), y)at 0+1 / y0limit(sqrt(x) cos(x)/x, x, 0)at 1+NaNlimit(cos(1), 1, 0)provided not x = 0, is dropped where it holds on each side approached. Where it cannot be decided, the limit is left unevaluated. That is whyderivative(ln(x y), y)is unevaluated: whetherx yis 0 depends ony.NaN, which was right; it is no longer malformed.Recorded in BREAKING-CHANGES.md. Test
ALimitOfABinderTest.The full check passed: unit, MCP, terminal, interactive and F# suites, AOT, and the ten harnesses. A limitcheck A/B against master changed no row.
🤖 Generated with Claude Code