rgsl/randist/
exponential.rs

1//
2// A rust binding for the GSL library by Guillaume Gomez (guillaume1.gomez@gmail.com)
3//
4
5/// This function computes the probability density p(x) at x for an exponential distribution with mean mu, using the formula given above.
6#[doc(alias = "gsl_ran_exponential_pdf")]
7pub fn exponential_pdf(x: f64, mu: f64) -> f64 {
8    unsafe { sys::gsl_ran_exponential_pdf(x, mu) }
9}
10
11/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the exponential distribution with mean mu.
12#[doc(alias = "gsl_cdf_exponential_P")]
13pub fn exponential_P(x: f64, mu: f64) -> f64 {
14    unsafe { sys::gsl_cdf_exponential_P(x, mu) }
15}
16
17/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the exponential distribution with mean mu.
18#[doc(alias = "gsl_cdf_exponential_Q")]
19pub fn exponential_Q(x: f64, mu: f64) -> f64 {
20    unsafe { sys::gsl_cdf_exponential_Q(x, mu) }
21}
22
23#[doc(alias = "gsl_cdf_exponential_Pinv")]
24pub fn exponential_Pinv(P: f64, mu: f64) -> f64 {
25    unsafe { sys::gsl_cdf_exponential_Pinv(P, mu) }
26}
27
28/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the exponential distribution with mean mu.
29#[doc(alias = "gsl_cdf_exponential_Qinv")]
30pub fn exponential_Qinv(Q: f64, mu: f64) -> f64 {
31    unsafe { sys::gsl_cdf_exponential_Qinv(Q, mu) }
32}