Skip to content

Do not read an infinity in an expression as a coefficient - #2374

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
feature/a-logarithm-of-zero-has-a-limit
Nov 5, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
feature/a-logarithm-of-zero-has-a-limit

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

log(x, 0) is ln(0) / ln(x). Since ln(0) is -oo, it is +oo at every point between 0 and 1, but its limit at 0 from the right was 0. An infinity that does not depend on the variable was read as a coefficient:

  • The polynomial readers took -oo / x for a constant over a line, which tends to 0.
  • The product and quotient descents put the other part's limit in place of that part. So +oo * x at 0 became +oo * 0, which folds to 0.

The polynomial reader now declines a monomial whose coefficient evaluates to an infinity. The descent answers such an infinity with its own sign times the sign the other part keeps on the way in. Where that sign changes at the destination, nothing is claimed one-sidedly, and the two-sided limit is NaN.

A coefficient that evaluates to NaN is declined too. Near 1/2, 1 ^ log(1 - x, x - x) is 1 at every point, but it was answered NaN. It is now left unevaluated.

Limit 2.6.0 Now
log(x, 0) at 0, right 0 +oo
log(x, 0) at +oo 0 -oo
-oo / x at +oo 0 -oo
+oo * x at 0, right 0 +oo
arctan(log(sinh(x), 0)) at 0, right unevaluated pi / 2
1 ^ log(1 - x, x - x) at 1/2 NaN unevaluated

Unchanged:

  • +oo * x at 0, two-sided, is NaN.
  • 5 / x at +oo is 0.
  • The pinned x * ln(x) at 0, two-sided, is NaN.

The entry is in BREAKING-CHANGES.md.

Tests: AnInfinityIsNotACoefficientTest has 13 cases. 9 of them fail on master.

Measured:

  • The unit, MCP, terminal, interactive and F# suites pass.
  • AOT builds.
  • The boundcheck, rootcheck, casbench, propcheck, simpsweep, rulecheck, canoncheck and confluence harnesses all pass.
  • limitcheck at DEPTH=3 over 27 seeds, against master: one "another value" gone (seed 57), eleven NaN answers where the values settle gone (seeds 19, 45 and 56), no case lost.

Not fixed: log(log(2x, 0), x) at 0 from the right is still +oo where it should be 0. Its inner part is +oo at every point, which is infinity arithmetic proper (#1019).

Found by limitcheck at SEED=55 and SEED=57. No issue was filed.

🤖 Generated with Claude Code

log(x, 0) is ln(0) / ln(x), and ln(0) is -oo, so between 0 and 1 it
is +oo at every point; its limit at 0 from the right was 0. An infinity
that does not depend on the variable was read as a coefficient: the
polynomial readers took -oo / x for a constant over a line, which tends
to 0, and the product and quotient descents put the other part's limit
in its place, so +oo * x at 0 became +oo * 0, which folds to 0.

The polynomial reader now declines a monomial whose coefficient
evaluates to an infinity, and the descent answers such an infinity with
its sign times the sign the other part keeps on the way in. Where that
sign changes at the destination nothing is claimed one-sidedly, and
two-sided the sides disagree and the limit is NaN. A coefficient that
evaluates to NaN is declined too: 1 ^ log(1 - x, x - x) near 1/2 is 1
at every point and was answered NaN; it is left unevaluated now.

limitcheck at DEPTH=3 over 27 seeds: one "another value" removed (seed
57), eleven NaN answers where the values settle removed (seeds 19, 45
and 56), no case lost. Found by limitcheck at SEED=55 and SEED=57; no
issue was filed.

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

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.53846% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.77%. Comparing base (2d26789) to head (f6ebaf3).

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2374   +/-   ##
=======================================
  Coverage   86.76%   86.77%           
=======================================
  Files         312      312           
  Lines       68953    68979   +26     
  Branches    20096    20107   +11     
=======================================
+ Hits        59828    59854   +26     
+ Misses       4921     4920    -1     
- Partials     4204     4205    +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.31% <61.53%> (+<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.Solvers.cs 86.62% <100.00%> (+0.26%) ⬆️
...nctions/Continuous/Limits/Solvers/Limit.Classes.cs 73.27% <58.33%> (-1.14%) ⬇️

... 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 595d9b6 into master Nov 5, 2026
39 of 41 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 5, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/a-logarithm-of-zero-has-a-limit branch November 5, 2026 20: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