Complexity: Exactly
k=max(1,⌈b/log2R⌉)
invocations
of g,
where b252
is the lesser of numeric_limits<RealType>::digits
and bits,
and
R is the value of g.max()−g.min()+1.
If the values gi produced by g are uniformly distributed,
the instantiation's results are distributed as uniformly as possible.
Obtaining a value in this way
can be a useful step
in the process of transforming
a value generated by a uniform random bit generator
into a value
that can be delivered by a random number distribution.