rgsl/randist/
gaussian.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 a Gaussian distribution with standard deviation sigma, using the formula given above.
6#[doc(alias = "gsl_ran_gaussian_pdf")]
7pub fn gaussian_pdf(x: f64, sigma: f64) -> f64 {
8    unsafe { sys::gsl_ran_gaussian_pdf(x, sigma) }
9}
10
11/// This function computes results for the unit Gaussian distribution.
12/// They are equivalent to the functions above with a standard deviation of one, sigma = 1.
13#[doc(alias = "gsl_ran_ugaussian_pdf")]
14pub fn ugaussian_pdf(x: f64) -> f64 {
15    unsafe { sys::gsl_ran_ugaussian_pdf(x) }
16}
17
18/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Gaussian distribution with standard deviation sigma.
19#[doc(alias = "gsl_cdf_gaussian_P")]
20pub fn gaussian_P(x: f64, sigma: f64) -> f64 {
21    unsafe { sys::gsl_cdf_gaussian_P(x, sigma) }
22}
23
24/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Gaussian distribution with standard deviation sigma.
25#[doc(alias = "gsl_cdf_gaussian_Q")]
26pub fn gaussian_Q(x: f64, sigma: f64) -> f64 {
27    unsafe { sys::gsl_cdf_gaussian_Q(x, sigma) }
28}
29
30/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Gaussian distribution with standard deviation sigma.
31#[doc(alias = "gsl_cdf_gaussian_Pinv")]
32pub fn gaussian_Pinv(P: f64, sigma: f64) -> f64 {
33    unsafe { sys::gsl_cdf_gaussian_Pinv(P, sigma) }
34}
35
36/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the Gaussian distribution with standard deviation sigma.
37#[doc(alias = "gsl_cdf_gaussian_Qinv")]
38pub fn gaussian_Qinv(Q: f64, sigma: f64) -> f64 {
39    unsafe { sys::gsl_cdf_gaussian_Qinv(Q, sigma) }
40}
41
42/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the unit Gaussian distribution.
43#[doc(alias = "gsl_cdf_ugaussian_P")]
44pub fn ugaussian_P(x: f64) -> f64 {
45    unsafe { sys::gsl_cdf_ugaussian_P(x) }
46}
47
48/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the unit Gaussian distribution.
49#[doc(alias = "gsl_cdf_ugaussian_Q")]
50pub fn ugaussian_Q(x: f64) -> f64 {
51    unsafe { sys::gsl_cdf_ugaussian_Q(x) }
52}
53
54/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the unit Gaussian distribution.
55#[doc(alias = "gsl_cdf_ugaussian_Pinv")]
56pub fn ugaussian_Pinv(P: f64) -> f64 {
57    unsafe { sys::gsl_cdf_ugaussian_Pinv(P) }
58}
59
60/// This function computes the cumulative distribution functions P(x), Q(x) and their inverses for the unit Gaussian distribution.
61#[doc(alias = "gsl_cdf_ugaussian_Qinv")]
62pub fn ugaussian_Qinv(Q: f64) -> f64 {
63    unsafe { sys::gsl_cdf_ugaussian_Qinv(Q) }
64}