Repository: GuillaumeGomez/rust-GSL (language: rust)

Issue:
Incorrect documentation, and possible function names, for gamma distributions
The functions in [`rgsl::randist::gamma`](https://docs.rs/GSL/1.0.0/rgsl/randist/gamma/index.html) have improper documentation, and possible function names. Functions such as [`gamma_P`](https://github.com/GuillaumeGomez/rust-GSL/blob/ce569dcd948620f80161a1d096806e05cc46d218/src/randist/gamma.rs#L31), `gamma_Q`, `gamma_Pinv`, and `gamma_Qinv` say the compute the pdf in the rgsl documentation, but the gnu documentation for the [functions called](https://www.gnu.org/software/gsl/doc/html/randist.html#the-gamma-distribution) says they compute the cdf. P and Q are explained [here](https://www.gnu.org/software/gsl/doc/html/randist.html).

The documentation should be updated. Perhaps the function names could be changed as well, but that would be a breaking change and probably not worth it.


Discussion / hints:

Fix patch:
diff --git a/src/randist/gamma.rs b/src/randist/gamma.rs
index 6a70274e..0c384da7 100644
--- a/src/randist/gamma.rs
+++ b/src/randist/gamma.rs
@@ -8,25 +8,29 @@ pub fn gamma_pdf(x: f64, a: f64, b: f64) -> f64 {
     unsafe { sys::gsl_ran_gamma_pdf(x, a, b) }
 }
 
-/// This function computes This function computes the probability density p(x) at x for a gamma distribution with parameters a and b, using the formula given above.
+/// This function compute the cumulative distribution functions P(x), Q(x) and their inverses for
+/// the gamma distribution with parameters a and b.
 #[doc(alias = "gsl_cdf_gamma_P")]
 pub fn gamma_P(x: f64, a: f64, b: f64) -> f64 {
     unsafe { sys::gsl_cdf_gamma_P(x, a, b) }
 }
 
-/// This function computes This function computes the probability density p(x) at x for a gamma distribution with parameters a and b, using the formula given above.
+/// This function compute the cumulative distribution functions P(x), Q(x) and their inverses for
+/// the gamma distribution with parameters a and b.
 #[doc(alias = "gsl_cdf_gamma_Q")]
 pub fn gamma_Q(x: f64, a: f64, b: f64) -> f64 {
     unsafe { sys::gsl_cdf_gamma_Q(x, a, b) }
 }
 
-/// This function computes This function computes the probability density p(x) at x for a gamma distribution with parameters a and b, using the formula given above.
+/// This function compute the cumulative distribution functions P(x), Q(x) and their inverses for
+/// the gamma distribution with parameters a and b.
 #[doc(alias = "gsl_cdf_gamma_Pinv")]
 pub fn gamma_Pinv(P: f64, a: f64, b: f64) -> f64 {
     unsafe { sys::gsl_cdf_gamma_Pinv(P, a, b) }
 }
 
-/// This function computes This function computes the probability density p(x) at x for a gamma distribution with parameters a and b, using the formula given above.
+/// This function compute the cumulative distribution functions P(x), Q(x) and their inverses for
+/// the gamma distribution with parameters a and b.
 #[doc(alias = "gsl_cdf_gamma_Qinv")]
 pub fn gamma_Qinv(Q: f64, a: f64, b: f64) -> f64 {
     unsafe { sys::gsl_cdf_gamma_Qinv(Q, a, b) }


Test patch: