Jacobian Elliptic function ``ellipj u m`` returns ``(sn, cn, dn, phi)``.
val ellipk : float -> float
Complete elliptic integral of the first kind ``ellipk m``.
val ellipkm1 : float -> float
Complete elliptic integral of the first kind around ``m = 1``.
val ellipkinc : float ->float -> float
Incomplete elliptic integral of the first kind ``ellipkinc phi m``.
val ellipe : float -> float
Complete elliptic integral of the second kind ``ellipe m``.
val ellipeinc : float ->float -> float
Incomplete elliptic integral of the second kind ``ellipeinc phi m``.
Gamma Functions
val gamma : float -> float
Gamma function.
.. math:: \Gamma(z) = \int_0^\infty x^z-1 e^
x
}
dx = (z - 1)!
The gamma function is often referred to as the generalized factorial since ``z*gamma(z) = gamma(z+1)`` and ``gamma(n+1) = n!`` for natural number ``n``.
Parameters: * ``z``
Returns: * The value of gamma(z).
val rgamma : float -> float
Reciprocal Gamma function.
val loggamma : float -> float
Logarithm of the gamma function.
val gammainc : float ->float -> float
Incomplete gamma function.
val gammaincinv : float ->float -> float
Inverse function of ``gammainc``.
val gammaincc : float ->float -> float
Complemented incomplete gamma integral.
val gammainccinv : float ->float -> float
Inverse function of ``gammaincc``.
val psi : float -> float
The digamma function.
Beta functions
val beta : float ->float -> float
Beta function.
.. math:: \mathrmB(a, b) = \frac\Gamma(a) \Gamma(b)\Gamma(a+b)
val betainc : float ->float ->float -> float
Incomplete beta integral.
val betaincinv : float ->float ->float -> float
Inverse funciton of beta integral.
Factorials
val fact : int -> float
Factorial function ``fact n`` calculates ``n!``.
val log_fact : int -> float
Logarithm of factorial function ``log_fact n`` calculates ``log n!``.
val doublefact : int -> float
Double factorial function ``doublefact n`` calculates n!! = n(n-2)(n-4)...
val log_doublefact : int -> float
Logarithm of double factorial function. ``log_doublefact n`` calculates log(n!!)
val permutation : int ->int -> int
``permutation n k`` gives the number n!/(n-k)! of ordered subsets of length k, taken from a set of n elements.
val permutation_float : int ->int -> float
``permutation_float`` is like ``permutation`` but deal with larger range.
val combination : int ->int -> int
``combination n k`` gives the number n!/(k!(n-k)!) of subsets of k elements of a set of n elements. This is the binomial coefficient 'n choose k'
val combination_float : int ->int -> float
``combination_float`` is like ``combination`` but can deal with a larger range.
val log_combination : int ->int -> float
``log_combination n k`` gives the logarithm of 'n choose k'.
Fresnel sin and cos integrals. ``fresnel x`` returns a tuple consisting of ``(Fresnel sin integral, Fresnel cos integral)``.
Struve functions
val struve : float ->float -> float
``struve v x`` returns the value of the Struve function of order ``v`` at ``x``. The Struve function is defined as,
.. math:: H_v(x) = (z/2)^
+ 1} \sum_{n=0}^\infty \frac{(-1)^n (z/2)^{2n}}{\Gamma(n + \frac{3}{2}) \Gamma(n + v + \frac{3}{2})},
where :math:`\Gamma` is the gamma function.
Parameters:
* ``v``: order of the Struve function (float).
* ``x``: Argument of the Struve function (float; 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 ``(shi, 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 ``(si, ci)``.
val si : float -> float
Sine integral.
val ci : float -> float
Cosine integral.
val zeta : float ->float -> float
``zeta x q`` gives the Hurwitz zeta function :math:`\zeta(x, q)`, which reduces to the Riemann zeta function :math:`\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.
.. math:: \mathrmdtr(k, n, p) = \sum_j=0^k {n\choosej
}
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 probabilities of 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,
.. math:: \mathrmdtrc(k, n, p) = \sum_j=k+1^n {n\choosej
}
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 zero to x of the beta probability density function,
.. math:: I = \int_0^x \frac\Gamma(a + b)\Gamma(a)\Gamma(b) t^a-1 (1-t)^-1\,dt
where :math:`\Gamma` is the gamma function.
Parameters: * ``a``: Shape parameter (a > 0). * ``b``: Shape parameter (a > 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 ``btdtr(a, b, x) = p``,
.. math:: p = \int_0^x \frac\Gamma(a + b)\Gamma(a)\Gamma(b) t^a-1 (1-t)^-1\,dt
where :math:`\Gamma` is the gamma function.
Parameters: * ``a``: Shape parameter (a > 0). * ``b``: Shape parameter (a > 0). * ``x``: Cumulative probability, in 0, 1.
Returns: * The quantile corresponding to ``p``.
Helper functions
val is_nan : float -> bool
``is_nan x`` returns ``true`` if ``x`` is ``nan``.
val is_inf : float -> bool
``is_inf x`` returns ``true`` if ``x`` is ``infinity`` or ``neg_infinity``.
val is_odd : int -> bool
``is_odd x`` returns ``true`` if ``x`` is odd.
val is_even : int -> bool
``is_even x`` returns ``true`` if ``x`` is even.
val is_pow2 : int -> bool
``is_pow2 x`` return ``true`` if ``x`` is 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 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.