The following generators are provided for compatibility with
Numerical Recipes. Note that the original Numerical Recipes
functions used single precision while we use double precision. This will
lead to minor discrepancies, but only at the level of single-precision
rounding error. If necessary you can force the returned values to single
precision by storing them in a
volatile float, which prevents the
value being held in a register with double or extended precision. Apart
from this difference the underlying algorithms for the integer part of
the generators are the same.
ran0implements Park and Miller's MINSTD algorithm with a modified seeding procedure.
ran1implements Park and Miller's MINSTD algorithm with a 32-element Bayes-Durham shuffle box.
ran2implements a L'Ecuyer combined recursive generator with a 32-element Bayes-Durham shuffle-box.
ran3implements Knuth's portable subtractive generator.