Skip to content

A quotient of logarithms is differentiated only where both diverge - #2275

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-logarithm-quotient-is-differentiated-only-when-both-diverge
Oct 31, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-logarithm-quotient-is-differentiated-only-when-both-diverge

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

limitright(ln(x) / ln(cos(x)), x, 0) was -oo, where it is +oo: -oo over a divisor vanishing from below. SolveAsLogarithmDivision applies l'Hopital's rule where both logarithms diverge, and decided that from the form of each argument's limit: an infinity anywhere in it, or 0. The limit of cos(1/x) comes back as cos(1 / +oo), which contains an infinity and is 1, so ln(cos(x)) was taken to diverge.

LogarithmDiverges reads a limit that evaluates to a finite number by its value, where only 0 diverges, and anything else by its form, as before.

Input 2.6.0 Now
limitright(ln(x) / ln(cos(x)), x, 0) -oo +oo
limitright(ln(sin(x)) / ln(cos(x)), x, 0) -oo +oo
limit(ln(x^2) / ln(cos(x)), x, 0) -oo NaN, still wrong; both sides are +oo, see #2274

LogarithmQuotientLimitTest has twelve limits that must be answered and two that may be declined, each checked against values near the destination. 11 of the 14 fail on master. The suite (18,243), the trio, F#, AOT and the eight harnesses pass locally.

Two more defects turned up on the way: #2271, a quotient of logarithms with symbolic limits, and #2274, the two-sided NaN above.

Fixes #2267.

🤖 Generated with Claude Code

limitright(ln(x) / ln(cos(x)), x, 0) was -oo, where it is +oo: -oo
over a divisor vanishing from below. SolveAsLogarithmDivision applies
l'Hopital's rule where both logarithms diverge, and read that off the
form of each argument's limit: an infinity anywhere in it, or 0. The
limit of cos(1/x) comes back as cos(1 / +oo), which has an infinity in
it and is 1, so ln(cos(x)) was taken to diverge, and the derivatives'
ratio (1/x) / (-tan(x)) answered -oo.

LogarithmDiverges reads a limit that evaluates to a finite number by
its value, where only 0 diverges, and anything else by its form as
before.

LogarithmQuotientLimitTest takes twelve limits that must be answered
and two that may be declined, each checked against values near the
destination. Eleven fail on master. The suite, the trio, F#, AOT and
the eight harnesses pass.

limit(ln(x^2) / ln(cos(x)), x, 0) moves from -oo to NaN, where both
sides are +oo: the two-sided path's NaN is #2274.

Fixes #2267.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.71%. Comparing base (ca785d3) to head (c9cafa2).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2275      +/-   ##
==========================================
- Coverage   86.72%   86.71%   -0.01%     
==========================================
  Files         310      310              
  Lines       67833    67845      +12     
  Branches    19685    19690       +5     
==========================================
+ Hits        58826    58835       +9     
  Misses       4890     4890              
- Partials     4117     4120       +3     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.26% <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.Solvers.cs 85.71% <100.00%> (ø)

... and 12 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 3a9a299 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-logarithm-quotient-is-differentiated-only-when-both-diverge branch October 31, 2026 00:37
Rafael-SOWNet added a commit that referenced this pull request Oct 31, 2026
limitright(ln(x^x), x, -1) was ln(-1), which is i pi, where it is
-i pi: x^x comes to -1 from below as x comes down to -1, and the
principal logarithm is continuous on its cut from above only. The
value on the cut is the limit along the real line and from above, so
it was given as the limit from either side.

ArrivesOnTheCutOffTheRealLine asks whether a logarithm's argument, or
the base of a power to an exponent that is not whole, tends to a
negative real and is not known to be real on the approach; a power's
base and a logarithm's argument count as positive where their values
at the destination are. Which side such an argument comes from is not
decided, so a limit there is declined: by substitution, by the
logarithm's and the power's descent, by SolveAsLogarithm, by the
quotient of logarithms, and by Gruntz, whose series took the principal
logarithm of a negative coefficient. A limit from above, whose answer
was right, is declined too.

LimitOnABranchCutTest takes eight limits from below the cut, three
two-sided ones that do not exist, and nine along the real line, which
are answered as before; eleven fail on master. The suite, the trio,
F#, AOT and the eight harnesses pass. Composed with #2268, #2275 and
#2276, work/limitcheck finds none of the 56 limits it found answered
with another value on master, of 600 expressions.

Part of #2266.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet added a commit that referenced this pull request Oct 31, 2026
)

limit(ln(x^2) / (cos(x) - 1), x, 0) was NaN, the claim that there is
no limit, where it is +oo from both sides. Each side's descent put the
parts' limits in place of the parts and read (-oo) / 0, which says
nothing about the side the divisor vanishes from and is NaN, and
DivergesAtAVanishingDivisor, which reads that side, asked for a finite
dividend. An infinity with a sign over a divisor vanishing from one
side is no more indeterminate than a number is: it is the infinity of
the two signs' product. The rule now takes one.

AnInfinityOverAVanishingDivisorTest takes four two-sided limits that
were NaN, four one-sided and two-sided ones that were answered and are
unchanged, and three that have no limit and stay NaN, x^x at 0 among
them; the four fail on master. The suite, the trio, F#, AOT and the
eight harnesses pass. #2275's entry for ln(x^2) / ln(cos(x)) now reads
+oo.

The issue put the cause at WhereBothSidesAgree's real-codomain gate.
Opening the gate changed nothing: each side was still (-oo) / 0.

Fixes #2274.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

limitright(ln(x) / ln(cos(x)), x, 0) is -oo, where it is +oo

1 participant