TYoshimura.MultiPrecision 6.3.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package TYoshimura.MultiPrecision --version 6.3.4                
NuGet\Install-Package TYoshimura.MultiPrecision -Version 6.3.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TYoshimura.MultiPrecision" Version="6.3.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TYoshimura.MultiPrecision --version 6.3.4                
#r "nuget: TYoshimura.MultiPrecision, 6.3.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TYoshimura.MultiPrecision as a Cake Addin
#addin nuget:?package=TYoshimura.MultiPrecision&version=6.3.4

// Install TYoshimura.MultiPrecision as a Cake Tool
#tool nuget:?package=TYoshimura.MultiPrecision&version=6.3.4                

MultiPrecision

MultiPrecision Arithmetic Implements

Requirement

.NET 8.0

AVX2 suppoted CPU. (Intel:Haswell(2013)-, AMD:Excavator(2015)-)

Install

Download DLL
Download Nuget

More Functions ?

DoubleDouble (30-31 digits)

Spec

Exponent : ±2147483647
Mantissa : 128-32768 bits
Round: half away from zero
MaxValue: ±8.808065x10^646456992

Types

type mantissa bits significant digits note
MultiPrecision<Pow2.N4> 128 34 Fastest
MultiPrecision<Pow2.N8> 256 73 Fast
MultiPrecision<Pow2.N16> 512 150 Standard
MultiPrecision<Pow2.N32> 1024 304
MultiPrecision<Pow2.N64> 2048 612 Slow
MultiPrecision<Pow2.N128> 4096 1229
MultiPrecision<Pow2.N256> 8192 2462 Very slow
MultiPrecision<Pow2.N512> 16384 4928
MultiPrecision<Pow2.N1024> 32768 9860 Not recommended
MultiPrecision<N> Length x 32 Length x 9.6 - 4 public struct N : IConstant { public int Value => Length; }

Functions

function domain mantissa error bits note
MultiPrecision<N>.Sqrt(x) [0,+inf) 1
MultiPrecision<N>.Cbrt(x) (-inf,+inf) 1
MultiPrecision<N>.Log2(x) (0,+inf) 0
MultiPrecision<N>.Log(x) (0,+inf) 1
MultiPrecision<N>.Log10(x) (0,+inf) 1
MultiPrecision<N>.Log1p(x) (-1,+inf) 1 log(1+x)
MultiPrecision<N>.Pow2(x) (-inf,+inf) 0
MultiPrecision<N>.Pow(x, y) (-inf,+inf) 1
MultiPrecision<N>.Pow10(x) (-inf,+inf) 1
MultiPrecision<N>.Exp(x) (-inf,+inf) 1
MultiPrecision<N>.Expm1(x) (-inf,+inf) 1 exp(x)-1
MultiPrecision<N>.Sin(x) (-inf,+inf) 1
MultiPrecision<N>.Cos(x) (-inf,+inf) 1
MultiPrecision<N>.Tan(x) (-inf,+inf) 2
MultiPrecision<N>.SinPI(x) (-inf,+inf) 0 sin(πx)
MultiPrecision<N>.CosPI(x) (-inf,+inf) 0 cos(πx)
MultiPrecision<N>.TanPI(x) (-inf,+inf) 1 tan(πx)
MultiPrecision<N>.Sinh(x) (-inf,+inf) 2
MultiPrecision<N>.Cosh(x) (-inf,+inf) 2
MultiPrecision<N>.Tanh(x) (-inf,+inf) 2
MultiPrecision<N>.Asin(x) [-1,1] 2 Accuracy deteriorates near x=-1,1.
MultiPrecision<N>.Acos(x) [-1,1] 2 Accuracy deteriorates near x=-1,1.
MultiPrecision<N>.Atan(x) (-inf,+inf) 2
MultiPrecision<N>.Atan2(y, x) (-inf,+inf) 2
MultiPrecision<N>.Arsinh(x) (-inf,+inf) 2
MultiPrecision<N>.Arcosh(x) [1,+inf) 2
MultiPrecision<N>.Artanh(x) (-1,1) 4 Accuracy deteriorates near x=-1,1.
MultiPrecision<N>.Sinc(x, normalized) (-inf,+inf) 2 normalized: x → πx
MultiPrecision<N>.Sinhc(x) (-inf,+inf) 3
MultiPrecision<N>.Erf(x) (-1,1) 2 Length ≤ 256
MultiPrecision<N>.Erfc(x) (0,2) 2 Length ≤ 256
MultiPrecision<N>.InverseErf(x) (-1,1) 2 Length ≤ 256
MultiPrecision<N>.InverseErfc(x) (0,2) 4 Length ≤ 256
MultiPrecision<N>.LogGamma(x) (0,+inf) 2 Accuracy deteriorates near x=0. Length ≤ 256
MultiPrecision<N>.Gamma(x) (-inf,+inf) 2 Accuracy deteriorates near non-positive intergers. Length ≤ 256
MultiPrecision<N>.Digamma(x) (-inf,+inf) 2 Accuracy deteriorates near non-positive intergers and zero points. Length ≤ 256
MultiPrecision<N>.BesselJ(nu, z) (-inf,+inf) 2 Accuracy deteriorates near zero points. (error ≤ 2^-(mantissa bits + 64)) Length ≤ 65 abs(nu) ≤ 64
MultiPrecision<N>.BesselY(nu, z) (-inf,+inf) 2 Accuracy deteriorates near zero points. (error ≤ 2^-(mantissa bits + 64)) Length ≤ 65 abs(nu) ≤ 64
MultiPrecision<N>.BesselI(nu, z) [0,+inf) 2 Length ≤ 65 abs(nu) ≤ 64
MultiPrecision<N>.BesselK(nu, z) [0,+inf) 2 Length ≤ 65 abs(nu) ≤ 64
MultiPrecision<N>.Jinc(x) (-inf,+inf) 3
MultiPrecision<N>.EllipticK(m) [0,1] 1 k: elliptic modulus, m=k^2
MultiPrecision<N>.EllipticE(m) [0,1] 1 k: elliptic modulus, m=k^2
MultiPrecision<N>.EllipticPi(n, m) [0,1] 1 k: elliptic modulus, m=k^2
MultiPrecision<N>.Ldexp(x, y) (-inf,+inf) N/A
MultiPrecision<N>.Random(random) N/A N/A generation uniform random [0, 1)
MultiPrecision<N>.Min(x, y) N/A N/A
MultiPrecision<N>.Max(x, y) N/A N/A
MultiPrecision<N>.Floor(x) N/A N/A
MultiPrecision<N>.Ceiling(x) N/A N/A
MultiPrecision<N>.Round(x) N/A N/A
MultiPrecision<N>.Truncate(x) N/A N/A
IEnumerable<MultiPrecision<N>>.Sum() N/A N/A kahan summation
IEnumerable<MultiPrecision<N>>.Average() N/A N/A kahan summation
IEnumerable<MultiPrecision<N>>.Variance() N/A N/A population variance
IEnumerable<MultiPrecision<N>>.Min() N/A N/A
IEnumerable<MultiPrecision<N>>.Max() N/A N/A

