where \Gamma is the gamma function. x must be positive unless v is an integer
Other special functions
val expn : int ->float -> float
Exponential integral E_n.
val shichi : float -> float * float
Hyperbolic sine and cosine integrals, shichi x returns * (\mathrm{shi}, \mathrm{chi}).
val shi : float -> float
Hyperbolic sine integral.
val chi : float -> float
Hyperbolic cosine integral.
val sici : float -> float * float
Sine and cosine integrals, sici x returns (\mathrm{si}, \mathrm{ci}).
val si : float -> float
Sine integral.
val ci : float -> float
Cosine integral.
val zeta : float ->float -> float
zeta x q returns the Hurwitz zeta function \zeta(x, q), which reduces to the Riemann zeta function \zeta(x) when q=1.
val zetac : float -> float
Riemann zeta function minus 1.
Raw statistical functions
val bdtr : int ->int ->float -> float
Binomial distribution cumulative distribution function.
bdtr k n p calculates the sum of the terms 0 through k of the Binomial probability density.
\mathrm{bdtr}(k, n, p) = \sum_{j=0}^k \binom{n}{j} p^j (1-p)^{n-j}
Parameters: * k: Number of successes. * n: Number of events. * p: Probability of success in a single event.
Returns: * Probability of k or fewer successes in n independent events with success probability p.
val bdtrc : int ->int ->float -> float
Binomial distribution survival function.
bdtrc k n p calculates the sum of the terms k + 1 through n of the binomial probability density,
\mathrm{bdtrc}(k, n, p) = \sum_{j=k+1}^n \binom{n}{j} p^j (1-p)^{n-j}
val bdtri : int ->int ->float -> float
Inverse function to bdtr with respect to p.
Finds the event probability p such that the sum of the terms 0 through k of the binomial probability density is equal to the given cumulative probability y.
val btdtr : float ->float ->float -> float
Cumulative density function of the beta distribution.
btdtr a b x returns the integral from 0 to x of the beta probability density function,
I = \int_0^x \frac{\Gamma(a + b)}{\Gamma(a)\Gamma(b)} t^{a-1} (1-t)^{b-1}\,dt
where \Gamma is the gamma function.
Parameters: * a: Shape parameter (a > 0). * b: Shape parameter (b > 0). * x: Upper limit of integration, in [0, 1].
Returns: * Cumulative density function of the beta distribution with a and b at x.
val btdtri : float ->float ->float -> float
The p-th quantile of the Beta distribution.
This function is the inverse of the beta cumulative distribution function, btdtr, returning the value of x for which \mathrm{btdtr}(a, b, x) = p,
p = \int_0^x \frac{\Gamma(a + b)}{\Gamma(a)\Gamma(b)} t^{a-1} (1-t)^{b-1}\,dt
is_inf x returns true exactly if x is infinity or neg_infinity.
val is_normal : float -> bool
is_normal x returns true if x is a normal float number.
val is_subnormal : float -> bool
is_nan x returns true if x is subnormal float number.
val is_odd : int -> bool
is_odd x returns true exactly if x is odd.
val is_even : int -> bool
is_even x returns true exactly if x is even.
val is_pow2 : int -> bool
is_pow2 x return true exactly if x is an integer power of 2, e.g. 32, 64, etc.
val same_sign : float ->float -> bool
same_sign x y returns true if x and y have the same sign, otherwise it returns false. Positive and negative zeros are special cases and always returns true.
val is_simplex : float array-> bool
is_simplex x checks whether the vector x lies on a simplex. In other words, \sum_i^K x_i = 1 and x_i\ge~0,\forall~i\in~[1,K], where K is the dimension of x.
val is_int : float -> bool
val is_sqr : int -> bool
is_sqr x checks if x is the square of an integer.
val mulmod : int ->int ->int -> int
mulmod a b m computes (a*b) mod m.
val powmod : int ->int ->int -> int
powmod a b m computes (a^b) mod m.
val is_prime : int -> bool
is_prime x returns true if x is a prime number. The function is deterministic for all numbers representable by an int. The function uses the Rabin–Miller primality test.
val fermat_fact : int -> int * int
fermat_fact x performs Fermat factorisation over x, i.e. into two roughly equal factors. x must be an odd number.
val nextafter : float ->float -> float
nextafter from to returns the next representable double precision value of from in the direction of to. If from equals to, this value is returned.
val nextafterf : float ->float -> float
nextafter from to returns the next representable single precision value of from in the direction of to. If from equals to, this value is returned.