Skip to content

Read a power of a power of a positive base in a limit as one power - #2398

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
feature/limit-of-a-power-of-a-power
Nov 9, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
feature/limit-of-a-power-of-a-power

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

(g^a)^b, with a and b real constants, equals g^(a b) wherever g is positive, but nothing in a limit read it that way. Read as written, sqrt(x^3) / x at 0 from the right came out 0 only after 4 s of l'Hopital's rule, each step another root over a power. floor(sqrt(x^3)) and sgn(sqrt(x^3)) took longer still, because they ask that limit for the sign of sqrt(x^3).

The fix. The power is merged in front of the descent, beside the existing logarithm-of-a-power rewrite, where b is not an integer and g is positive near the point on every side approached. Where g is negative the two differ: sqrt(x^3) is i |x|^(3/2) for x < 0, and x^(3/2) is -i |x|^(3/2). So limits from the left, and two-sided limits of such a root, are read as before. An integer outer exponent is left to the normalisation.

Measured on master (567890f) and this branch. The answers are the same; only the time changes:

Limit master this branch
floor(sqrt(x^3)) at 0+ 5.9 s 0.16 s
sgn(sqrt(x^3)) at 0+ 4.0 s 0.14 s
sqrt(x^3) / x at 0+ 3.9 s 0.13 s
sqrt(x^3) / x at 0, two-sided 4.5 s 0.18 s
sgn(sqrt(x^5)) at 0+ 1.4 s 0.14 s

One answer changes against 2.6.0 and master: sinh(arctan(x))^sqrt(x * x) at 0+ is now 1, in 0.3 s. Both 2.6.0 and master leave it unevaluated after 3.5 s. A BREAKING-CHANGES entry records it.

limitcheck, 42 seeds at depth 3 with 600 expressions each, against master: that one limit gained, and no losses, wrong answers or new timeouts.

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

New test: APowerOfAPowerIsOnePowerTest. It includes the left-side and two-sided floor(sqrt(x^3)), which are asserted to stay unevaluated.

🤖 Generated with Claude Code

(g^a)^b, with a and b real constants, is g^(a b) wherever g is
positive, and in a limit nothing read it so. Read as written,
sqrt(x^3) / x at 0 from the right came out 0 only after four seconds
of l'Hopital's rule, each step another root over a power, and
floor(sqrt(x^3)) took six, asking it for the sign of sqrt(x^3).

The power is now merged in front of the descent, beside the logarithm
of a power, where g is positive near the point on each side
approached. Where g is negative the two differ -- sqrt(x^3) is
i |x|^(3/2) for x < 0 and x^(3/2) is -i |x|^(3/2) -- so from the left
and from both sides nothing changes. An integer outer exponent is
left to the normalisation. 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.81%. Comparing base (567890f) to head (549c417).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2398   +/-   ##
=======================================
  Coverage   86.81%   86.81%           
=======================================
  Files         312      312           
  Lines       69265    69272    +7     
  Branches    20201    20202    +1     
=======================================
+ Hits        60131    60140    +9     
+ Misses       4916     4914    -2     
  Partials     4218     4218           
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.35% <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 Δ
...ns/Continuous/Limits/Solvers/Solvers.Definition.cs 92.22% <100.00%> (+0.20%) ⬆️

... 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 69aa9bd into master Nov 9, 2026
35 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 9, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the feature/limit-of-a-power-of-a-power branch November 9, 2026 08:26
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