Skip to content

Ask a modulus's argument for its whole limit where its parts say nothing - #2372

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
fix/a-modulus-asks-its-arguments-whole-limit
Nov 4, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
fix/a-modulus-asks-its-arguments-whole-limit

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

abs(x * ln(x)) at 0 was NaN, the claim that the limit does not exist, and it was unevaluated from each side. The limit is 0 from both sides. The expression is real on both sides, and from the left |x|·|ln|x| + iπ| tends to 0 too.

The modulus took its argument's limit as the descent reads it, and the descent reads x * ln(x) as 0 · (-oo), which is NaN. 2.6.0 gives the same results.

Now, where that reading has no value, the modulus asks its argument's whole limit and takes the modulus of a value. It does this through AsTheWholeLimit, as a quotient already does: one level deep, and not under a limit budget.

On the two-sided convention (#2365): x * ln(x) and x^x stay NaN at 0, because neither has real values to the left. The tests pin both. A modulus of them does have real values on both sides, since |x^x| is |x|^x to the left of 0. So under the same convention abs(x^x) has a limit there, and it is now 1.

Input, at 0 2.6.0 and master Now
abs(x * ln(x)) NaN; unevaluated from each side 0
abs(sin(x) * ln(x)) NaN 0
abs(x^2 * ln(x)) NaN 0
abs(x^x) NaN 1

Measured

  • limitcheck at DEPTH=3 on 21 seeds (14 to 51), master against this branch: 20 more rows compared, across 8 seeds. 10 "NaN where the values settle" findings are answered. Each takes the modulus of something that holds a power like x^x at 0, for example abs(x^x), abs(sinh(x^x)) and abs(x + 1 - x^x). No row moved to another value.
  • The new tests fail on master: the three zero rows. The NaN rows pass on both.
  • Suite: 18994 passed, 0 failed. AOT passed. BoundCheck, RootCheck, CasBench, PropCheck, SimpSweep, RuleCheck, CanonCheck and Confluence are clean.

Found while checking #2371. Recorded in BREAKING-CHANGES.md.

🤖 Generated with Claude Code

abs(x * ln(x)) at 0 was NaN, the claim that the limit does not exist,
and unevaluated from each side, where it is 0 from both: it is real on
both sides, and from the left |x| |ln|x| + i pi| tends to 0 too. The
modulus took its argument's limit as the descent reads it, and the
descent reads x * ln(x) as 0 * -oo, which is NaN. The same on 2.6.0.

Where that reading has no value, the modulus now asks its argument's
whole limit, one level deep and outside a limit budget as a quotient
does, and takes the modulus of a value. x * ln(x) itself keeps the
two-sided convention, and so does x^x; abs(x^x), real on both sides
since |x^x| is |x|^x to the left of 0, is 1 there.

limitcheck at DEPTH=3, 21 seeds 14-51, master against this: 20 more
compared over 8 seeds, 10 NaNs where the values settle answered, each
taking the modulus of something that holds a power like x^x at 0 --
abs(x^x), abs(sinh(x^x)), abs(x + 1 - x^x) -- and nothing moved to
another value. Suite 18994 passed, AOT and the eight harnesses clean.

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

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.76%. Comparing base (598dae9) to head (4246612).

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2372      +/-   ##
==========================================
- Coverage   86.77%   86.76%   -0.01%     
==========================================
  Files         312      312              
  Lines       68908    68911       +3     
  Branches    20081    20082       +1     
==========================================
- Hits        59798    59794       -4     
- Misses       4912     4917       +5     
- Partials     4198     4200       +2     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.31% <83.33%> (-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 74.83% <83.33%> (+0.59%) ⬆️

... and 6 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 eda9e03 into master Nov 4, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 4, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the fix/a-modulus-asks-its-arguments-whole-limit branch November 4, 2026 21:44
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