Skip to content

Read the logarithm of a power through the logarithm of its base in a limit - #2385

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
feature/log-of-a-power-in-a-limit
Nov 8, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
feature/log-of-a-power-in-a-limit

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Nothing in a limit read ln(f^c), for a constant real c, as a multiple of ln(f). log(x, arcsin(x)^tan(1/2)) at 0, which is tan(1/2) from each side, was left unevaluated after three seconds, where log(x, arcsin(x)) is 1 at once.

Where f is positive near the point, ln(f^c) is c ln(f). Where f is negative, f^c is (-f)^c (-1)^c on the principal branch: a positive number times one of modulus 1. So ln(f^c) is c ln(-f) + ln((-1)^c), which equals c ln(f) only for c in (-1, 1]. In that range the first form holds wherever f is real, whatever its sign, so a two-sided limit whose sides differ in sign is asked through it too. The rewrite runs next to the one that turns log(b, f) into ln(f) / ln(b).

master this branch
log(x, arcsin(x)^tan(1/2)) at 0+ unevaluated, 3.1 s sin(1/2) / cos(1/2), 0.29 s
the same, 0- unevaluated, 2.2 s the same, 0.26 s
the same, two-sided unevaluated, 4.2 s the same, 0.44 s
ln(arcsin(x)^pi) / ln(x) at 0 unevaluated, 2.7 s pi, 1.1 s
ln(sin(x)^(1/3)) / ln(x) at 0 1/3, 2.4 s 1/3, 0.23 s

Each was measured alone on a build of each.

Found by limitcheck at DEPTH=3, SEED=65, in the A/B of a Simplify change that made this decline slower. No issue was filed.

limitcheck A/B against master (DEPTH=3, the usual seeds): eleven answers gained, none wrong, one slower.

master branch
e^(1/2)^x / log(x^2, arctan(x)) at -1- unevaluated (2.6.0: a wrong finite value) 0, as from the right
the same, two-sided NaN 0
log(log(x - 1, 1/2), log(abs(x), x^2)) at -1- unevaluated -0.19160… - 0.22317…i, as from the right
the same, two-sided NaN the same
sqrt(x / 2)^(x^pi * x) at 0- and 0+ unevaluated 1
log(x^pi, sgn(-1))^2 at 1- and 1+ unevaluated -oo
the same, two-sided NaN -oo
(tanh(x)^erf(2))^sin(x^3) at 0- and 0+ unevaluated 1

The two-sided rows that were NaN had a left side master did not answer; it now agrees with the right. The held two-sided convention (x^x at 0 is NaN) does not move.

One row moved from an answer to a timeout at the harness's 5 s cap: (tanh(x)^3)^exp(1/x) at 0-. Alone it is 1 on both builds, 0.47 s on master and 7.2 s here. The rewrite hands on e^(1/x) (3 ln(-tanh(x)) + 1), and master takes 7 s on that already: three samples put the time in ApplyFirstRemarkableOverFactors, through IsIndeterminateQuotient's nested limits into l'Hôpital's rule. That path is the next fix.

Two rows changed only in printing. tan(log(x^2, x^pi)) at 0+ is the constant tan(pi/2), which does not exist: master's inner limit was a decimal of pi/2 and the harness compared its huge tangent; here it is pi / 2 exactly, and the row is not a number. The other prints (-1) ^ (1/2 * ln(-1)) where master printed (-1) ^ ln(i), the same value.

Each new answer is in BREAKING-CHANGES.md, measured on 2.6.0. The full suite (19,100), the wrapper suites, AOT and the ten harnesses pass. This opens after #2384, which the rewrite ran into: ln(x^3) / ln(2 + x) became 3 ln(x) / ln(2 + x) and hung under a product.

🤖 Generated with Claude Code

Rafael-SOWNet and others added 2 commits November 7, 2026 22:48
…limit

Nothing in a limit read ln(f^c), for a constant real c, as a multiple of
ln(f). log(x, arcsin(x)^tan(1/2)) at 0, which is tan(1/2) from each side,
was left unevaluated after 3.1 s from the right, 2.2 s from the left and
4.2 s two-sided, where log(x, arcsin(x)) was 1 at once.

For f positive near the point, ln(f^c) is c ln(f). For f negative, f^c is
(-f)^c (-1)^c on the principal branch, a positive number times one of
modulus 1, so ln(f^c) is c ln(-f) + ln((-1)^c), which is c ln(f) only for
c in (-1, 1]. In that range the first form holds wherever f is real, so a
two-sided limit whose sides differ in sign is asked through it too. The
rewrite runs beside the one that turns log(b, f) into ln(f) / ln(b).

Measured, master against this branch, each alone:
  log(x, arcsin(x)^tan(1/2)) at 0+   unevaluated 3.1 s -> tan(1/2) 0.29 s
  the same two-sided                  unevaluated 4.2 s -> tan(1/2) 0.44 s
  ln(arcsin(x)^pi) / ln(x) at 0       unevaluated 2.7 s -> pi 1.1 s
  ln(sin(x)^(1/3)) / ln(x) at 0       1/3 2.4 s -> 1/3 0.23 s

Found by limitcheck at DEPTH=3, SEED=65; no issue was filed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Nov 8, 2026
@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.79%. Comparing base (9d499b8) to head (c170b55).

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2385      +/-   ##
==========================================
+ Coverage   86.78%   86.79%   +0.01%     
==========================================
  Files         312      312              
  Lines       69129    69156      +27     
  Branches    20159    20166       +7     
==========================================
+ Hits        59991    60022      +31     
+ Misses       4920     4918       -2     
+ Partials     4218     4216       -2     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.33% <96.29%> (+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 Δ
...ns/Continuous/Limits/Solvers/Solvers.Definition.cs 91.66% <100.00%> (+1.29%) ⬆️
...ath/Functions/Continuous/Limits/Transformations.cs 88.82% <92.85%> (+0.22%) ⬆️

... 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 a1c0034 into master Nov 8, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 8, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/log-of-a-power-in-a-limit branch November 8, 2026 00:51
Rafael-SOWNet added a commit that referenced this pull request Nov 8, 2026
…#2387)

Record the term-by-term product's changed answers


Take a vanishing factor times a sum term by term in a one-sided limit

From one side, a product whose factors tend to 0 and to an infinity, one
of them a sum or a difference, is now asked as the sum of the products
term by term, its whole limit once. Read as a product, l'Hopital's rule
took x * (ln(-tanh(x)) + 1) at 0 from the left through nested limits for
4.5 s, where x ln(-tanh(x)) + x is 0 at once. The same gates as the
quotient regrouping beside it: one-sided, and not while the sides of a
two-sided limit are compared.

x * (ln(-tanh(x)) + 1) at 0-: 4.5 s -> 0.44 s.
e^(1/x) * (3 ln(-tanh(x)) + 1) at 0-: 7.2 s -> 0.46 s.
(tanh(x)^3)^exp(1/x) at 0-: 7.5 s -> 0.47 s, the row the
logarithm-of-a-power change (#2385) slowed.



Co-Authored-By: Claude Opus 5.5 <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.

1 participant