Original version:
Mon Dec 30 11:38:45 2024
Last updates:
Thu Mar 27 16:05:32 2025
This Web site collects software, and test results, for evaluation of the quality of random-number generation. All files are freely available for use by others.
The file tuftests-2024.tar.gz is a bundle with the author's latest version of the Marsaglia/Tsang tuftests suite, with portability improvements, and support for simple one-line testing of about 50 or so random-number generators using tuftests, or with output to a file that can be used as input to Marsaglia's Diehard Battery test suite, or with one-line changes to the unigen*.c files, creating programs that can feed the Dieharder test suite.
Dieharder's home Web site is at https://webhome.phy.duke.edu/~rgb/General/dieharder.php, but it is not often necessary to build it from source code, because many operating-system binary package distributions already supply it. Here are some typical installation recipes, to be run by a system administrator (root) on Unix-like systems:
Alma/Fedora/Rocky/RedHat 8+: # dnf install dieharder-devel CentOS/RedHat 7: # yum install dieharder-devel Debian/Mint/Ubuntu: # apt-get install dieharder libdieharder-dev DragonFlyBSD/FreeBSD: # pkg install dieharder NetBSD: # pkgin install dieharder OpenBSD: # pkg_add dieharder
After downloading the bundle, unpack and build it like this:
% tar xfz tuftests-2024.tar.gz % cd tuftests-2024 % make
The Makefile comment header contains extensive comments on how to run selected, or all, tests on your system. Run times for each tuftests validation are about one minute on 2020-vintage workstations, under a minute for Diehard testing, and a half hour or so for Dieharder testing. Additional command line options capture streams of random numbers for display as 2-D and 3-D point plots. Such plots are generally not useful for quality assessment of generators, but can be helpful during testing of a new generator.
The Dieharder tests can be run for a particular generator like this, provided that a suitable function prototype is present in the unigen*.c file:
% cc -DUNIRAND=tyche64 tyche.c unigen64.c % ./a.out | dieharder -a -g 200 > tyche64.dieharder.report
Notable in this release is a new translation from Fortran 90 to C, in the file bcninc.c, of the Bailey–Crandall BCN generator that returns bit sequences from a provably normal number, meaning roughly that its digits are perfectly random. It can be used as a drop-in replacement for the Fortran code that is normally linked into the tuftests-2024 executable.
Chapter 7 of the author's book, The Mathematical-Function Computation Handbook, has an extensive discussion of random-number generation and testing, and its introduction enumerates properties that random-number software should have, but rarely does. When I recently reread that chapter, I found that there should be one more list item: if the generator returns IEEE 754 floating-point values, are subnormal numbers ever returned?
That book chapter also introduces the shuffle buffer technique for improving the quality, and period, of any given generator, and test results in the files okay/*shuffle* can be compared to see how much improvement is possible. The period lengthening from shuffling can be many orders of magnitude, solving the problem that many historical generators have, such as short periods of 2**32 or 2**64.
The okay subdirectory contains tuftest output for all the supported generators. That output shows that the Dyadkin–Hamilton urnd and Marsaglia xor_shift generators, both of which support families of hundreds of independent generators, all have serious correlation problems that are exposed by failures in the Gorilla test. They have both been touted in the literature as being of high quality, and offering fast execution.
The bcn, tyche, and xorwow generators pass all of the tuftests suite. So do the teagen ones, but they are notably slower than those others.
The bundle dziala-1.0.0.tar.gz contains code for several new generators described in a not-yet-published (late 2024) article. It corrects some portability and C-interpretation issues, and augments the proposed generators with functions for seeding, and getting and setting generator state. The new generators are claimed to be among the fastest of previously published ones.
The bundle jones-1.0.0.tar.gz contains code from a Web site by David Jones at University College London, UK, that discusses desirable properties of generators, and offers code for several of them.
As with the Działa collection, the Jones code has been extended with additional capabilities, and validated on numerous operating systems and CPU architectures. Both should build flawlessly everywhere with modern C and C++ compilers.
Both the Działa and Jones packages have been augmented with 128-bit generators, because that data size is now partially supported by major C and C++ compilers.
The author maintains an extensive, and frequently updated, bibliography of publications on random-number generation and testing at http://www.math.utah.edu/pub/tex/bib/index-table-p.html#prng. In late 2024, it contains more than 4200 entries from almost 600 journals, from 1900 to 2024. Its updates come from a growing archive of more than two million publications in several areas of computational science and mathematics from more than 8750 journals.