Skip to content

Ask the parts of a one-sided limit's sum for their limits from its side - #2401

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
feature/limit-of-a-sum-with-a-logarithm-base
Nov 9, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
feature/limit-of-a-sum-with-a-logarithm-base

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Before searching, a limit replaces a sum, difference or product whose parts have finite limits by those limits (ApplyTrivialTransformations). For a one-sided limit it asked each part for its two-sided limit. Two effects:

  • Slow: x^pi / log(x, 2) - 2 at 0 from the right took its quotient through l'Hôpital's rule from the left as well, where x^pi is not real, and on to +oo: 10.4 s, against 0.19 s for the quotient alone.
  • Unanswered: a part with a finite limit from the side approached and none from the other, such as x ^ x at 0 from the left, kept the whole limit unevaluated.

Each part is now asked from the side the limit is. Finite one-sided limits of the parts are the one-sided limit of their sum, difference or product, so nothing new is claimed; the two-sided case is unchanged.

Limit at 0 2.6.0 master this PR
x^pi / log(x, 2) - 2, right -2 -2, 10.4 s -2, 0.19 s
x^pi / log(x, 2) - 2, left unevaluated -2, 10.5 s -2, 0.85 s
log(x, 1) - x^x + 1, left unevaluated unevaluated 0
-tan(x)^abs(x), left unevaluated unevaluated -1
(pi/x)^erf(x) * e^log(x, x), left unevaluated unevaluated e
sqrt(x) + abs(x)/x, right / left 1 / -1 1 / -1

Measured:

  • Suite 19211 passed, AOT OK, all ten harnesses clean.
  • limitcheck A/B against master: eight left-side rows answered, all checked by hand (each part → 1 since |ln x| · x → 0), no losses, no new timeouts.
  • BREAKING-CHANGES entry added.

Still slow: the two-sided x^pi / log(x, 2) - 2 takes 10 s by another path; separate PR.

🤖 Generated with Claude Code

The trivial transformations a limit makes before its descent replace a sum, a
difference or a product by the limits of its parts where both are finite. They
asked each part from both sides, also for a one-sided limit. x^pi / log(x, 2)
- 2 at 0 from the right took its quotient through l'Hopital's rule from the
left as well, where x^pi is not real, and on to +oo by the substitution that
side asks for: 10 s, where the quotient alone takes 0.2 s.

Each part is now asked from the side the limit is. Finite one-sided limits of
the parts are the one-sided limit of their sum, difference or product, so the
rewrite says nothing it could not say before; the two-sided case is as it was.
The limit takes 0.19 s from the right and 0.85 s from the left, with the same
answers.

A part with a finite limit from the side approached and none from the other no
longer keeps the whole unevaluated: x^x at 0 from the left goes to 1, so
log(x, 1) - x^x + 1 is 0 there, where 2.6.0 and master leave it unevaluated.
The limitcheck A/B against master answers eight such rows and loses none.

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.81%. Comparing base (552e65b) to head (c40d876).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2401   +/-   ##
=======================================
  Coverage   86.81%   86.81%           
=======================================
  Files         312      312           
  Lines       69332    69332           
  Branches    20232    20232           
=======================================
+ Hits        60190    60191    +1     
+ Misses       4917     4916    -1     
  Partials     4225     4225           
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.35% <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 Δ
...ns/Continuous/Limits/Solvers/Solvers.Definition.cs 92.22% <100.00%> (ø)
...ath/Functions/Continuous/Limits/Transformations.cs 88.08% <100.00%> (ø)

... 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 42af5e0 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-sum-with-a-logarithm-base branch November 9, 2026 17:55
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