Uniform Random Number Generation
Another generator of uniformly distributed random numbers. luxtst.f90
A program to test luxury.f90.
L'Ecuyer's 1996 Tausworthe random number generator, and lfsr113.f90
L'Ecuyer's 1999 Tausworthe random number generator. The first has a cycle of
2^88 while the second is a little slower but has a cycle of 2^113. Both are
translations from C. N.B. These both assume that default integers are 32-bit.
A 64-bit random number generator from Pierre L'Ecuyer with a cycle of about
2^258 or more than 10^77.
Nick Maclaren's double precision random number generator, translated into
The 'Mersenne Twister' random number generator from Japan with a cycle of
length (2^19937 - 1). mt19937a.f90 is a
version for compilers which stop when there are integer overflows, as some do
when compiler check options are enabled for debugging purposes. mt19937.f90 was revised on 5 February
2002; mt19937a.f90 has not been revised.
- rand3.f90 Yet
another random number generator; this one is based upon an algorithm by Donald
Pairs of uniform random numbers should be uniformly distributed in the unit
square. This is a simple test program which failed using a new (1998)
Random numbers from other distributions
A module for generating random numbers from a range of distributions. There is
a test program t_random.f90.
Another library for random number generation can be found at
Generate random numbers from the standard normal distribution. ran_norm uses
more random number calls, but rnorm uses more logarithms and square roots. On
those machine/compiler combinations which have been tested recently, rnorm has
usually been faster (5-20%).
Generate random numbers from the gamma distribution. The first routine is
adapted from Dagpunar's book, while the second is by Marsaglia and Bray.
Generate random Poisson deviates. Requires ran_exp.f90.
Generate random exponential deviates, simple method.
Generate random exponential deviates; two algorithms from TOMS algorithm 780.
A program to compare speeds of 3 different generators.
Generate random binomial deviates, including a small driver program.
Generate discrete random deviates having the Zipf (or zeta) distribution, with
a small test program.
The file for r_hyperg.f90 contains TOMS algorithm 668 for generating random
values from the hypergeometric distribution.
George Marsaglia's functions for generating random samples from the uniform,
normal and exponential distributions. Translated from C.