18 #ifndef _biomcmc_prob_distribution_aux_h_ 19 #define _biomcmc_prob_distribution_aux_h_ 23 #define R_LN2 0.693147180559945309417232121458 24 #define R_PI 3.141592653589793238462643383280 25 #define R_2PI 6.283185307179586476925286766559 26 #define R_EXP_M1 0.367879441171442321595523770161 27 #define R_SQRT_32 5.656854249492380195206754896838 28 #define R_1_SQRT_2PI 0.398942280401432677939946059934 29 #define R_LN_SQRT_2PI 0.918938533204672741780329736406 30 #define R_LN_SQRT_PId2 0.225791352644727432363097614947 32 const double pInf = 1./0., mInf = -1./0., NaN = 0./0.;
34 const double scalefactor = 115792089237316195423570985008687907853269984665640564039457584007913129639936.;
36 const double M_cutoff = R_LN2 * DBL_MAX_EXP / DBL_EPSILON;
39 double lgammacor (
double x);
42 int chebyshev_init (
const double *dos,
int nos,
double eta);
44 double chebyshev_eval (
double x,
const double *a,
const int n);
47 void gammalims (
double *xmin,
double *xmax);
50 double logcf (
double x,
double i,
double d,
double eps);
52 double lgamma1p (
double a);
54 double dpois_wrap (
double x_plus_1,
double lambda,
bool log_p);
56 double dpois_raw(
double x,
double lambda,
bool log_p);
58 double stirlerr(
double n);
61 double bd0(
double x,
double np);
63 double pgamma_smallx (
double x,
double alph,
bool log_p);
65 double pd_upper_series (
double x,
double y,
bool log_p);
67 double pd_lower_series (
double lambda,
double y);
69 double pd_lower_cf (
double i,
double d);
71 double dpnorm (
double x,
double lp);
73 double ppois_asymp (
double x,
double lambda,
bool log_p);
75 double pgamma_raw (
double x,
double alph,
bool log_p);
77 double qchisq_appr (
double p,
double nu,
double g,
bool log_p,
double tol);
79 void pnorm_both(
double x,
double *cum,
double *ccum,
int i_tail,
bool log_p);
81 double do_poisson_search (
double y,
double *z,
double p,
double lambda,
double incr);
Probability distribution functions and auxiliary mathematical functions from statistical package R...