Skip to content

Fold the destination out of a trigonometric argument's limit - #2361

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
fix/fold-the-infinities-a-substitution-leaves
Nov 4, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
fix/fold-the-infinities-a-substitution-leaves

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

sin(x^2 + x - 1) from the left at 0 was left unevaluated, as on 2.6.0, and so were its two-sided limit and the tangent's.

A one-sided limit at a finite point moves the variable out to infinity, and the value read off there keeps the infinity in it: x^2 + x - 1 from the left at 0 comes back as -1 - 1/+oo + 1/+oo^2. That is -1, but the sine above it asks whether it is finite, is told no, and declines.

The argument's limit is now folded for the six trigonometric functions. They have no cut, and are continuous at every finite argument short of a pole.

Not folded for every caller, deliberately. The first version folded in SolveBySubstitution itself. That answered arctan on its cut and x! at its pole -1, which the descent had declined only because the infinity was still there. limitcheck then read arctan(ln(x))^2 at -1+ as arctan(ln(-1))^2, the value on the cut, and three tests failed.

limitcheck, DEPTH=3, seeds 14, 16, 19, 23 and 26, against master f73ac9a:

master this branch
compared 25 958 25 961
the limit is another value 6 6
the limit is NaN where the values settle 69 69

The three newly answered limits are cos(sinh(x) + x + 1) at -1, from the right and from both sides, and tan(x^2 + x - 1) at 0 from both sides. This also turns the two rows of #2360's test that it allowed to decline into required answers. Suite, AOT and the harnesses are green locally.

Found by limitcheck at SEED=26; no issue was filed.

🤖 Generated with Claude Code

A one-sided limit at a finite point moves the variable out to infinity, and
the value read off there keeps the infinity in it: x^2 + x - 1 from the left
at 0 came back as -1 - 1/+oo + 1/+oo^2. That is -1, but the sine above it
asked whether it was finite, was told no, and declined -- so
sin(x^2 + x - 1) from the left at 0 was left unevaluated, as on 2.6.0, and
with it the two-sided limit and the tangent's.

The argument's limit is now folded for the six trigonometric functions,
which have no cut and are continuous at every finite argument short of a
pole. Folding it in the substitution itself, for every caller, answered
arctan on its cut and x! at its pole -1, which the descent declined only
because the infinity was still there: limitcheck read arctan(ln(x))^2 at -1+
as arctan(ln(-1))^2, the value on the cut, and three tests failed.

limitcheck, DEPTH=3, seeds 14, 16, 19, 23, 26 against master f73ac9a: three
limits more answered, the wrong values and the NaNs unchanged. Found at
SEED=26; 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 4, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.78%. Comparing base (f73ac9a) to head (b315650).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2361      +/-   ##
==========================================
- Coverage   86.78%   86.78%   -0.01%     
==========================================
  Files         312      312              
  Lines       68815    68818       +3     
  Branches    20048    20050       +2     
==========================================
+ Hits        59724    59726       +2     
- Misses       4908     4909       +1     
  Partials     4183     4183              
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.33% <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 73.62% <100.00%> (+0.29%) ⬆️

... and 5 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 403394b into master Nov 4, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Nov 4, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the fix/fold-the-infinities-a-substitution-leaves branch November 4, 2026 05:35
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