An exhaustive search for good 64-bit linear congruential random number generators with restricted multiplier

https://doi.org/10.1016/j.cpc.2011.06.013Get rights and content

Abstract

This paper explores that the different prime moduli can affect both the number of primitive root and the spectral test performance for 64-bit linear congruential generators (LCGs). Three forms of prime modulus and two types restriction on multiplier are considered in this paper. We perform computerized experiments that indicate significant differences exist among the number of primitive root of three forms of prime modulus. These differences can affect the performance of the spectral test. Two good 64-bit LCGs with significantly better spectral values and excellent empirical performance are presented. They are suitable for the requirements of todayʼs computer simulation studies.

Highlights

► Different prime moduli can affect the number of primitive root. ► These differences lead to the larger spectral value of the LCGs with Sophie–Germain prime modulus. ► Two good 64-bit LCGs with sound lattice structure and excellent statistical performance are presented.

Introduction

A 64-bit linear congruential generator (LCG) is defined by the following recursive formulaXnaXn1(modm),n1 where m is the prime modulus, multiplier a and seed X0 are between 1 and (m1) for a 64-bit computer. The first bit of a signed integer is the sign bit, so the largest modulus representable as an ordinary integer is 2631 for a 64-bit machine. Three prerequisites for an ideal LCG are full period, randomness and efficiency [3], [5]. The maximal period of an LCG is m1, called a full period LCG. An LCG is relatively easy to implement and reasonably fast.

For a random number (RN) practitioner, two parameters of an LCG should be determined: multiplier and modulus. For a given modulus, most of the literature is the multiplier problem of searching for the best spectral test performance in a full period LCG [2], [6]. Dyadkin and Hamilton [1] performed an extensive analysis and resulted in the identification of over 200 good LCGs with modulus m=264. They indicated that “the large prime moduli can be the subject of another study”. So this paper considers 64-bit LCGs with prime modulus. For the modulus problem, Tang [9] empirically analyzed the spectral test and statistical test performances of LCGs with ten largest prime moduli smaller than 231. From the viewpoint of number theory, five special forms of prime: Mersenne prime modulus, largest prime modulus, Sophie–Germain prime modulus, twin prime modulus and factorial prime modulus are adopted by Tang et al. [10]. The results indicated that LCGs with Sophie–Germain prime moduli can give better spectral values than those of other moduli. From a computational implementation perspective, an LCG with Mersenne prime modulus can be implemented generally and efficiently by the simulated division method. Therefore, this paper considers Sophie–Germain prime modulus, Mersenne prime modulus and largest prime modulus but not Mersenne prime and Sophie–Germain prime ones for a 64-bit LCG.

Since the number of multiplier is astronomical, an exhaustive search appears to be impractical. For portability and correctness, two types of restriction on multiplier are distinguished: approximate factoring (AF) multiplier and double precision floating-point (DF) multiplier. To the best of our knowledge, even for the AF restricted multiplier, an exhaustive search has not been yet performed for a 64-bit LCG. For Sophie–Germain prime modulus, Mersenne prime modulus and largest prime modulus, this paper conducts an exhaustive search for the maximum spectral test criterion in a full period 64-bit LCG with AF restricted multiplier. We also perform a random search for the best spectral value of a full period 64-bit LCG with DF restricted multiplier. We obtain some good LCGs with significantly better spectral values than what were known before.

The organization of this paper is as follows. Section 2 briefly reviews the full period and the spectral test of an LCG and presents three forms of prime modulus. Section 3 proposes the design of experiment and examines how the different prime moduli affect the performances of the number of primitive root modulo m and the spectral test. Section 4 presents the statistical analysis by applying some well-known statistical packages. The paper ends with conclusions in Section 5.

Section snippets

Full period, spectral test and prime modulus

The necessary and sufficient condition of a full period LCG is that multiplier a is a primitive root modulo m. More specific, a(m1)/q1(modm) for each prime factor q of (m1). Theoretically, the number of primitive root modulo m is ϕ(m1), where ϕ(.) is Eulerʼs totient function. The periods of LCGs with multipliers a and a1 are same, and the periods of a and −a are same for the case that (m1) is a multiple of 4.

The most important ingredient of an ideal LCG is the randomness. For t>1, the

Design of experiment

This section conducts two computational experiments to empirically study the influence of the forms of prime modulus on the spectral test performance for an LCG with AF and DF restricted multiplier. In the first experiment, we consider the spectral test performance of a full period 64-bit LCG with three forms of prime modulus. Since the number of multiplier is inconceivably large, we place AF restricted multiplier to conduct an exhaustive search for the maximum spectral test performance with

Empirical evaluations

We evaluate these four generators LCG0, LCG1, LCG2, and LCG3 with the empirical tests. The goal is that the successive output values of the LCG imitate independent random variables from the uniform distribution over the interval [0,1]. Some well-known public-domain testing packages adopted are the small battery SmallCrush, the more stringent battery Crush and the yet more time-consuming battery BigCrush suits of LʼEcuyer and Simard [7]. We also apply the battery PseudoDIEHARD which implements

Conclusion

Three forms of prime modulus and two types restriction on multiplier for the 64-bit LCGs are considered in this paper. The exhaustive and random computerized searches are conducted for the AF and DF restricted multiplier, respectively. The results indicate that the smaller number of prime factor of (m1) and the larger value of modulus result in the larger number of primitive root modulo m. Among three forms of prime modulus, the largest number of primitive root modulo m is Sophie–Germain prime

References (10)

  • I.G. Dyadkin et al.

    A study of 64-bit multipliers for Lehmer pseudorandom number generators

    Computer Physics Communications

    (1997)
  • G.S. Fishman

    Multiplicative congruential random number generators with modulus 2β: an exhaustive analysis for β=32 and a partial analysis for β=48

    Mathematics of Computation

    (1990)
  • G.S. Fishman et al.

    Concepts, Algorithms, and Applications

    (1996)
  • G.S. Fishman et al.

    An exhaustive analysis of multiplicative congruential random number generators with modulus 2311

    SIAM Journal on Scientific and Statistical Computing

    (1986)
  • D.E. Knuth

    The Art of Computer Programming, vol. 2, Semi-Numerical Algorithms

    (1997)
There are more references available in the full text version of this article.

Cited by (3)

  • The mathematical-function computation handbook: Programming using the MathCW portable software library

    2017, The Mathematical-Function Computation Handbook: Programming Using the MathCW Portable Software Library
View full text