Author(s): F. James | Library: MATHLIB |
Submitter: | Submitted: 15.03.1994 |
Language: Fortran | Revised: |
RANLUX generates pseudorandom numbers uniformly distributed
in the interval (0,1), the end points excluded.
Each call produces an array of single-precision real numbers
of which 24 bits of mantissa are random.
The user can choose a luxury level which guarantees the quality
required for his application. The lowest luxury level (zero) gives
a fast generator which will fail some sophisticated tests of randomness;
The highest level (four) is about five times slower but guarantees
complete randomness. In all cases the period is greater than .
Independent subsequences can be generated. Entries are provided for
initialization and checkpointing.
Structure:
SUBROUTINE Subprograms
User Entry Names: RANLUX, RLUXGO, RLUXAT,
RLUXIN, RLUXUT
Usage:
CALL RANLUX(RVEC,LEN)returns a vector RVEC of LEN 32-bit random floating point numbers in the interval (0,1), the end points excluded. RVEC is an array of type REAL and of length LEN at least.
Luxury levels:
For simplicity, five standard luxury levels may be chosen (t is the time factor relative to level zero; for the definition of p, see References). Ref. 1. explains the method, Ref. 2. describes the Fortran implementation in more detail.
Level | p | t | |
0 | 24 | 1 | ![]() |
1 | 48 | 1.5 | ![]() |
2 | 97 | 2 | ![]() |
3 | 223 | 3 | ![]() |
4 | 389 | 5 | ![]() |
No initialization is necessary if the user wants default values. Otherwise the following are available:
CALL RLUXGO(LUX,INT,K1,K2)When
CALL RLUXAT(LUX,INT,K1,K2)dumps the four integers which can be used to restart the generator at this point by calling RLUXGO. RANLUX will then skip over
CALL RLUXIN(IVEC)restarts the generator from vector IVEC of 25 32-bit integers (see RLUXUT). IVEC is an array of type INTEGER and of length 25 at least.
CALL RLUXUT(IVEC)outputs the current values of the 25 32-bit integer seeds, to be used for restarting.
References: