Skip to content

Gather a difference of logarithms into one in a limit - #2409

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
feature/limit-of-a-difference-of-logarithms
Nov 10, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
feature/limit-of-a-difference-of-logarithms

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

ln(sin(x)) - ln(x) at 0 from the right was left unevaluated; it is 0.

At an infinity, a difference of two logarithms of one base, each a constant multiple, is gathered into one logarithm, log(b, f^m g^n), and that limit is taken. It is done only where both arguments are checked to be positive on the way (the limit of sgn of each is 1). Reading positivity off each logarithm tending to -oo instead gave ln(x) - ln(-x) the wrong sign, since ln(-x) at 0⁺ is reported as -oo; with the sign check it stays as on master. A constant factor or divisor around the difference is peeled off first.

at 0, from the right master this PR
ln(sin(x)) - ln(x) unevaluated 0
(ln(sin(x)) - ln(x)) / x^2 unevaluated -1/6
(ln(sin(x)) - ln(x)) / x unevaluated 0
log(2, sin(x)) - log(2, x) unevaluated 0
2 ln(sin(x)) - ln(x^2) unevaluated 0
ln(x) - ln(-x) -ln(-1) -ln(-1)

Left and two-sided limits of these are unchanged. The rows are in BREAKING-CHANGES.md and in ADifferenceOfLogarithmsIsGatheredTest.

Measured: the unit tests (19268), the wrappers, AOT, and the eight harnesses pass; limitcheck over 42 seeds is identical to master's.

🤖 Generated with Claude Code

Rafael-SOWNet and others added 2 commits November 10, 2026 17:42
ln(sin(x)) - ln(x) at 0 from the right is ln(sin(x) / x), which tends to
0, and was left unevaluated. At +oo, where the limit is taken, it is
ln(sin(1/x)) - ln(1/x), a difference of two infinities whose ratio
tends to 1, which settles nothing, and with no root for the conjugate.
Two logarithms to one base, each a real constant times a logarithm, are
now gathered into one where both antilogarithms are positive on the
way: c log(a) + d log(b) = log(a^c b^d) holds exactly there. The sign
is asked of each, and not inferred from the logarithm tending to a real
infinity: ln(-x) at 0 from the right is read as -oo, and ln(x) - ln(-x)
would have gathered into ln(-1) where it is -pi i.

A constant factor or divisor is taken out of the difference first,
since simplifying puts log(2, sin(1/x)) - log(2, 1/x) over ln(2).

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 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.81%. Comparing base (cb49a8c) to head (cbb4f3d).

Files with missing lines Patch % Lines
...ath/Functions/Continuous/Limits/Transformations.cs 90.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2409   +/-   ##
=======================================
  Coverage   86.80%   86.81%           
=======================================
  Files         312      312           
  Lines       69415    69444   +29     
  Branches    20271    20286   +15     
=======================================
+ Hits        60257    60286   +29     
  Misses       4926     4926           
  Partials     4232     4232           
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.35% <90.00%> (+<0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 39.81% <ø> (ø)

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.72% <90.00%> (+0.47%) ⬆️

... 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 e994ffd into master Nov 10, 2026
34 of 35 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 10, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/limit-of-a-difference-of-logarithms branch November 10, 2026 19:29
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