Namespaces

Types

Type Fn

Namespace MathNet.Numerics

Methods

Public instance methods

bool Equals(object obj)

Parameters
return bool
object obj

int GetHashCode()

Parameters
return int

Type GetType()

Parameters
return Type

string ToString()

Parameters
return string

Public static methods

double Beta(double z, double w)

Returns the Euler Beta function of real valued z > 0, w > 0. Beta(z,w) = Beta(w,z).
Parameters
return double
double z
double w

double BetaLn(double z, double w)

Returns the natural logarithm of the Euler Beta function of real valued z > 0, w > 0. BetaLn(z,w) = BetaLn(w,z).
Parameters
return double
double z
double w

double BetaRegularized(double a, double b, double x)

Returns the regularized lower incomplete beta function I_x(a,b) = 1/Beta(a,b) * int(t^(a-1)*(1-t)^(b-1),t=0..x) for real a > 0, b > 0, 1 >= x >= 0.
Parameters
return double
double a
double b
double x

double BinomialCoefficient(int n, int k)

Returns the binomial coefficient of n and k as a double precision number.
If you need to multiply or divide various such coefficients, consider using the logarithmic version BinomialCoefficientLn instead so you can add instead of multiply and subtract instead of divide, and then exponentiate the result using Exp.
Parameters
return double
int n
int k

double BinomialCoefficientLn(int n, int k)

Returns the natural logarithm of the binomial coefficient of n and k as a double precision number.
Parameters
return double
int n
int k

int CeilingToPowerOf2(int value)

Returns the smallest integer power of two bigger or equal to the value.
Parameters
return int
int value

double Digamma(double x)

Returns the digamma (psi) function of real values (except at 0, -1, -2, ...). Digamma is the logarithmic derivative of the Gamma function.
Parameters
return double
double x

double Erf(double x)

Returns the error function erf(x) = 2/sqrt(pi) * int(exp(-t^2),t=0..x)
Parameters
return double
double x

double ErfInverse(double x)

Returns the inverse error function erf^-1(x).
Parameters
return double
double x

double Factorial(int value)

Returns the factorial (n!) of an integer number > 0. Consider using FactorialLn instead.
If you need to multiply or divide various such factorials, consider using the logarithmic version FactorialLn instead so you can add instead of multiply and subtract instead of divide, and then exponentiate the result using Exp. This will also completely circumvent the problem that factorials easily become very large.
Parameters
return double
int value

double FactorialLn(int value)

Returns the natural logarithm of the factorial (n!) for an integer value > 0.
Parameters
return double
int value

int FloorToPowerOf2(int value)

Returns the biggest integer power of two smaller or equal to the value.
Parameters
return int
int value

double Gamma(double value)

Returns the gamma function for real values (except at 0, -1, -2, ...). For numeric stability, consider to use GammaLn for positive values.
Parameters
return double
double value

double GammaLn(double value)

Returns the natural logarithm of Gamma for a real value > 0.
Parameters
return double
double value

double GammaRegularized(double a, double x)

Returns the regularized lower incomplete gamma function P(a,x) = 1/Gamma(a) * int(exp(-t)t^(a-1),t=0..x) for real a > 0, x > 0.
Parameters
return double
double a
double x

long Gcd(long a, long b, Int64& x, Int64& y)

Parameters
return long
long a
long b
Int64& x
Int64& y

long Gcd(long a, long b)

Returns the greatest common divisor of two integers using euclids algorithm.
Parameters
return long
long a
long b

double HarmonicNumber(int n)

Evaluates the n-th harmonic number Hn = sum(1/k,k=1..n).
See Wikipedia - Harmonic Number
Parameters
return double
int n n >= 0

double Hypot(double a, double b)

Returns sqrt(a2 + b2)without underflow/overflow.
Parameters
return double
double a
double b

double IncompleteBetaRegularized(double a, double b, double x)

Obsolete. Please use BetaRegularized instead, with the same parameters (method was renamed).
Parameters
return double
double a
double b
double x

double IncompleteGammaRegularized(double a, double x)

Obsolete. Please use GammaRegularized instead, with the same parameters (method was renamed).
Parameters
return double
double a
double x

int IntLog2(int x)

Evaluates the logarithm to base 2 of the provided integer value.
Parameters
return int
int x

long IntPow(long radix, uint exponent)

Integer Power
Parameters
return long
long radix
uint exponent

int IntPow2(int exponent)

Raises 2 to the provided integer exponent (0 <= exponent < 31).
Parameters
return int
int exponent

long Lcm(long a, long b)

Returns the least common multiple of two integers using euclids algorithm.
Parameters
return long
long a
long b

double Sinc(double x)

Normalized Sinc (sinus cardinalis) Function.
sinc(x) = sin(pi * x) / (pi * x)
Parameters
return double
double x