52 void twiddle (
unsigned int &v)
54 for (
int i=0; i<9; ++i)
65 if (x==0) x = 123456789;
66 if (y==0) y = 362436069;
67 if (z==0) z = 521288629;
68 if (w==0) w = 88675123;
71 twiddle(x); twiddle(y); twiddle(z); twiddle(w);
74 for (
int i=0; i<16; ++i)
80 planck_rng (
unsigned int x1=123456789,
unsigned int y1=362436069,
81 unsigned int z1=521288629,
unsigned int w1=88675123)
82 : x(x1), y(y1), z(z1), w(w1),
83 small(1./(1.+double(0xFFFFFFFF))), gset(0.), empty(true)
85 planck_assert (
sizeof(
unsigned int)==4,
"wrong integer size for RNG");
90 void seed (
unsigned int x1=123456789,
unsigned int y1=362436069,
91 unsigned int z1=521288629,
unsigned int w1=88675123)
93 x = x1; y = y1; z = z1; w = w1;
102 unsigned int t = x^(x<<11);
107 return w=(w^(w>>19))^(t^(t>>8));
130 while ((rsq>=1) || (rsq==0));
131 double fac=sqrt(-2*log(rsq)/rsq);
double rand_gauss()
Returns random numbers with Gaussian distribution (mean=0, sigma=1).
unsigned int int_rand_uni()
void seed(unsigned int x1=123456789, unsigned int y1=362436069, unsigned int z1=521288629, unsigned int w1=88675123)
double rand_uni()
Returns uniformly distributed random numbers from the interval [0;1[.
#define planck_assert(testval, msg)
double rand_exp()
Returns exponentially distributed random numbers (mean=1, nonnegative)
planck_rng(unsigned int x1=123456789, unsigned int y1=362436069, unsigned int z1=521288629, unsigned int w1=88675123)