Version 1.0.1

Recent Changes

Code Download

  • Single
  • Double

FA14 Uniform distribution

This function generates uniformly distributed pseudo-random numbers. Random numbers are generated in the ranges 0 < ξ < 1,1 < η < 1 and random integers in 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 the subroutine gn + 1 is updated to 75gnmod(231 1); the initial value of g is 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 subroutine also provides the facility for saving the current value of the generator word and for re-starting with any specified value.