Skip to content

Read a limit of a quotient over a quotient as a quotient of products - #2394

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
feature/limit-of-a-quotient-over-a-quotient
Nov 9, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
feature/limit-of-a-quotient-over-a-quotient

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

In a limit, a / (b / c) with b constant is now read first as a c / b, which it equals wherever it has a value. That reading is kept only where it gives a value.

Why. Read as written, x^(-pi) / (ln(2) / ln(x)) at +oo is 0/0. Each l'Hôpital step gives another 0·∞ with a higher power of ln x, so the limit was left unevaluated. The same function written x^(-pi) ln(x) / ln(2) is 0 at once. log(x, 2) is ln(2) / ln(x), so any logarithm in a divisor ran into this.

Why only a value is kept. The descent returns x ln(x) at 0 as 0 * (-oo). Returning that made x / log(x, 2) NaN from both sides of 0, where it is 0. That would have been nine losses in limitcheck, all two-sided at a finite point. In those cases the quotient is read as written, as before.

Why only over a constant b. Read as a product, x^x / (x / x) became x^x x / x. That took twenty times as long, and it answered 1 from both sides of 0, where x^x itself is NaN.

Limit 2.6.0 master this PR
x^(-pi) / log(x, 2) at +oo unevaluated unevaluated 0
x^(-pi) / (ln(2) / ln(x)) at +oo unevaluated unevaluated 0
(1/x)^pi / log(1/x, 2) at +oo unevaluated unevaluated (6.4 s) 0 (0.2 s)
arcsin(pi + x) / (1/x) at 0, either side or both unevaluated unevaluated 0
tan(1/2) / log(x, -1) / tanh(sin(x)) at 1 from the left unevaluated unevaluated 0
tan(1/2) / log(x, -1) / tanh(sin(x)) at 1 NaN NaN 0
tanh(exp(pi)) / log(log(-1, x), 2) at −1 0 NaN 0

Measured

  • limitcheck (depth 3, 600 expressions, 42 seeds) against master: only the rows above moved.
  • One timing moved: floor(sinh(2)^log(2, x)) at 0 from the right still answers 0, but now takes 6.8 s where master takes 5.7 s (three runs each). It crossed limitcheck's 5 s cap.
  • Not fixed here: x^pi / log(x, 2) - 2 at 0 from the right still takes 12 s. The product reading's descent gives 0 * (-oo) there.
  • Suite and harnesses: the full suite, the other test projects, AOT and all harnesses pass.

Tests: AQuotientOverAQuotientTest pins the new answers. It also pins two two-sided rows that must stay as master reads them: x / log(x, 2) at 0 and x ^ log(pi + 1, x - 1) at 1.

BREAKING-CHANGES.md has an entry. Found by limitcheck; no issue was filed.

🤖 Generated with Claude Code

The descent read a / (b / c) as written. x^(-pi) / (ln(2) / ln(x)) at
+oo is then 0/0, and l'Hopital's rule makes each step another 0 * oo
with a higher power of ln(x), so it was left unevaluated where
x^(-pi) ln(x) / ln(2), the same function, is 0. log(x, 2) is
ln(2) / ln(x), so x^(-pi) / log(x, 2) was left unevaluated too.

Where b is a constant, the quotient is now read first as a c / b, which
it equals wherever it has a value, and that reading is kept only where
it gives one. x ln(x) at 0 comes back from the descent as 0 * (-oo),
and taking that as the answer made x / log(x, 2) from both sides of 0
NaN where it is 0; there the quotient is read as written, as before.
Over a b that is not constant, x^x / (x / x) read as x^x x / x took
twenty times as long. Found by limitcheck; 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 9, 2026
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.80%. Comparing base (d682f0d) to head (b8bd485).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2394      +/-   ##
==========================================
- Coverage   86.81%   86.80%   -0.01%     
==========================================
  Files         312      312              
  Lines       69224    69228       +4     
  Branches    20186    20187       +1     
==========================================
- Hits        60097    60096       -1     
- Misses       4912     4916       +4     
- Partials     4215     4216       +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.34% <100.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 76.37% <100.00%> (+0.21%) ⬆️

... and 3 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 9a5503e into master Nov 9, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 9, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/limit-of-a-quotient-over-a-quotient branch November 9, 2026 00:41
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