Scaling utilities.
Scaling utilities.
Often, in order to avoid underflow, we can offload some of the exponent of a double into an int. To make things more efficient, we can actually share that exponent between doubles.
The scales used in this trait are in log space: they can be safely added and subtracted.
Implementations of the Bessel functions, based on Numerical Recipes
Package for common unit conversions.
The indicator function.
The indicator function. 1.0 iff b, else 0.0 For non-boolean arguments, 1.0 iff b != 0, else 0.0
closeTo for Doubles.
This package specifies standard numerical/scientific constants in SI units.
The derivative of the log gamma function
An approximation to the error function
An approximation to the complementary error function: erfc(x) = 1 - erfc(x)
Inverse erfc
The imaginary error function for real argument x.
The imaginary error function for real argument x.
Adapted from http://www.mathworks.com/matlabcentral/newsreader/view_thread/24120 verified against mathematica
Inverse erf
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/special/Gamma.html#regularizedGammaP(double, double)
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
regularized incomplete gamma function \int_0x \exp(-t)pow(t,a-1) dt / Gamma(a)
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/special/Gamma.html#regularizedGammaP(double, double)
Whether a number is even.
Whether a number is even. For Double and Float, isEven also implies that the number is an integer, and therefore does not necessarily equal !isOdd for fractional input.
Whether a number is odd.
Whether a number is odd. For Double and Float, isOdd also implies that the number is an integer, and therefore does not necessarily equal !isEven for fractional input.
Evaluates the log of the generalized beta function.
Evaluates the log of the generalized beta function. \sum_a lgamma(c(a))- lgamma(c.sum)
Computes the log of the gamma function.
Computes the log of the gamma function. The two parameter version is the log Incomplete gamma function = \log \int_0x \exp(-t)pow(t,a-1) dt
an approximation of the log of the Gamma function of x.
The indicator function in log space: 0.0 iff b else Double.NegativeInfinity
The logit (inverse sigmoid) function: -log((1/x) - 1)
Multivariate Digamma
Multivariate digamma log
Computes the polynomial P(x) with coefficients given in the passed in array.
Computes the polynomial P(x) with coefficients given in the passed in array. coefs(i) is the coef for the x_i term.
The Relu function: max(0, x)
The Relu function: max(0, x)
https://en.wikipedia.org/wiki/Rectifier_(neural_networks)
The sigmoid function: 1/(1 + exp(-x))
The sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(x)/x.
The sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(x)/x. Note that this differs from some signal analysis conventions, where sinc(n != 0) is defined by sin(Pi*x)/(Pi*x). This variant is provided for convenience as breeze.numerics.sincpi. Use it instead when translating from numpy.sinc..
The pi-normalized sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(Pi*x)/(Pi*x).
The pi-normalized sine cardinal (sinc) function, as defined by sinc(0)=1, sinc(n != 0)=sin(Pi*x)/(Pi*x). See also breeze.numerics.sinc.
The second derivative of the log gamma function
Contains several standard numerical functions as UFunc with MappingUFuncs,