Skip to content

Ask the side a complex argument of a step arrives from - #2355

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-step-of-a-complex-argument-near-a-real-limit
Nov 3, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-step-of-a-complex-argument-near-a-real-limit

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

limitcheck found this at DEPTH=3, SEED=18. No issue was filed.

2.6.0 and master now
limitright(floor(4^((-1)^x)), x, 1) 0, where every floor near 1 is -i unevaluated
limitleft(ceil(4^((-1)^x)), x, 1) 1, where it is 1 + i unevaluated
limitleft(floor(4^((-1)^x)), x, 1) 0, right unevaluated
floor(sqrt(x)) at 4, floor(x^x) at 2, floor(ln(x)) at 1 from the left 1 / 2, 3, -1 unchanged

The limit of a floor or a ceil read its argument as real along the path, and the code said so: "an argument that is complex near the destination and real at it can still be answered here when it should not be". 4^((-1)^x) at 1 from the right tends to 1/4 from below the real line. Floor is taken part by part (floor(1/4 - 0.001i) is -i), so the limit is -i, and the floor of the limit, 0, was the answer.

  • Where the limit is real, the argument is evaluated at an exact point just off the destination on each side approached. Real there, it is read as before.
  • Not real there, the side its imaginary part arrives from (SignNear(Im(argument))) decides the imaginary step, and where that is not decided the limit is declined.
  • TreeAnalyzer.IsRealValued is asked first, but it does not list x^x. Asked alone, it declined floor(x^x) at 1, 1/2 and 2, which the limitcheck diff showed. The sample sends a limit only to the question or to declining, never to an answer of its own.
  • For 4^((-1)^x) the imaginary part's side is not decided, so the left limit, which was right, is declined with the right one. Answering it would need a sign rule for Im of a complex power; NaN or a wrong value would be worse than unevaluated.

limitcheck: at DEPTH=3, SEED=18 the two wrong limits go, and the only declined limits added are these four. At SEED=16 the declined limits are master's exactly.

Tests: AStepOfAComplexArgumentNearARealLimitTest, 9 cases. The 3 that must be declined fail on master; the 6 real ones pass on both. The full suite, AOT and the nine harnesses pass. There is a BREAKING-CHANGES entry, measured on 2.6.0.

🤖 Generated with Claude Code

The limit of a floor or a ceil read its argument as real along the path.
4^((-1)^x) at 1 from the right tends to 1/4 from below the real line,
where every floor is -i, and the limit was the floor of 1/4, 0; ceil
from the left was 1 where it is 1 + i. 2.6.0 answers the same.

Where the limit is real and the argument is not real just off the
destination, at an exact point on each side approached, the side its
imaginary part arrives from decides the imaginary step, and where that is
not decided the limit is declined. TreeAnalyzer's realness does not list
x^x, and asked first it declined floor(x^x) at 1, 1/2 and 2; the point
sample sends a limit only to the question or to declining, never to an
answer. For 4^((-1)^x) the side is not decided, so the left limit, which
was right, is declined with the right one.

limitcheck at DEPTH=3, SEED=18 loses its two wrong limits and no other
answer; on SEED=16 the declined limits are master's exactly.

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

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.77%. Comparing base (0116c08) to head (97aa232).

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2355      +/-   ##
==========================================
+ Coverage   86.75%   86.77%   +0.01%     
==========================================
  Files         312      312              
  Lines       68753    68777      +24     
  Branches    20025    20034       +9     
==========================================
+ Hits        59648    59679      +31     
+ Misses       4921     4912       -9     
- Partials     4184     4186       +2     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.31% <80.76%> (+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 Δ
...nctions/Continuous/Limits/Solvers/Limit.Classes.cs 72.90% <80.76%> (+0.66%) ⬆️

... and 8 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 5df9686 into master Nov 3, 2026
37 of 38 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 3, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the a-step-of-a-complex-argument-near-a-real-limit branch November 3, 2026 20:34
Rafael-SOWNet added a commit that referenced this pull request Nov 3, 2026
Since #2355 a floor or a ceil whose argument is real at the destination
and complex just off it declines its own limit, and SolveBySubstitution,
which reads an expression's value at the destination, answered the
expression it is in anyway: x / floor(arcsin(x)) at 1 from the right was
1, the value at 1, where the floor all the way in is 1 - i and the
quotient (1 + i)/2; at -1 from the left it was 1/2 for (2 - i)/5. 2.6.0
answers the same. The substitution declines such a step as it already
declines one that sits on a jump.

And #2355 asked whether an argument was real at the integer 10^6 on the
way to an infinity, which for 1/x! built 10^6!: the limit of floor(1/x!)
at +oo went from 93 ms to 3.9 s. Both checks now take the argument at the
decimal 1e6 with the downcasting off, as limitcheck samples, and it is
back to about 0.2 s.

limitcheck at SEED=16 and at DEPTH=3 on SEED=18 and 19 changes only the
two wrong limits, now unevaluated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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