9.215. RANDOM_NUMBER
9.215 RANDOM_NUMBER — Pseudo-random number
- Description:
- Returns a single pseudorandom number or an array of pseudorandom numbers from the uniform distribution over the range 0 \leq x < 1.
The runtime-library implements George Marsaglia's KISS (Keep It Simple Stupid) random number generator (RNG). This RNG combines:
- The congruential generator x(n) = 69069 \cdot x(n-1) + 1327217885 with a period of 2^32,
- A 3-shift shift-register generator with a period of 2^32 - 1,
- Two 16-bit multiply-with-carry generators with a period of 597273182964842497 > 2^59.
Please note, this RNG is thread safe if used within OpenMP directives, i.e., its state will be consistent while called from multiple threads. However, the KISS generator does not create random numbers in parallel from multiple sources, but in sequence from a single so