26#define _USE_MATH_DEFINES
48#include "common/parser/rapidxml/rapidxml_print.hpp"
49#include "common/parser/rapidxml/rapidxml.hpp"
50#include "../plugins/experimental/biogas/save_load.h"
92template <
typename TData,
int dim,
typename TRet>
97 if (x <= Gamma_Function_Max_Arg())
98 return log(Gamma_Function(x));
100 return (
double) xLnGamma_Asymptotic_Expansion( (
long double) x );
131template <
typename TData,
int dim,
typename TRet>
136 if (x <= Gamma_Function_Max_Arg())
137 return logl(xGamma_Function(x));
139 return xLnGamma_Asymptotic_Expansion( x );
169template <
typename TData,
int dim,
typename TRet>
173 long double sum = 0.0L;
174 long double xx = x * x;
179 lngamma = log_sqrt_2pi - xj + (xj - 0.5L) * logl(xj);
180 for (i = 0; i < m; i++)
182 term[i] = B[i] / xj; xj *= xx;
184 for (i = m - 1; i >= 0; i--)
186 return lngamma + sum;
double Ln_Gamma_Function(double x)
Definition ln_gamma_function.h:93
long double xLn_Gamma_Function(long double x)
Definition ln_gamma_function.h:132
long double xLnGamma_Asymptotic_Expansion(long double x)
Definition ln_gamma_function.h:170