Constants

constant value note
MultiPrecision<N>.PI 3.141592653589793238462... Pi
MultiPrecision<N>.E 2.718281828459045235360... Napier's E
MultiPrecision<N>.Sqrt2 1.414213562373095048801... Sqrt(2)
MultiPrecision<N>.Lg2 0.301029995663981195213... log10(2) lg:=log10 (ISO 80000-2-12.6)
MultiPrecision<N>.Lb10 3.321928094887362347870... log2(10) lb:=log2 (ISO 80000-2-12.7)
MultiPrecision<N>.Ln2 0.693147180559945309417... log(2) ln:=log (ISO 80000-2-12.5)
MultiPrecision<N>.LbE 1.442695040888963407359... log2(e)
MultiPrecision<N>.EulerGamma 0.577215664901532860606... Euler's Gamma
MultiPrecision<N>.Zeta3 1.202056903159594285399... ζ(3), Apery const.
MultiPrecision<N>.Zeta5 1.036927755143369926331... ζ(5)
MultiPrecision<N>.Zeta7 1.008349277381922826839... ζ(7)

Sequence

sequence note
MultiPrecision<N>.TaylorSequence Taylor, 1/n!
MultiPrecision<N>.BernoulliSequence Bernoulli, B(2k)
MultiPrecision<N>.StirlingSequence Stirling, Gamma convergent series, Bayes(1763)
MultiPrecision<N>.HarmonicNumber HarmonicNumber, H_n

Coefficient

coefficient note
MultiPrecision<N>.ChebyshevCoef Chebyshev, C(n, m)

Casts

  • long (accurately)
MultiPrecision<N> v0 = 123;
long n0 = (long)v0;
  • double (accurately)
MultiPrecision<N> v1 = 0.5;
double n1 = (double)v1;
  • decimal (approximately)
MultiPrecision<N> v1 = 0.1m;
decimal n1 = (decimal)v1;
  • string (approximately)
MultiPrecision<N> v2 = "3.14e0";
string s0 = v2.ToString();
string s1 = v2.ToString("E8");
string s2 = $"{v2:E8}";

I/O

BinaryWriter, BinaryReader

Licence

MIT

Author

T.Yoshimura

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on TYoshimura.MultiPrecision:

Package Downloads
TYoshimura.MultiPrecision.Algebra

MultiPrecision Algebra

TYoshimura.MultiPrecision.CurveFitting

MultiPrecision Curve Fitting - linear, polynomial, pade, arbitrary function

TYoshimura.MultiPrecision.Integrate

MultiPrecision Numerical Integration Implements

TYoshimura.MultiPrecision.Complex

MultiPrecision Complex and Quaternion Implements

TYoshimura.MultiPrecision.ComplexAlgebra

MultiPrecision Complex Algebra

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.5.0 137 11/13/2024
6.4.1 100 11/7/2024
6.4.0 165 11/1/2024
6.3.4 404 8/22/2024
6.3.3 117 6/10/2024
6.3.2 483 2/21/2024
6.3.1 240 2/8/2024
6.3.0 516 1/20/2024
6.2.1 488 9/9/2023
6.2.0 564 9/6/2023
6.1.1 590 4/6/2023
6.1.0 1,076 3/10/2023
6.0.0 596 3/3/2023
5.1.0 2,788 9/17/2022
5.0.7 639 1/6/2022
5.0.6 587 1/5/2022
5.0.5 1,417 12/1/2021
5.0.4 2,433 11/26/2021
5.0.3 606 11/22/2021
5.0.2 660 11/10/2021

add: sinc, sinhc, jinc