TYoshimura.MultiPrecision 5.0.7

.NET 5.0
Install-Package TYoshimura.MultiPrecision -Version 5.0.7
dotnet add package TYoshimura.MultiPrecision --version 5.0.7
<PackageReference Include="TYoshimura.MultiPrecision" Version="5.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TYoshimura.MultiPrecision --version 5.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TYoshimura.MultiPrecision, 5.0.7"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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=5.0.7

// Install TYoshimura.MultiPrecision as a Cake Tool
#tool nuget:?package=TYoshimura.MultiPrecision&version=5.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

MultiPrecision

Float multi precision arithmetic implements

Requirement

.NET 5.0

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

Install

Download DLL
Download Nuget package

  • To install, just import the DLL.
  • This library does not change the environment at all.

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 { <br/>  public int Value => Length; <br/> }

Functions

function domain mantissa error bits note usage
sqrt [0,+inf) 1 MultiPrecision<N>.Sqrt(x)
cbrt (-inf,+inf) 1 MultiPrecision<N>.Cbrt(x)
log2 (0,+inf) 0 MultiPrecision<N>.Log2(x)
log (0,+inf) 1 MultiPrecision<N>.Log(x)
log10 (0,+inf) 1 MultiPrecision<N>.Log10(x)
log1p (-1,+inf) 1 log(1+x) MultiPrecision<N>.Log1p(x)
pow2 (-inf,+inf) 0 MultiPrecision<N>.Pow2(x)
pow (-inf,+inf) 1 MultiPrecision<N>.Pow(x, y)
pow10 (-inf,+inf) 1 MultiPrecision<N>.Pow10(x)
exp (-inf,+inf) 1 MultiPrecision<N>.Exp(x)
expm1 (-inf,+inf) 1 exp(x)-1 MultiPrecision<N>.Expm1(x)
sin (-inf,+inf) 1 MultiPrecision<N>.Sin(x)
cos (-inf,+inf) 1 MultiPrecision<N>.Cos(x)
tan (-inf,+inf) 2 MultiPrecision<N>.Tan(x)
sinpi (-inf,+inf) 0 sin(πx) MultiPrecision<N>.SinPI(x)
cospi (-inf,+inf) 0 cos(πx) MultiPrecision<N>.CosPI(x)
tanpi (-inf,+inf) 1 tan(πx) MultiPrecision<N>.TanPI(x)
sinh (-inf,+inf) 2 MultiPrecision<N>.Sinh(x)
cosh (-inf,+inf) 2 MultiPrecision<N>.Cosh(x)
tanh (-inf,+inf) 2 MultiPrecision<N>.Tanh(x)
asin [-1,1] 2 Accuracy deteriorates near x=-1,1. MultiPrecision<N>.Asin(x)
acos [-1,1] 2 Accuracy deteriorates near x=-1,1. MultiPrecision<N>.Acos(x)
atan (-inf,+inf) 2 MultiPrecision<N>.Atan(x)
atan2 (-inf,+inf) 2 MultiPrecision<N>.Atan2(y, x)
arsinh (-inf,+inf) 2 MultiPrecision<N>.Arsinh(x)
arcosh [1,+inf) 2 MultiPrecision<N>.Arcosh(x)
artanh (-1,1) 4 Accuracy deteriorates near x=-1,1. MultiPrecision<N>.Artanh(x)
erf (-1,1) 2 Length ≤ 256 MultiPrecision<N>.Erf(x)
erfc (0,2) 2 Length ≤ 256 MultiPrecision<N>.Erfc(x)
inverse_erf (-1,1) 2 Length ≤ 256 MultiPrecision<N>.InverseErf(x)
inverse_erfc (0,2) 4 Length ≤ 256 MultiPrecision<N>.InverseErfc(x)
loggamma (0,+inf) 2 Accuracy deteriorates near x=0.<br/>Length ≤ 256 MultiPrecision<N>.LogGamma(x)
gamma (-inf,+inf) 2 Accuracy deteriorates near non-positive intergers.<br/>Length ≤ 256 MultiPrecision<N>.Gamma(x)
digamma (-inf,+inf) 2 Accuracy deteriorates near non-positive intergers and zero points.<br/>Length ≤ 256 MultiPrecision<N>.Digamma(x)
bessel_j (-inf,+inf) 2 Accuracy deteriorates near zero points.<br/>(error ≤ 2^-(mantissa bits + 64))<br/>Length ≤ 65<br/>abs(nu) ≤ 64 MultiPrecision<N>.BesselJ(nu, z)
bessel_y (-inf,+inf) 2 Accuracy deteriorates near zero points.<br/>(error ≤ 2^-(mantissa bits + 64))<br/>Length ≤ 65<br/>abs(nu) ≤ 64 MultiPrecision<N>.BesselY(nu, z)
bessel_i [0,+inf) 2 Length ≤ 65<br/>abs(nu) ≤ 64 MultiPrecision<N>.BesselI(nu, z)
bessel_k [0,+inf) 2 Length ≤ 65<br/>abs(nu) ≤ 64 MultiPrecision<N>.BesselK(nu, z)
elliptic_k [0,1] 1 k: elliptic modulus, m=k^2 MultiPrecision<N>.EllipticK(m)
elliptic_e [0,1] 1 k: elliptic modulus, m=k^2 MultiPrecision<N>.EllipticE(m)
elliptic_pi [0,1] 1 k: elliptic modulus, m=k^2 MultiPrecision<N>.EllipticPi(n, m)
ldexp (-inf,+inf) N/A MultiPrecision<N>.Ldexp(x, y)
random N/A N/A generation uniform random [0, 1) MultiPrecision<N>.Random(random)
min N/A N/A MultiPrecision<N>.Min(x, y)
max N/A N/A MultiPrecision<N>.Max(x, y)
floor N/A N/A MultiPrecision<N>.Floor(x)
ceiling N/A N/A MultiPrecision<N>.Ceiling(x)
round N/A N/A MultiPrecision<N>.Round(x)
truncate N/A N/A MultiPrecision<N>.Truncate(x)
array sum N/A N/A kahan summation IEnumerable<MultiPrecision<N>>.Sum()
array average N/A N/A kahan summation IEnumerable<MultiPrecision<N>>.Average()
array variance N/A N/A population variance IEnumerable<MultiPrecision<N>>.Variance()
array min N/A N/A IEnumerable<MultiPrecision<N>>.Min()
array max N/A N/A IEnumerable<MultiPrecision<N>>.Max()

Constants

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

Sequence

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

Coefficient

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

Util

  • NewtonRaphsonRootFinding

  • HalleyRootFinding

  • RombergIntegrate

  • FiniteDifference

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 Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages (1)

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

Package Downloads
TYoshimura.MultiPrecision.Algebra

Float multi precision algebra

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.7 101 1/6/2022
5.0.6 82 1/5/2022
5.0.5 606 12/1/2021
5.0.4 1,899 11/26/2021
5.0.3 102 11/22/2021
5.0.2 143 11/10/2021

!! fix elliptic integrals parameter k to m !!