Go to the first, previous, next, last section, table of contents.

Numerical Recipes generators

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.

Generator: gsl_rng_ran0
Numerical recipes ran0 implements Park and Miller's MINSTD algorithm with a modified seeding procedure.

Generator: gsl_rng_ran1
Numerical recipes ran1 implements Park and Miller's MINSTD algorithm with a 32-element Bayes-Durham shuffle box.

Generator: gsl_rng_ran2
Numerical recipes ran2 implements a L'Ecuyer combined recursive generator with a 32-element Bayes-Durham shuffle-box.

Generator: gsl_rng_ran3
Numerical recipes ran3 implements Knuth's portable subtractive generator.


Go to the first, previous, next, last section, table of contents.