Repository navigation
Commit a9c0191
Invert a power of the variable in a product l'Hopital's rule reads at infinity (#2404)
Invert a power of the variable in a product l'Hopital's rule reads at infinity
A product of something vanishing and something diverging is written as a
quotient before l'Hopital's rule reads it, the diverging factor on top and
the reciprocal of the vanishing one underneath. Where the diverging factor is
a power of the variable, that arrangement grows on every step: the reciprocal
of the vanishing factor squares it under differentiation, so
x^2 * ln(1 - 1 / x) at +oo went to x^3 * ln(1 - 1 / x)^2, then
x^4 * ln(1 - 1 / x)^3, for three seconds before answering -oo. The power is
inverted instead at an infinity, where its reciprocal is another power that
differentiating lowers.
A vanishing factor that leaves the reals on the approach keeps the old
arrangement. (sqrt(x) - erf(x)) / x at 0 from the left reaches here at +oo
with sqrt(-1 / x) in it, and over the power came out a directed complex
infinity where it is left unevaluated.
Faster, with the same answers: x^2 * ln(1 - 1 / x) at +oo 3.1 s to 0.19 s;
(-1 - x) / log(x, 2)^(x - 1) at 1 from the left 6.0 s to 1.6 s, which is
2.6.0's time again; sinh((x - 1)^ln(x)) at 1 from the right 2.0 s to 0.6 s;
ln(1 + 1 / x) * ln(1 / x) at +oo 2.1 s to 0.5 s.
And some that were declined are answered, because the inverted quotient
differentiates to something the rule can read: x^2 * (1 - cos(1 / x)) at +oo
is 1/2, x * abs(2 / x) at +oo and -oo is 2 and -2, log(x, x^3 / abs(x)) at 0
from the right is 2, and log(2 * (-1)^x, arcsin(x) / (2 * x)) at 0 is -1,
where master said NaN. 2.6.0 answers none of them.
tanh(log(arcsin(x), x)) at 0 from the left is slower, 2.8 s to 6.7 s, same
answer (2.6.0 declines it after 11 s): x^3 * arccsc(-x) inside it is now
differentiated, and the caller declines the result. Only inverting where the
old arrangement would differentiate too gave that time back, and lost
x^2 * (1 - cos(1 / x)).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent e8b0995 commit a9c0191
2 files changed
Lines changed: 62 additions & 0 deletions
File tree
- Sources
- AngouriMath/Functions/Continuous/Limits
- Tests/UnitTests/Calculus
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1780 | 1780 | | |
1781 | 1781 | | |
1782 | 1782 | | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1783 | 1792 | | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
1784 | 1796 | | |
1785 | 1797 | | |
1786 | 1798 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
0 commit comments