Lines Matching refs:rnd
36 void deRandom_init (deRandom* rnd, deUint32 seed) in deRandom_init() argument
38 rnd->x = (deUint32)(-(int)seed ^ 123456789); in deRandom_init()
39 rnd->y = (deUint32)(362436069 * seed); in deRandom_init()
40 rnd->z = (deUint32)(521288629 ^ (seed >> 7)); in deRandom_init()
41 rnd->w = (deUint32)(88675123 ^ (seed << 3)); in deRandom_init()
49 deUint32 deRandom_getUint32 (deRandom* rnd) in deRandom_getUint32() argument
51 deUint32 w = rnd->w; in deRandom_getUint32()
54 t = rnd->x ^ (rnd->x << 11); in deRandom_getUint32()
55 rnd->x = rnd->y; in deRandom_getUint32()
56 rnd->y = rnd->z; in deRandom_getUint32()
57 rnd->z = w; in deRandom_getUint32()
58 rnd->w = w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); in deRandom_getUint32()
67 deUint64 deRandom_getUint64 (deRandom* rnd) in deRandom_getUint64() argument
69 deUint64 x = deRandom_getUint32(rnd); in deRandom_getUint64()
70 return x << 32 | deRandom_getUint32(rnd); in deRandom_getUint64()
78 float deRandom_getFloat (deRandom* rnd) in deRandom_getFloat() argument
80 return (float)(deRandom_getUint32(rnd) & 0xFFFFFFFu) / (float)(0xFFFFFFFu+1); in deRandom_getFloat()
88 double deRandom_getDouble (deRandom* rnd) in deRandom_getDouble() argument
91 return ldexp((double)(deRandom_getUint64(rnd) & ((1ull << DBL_MANT_DIG) - 1)), in deRandom_getDouble()
100 deBool deRandom_getBool (deRandom* rnd) in deRandom_getBool() argument
102 deUint32 val = deRandom_getUint32(rnd); in deRandom_getBool()