Skip to content

Take a vanishing factor times a sum term by term in a one-sided limit - #2387

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
feature/distribute-a-vanishing-factor
Nov 8, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
feature/distribute-a-vanishing-factor

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

A factor tending to 0 times a sum tending to an infinity is asked term by term, from one side. Read as a product, l'Hôpital's rule took x (ln(-tanh(x)) + 1) at 0 from the left through four and a half seconds of nested limits, where x ln(-tanh(x)) + x is 0 at once. (tanh(x)^3)^exp(1/x) comes to the same product. #2385 slowed that row from 0.5 s to 7.5 s and accepted the slowdown, and this fixes it. The rewrite is exact, and it has the same gates as the quotient regroup in #2384: one side only, and not while the two sides of a limit are being compared. A term-by-term answer of NaN is not taken. The product is read as before.

Limit at 0, from the left 2.6.0 master branch
x (ln(-tanh(x)) + 1) 0, 3.2 s 0, 4.5 s 0, 0.44 s
e^(1/x) (3 ln(-tanh(x)) + 1) 0, 1.0 s 0, 7.2 s 0, 0.46 s
(tanh(x)^3)^exp(1/x) 1, 0.5 s 1, 7.5 s 1, 0.47 s
sin(x) (ln(-tanh(x)) + 1/x) 1, 3.7 s 1, 5.2 s 1, 1.1 s

limitcheck A/B against master (DEPTH=3, the usual seeds): no answer lost. Five rows that timed out and five that were left unevaluated now finish. Two answers are new:

  • log(pi, x)^sinh(x) sin(1) at 0, from each side, is sin(1). The exponent tends to 0 faster than ln|log(pi, x)| grows, so the power tends to 1. Master leaves it unevaluated after 4 s, and 2.6.0 does not finish in 30 s.
  • sin(e^x (x + 1/2)) at -oo is 0. Master and 2.6.0 leave it unevaluated.

log(2 pi, log(arctan(x), tanh(x))) at 0 moved from a timeout to a decline in 3–4 s. (x^2/sinh(x))^x at 0 from the left is still 1, now in 5 s, where master took 9.5 s.

Each changed answer is in BREAKING-CHANGES.md, measured on 2.6.0. The full suite (19,118), the wrapper suites, AOT and the ten harnesses pass.

Found by limitcheck, in the A/B of #2385. No issue was filed.

🤖 Generated with Claude Code

Rafael-SOWNet and others added 2 commits November 8, 2026 04:41
From one side, a product whose factors tend to 0 and to an infinity, one
of them a sum or a difference, is now asked as the sum of the products
term by term, its whole limit once. Read as a product, l'Hopital's rule
took x * (ln(-tanh(x)) + 1) at 0 from the left through nested limits for
4.5 s, where x ln(-tanh(x)) + x is 0 at once. The same gates as the
quotient regrouping beside it: one-sided, and not while the sides of a
two-sided limit are compared.

x * (ln(-tanh(x)) + 1) at 0-: 4.5 s -> 0.44 s.
e^(1/x) * (3 ln(-tanh(x)) + 1) at 0-: 7.2 s -> 0.46 s.
(tanh(x)^3)^exp(1/x) at 0-: 7.5 s -> 0.47 s, the row the
logarithm-of-a-power change (#2385) slowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Nov 8, 2026
@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.80%. Comparing base (7452b21) to head (7958a64).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2387   +/-   ##
=======================================
  Coverage   86.80%   86.80%           
=======================================
  Files         312      312           
  Lines       69190    69204   +14     
  Branches    20177    20179    +2     
=======================================
+ Hits        60060    60073   +13     
- Misses       4916     4917    +1     
  Partials     4214     4214           
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 75.76% <100.00%> (+0.82%) ⬆️

... and 1 file 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 569640b into master Nov 8, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 8, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/distribute-a-vanishing-factor branch November 8, 2026 06: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