Skip to content

Take agreeing sides for the two-sided limit where the expression is real on both - #2336

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-limit-real-on-both-sides-is-where-the-sides-agree
Nov 2, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-limit-real-on-both-sides-is-where-the-sides-agree

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Found by limitcheck at seed 11. No issue was filed.

Under the complex codomain, which is the default, two one-sided limits that agree were not taken for the two-sided one. That rule exists for x^x, which has a limit from the left only through its complex values and no two-sided limit over the reals (LimitTest.TestNoLimit pins this). But it also caught expressions that are real on both sides:

2.6.0 and master this PR
(x^2)^x at 0 NaN 1
(x*x)^(x - 1) at 0 NaN +oo
x^x at 0 NaN NaN

NaN says the limit does not exist, and each side is 1 (or +oo).

Agreeing sides are now taken for the two-sided limit where the expression is real on both sides of the point. That is decided structurally: every power to an exponent that is not whole, and every logarithm, must have a base that is positive on both sides, by SignNear. Anything not listed counts as not real, which costs coverage, never correctness.

limitcheck, 600 expressions at each of seeds 1, 7 and 11: the findings and counts are master's, except at seed 11, where the (x*x)^(x - 1) row is gone.

Tests: the three cases in ALimitRealOnBothSidesTest fail on master; the two controls, x^x and (x/pi)^x, pass on both. There is a BREAKING entry, A two-sided limit of an expression real on both sides is where its sides agree.

🤖 Generated with Claude Code

…eal on both

Under the complex codomain, the default, two one-sided limits that agree
were not taken for the two-sided one: x^x has a limit from the left only
through its complex values, and no two-sided limit over the reals.
(x^2)^x is real on both sides of 0 and tends to 1 from each, and its
two-sided limit was NaN, the claim that there is none.

They are now taken for it where the expression is real on both sides,
decided structurally: every power to an exponent that is not whole, and
every logarithm, has a base positive on both sides by SignNear. x^x is
still NaN at 0.

| | 2.6.0 and master | now |
|---|---|---|
| (x^2)^x at 0 | NaN | 1 |
| (x*x)^(x - 1) at 0 | NaN | +oo |

limitcheck, 600 expressions at each of seeds 1, 7 and 11: the findings
are master's but for the (x*x)^(x - 1) row at seed 11, which is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Nov 2, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Nov 2, 2026
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.77%. Comparing base (a7785bc) to head (f4189bc).

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2336      +/-   ##
==========================================
+ Coverage   86.76%   86.77%   +0.01%     
==========================================
  Files         312      312              
  Lines       68526    68547      +21     
  Branches    19935    19946      +11     
==========================================
+ Hits        59458    59485      +27     
+ Misses       4907     4902       -5     
+ Partials     4161     4160       -1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.32% <86.95%> (+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 89.72% <86.95%> (+0.70%) ⬆️

... and 5 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 9f4b3a6 into master Nov 2, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 2, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the a-limit-real-on-both-sides-is-where-the-sides-agree branch November 2, 2026 20:27
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