MathParser\Extensions\Math Class Reference

Static Public Member Functions

static gcd ($a, $b)
 Compute greates common denominator, using the Euclidean algorithm. More...
 
static logGamma ($a)
 Compute log(Gamma($a)) where $a is a positive real number. More...
 
static Factorial ($num)
 Compute factorial n! for an integer $n using iteration. More...
 
static SemiFactorial ($num)
 Compute semi-factorial n!! for an integer $n using iteration. More...
 

Static Private Member Functions

static logStirlingApproximation ($x)
 Compute log(Gamma($x)) using Stirling asympotic expansion. More...
 
static lanczosApproximation ($x)
 Compute log(Gamma($x)) using Lanczos approximation. More...
 

Member Function Documentation

static MathParser\Extensions\Math::Factorial (   $num)
static

Compute factorial n! for an integer $n using iteration.

Parameters
int$num
Return values
int
static MathParser\Extensions\Math::gcd (   $a,
  $b 
)
static

Compute greates common denominator, using the Euclidean algorithm.

Compute and return gcd($a, $b)

Parameters
int$a
int$b
Return values
int
static MathParser\Extensions\Math::lanczosApproximation (   $x)
staticprivate

Compute log(Gamma($x)) using Lanczos approximation.

Parameters
float$x
Return values
float
static MathParser\Extensions\Math::logGamma (   $a)
static

Compute log(Gamma($a)) where $a is a positive real number.

For large values of $a ($a > 171), use Stirling asympotic expansion, otherwise use the Lanczos approximation

Parameters
float$a
Exceptions
InvalidArgumentExceptionif $a < 0
Return values
float
static MathParser\Extensions\Math::logStirlingApproximation (   $x)
staticprivate

Compute log(Gamma($x)) using Stirling asympotic expansion.

Parameters
float$x
Return values
float
static MathParser\Extensions\Math::SemiFactorial (   $num)
static

Compute semi-factorial n!! for an integer $n using iteration.

Parameters
int$num
Return values
int

The documentation for this class was generated from the following file: