Generated by DocFX

Class Special

Set of special mathematic functions.

Inheritance
System.Object
Special
Namespace: ISynergy.Framework.Mathematics.Common
Assembly: ISynergy.Framework.Mathematics.dll
Syntax
public static class Special : object
Remarks

References:

  • Cephes Math Library, http://www.netlib.org/cephes/
  • John D. Cook, http://www.johndcook.com/

Methods

View Source

Acosec(Double)

Inverse cosecant.

Declaration
public static double Acosec(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Acosech(Double)

Inverse hyperbolic cosecant.

Declaration
public static double Acosech(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Acosh(Double)

Inverse hyperbolic cos.

Declaration
public static double Acosh(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Acotan(Double)

Inverse cotangent.

Declaration
public static double Acotan(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Acotanh(Double)

Inverse hyperbolic cotangent.

Declaration
public static double Acotanh(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Asec(Double)

Inverse secant.

Declaration
public static double Asec(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Asech(Double)

Inverse hyperbolic secant.

Declaration
public static double Asech(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Asinh(Double)

Inverse hyperbolic sin.

Declaration
public static double Asinh(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Atanh(Double)

Inverse hyperbolic tangent.

Declaration
public static double Atanh(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Binomial(Double, Double)

Computes the binomial coefficients C(n,k).

Declaration
public static double Binomial(double n, double k)
Parameters
Type Name Description
System.Double n
System.Double k
Returns
Type Description
System.Double
View Source

Binomial(Int32, Int32)

Computes the binomial coefficients C(n,k).

Declaration
public static double Binomial(int n, int k)
Parameters
Type Name Description
System.Int32 n
System.Int32 k
Returns
Type Description
System.Double
View Source

BSpline(Int32, Double)

Computes the Basic Spline of order n

Declaration
public static double BSpline(int n, double x)
Parameters
Type Name Description
System.Int32 n
System.Double x
Returns
Type Description
System.Double
View Source

Cosec(Double)

Cosecant.

Declaration
public static double Cosec(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Cosech(Double)

Hyperbolic secant.

Declaration
public static double Cosech(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Cotan(Double)

Cotangent.

Declaration
public static double Cotan(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Cotanh(Double)

Hyperbolic cotangent.

Declaration
public static double Cotanh(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Epslon(Double)

Estimates unit round-off in quantities of size x.

Declaration
public static double Epslon(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
Remarks

This is a port of the epslon function from EISPACK.

View Source

Erf(Double)

Error function of the specified value.

Declaration
public static double Erf(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Erfc(Double)

Complementary error function of the specified value.

Declaration
public static double Erfc(double value)
Parameters
Type Name Description
System.Double value
Returns
Type Description
System.Double
Remarks

http://mathworld.wolfram.com/Erfc.html

View Source

Expm1(Double)

Compute exp(x) - 1 without loss of precision for small values of x.

Declaration
public static double Expm1(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
Remarks

References:

  • http://www.johndcook.com/cpp_expm1.html
View Source

Factorial(Double)

Returns the extended factorial definition of a real number.

Declaration
public static double Factorial(double n)
Parameters
Type Name Description
System.Double n
Returns
Type Description
System.Double
View Source

Factorial(Int32)

Computes the factorial of a number (n!)

Declaration
public static double Factorial(int n)
Parameters
Type Name Description
System.Int32 n
Returns
Type Description
System.Double
View Source

Ierf(Double)

Inverse error function (Erf(Double).

Declaration
public static double Ierf(double y)
Parameters
Type Name Description
System.Double y
Returns
Type Description
System.Double
View Source

Ierfc(Double)

Inverse complemented error function (Erfc(Double).

Declaration
public static double Ierfc(double y)
Parameters
Type Name Description
System.Double y
Returns
Type Description
System.Double
View Source

Log1m(Double)

Computes log(1-x) without losing precision for small values of x.

Declaration
public static double Log1m(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Log1p(Double)

Computes log(1+x) without losing precision for small values of x.

Declaration
public static double Log1p(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
Remarks

References:

  • http://www.johndcook.com/csharp_log_one_plus_x.html
View Source

Log1pexp(Double)

Computes log(1 + exp(x)) without losing precision.

Declaration
public static double Log1pexp(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

LogBinomial(Double, Double)

Computes the log binomial Coefficients Log[C(n,k)].

Declaration
public static double LogBinomial(double n, double k)
Parameters
Type Name Description
System.Double n
System.Double k
Returns
Type Description
System.Double
View Source

LogBinomial(Int32, Int32)

Computes the log binomial Coefficients Log[C(n,k)].

Declaration
public static double LogBinomial(int n, int k)
Parameters
Type Name Description
System.Int32 n
System.Int32 k
Returns
Type Description
System.Double
View Source

LogDiff(Double, Double)

Computes x + y without losing precision using ln(x) and ln(y).

Declaration
public static double LogDiff(double lnx, double lny)
Parameters
Type Name Description
System.Double lnx
System.Double lny
Returns
Type Description
System.Double
View Source

LogFactorial(Double)

Returns the log factorial of a number (ln(n!))

Declaration
public static double LogFactorial(double n)
Parameters
Type Name Description
System.Double n
Returns
Type Description
System.Double
View Source

LogFactorial(Int32)

Returns the log factorial of a number (ln(n!))

Declaration
public static double LogFactorial(int n)
Parameters
Type Name Description
System.Int32 n
Returns
Type Description
System.Double
View Source

LogSum(Double, Double)

Computes x + y without losing precision using ln(x) and ln(y).

Declaration
public static double LogSum(double lnx, double lny)
Parameters
Type Name Description
System.Double lnx
System.Double lny
Returns
Type Description
System.Double
View Source

LogSum(Double[])

Computes x + y without losing precision using ln(x) and ln(y).

Declaration
public static double LogSum(double[] values)
Parameters
Type Name Description
System.Double[] values
Returns
Type Description
System.Double
View Source

LogSum(Single, Single)

Computes x + y without losing precision using ln(x) and ln(y).

Declaration
public static double LogSum(float lnx, float lny)
Parameters
Type Name Description
System.Single lnx
System.Single lny
Returns
Type Description
System.Double
View Source

LogSumExp(Double[])

Computes sum(x) without losing precision using ln(x_0) ... ln(x_n).

Declaration
public static double LogSumExp(this double[] array)
Parameters
Type Name Description
System.Double[] array
Returns
Type Description
System.Double
View Source

P1evl(Double, Double[], Int32)

Evaluates polynomial of degree N with assumption that coef[N] = 1.0

Declaration
public static double P1evl(double x, double[] coef, int n)
Parameters
Type Name Description
System.Double x
System.Double[] coef
System.Int32 n
Returns
Type Description
System.Double
View Source

Polevl(Double, Double[], Int32)

Evaluates polynomial of degree N

Declaration
public static double Polevl(double x, double[] coef, int n)
Parameters
Type Name Description
System.Double x
System.Double[] coef
System.Int32 n
Returns
Type Description
System.Double
View Source

Sec(Double)

Secant.

Declaration
public static double Sec(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Sech(Double)

Hyperbolic secant.

Declaration
public static double Sech(double x)
Parameters
Type Name Description
System.Double x
Returns
Type Description
System.Double
View Source

Sign(Double, Double)

Returns a with the sign of b.

Declaration
public static double Sign(double a, double b)
Parameters
Type Name Description
System.Double a
System.Double b
Returns
Type Description
System.Double

If B > 0 then the result is ABS(A), else it is -ABS(A).

Remarks

This is a port of the sign transfer function from EISPACK, and is is equivalent to C++'s std::copysign function.

View Source

Softmax(Double[])

Computes the Softmax function (also known as normalized Exponencial function) that "squashes"a vector or arbitrary real values into a vector of real values in the range (0, 1) that add up to 1.

Declaration
public static double[] Softmax(double[] input)
Parameters
Type Name Description
System.Double[] input

The real values to be converted into the unit interval.

Returns
Type Description
System.Double[]

A vector with the same number of dimensions as input but where values lie between 0 and 1.

View Source

Softmax(Double[], Double[])

Computes the Softmax function (also known as normalized Exponencial function) that "squashes"a vector or arbitrary real values into a vector of real values in the range (0, 1) that add up to 1.

Declaration
public static double[] Softmax(double[] input, double[] result)
Parameters
Type Name Description
System.Double[] input

The real values to be converted into the unit interval.

System.Double[] result

The location where to store the result of this operation.

Returns
Type Description
System.Double[]

A vector with the same number of dimensions as input but where values lie between 0 and 1.