Skip to content

A complex constant does not make the two sides of a limit differ - #2376

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
feature/a-complex-constant-is-the-same-on-both-sides
Nov 6, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
feature/a-complex-constant-is-the-same-on-both-sides

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Where the descent cannot compare the two sides of a limit, each side is asked through the whole of the machinery, but only of an expression IsRealOnBothSides passes, and that check required every constant to be real. pi^2 / log(x, -2) is pi^2 ln(x) / ln(-2), 0 from each side of 1, and its two-sided limit was NaN.

A constant is the same number on both sides, so a complex one cannot make them differ. It is now accepted, and what depends on x is read as before.

Input, two-sided 2.6.0 / master This PR
pi^2 / log(x, -2) at 1 NaN 0
(log(1/2, 1) + pi^2) / log(x, -2) at 1 NaN 0
log(x ^ (-1), -1) ^ 2 at 1 NaN -oo
x^x, x ln(x), x^i, i sgn(x), (2 + i)/x at 0; ln(-2)/ln(x) at 1 NaN NaN

Measured

  • Suite, wrappers, AOT and the harnesses are green.
  • limitcheck at DEPTH=3, across 39 seeds against master: eight two-sided NaNs are answered, all correct, and nothing else moved.
  • One cost: tanh(log(x, -1) - tan(x)) at 1 is still NaN, but asking both sides now takes 14 s where it took 3 s. On master each one-sided limit of it already takes 4–6 s, and that slowness is a separate defect.

Found by limitcheck at SEED=69; no issue was filed.

🤖 Generated with Claude Code

Where the descent cannot compare the two sides of a limit, each side is
asked through the whole of the machinery, but only of an expression that
IsRealOnBothSides passes, and that check required every constant to be
real. pi^2 / log(x, -2) is pi^2 ln(x) / ln(-2), 0 from each side of 1,
and its two-sided limit was NaN. A constant is the same number on both
sides, so a complex one cannot make them differ; it is now accepted, and
what depends on x is read as before. x^x, x ln(x), x^i, i sgn(x) and
(2 + i)/x at 0 stay NaN.

limitcheck at DEPTH=3 over 39 seeds: eight two-sided NaNs answered
(0, -oo, pi/2 among them), no other move. tanh(log(x, -1) - tan(x)) at 1
is still NaN; asking both sides now takes 14 s where it took 3 s, since
each one-sided limit of it takes 4-6 s on master already.

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

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.77%. Comparing base (60e6638) to head (bfe7fff).

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2376   +/-   ##
=======================================
  Coverage   86.77%   86.77%           
=======================================
  Files         312      312           
  Lines       68987    68987           
  Branches    20112    20112           
=======================================
  Hits        59862    59862           
+ Misses       4920     4919    -1     
- Partials     4205     4206    +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.31% <0.00%> (ø)
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.40% <0.00%> (-0.47%) ⬇️

... 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 4283f8b into master Nov 6, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 6, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/a-complex-constant-is-the-same-on-both-sides branch November 6, 2026 21:49
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