gleam_community/maths/special
Special: A module containing special mathematical functions.
- Special mathematical functions
Functions
pub fn beta(x: Float, y: Float) -> Float
The beta function over the real numbers:
\[ \text{B}(x, y) = \frac{\Gamma(x) \cdot \Gamma(y)}{\Gamma(x + y)} \]
The beta function is evaluated through the use of the gamma function.
pub fn gamma(x: Float) -> Float
The gamma function over the real numbers. The function is essentially equal to the factorial for any positive integer argument: $$\Gamma(n) = (n - 1)!$$
The implemented gamma function is approximated through Lanczos approximation using the same coefficients used by the GNU Scientific Library.
pub fn incomplete_gamma(
a: Float,
x: Float,
) -> Result(Float, String)
The lower incomplete gamma function over the real numbers.
The implemented incomplete gamma function is evaluated through a power series expansion.