6 return rand() / (T)RAND_MAX;
13 T U0 = rand_uniform<T>()+(T)1e-9;
14 T U1 = rand_uniform<T>();
17 return sqrt( -2 * log(U0) ) * cos(2*(T)3.141593 * U1);
24 T v = rand_normal<T>();
25 v = (T)0.5 + lambda + v*
sqrt(lambda);
26 return (
int)std::max((T)0,v);
34 T u = rand_uniform<T>();
36 }
while (p > L && k<200);
vector3< T > sqrt(const vector3< T > &a)
int rand_poisson(T lambda)