Skip to content

Give no limit to a quotient whose divisor is 0 near the point - #2379

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
feature/a-condition-that-fails-near-the-point
Nov 7, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
feature/a-condition-that-fails-near-the-point

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

abs(x) - x is 0 for every positive x, so (abs(x) - x) / (abs(x) - x) has no value anywhere near 1, and its limit there does not exist. l'Hopital's rule assumes a divisor that is not 0 near the point, nothing checked that, and the limit came back as 1. 2.6.0 answered 1 too.

A quotient whose divisor holds an abs or a sign is now checked first. Each abs and sign is replaced by the sign its argument keeps near the point, and if the divisor then simplifies to 0, the limit is NaN. Nothing is sampled, because a sample point can land on a zero by chance. A two-sided limit is NaN only where the divisor vanishes on both sides: where it is defined on one side, the point is still approached from that side.

Input 2.6.0 master This PR
(abs(x) - x) / (abs(x) - x) at 1 1 1 NaN
(abs(x) - x) * x / ((abs(x) - x) * sin(x)) at 0, from the right 1 1 NaN
(abs(x) - x) * x / ((abs(x) - x) * sin(x)) at 0, from the left and two-sided 1 1 1
(abs(x) - x) / (abs(x) - x) at -1 1 1 1

Measured

  • Suite, wrappers, AOT and the harnesses are green.
  • limitcheck at DEPTH=3, across 39 seeds against master: nothing moved but one row at SEED=56, (cos(x) * sqrt(x)) ^ arctan(tanh(x)) at 0+, which went from unevaluated to past the 5 s budget. Alone it takes 7.3-7.6 s and returns the same unevaluated limit on both builds, so it sits on the budget's edge either way.

Found while reviewing #2378's cancellation condition; no issue was filed.

🤖 Generated with Claude Code

abs(x) - x is 0 for every positive x, so (abs(x) - x) / (abs(x) - x)
has no value anywhere near 1, and l'Hopital's rule, whose premise is a
divisor that is not 0 near the point, read it as 1.

A divisor holding an abs or a sign is checked first: with each abs and
sign read by the sign its argument keeps near the destination, does it
simplify to 0? Nothing is sampled, since a sample can land on a zero.
Where it does, the limit is NaN; two-sided, only where it does on both
sides, since one side alone still approaches the point.

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

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.78%. Comparing base (68c41bf) to head (cbb0643).

Files with missing lines Patch % Lines
...ath/Functions/Continuous/Limits/Transformations.cs 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2379      +/-   ##
==========================================
+ Coverage   86.77%   86.78%   +0.01%     
==========================================
  Files         312      312              
  Lines       69036    69053      +17     
  Branches    20134    20141       +7     
==========================================
+ Hits        59907    59929      +22     
+ Misses       4919     4914       -5     
  Partials     4210     4210              
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.32% <94.11%> (+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 89.68% <100.00%> (+0.28%) ⬆️
...ath/Functions/Continuous/Limits/Transformations.cs 88.40% <90.90%> (+0.04%) ⬆️

... and 8 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 c41c8c5 into master Nov 7, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 7, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/a-condition-that-fails-near-the-point branch November 7, 2026 05:50
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