Skip to content

A step function at a jump takes the side its argument arrives from - #2283

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-step-function-at-a-jump-takes-the-side-its-argument-arrives-from
Oct 31, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-step-function-at-a-jump-takes-the-side-its-argument-arrives-from

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

A limit of floor, ceil or sgn whose argument arrives on a jump was left unevaluated, even where the side is plain: limitleft(floor(x), x, 0), limitright(sgn(x), x, 0). The side the argument arrives from is not always the side x comes from: floor(2 - x^2) comes to 2 from below as x comes to 0 from the right. It is the sign that the argument minus the jump keeps near the destination. SignNear already reads that from the limit, or from the first derivative that does not vanish. floor gives the jump from above and one less from below; ceil gives one more from above and the jump from below; sgn gives the side itself. A two-sided limit asks each side, and when they differ, as at a jump, it is NaN.

Input 2.6.0 and master Now
limitleft(floor(x), x, 0) unevaluated -1
limitright(floor(2 - x^2), x, 0) unevaluated 1
limitright(sgn(x^3 - x), x, 0) unevaluated -1
limit(floor(x), x, 1) unevaluated NaN
limit(sgn(x), x, 0) unevaluated NaN

StepFunctionAtAJumpTest: 15 of its 16 cases fail on master. FloorCeilTest and SignumLimitTest pinned the old declines. They now pin the values: NaN for the two-sided limits, which do not exist, and the side's sign for the one-sided ones. Each is still bounded in time, which is what those tests are for. The suite (18,272), the trio, F#, AOT and the eight harnesses pass locally.

This complements #2268. That PR stops substitution from evaluating straight through a jump, and this one gives the step's own limit. Built together, the composed expressions are answered correctly: limitleft(floor(x) - 1, x, 0) is -2, limitleft(arcsin(floor(x)), x, 0) is -pi/2, and limit(floor(x) + x, x, 1) is NaN. Each of the two is measured alone, and they touch different files.

Part of #2266.

🤖 Generated with Claude Code

A limit of floor, ceil or sgn whose argument arrives on a jump was
left unevaluated: limitleft(floor(x), x, 0) and limitright(sgn(x), x, 0)
among them. The remark gave the reason that which side the argument
arrives from is not the side x comes from, floor(2 - x^2) coming to 2
from below as x comes to 0 from the right. That side is the sign the
argument less the jump keeps there, which SignNear reads off the limit
or off the first derivative that does not vanish. floor gives the jump
from above and one less from below, ceil one more from above and the
jump from below, and sgn the side itself. A two-sided limit asks each
side, and where they differ, as at a jump, it is NaN.

StepFunctionAtAJumpTest takes sixteen limits; fifteen fail on master.
FloorCeilTest and SignumLimitTest pinned the declines, and now pin the
values: NaN for the two-sided limits, which do not exist, and the sign
of the side for the one-sided ones, each still bounded in time, which
is what they are for. The suite, the trio, F#, AOT and the eight
harnesses pass.

With #2268, which declines the substitution through a jump, the
composed expressions are answered too: limitleft(floor(x) - 1, x, 0)
is -2 and limit(floor(x) + x, x, 1) is NaN.

Part of #2266.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Oct 30, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.71%. Comparing base (47ea3b3) to head (cd84d98).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...nctions/Continuous/Limits/Solvers/Limit.Classes.cs 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2283   +/-   ##
=======================================
  Coverage   86.71%   86.71%           
=======================================
  Files         310      310           
  Lines       67845    67852    +7     
  Branches    19689    19694    +5     
=======================================
+ Hits        58830    58839    +9     
+ Misses       4895     4891    -4     
- Partials     4120     4122    +2     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.26% <90.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 Δ
...ath/Functions/Continuous/Limits/Transformations.cs 87.78% <ø> (+0.18%) ⬆️
...nctions/Continuous/Limits/Solvers/Limit.Classes.cs 70.64% <90.00%> (+0.35%) ⬆️

... 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 51820d7 into master Oct 31, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Oct 31, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the a-step-function-at-a-jump-takes-the-side-its-argument-arrives-from branch October 31, 2026 02:59
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