F
Francois Grieu
Hi,
suppose I have an unsigned 32-bit type tu32 and a robust
32-bit Random Number Generator
tu32 rng32(void);
producing output uniformly distributed on [0 .. 0xFFFFFFFF].
I want to build a robust double RNG with output uniformly
distributed on ]0..1[ (or similar but known, e.g.
[DBL_MIN..1-DBL_EPSILON] ), for some sound definition of
uniformly distributed matching what double allows.
double rngdouble(void);
In particular, I do care that even a subsample of the output
restricted to some interval like [0 .. 1e-7] appear uniform
rather than "grainy".
Is there a classic good technique?
Francois Grieu
suppose I have an unsigned 32-bit type tu32 and a robust
32-bit Random Number Generator
tu32 rng32(void);
producing output uniformly distributed on [0 .. 0xFFFFFFFF].
I want to build a robust double RNG with output uniformly
distributed on ]0..1[ (or similar but known, e.g.
[DBL_MIN..1-DBL_EPSILON] ), for some sound definition of
uniformly distributed matching what double allows.
double rngdouble(void);
In particular, I do care that even a subsample of the output
restricted to some interval like [0 .. 1e-7] appear uniform
rather than "grainy".
Is there a classic good technique?
Francois Grieu