In this section we discuss some of the testing done, both theoretical and experimental, on the RNG library routines. First, number theory can be used to demonstrate that the algorithms in the RNG library have maximal period (see discussion regarding each algorithm) and to limit the choice for the multipliers (e.g., the potency test as described in [8]). Further checks of the ``goodness'' of a pseudo random number generator must be done experimentally. Extensive testing has been performed on the 64-bit linear congruential generator of section 3.1, on the 61-bit prime modulus linear congruential generator of section 3.4, and on the 48-bit modulus linear congruential generator of section 3.2 by the developers of SPRNG [1] library. We have duplicated the constants used in the SPRNG library for these generators in order to leverage their testing efforts. To insure that we duplicated the SPRNG arithmetic, we seeded the RNG routines and the equivalent SPRNG routines with the same values 4, and compared their results for a large number of advances on several different architectures (see Table 1).
The RNG library was also compared to Mathematica calculations for a large number of advances in order to check the accuracy of our implementation of modular arithmetic. Furthermore, on the IRIX64 machine listed in Table 1 the RNG library was tested with 1012 advances to insure that the values returned by the iRng(), dRng() and fRng() routines are within the specified limits. A more satisfying test of the returned value was done by seeding a RNG state with the value that when advanced once produces the maximum (minimum) value allowed by the generator. The iRng(), dRng() and fRng() routines also passed this last test on the platforms listed in Table 1.
It is important that one run these tests on any new platform port in order to defend against any problems that crop up due to compiler differences. One can run the command make test in the build directory in order to accomplish this. This command will run the random number generators in the library to insure that they produce the correct state as compared against built-in tables that record past behavior. After this check, the approximate timings of the iRng(), dRng() and fRng() routines are reported in Million Randoms per Second (MRS). Finally, the generators are seeded with the values that produce, on the next call, the minimum and maximum values for the iRng(), dRng() and fRng() routines. These routines are called and the returned values are printed to standard output. The maximum double and float values should be the same as those printed to standard output by the program one-eps.c in the Test sub-directory. To compile and run this program enter the command make one-eps in the Test sub-directory. Note, in most cases the maximum double value should match that produced by one-eps.c; however, for some generators the value is slightly less due to the fact that there is no double value which when multiplied by the maximum value of that generator produces the nearest-to-one value that is less than one.
We are currently engaged in extensive statistical testing of the new prime modulus generators we have introduced in the RNG library, comparing them to those derived from the SPRNG package, and will report on the results of this testing in a separate paper.
|