Skip to content

Read the sign of a difference with 0 in a limit as that of what it subtracts from - #2400

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
feature/limit-without-a-zero-offset
Nov 9, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
feature/limit-without-a-zero-offset

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

floor(sinh(2)^log(2, x)) at 0 from the right is 0, and took 7 s to say so, where sgn of the same argument takes 0.4 s. At a jump of 0, floor asks for the sign of g - 0. The sign is then read from the slope, which divides by x - 0. Neither - 0 is simplified away inside a limit, and l'Hopital's rule spent 6.9 s on (g - 0) / (x - 0) before declining, against 0.4 s on g / x.

The fix. SignNear drops a - 0 where it starts, in place of the arm in SignOfTheFactors that handled it one level down. The slope at 0 divides by x itself.

Read as g / x, a derivatives' quotient no longer fits the bound l'Hopital's rule sets on growth by the two nodes the zeros added. So floor(sqrt(x) - erf(x)) at 0 from the right was lost on the first run of this branch, until #2399 read such a quotient by its terms. This branch is rebased on that merge, and the row answers 0 as on master.

Measured on master (b1d0c22) and this branch, at 0 from the right:

Limit master this branch
floor(sinh(2)^log(2, x)) 0, 7.0 s 0, 0.42 s
floor(sqrt(x) - erf(x)) 0, 0.21 s 0, 0.19 s

The other step-function limits probed are unchanged in answer and time, and no answer changes against master.

limitcheck, 42 seeds at depth 3 with 600 expressions each, against master: the one row above no longer times out, with no losses, wrong answers or new timeouts.

Checks: the full suite passed (19205 tests), as did the MCP, terminal, interactive and F# wrapper suites, the AOT build and the eight harnesses.

New test: ASignIsReadWithoutAZeroOffsetTest. It asserts that the floor finishes within a minute, and pins the step limits read through the same path.

🤖 Generated with Claude Code

…btracts from

A step function at a jump of 0 and a comparison with 0 ask for the
sign of g - 0, which is not simplified on the way, and every reading
of that sign carried the 0 along. The structural reading that strips
it came last, after the slope, so floor(sinh(2)^log(2, x)) at 0 from
the right asked for the limit of (g - 0) / (x - 0), which l'Hopital's
rule took seven seconds to decline, where g / x is declined in under
half a second. The answer, 0, came from the reading after it.

The 0 is now stripped once, where the sign is asked for, and the
slope at 0 is taken over x itself. Found by limitcheck; 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 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.80%. Comparing base (b1d0c22) to head (816bc4f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2400   +/-   ##
=======================================
  Coverage   86.80%   86.80%           
=======================================
  Files         312      312           
  Lines       69330    69332    +2     
  Branches    20230    20232    +2     
=======================================
+ Hits        60182    60187    +5     
+ Misses       4921     4919    -2     
+ Partials     4227     4226    -1     
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 Δ
...ath/Functions/Continuous/Limits/Transformations.cs 88.08% <100.00%> (+0.02%) ⬆️

... and 6 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 552e65b into master Nov 9, 2026
35 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/limit-without-a-zero-offset branch November 9, 2026 15:44
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 9, 2026
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