Skip to content

tk-yoshimura/DoubleDoubleIntegrate

Repository files navigation

DoubleDoubleIntegrate

Double-Double Numerical Integration Implements

Requirement

.NET 8.0
DoubleDouble

Install

Download DLL
Download Nuget

Usage

// Gauss-Legendre Integrate 32 Points: sin(t) t=0 to pi
GaussLegendreIntegral.Integrate(
    ddouble.Sin, 
    ddouble.Zero, ddouble.Pi, 
    n: 32
);

// Gauss-Kronrod Adaptive Integrate 7-15: exp(t) t=1 to 4
GaussKronrodIntegral.AdaptiveIntegrate(
    ddouble.Exp, 
    1, 4, 
    eps: 1e-25, 
    order: GaussKronrodOrder.G7K15, 
    maxdepth: 10
);

// Gauss-Kronrod Adaptive Integrate 32-65: exp(-t^2) t=-inf to +inf
GaussKronrodIntegral.AdaptiveIntegrate(
    x => ddouble.Exp(-x * x), 
    ddouble.NegativeInfinity, ddouble.PositiveInfinity, 
    eps: 1e-25, 
    order: GaussKronrodOrder.G32K65, 
    maxdepth: 10
);

// Gauss-Kronrod Adaptive Integrate 32-65: exp(-t^2) t=-inf to +inf
GaussKronrodIntegral.AdaptiveIntegrate(
    x => ddouble.Exp(-x * x), 
    ddouble.NegativeInfinity, ddouble.PositiveInfinity, 
    eps: 0, // Auto epsilon
    order: GaussKronrodOrder.G32K65, 
    maxdepth: 10
);

// Romberg Integrate: sqrt(1 - t^2) t=0 to sqrt(2)/2
RombergIntegral.Integrate(
    x => ddouble.Sqrt(1 - x * x), 
    0, ddouble.Sqrt(2) / 2, 
    level: 20
);

Licence

MIT

Author

T.Yoshimura