Skip to content

Read the limit of a modulus as the quotient or product of moduli - #2371

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
fix/a-modulus-of-a-quotient-is-a-quotient-of-moduli
Nov 4, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
fix/a-modulus-of-a-quotient-is-a-quotient-of-moduli

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

abs(1/x^pi) at 0 was NaN, the claim that the limit does not exist. It is +oo from both sides, as 1/abs(x)^pi is.

The modulus took its argument's limit and nothing else. To the left of 0, x^pi is complex, so there was no reading of which sign 1/x^pi's divisor vanishes with. That side had no limit, and the two-sided limit was NaN. 2.6.0 gives the same results.

Now, where the argument's limit gives the modulus no value, the modulus of a quotient is read as the quotient of the moduli, and of a product as the product. Both hold for complex values. Read that way, the divisor vanishes from above, and the existing vanishing-divisor reading answers it. A modulus that already has a limit as written keeps it, and the tests pin three of those.

Input, at 0 2.6.0 and master Now
abs(1/x^pi) NaN; unevaluated from the left +oo
abs(1/sqrt(x)) NaN +oo
abs(2/x^(3/2)) from the left unevaluated +oo
abs(log(cos(x), -1)), which is π/|ln cos x| NaN; unevaluated from the right +oo

Measured

  • limitcheck at DEPTH=3 on 21 seeds (14 to 51), master against this branch: 3 more rows compared, across 2 seeds. Those are the two NaNs above, abs(1/x^pi) at seed 51 and abs(log(cos(x), -1)) at seed 41. No other row changed.
  • The new tests fail on master: the three infinite rows I ran before adding the fourth. The three "keeps what it had" rows pass on both.
  • Suite: 18988 passed, 0 failed. AOT passed. BoundCheck, RootCheck, CasBench, PropCheck, SimpSweep, RuleCheck, CanonCheck and Confluence are clean.

Recorded in BREAKING-CHANGES.md.

🤖 Generated with Claude Code

abs(1/x^pi) at 0 was NaN, the claim that the limit does not exist,
where it is +oo from both sides, as 1/abs(x)^pi is. The modulus took its
argument's limit and nothing else. To the left of 0, x^pi is complex, so
the sign 1/x^pi's divisor vanishes with could not be read: that side had
no limit, and the two-sided limit was NaN. The same on 2.6.0.

Where the argument's limit gives the modulus no value, the modulus of a
quotient is now read as the quotient of the moduli, and of a product as
the product. Both hold for complex values. Read that way, the divisor
vanishes from above, which the vanishing-divisor reading already
answers. abs(log(cos(x), -1)) at 0, which is pi / abs(ln(cos(x))), is
+oo for the same reason.

limitcheck at DEPTH=3, 21 seeds 14-51, master against this: 3 more
compared over 2 seeds, the two NaNs above answered, and nothing else
changed. Suite 18988 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 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.77%. Comparing base (fdc586f) to head (4676d3d).

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2371      +/-   ##
==========================================
+ Coverage   86.76%   86.77%   +0.01%     
==========================================
  Files         312      312              
  Lines       68897    68908      +11     
  Branches    20078    20081       +3     
==========================================
+ Hits        59777    59798      +21     
+ Misses       4923     4912      -11     
- Partials     4197     4198       +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.32% <75.00%> (+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.23% <75.00%> (+0.29%) ⬆️

... and 4 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 598dae9 into master Nov 4, 2026
32 of 35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 4, 2026
@Rafael-SOWNet

Copy link
Copy Markdown
Member Author

Merged without the three macOS jobs. They were cancelled before they started ("The job was not acquired by Runner of type hosted even after multiple attempts"), the same macOS arm64 outage as on #2368–#2370. In their place:

  • I ran this PR's rows on a 512 KB thread, the tightest stack the macOS leg gives, along with x * ln(x). Each limit came out as the tests expect.
  • The branch sits on current master, so there was nothing to trial-merge.
  • Every Linux and Windows check is green.
  • The local chain, suite and harnesses all passed.

@Rafael-SOWNet
Rafael-SOWNet deleted the fix/a-modulus-of-a-quotient-is-a-quotient-of-moduli branch November 4, 2026 20:19
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