TedToolkit.Mathematics.Asymptotic
2026.6.23.1
dotnet add package TedToolkit.Mathematics.Asymptotic --version 2026.6.23.1
NuGet\Install-Package TedToolkit.Mathematics.Asymptotic -Version 2026.6.23.1
<PackageReference Include="TedToolkit.Mathematics.Asymptotic" Version="2026.6.23.1" />
<PackageVersion Include="TedToolkit.Mathematics.Asymptotic" Version="2026.6.23.1" />
<PackageReference Include="TedToolkit.Mathematics.Asymptotic" />
paket add TedToolkit.Mathematics.Asymptotic --version 2026.6.23.1
#r "nuget: TedToolkit.Mathematics.Asymptotic, 2026.6.23.1"
#:package TedToolkit.Mathematics.Asymptotic@2026.6.23.1
#addin nuget:?package=TedToolkit.Mathematics.Asymptotic&version=2026.6.23.1
#tool nuget:?package=TedToolkit.Mathematics.Asymptotic&version=2026.6.23.1
TedToolkit.Mathematics.Asymptotic
TedToolkit.Mathematics.Asymptotic models polynomial-like asymptotic expressions as x -> +infinity.
Use it when your code needs explicit reasoning about:
- normalized terms
- leading-order growth
- limit classification
- arithmetic over asymptotic expressions
Installation
dotnet add package TedToolkit.Mathematics.Asymptotic
Core Types
PolynomialTerm<TCoefficient, TExponent>
Represents a single term such as 3ω², -5ω, 7, or 2ω⁻¹.
TCoefficientmust satisfyINumber<TCoefficient>TExponentmust satisfyISignedNumber<TExponent>andINumber<TExponent>- a zero coefficient is normalized to exponent
0
LimitPolynomial<TCoefficient, TExponent>
Represents a normalized collection of terms ordered by descending exponent.
During construction:
- terms with the same exponent are merged
- zero-coefficient terms are removed
- terms are stored in descending exponent order
- an all-zero input becomes a single zero term
LimitResult<TValue> and LimitState
Represents the limit classification returned by LimitValue.
Possible states are:
FINITEPOSITIVE_INFINITYNEGATIVE_INFINITYPOSITIVE_INFINITESIMALNEGATIVE_INFINITESIMAL
Basic Usage
using TedToolkit.Mathematics.Asymptotic;
var expression = new LimitPolynomial<double, int>(
[
new PolynomialTerm<double, int>(3, 2),
new PolynomialTerm<double, int>(-4, 1),
new PolynomialTerm<double, int>(10, 0),
]);
Console.WriteLine(expression);
If multiple terms use the same exponent, they are merged automatically:
var simplified = new LimitPolynomial<double, int>(
[
new PolynomialTerm<double, int>(3, 2),
new PolynomialTerm<double, int>(5, 2),
new PolynomialTerm<double, int>(-8, 2),
new PolynomialTerm<double, int>(1, 0),
]);
Console.WriteLine(simplified); // 1
Limit Evaluation
LimitValue is determined by the leading term.
var polynomial = new LimitPolynomial<double, int>(
[
new PolynomialTerm<double, int>(-2, 3),
new PolynomialTerm<double, int>(5, 0),
]);
Console.WriteLine(polynomial.LimitValue);
Examples of the returned classification:
- positive coefficient with positive exponent → positive infinity
- negative coefficient with positive exponent → negative infinity
- exponent
0→ finite constant - positive coefficient with negative exponent → positive infinitesimal
- negative coefficient with negative exponent → negative infinitesimal
Growth Comparison
Use CompareGrowthRateTo when only the leading term matters:
var left = new LimitPolynomial<double, int>(new PolynomialTerm<double, int>(2, 3));
var right = new LimitPolynomial<double, int>(new PolynomialTerm<double, int>(1, 2));
Console.WriteLine(left.CompareGrowthRateTo(right) > 0); // True
Use EqualsGrowthRate when two expressions should be treated as having the same leading-order behavior:
var a = new LimitPolynomial<double, int>(
[
new PolynomialTerm<double, int>(2, 3),
new PolynomialTerm<double, int>(1, 0),
]);
var b = new LimitPolynomial<double, int>(
[
new PolynomialTerm<double, int>(2, 3),
new PolynomialTerm<double, int>(-100, 1),
]);
Console.WriteLine(a.EqualsGrowthRate(b)); // True
Arithmetic and Comparison
LimitPolynomial<TCoefficient, TExponent> supports:
- comparison operators:
==,!=,<,<=,>,>= - arithmetic operators:
+,-, unary+, unary-,*,/,%
var x2 = new LimitPolynomial<double, int>([new PolynomialTerm<double, int>(1, 2)]);
var x = new LimitPolynomial<double, int>([new PolynomialTerm<double, int>(1, 1)]);
var sum = x2 + x;
var product = x2 * x;
var quotient = product / x2;
Console.WriteLine(sum);
Console.WriteLine(product);
Console.WriteLine(quotient);
Formatting
PolynomialTerm<TCoefficient, TExponent> and LimitPolynomial<TCoefficient, TExponent> support formatted string output.
var polynomial = new LimitPolynomial<double, int>(
[
new PolynomialTerm<double, int>(12.5, 12),
new PolynomialTerm<double, int>(-3.25, -2),
]);
Console.WriteLine(polynomial.ToString("0.00", "00", null));
The default string form uses ω notation, for example (2ω³ - 4ω + 6).
Notes
- This package models behavior only for
x -> +infinity. LimitPolynomial<TCoefficient, TExponent>implements numeric-style interfaces and exposes parse members, but parsing is not currently supported.- Generic parameters must satisfy the .NET numeric interface constraints used by the public types.
Target Frameworks
net7.0net8.0net9.0net10.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.6.23.1 | 134 | 6/23/2026 |
| 2026.6.23 | 120 | 6/23/2026 |