Version 1.1.0

Code Download

  • Single
  • Double

HSL_FA14 Uniform distribution

This package generates uniformly distributed pseudo-random numbers. Random reals are generated in the range 0 < ξ < 1 or the range 1 < η < 1 and random integers in the range 1 k N where N is specified by the user.

A multiplicative congruent method is used where a 31 bit generator word g is maintained. On each call to a procedure of the package, gn + 1 is updated to 75gnmod(231 1); the initial value of g is 216 1. Depending upon the type of random number required the following are computed ξ = gn+1(231 1); η = 2ξ 1 or k = int.part{ξN} + 1.

The package also provides the facility for saving the current value of the generator word and for restarting with any specified value.