TYoshimura.MultiPrecision 5.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package TYoshimura.MultiPrecision --version 5.0.3                
NuGet\Install-Package TYoshimura.MultiPrecision -Version 5.0.3                
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="5.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TYoshimura.MultiPrecision --version 5.0.3                
#r "nuget: TYoshimura.MultiPrecision, 5.0.3"                
#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=5.0.3

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

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 (-inf,+inf) 2 Length ≤ 256 MultiPrecision<N>.Erf(x)
erfc (-inf,+inf) 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 MultiPrecision<N>.EllipticK(k)
elliptic_e [0,1] 1 MultiPrecision<N>.EllipticE(k)
elliptic_pi [0,1] 1 MultiPrecision<N>.EllipticPi(n, k)
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 Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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 was computed.  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.
  • net5.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 125 11/13/2024
6.4.1 96 11/7/2024
6.4.0 163 11/1/2024
6.3.4 402 8/22/2024
6.3.3 115 6/10/2024
6.3.2 481 2/21/2024
6.3.1 238 2/8/2024
6.3.0 514 1/20/2024
6.2.1 486 9/9/2023
6.2.0 562 9/6/2023
6.1.1 588 4/6/2023
6.1.0 1,074 3/10/2023
6.0.0 594 3/3/2023
5.1.0 2,786 9/17/2022
5.0.7 637 1/6/2022
5.0.6 585 1/5/2022
5.0.5 1,415 12/1/2021
5.0.4 2,431 11/26/2021
5.0.3 604 11/22/2021
5.0.2 658 11/10/2021

fix paramsearch