QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Static Private Attributes | List of all members
GammaFunction Class Reference

Gamma function class. More...

#include <gammadistribution.hpp>

+ Collaboration diagram for GammaFunction:

Public Member Functions

Real value (Real x) const
 
Real logValue (Real x) const
 

Static Private Attributes

static const Real c1_ = 76.18009172947146
 
static const Real c2_ = -86.50532032941677
 
static const Real c3_ = 24.01409824083091
 
static const Real c4_ = -1.231739572450155
 
static const Real c5_ = 0.1208650973866179e-2
 
static const Real c6_ = -0.5395239384953e-5
 

Detailed Description

Gamma function class.

This is a function defined by

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

The implementation of the algorithm was inspired by "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling, Flannery, chapter 6

Tests:
the correctness of the returned value is tested by checking it against known good results.

Definition at line 56 of file gammadistribution.hpp.

Member Function Documentation

◆ value()

Real value ( Real  x) const

Definition at line 84 of file gammadistribution.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logValue()

Real logValue ( Real  x) const

Definition at line 69 of file gammadistribution.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ c1_

const Real c1_ = 76.18009172947146
staticprivate

Definition at line 61 of file gammadistribution.hpp.

◆ c2_

const Real c2_ = -86.50532032941677
staticprivate

Definition at line 61 of file gammadistribution.hpp.

◆ c3_

const Real c3_ = 24.01409824083091
staticprivate

Definition at line 61 of file gammadistribution.hpp.

◆ c4_

const Real c4_ = -1.231739572450155
staticprivate

Definition at line 61 of file gammadistribution.hpp.

◆ c5_

const Real c5_ = 0.1208650973866179e-2
staticprivate

Definition at line 61 of file gammadistribution.hpp.

◆ c6_

const Real c6_ = -0.5395239384953e-5
staticprivate

Definition at line 61 of file gammadistribution.hpp.