Skip to content

Take a derivative before its limit, and put no limit in a bound variable - #2390

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
feature/limit-of-a-binder
Nov 8, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
feature/limit-of-a-binder

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

A limit of a derivative or limit node put the point into the node's own variable. A derivative became derivative(0, 0), a derivative by a number, or a constant differentiated to 0. An inner limit became limit(cos(1), 1, 0). 2.6.0 had wrong answers on the same inputs.

Limit 2.6.0 master this PR
derivative(sqrt(x), x) at 0+ 0 derivative(0, 0) +oo
derivative(ln(sqrt(x) cos x), x) at 0+ 0 0 +oo
derivative(sin(x)/x, x) at 0 NaN derivative(1, 0) 0
derivative(abs(x), x) at 0+ 1 derivative(0, 0) 1
derivative(x^3, x, 2) at 1 +oo 6 6
derivative(ln(x y), y) at 0+ 1 / y 0 unevaluated
limit(sqrt(x) cos(x)/x, x, 0) at 1+ NaN limit(cos(1), 1, 0) unevaluated
  • Derivatives: a derivative with a closed form is taken before the limit, and its limit is the limit of that function. The condition differentiating attaches, such as 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 why derivative(ln(x y), y) is unevaluated: whether x y is 0 depends on y.
  • Limits: a limit over another variable is computed through, and a limit over the same variable is constant in it. An inner limit's variable is never substituted into. The last row is unevaluated rather than 2.6.0's 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

Rafael-SOWNet and others added 2 commits November 8, 2026 11:04
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>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Nov 8, 2026
@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.11111% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.80%. Comparing base (88f5f3c) to head (7773056).

Files with missing lines Patch % Lines
...nctions/Continuous/Limits/Solvers/Limit.Classes.cs 0.00% 4 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.34% <61.11%> (+0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ns/Continuous/Limits/Solvers/Solvers.Definition.cs 92.01% <100.00%> (+0.34%) ⬆️
...nctions/Continuous/Limits/Solvers/Limit.Classes.cs 76.15% <0.00%> (+0.17%) ⬆️

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rafael-SOWNet
Rafael-SOWNet merged commit 6a14757 into master Nov 8, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 8, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/limit-of-a-binder branch November 8, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant