00001 #if !defined SPECIAL_FUNC_H 00002 #define SPECIAL_FUNC_H 00003 00004 #include <math.h> 00005 #include <complex> 00006 00007 #include "constants.h" 00008 00009 using namespace std; 00010 00011 typedef complex< double > double_complex; 00012 00013 // Gamma function and friends 00014 double_complex Gamma(double_complex z); 00015 double LnGamma(double xx); 00016 double Gamma(double xx); 00017 double Factorial(int n); 00018 double BinomialCoeff(int n, int k); 00019 double LnFactorial(int n); 00020 double IncGammaP(double a, double x); 00021 double IncGammaQ(double a, double x); 00022 00023 // Error function and friends 00024 double Erf(double x); 00025 double Erfc(double x); 00026 double Daw(double x); 00027 double Erfi(double x); 00028 00029 // Probability distributions 00030 double Chi2ProbDist(double z, int n); 00031 #endif