Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ one inside another was answered with the empty set, a claim that it has no solut
| `"1/(2 + p^(-3)) = 1/3".Solve("p")` | `{ }` | `{ 1, -1/2 + i * 1/2 * sqrt(3), -1/2 + i * -1/2 * sqrt(3) }` |
| `"1/(1 + x^(-2)) = y".Solve("x")` | `{ }` | `{ ((-1) / (-y) - 1) ^ (-1/2), -((-1) / (-y) - 1) ^ (-1/2) }` |

### A vanishing factor times an infinity is asked as a whole when read as a part

**Silent: a limit with, somewhere inside it, a product of a factor tending to 0 and one tending to an infinity is
answered where that product's own limit is.** Read as a part, the product came back as `0 * oo`, a form with no value,
and the whole was left unevaluated; `x^pi ln(x)` at 0 from the right is 0, but `x^pi ln(x) / 2` was not answered. One
side only, as for a quotient's divisor and a sum's terms. Found by limitcheck; no issue was filed.

| Input | Was (2.6.0) | Now |
|---|---|---|
| `"x^pi * ln(x) / 2".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(x ^ pi * ln(x) / 2, x, 0)` | `0` |
| `"sin(x^(3/2) * ln(x))".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(sin(x ^ (3/2) * ln(x)), x, 0)` | `0` |
| `"x^pi / log(x, -1) - 2".ToEntity().Limit("x", 0, ApproachFrom.Right)` | `limitright(x ^ pi / log(x, -1) - 2, x, 0)` | `-2` |
| `"sin(ln(x) * x)".ToEntity().Limit("x", 0, ApproachFrom.Left)` | `limitleft(sin(ln(x) * x), x, 0)` | `0` |

### Two fractions over a shared factor are added over their least common denominator

**Silent: where the denominators of two fractions share a factor, `Simplify` adds them over the least common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,20 @@ partial record Mulf
({ } bas, { IsFinite: true } lim2) => (bas, lim2),
_ => (Multiplier, Multiplicand)
};
return ComputeLimitImpl(New(mp, md), x, dist, side);
var substituted = ComputeLimitImpl(New(mp, md), x, dist, side);
// Any other 0 * oo, read off the parts, is a form with no value, which says there is
// no limit where the descent only cannot tell. Its whole limit is asked once, as a
// quotient's is: x^pi ln(x) at 0 from the right is 0, and the whole limit says so,
// but the descent handed on 0 * (-oo), and x^pi ln(x) / 2 and sin(x^pi ln(x)) were
// left unevaluated. Under the gates above, and only a value is taken.
if ((substituted is null || substituted.Evaled == MathS.NaN)
&& side is not ApproachFrom.BothSides && !IsComparingSides
&& multiplierLimit is { } zeroOrInfinity5 && multiplicandLimit is { } zeroOrInfinity6
&& IsZeroTimesAnInfinity(zeroOrInfinity5, zeroOrInfinity6)
&& AsTheWholeLimit(this, x, dist, side) is { } asked && asked.Evaled is Number { IsNaN: false } value)
return asked.InnerSimplified is var folded && folded.Nodes.Any(static node => node is Number { IsFinite: false })
? value : folded;
return substituted;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// Copyright (c) 2019-2026 Angouri.
// AngouriMath is licensed under MIT.
// Details: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.
// Website: https://am.angouri.org.
//

using System;
using System.Threading.Tasks;
using AngouriMath.Core;
using Xunit;

namespace AngouriMath.Tests.Calculus
{
/// <summary>
/// A product tending to 0 times an infinity, read inside something else, is asked as a whole once.
/// <c>x^pi ln(x)</c> at 0 from the right is 0, and its own limit says so, but read as a part of a
/// quotient or a sine it came back as <c>0 * (-oo)</c>, a form with no value, and the whole was left
/// unevaluated. Found by limitcheck; no issue was filed.
/// </summary>
[Trait("Area", "Calculus")]
public sealed class AVanishingPowerTimesALogarithmTest
{
[Theory]
[InlineData("x^pi * ln(x) / 2", "0")]
[InlineData("sin(x^pi * ln(x))", "0")]
[InlineData("sin(x^(3/2) * ln(x))", "0")]
public void IsAnsweredFromTheRight(string input, string expected)
{
var limit = Task.Run(() => MathS.FromString(input).Limit("x", 0, ApproachFrom.Right));
Assert.True(limit.Wait(TimeSpan.FromSeconds(30)), $"{input} did not finish");
Assert.Equal(MathS.FromString(expected), limit.Result);
}
}
}
Loading