Version 1.0.1

Recent Changes

• Single
• Double

FA14 Uniform distribution

This function generates uniformly distributed pseudo-random numbers. Random numbers are generated in the ranges $0<\xi <1,-1<\eta <1$ and random integers in $1\le k\le N$ where $N$ is speciﬁed by the user.

A multiplicative congruent method is used where a 31 bit generator word $g$ is maintained. On each call to the subroutine ${g}_{n}+1$ is updated to ${7}^{5}{g}_{n}mod\left({2}^{31}-1\right)$; the initial value of $g$ is 1. Depending upon the type of random number required the following are computed $\xi ={g}_{n+1}∕\left({2}^{31}-1\right)$; $\eta =2\xi -1$ or $k=int.part\left\{\xi N\right\}+1$.

The subroutine also provides the facility for saving the current value of the generator word and for re-starting with any speciﬁed value.