镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Leave a two-sided limit unevaluated where a side stops at an indeterminate form - #2419

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
feature/an-undecided-side-leaves-a-two-sided-limit-unevaluated
Nov 13, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
feature/an-undecided-side-leaves-a-two-sided-limit-unevaluated

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

A two-sided limit at a finite point compares the limits from each side. When a side came back NaN, the answer was NaN, which means "this does not exist". But the descent also returns NaN internally for an indeterminate form it could not resolve. For x * floor(2/x) at 0 that form is 0 * floor(-oo), and each side is 2. That NaN means "undecided", and turning it into a two-sided NaN gave a wrong answer where the library had decided nothing.

When the sides are asked outright, a side that stops at an indeterminate form with an infinity in it now counts as undecided, and the two-sided limit stays unevaluated. NaN is still the answer when:

  • a side settles as NaN;
  • the indeterminate form has only finite parts, such as 0/0 for (x - x)/(x - x) or ln(-2)/0 for ln(-2)/ln(x) at 1. These have no value anywhere near the point.
Input, at 0, two-sided true value 2.6.0 master this branch
x * floor(2/x) 2 NaN NaN unevaluated
floor(1/x) * sin(x) 1 NaN NaN unevaluated
x^2 * floor(1/x^2) 1 0 NaN unevaluated
x * ceil(1/x) 1 NaN NaN unevaluated
floor(2/x) none NaN NaN NaN
floor(x) none unevaluated NaN NaN
sin(1/x) none NaN NaN NaN
(x-x)*sin(x)/((x-x)*x) none NaN NaN NaN
(abs(x)^(x/pi))^sgn(x) 1 unevaluated 1 1

The first four rows are in BREAKING-CHANGES.md. Answering them with their values needs the floor's 0 * oo resolved from each side, which is a separate change; this one stops the wrong answer. The new test checks that the four rows stay limit(...) nodes, and that the rows without a limit stay NaN.

Checked on this branch:

  • Tests: UnitTests 19330 passed, plus the MCP, Terminal, InteractiveWrapper and F# wrapper suites, and the AOT smoke test.
  • Harnesses: BoundCheck, RootCheck, CasBench, PropCheck, SimpSweep, RuleCheck, CanonCheck and Confluence all pass.
  • limitcheck at DEPTH=3, COUNT=600, on 42 seeds against master: no answer changed. On seed 45, tanh(log(x, -1) - tan(x)) at 1 from the right moved into "did not finish in 5 s". It takes 6.2 to 6.6 s on master and 6.3 to 7.1 s on this branch, and is unevaluated on both, so the 5 s cap decides which list it lands in.

🤖 Generated with Claude Code

…inate form

A two-sided limit at a finite point compares its sides. When one came back
NaN, the answer was NaN: "this does not exist". But the descent also
returns NaN for an indeterminate form it could not resolve, such as
0 * floor(-oo) for x * floor(2/x) at 0, whose sides are 2 from each
direction. That NaN means "undecided", and turning it into a two-sided NaN
answered wrongly where the library had not decided anything.

When the sides are asked outright, a side that stops at an indeterminate
form with an infinity in it now counts as undecided, and the two-sided
limit stays unevaluated. A side that settles as NaN still makes the
two-sided limit NaN. So does an indeterminate form with only finite parts,
such as 0/0 for (x - x)/(x - x), which does not exist anywhere near the point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.81%. Comparing base (15070c6) to head (20cffb8).

Files with missing lines Patch % Lines
...ns/Continuous/Limits/Solvers/Solvers.Definition.cs 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2419   +/-   ##
=======================================
  Coverage   86.81%   86.81%           
=======================================
  Files         312      312           
  Lines       69514    69523    +9     
  Branches    20300    20305    +5     
=======================================
+ Hits        60348    60356    +8     
- Misses       4932     4933    +1     
  Partials     4234     4234           
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.35% <94.11%> (+<0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 39.81% <ø> (ø)

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.28% <94.11%> (+0.58%) ⬆️

... and 7 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 6d5f175 into master Nov 13, 2026
37 of 38 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 13, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/an-undecided-side-leaves-a-two-sided-limit-unevaluated branch November 13, 2026 11:13
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