[][src]Trait mathru::special::gamma::Gamma

pub trait Gamma {
    pub fn gamma(self) -> Self;
pub fn ln_gamma(self) -> Self;
pub fn digamma(self) -> Self;
pub fn gamma_u(self, x: Self) -> Self;
pub fn gamma_ur(self, x: Self) -> Self;
pub fn gamma_l(self, x: Self) -> Self;
pub fn gamma_lr(self, x: Self) -> Self; }

Provides gamma related functions

Required methods

pub fn gamma(self) -> Self[src]

Gamma function

\Gamma(z) = \int_0^\infty t^{z-1} {\mathrm e}^{-t} \mathrm dt

Fore more information: https://en.wikipedia.org/wiki/Gamma_function

Arguments

  • self > 0.0

Panics

*self <= 0.0

Example

use mathru::special::gamma::Gamma;

let z: f64 = 0.3_f64;
let gamma: f64 = z.gamma();

pub fn ln_gamma(self) -> Self[src]

Log-gamma function

lnΓ(z) Fore more information: https://en.wikipedia.org/wiki/Gamma_function#The_log-gamma_function

Arguments

  • self
use mathru::special::gamma::Gamma;

let x: f64 = 0.3_f64;
let ln_gamma: f64 = x.ln_gamma();

pub fn digamma(self) -> Self[src]

Digamma function

\psi(x)=\frac{d}{dx}\ln\big(\Gamma(x)\big)=\frac{\Gamma'(x)}{\Gamma(x)}

Fore more information: https://en.wikipedia.org/wiki/Digamma_function

Arguments

  • self

Example

use mathru::special::gamma::Gamma;

let x: f64 = 0.3_f64;
let digamma: f64 = x.digamma();

pub fn gamma_u(self, x: Self) -> Self[src]

Upper incomplete gamma function

\Gamma(s,x) = \int_x^{\infty} t^{s-1}\,\mathrm{e}^{-t}\,{\rm d}t

Fore more information: https://en.wikipedia.org/wiki/Incomplete_gamma_function#Upper_incomplete_Gamma_function

Arguments

  • self
  • x

Example

use mathru::special::gamma::Gamma;

let a: f64 = 0.5_f64;
let x: f64 = 0.3_f64;

let gamma_u: f64 = a.gamma_u(x);

pub fn gamma_ur(self, x: Self) -> Self[src]

Upper incomplete regularized gamma function

P(s,x)=\frac{\gamma(s,x)}{\Gamma(s)}

Fore more information: https://en .wikipedia.org/wiki/Incomplete_gamma_function# Regularized_Gamma_functions_and_Poisson_random_variables

Arguments

  • self
  • x

Example

use mathru::special::gamma::Gamma;

let a: f64 = 0.5_f64;
let x: f64 = 0.3_f64;
let gamma_ur: f64 = a.gamma_ur(x);

pub fn gamma_l(self, x: Self) -> Self[src]

Lower incomplete gamma function

\gamma(s,x) = \int_0^x t^{s-1}\,\mathrm{e}^{-t}\,{\rm d}t

Fore more information: https://en .wikipedia.org/wiki/Incomplete_gamma_function# Regularized_Gamma_functions_and_Poisson_random_variables

Arguments

  • self
  • x

Example

use mathru::special::gamma::Gamma;

let a: f64 = 0.5_f64;
let x: f64 = 0.3_f64;
let gamma_l: f64 = a.gamma_l(x);

pub fn gamma_lr(self, x: Self) -> Self[src]

Lower regularized incomplete gamma function

Q(s,x)=\frac{\Gamma(s,x)}{\Gamma(s)}=1-P(s,x)

Fore more information: https://en .wikipedia.org/wiki/Incomplete_gamma_function# Regularized_Gamma_functions_and_Poisson_random_variables

Arguments

  • self
  • x

Example

use mathru::special::gamma::Gamma;

let a: f64 = 0.5_f64;
let x: f64 = 0.3_f64;
let gamma_lr: f64 = a.gamma_lr(x);
Loading content...

Implementations on Foreign Types

impl Gamma for f64[src]

impl Gamma for f32[src]

Loading content...

Implementors

Loading content...