Skip to content

Answer an infinity beside a symbol and a quotient of roots of negative radicands (#2656) - #2666

Open
Rafael-SOWNet wants to merge 2 commits into
masterfrom
one-sided-limits-at-pi-over-2-2656
Open

Rafael-SOWNet wants to merge 2 commits into
masterfrom
one-sided-limits-at-pi-over-2-2656

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Two one-sided limits at pi/2 were left unevaluated although each has a value. They fail by two separate mechanisms, both in Limit.Classes.cs.

1. An infinity beside a symbolic constant. The parts of tan(x) - a tend to +oo and a. +oo - a evaluates to no number, so the descent read it as undecided, while tan(x) - 3 was answered +oo. A symbol is a finite number here, as +oo * a already reads it. So in Sumf, and in Minusf with the subtrahend's infinity negated, an infinity beside a constant is now that infinity, provided the constant holds no infinity and evaluates to none.

The evaluation check is load-bearing. The descent can hand a part back as 1 / 0, and my first version read that as a constant beside -oo. It answered (cot(x) - 1/x) / (2x) at 0 from the right with -oo, where the limit is -1/6. ADifferenceOfLogarithmsIsGatheredTest caught it, and both inputs are now pinned in the new test.

2. A quotient of square roots whose radicands are both negative on the way in. Each root is i times a real one and the two i cancel, so the quotient is taken as sqrt(u / v).

.Limit(x, ..., side) master / 2.10.0 this branch
tan(x) - a at pi/2, left limitleft(tan(x) - a, x, pi / 2) +oo
tan(x) - a at pi/2, right unevaluated -oo
cotan(x) - a at 0, right unevaluated +oo
sqrt(cos(x)) / sqrt(pi/2 - x) at pi/2, right unevaluated 1
sqrt(sin(x)) / sqrt(x) at 0, left unevaluated 1

The issue's controls are unchanged.

Checks

  • The new test OneSidedLimitsAtAPoleAndAtNegativeRadicandsTest covers both mechanisms and the two -1/6 limits above, and checks the values numerically.
  • limitcheck and symlimitcheck report the same findings on master (f8a822d) and on this branch.
  • The full UnitTests suite passed: 21878 passed, 13 skipped, 0 failed. The library builds for every target framework.

.editorconfig gains one entry: the 2026 header template for the new test file, which IDE0073 requires.

Closes #2656.

🤖 Generated with Claude Code

…e radicands (#2656)

tan(x) - a at pi/2 from the left was left unevaluated where tan(x) - 3 was
+oo: the parts tend to +oo and a, and +oo - a evaluates to no number, so the
descent read it as undecided. A symbol is a finite number, as +oo * a already
reads it, so an infinity beside a constant that holds no infinity and
evaluates to none is that infinity, in Sumf and in Minusf with the
subtrahend's infinity negated. The evaluation check is load-bearing: the
descent can hand a part back as 1 / 0, and read as a constant beside -oo it
answered (cot(x) - 1/x) / (2x) at 0 from the right with -oo, where it is -1/6;
ADifferenceOfLogarithmsIsGatheredTest caught that in the first version.

sqrt(cos(x)) / sqrt(pi/2 - x) at pi/2 from the right was left unevaluated
where it is 1. Both radicands are negative there, each root is i times a real
one and the two i cancel, so a quotient of square roots whose radicands are
both negative on the way in is taken as the root of the quotient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.70%. Comparing base (d394391) to head (623d00a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2666      +/-   ##
==========================================
- Coverage   86.70%   86.70%   -0.01%     
==========================================
  Files         346      345       -1     
  Lines       75719    75199     -520     
  Branches    22144    21961     -183     
==========================================
- Hits        65655    65202     -453     
+ Misses       5430     5405      -25     
+ Partials     4634     4592      -42     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
fsharp 32.79% <ø> (ø)
interactive 40.09% <ø> (ø)

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 78.18% <ø> (-0.54%) ⬇️

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

limit(tan(x) - a, x, pi/2-) and limit(sqrt(cos x)/sqrt(pi/2 - x), x, pi/2+) are left unevaluated

1 participant