To verify proper statistical behavior for the random sequences produced by CLHEP Random, we have applied the "DIEHARD" suite of tests to each engine. This is quite a comprehensive suite, and evidently more stringent than tests previously applied to these distributions.
The engines as they existed previously in the CLHEP library each have
a method flat() that returns a 64-bit double-precision floating
point number. The DIEHARD suite, however, expects a completely random stream
of bits, meaning some conversion to an integer is necessary. Specifically,
the suite needs three million 32-bit unsigned integers, on the open interval
between 0 and 2^32.
A recent revision to all of the classes of ZOOM's version of the CLHEP Random engines was the addition of conversion operators for the engines. This means that the notation
- float x = someEngine;
- double y = someEngine;
- unsigned int z = someEngine;
is now possible, and will advance the engine in a similar manner to calling
flat(). In fact, the conversion to double operator is essentially
just a synonym for flat(). Special care has been taken so that
the float and unsigned int conversion operators both return values that have
all 32 bits properly filled (i.e. no zero bytes). In many cases, the engines
can produce a single-precision float or an unsigned int faster than the
double-precision value, but it all depends upon the internal representation
and computation of the values. So, along with the DIEHARD statistical
validation of the engines, we also offer benchmark times to produce
the 3 million numbers used, for each of the three conversion operators.
Note: that the time trial tests were performed on a single IP22 Processor machine, running at 174 MHz. The following table summarizes the results obtained.
| Engine name |
Test Failed | CPU Time for 3 million nums (s) | ||
|---|---|---|---|---|
| double | float | unsigned int |
||
| DRand48Engine | OPSO, OQSO, DNA | 6.31 | 7.37 | 8.25 |
| DualRand | None | 6.61 | 5.11 | 4.78 |
| Hurd160Engine | Minimum Distance | 4.73 | 3.27 | 2.95 |
| Hurd288Engine | None | 4.97 | 3.24 | 2.92 |
| JamesEngine | Minimum Distance | 5.98 | 5.26 | 7.08 |
| MTwistEngine | None | 6.76 | 3.94 | 3.65 |
| RandEngine | Binary Rank for 6x8 OPSO, OQSO, DNA Count the 1's in a stream Count the 1's for specific bytes | 4.6 | 4.85 | 3.12 |
| RanecuEngine | None | 12.5 | 10.98 | 8.48 |
| RanluxEngine luxury level 0 |
Birthday Spacings Test Minimum Distance CRAPS Test | 4.62 | 4.55 | 6.44 |
| RanluxEngine luxury level 1 |
Minimum Distance | 6.68 | 6.55 | 8.47 |
| RanluxEngine luxury level 2 |
None | 11.09 | 11.39 | 12.49 |
| RanluxEngine luxury level 3 |
None | 21.79 | 21.88 | 22.82 |
| RanluxEngine luxury level 4 |
None | 36.48 | 36.86 | 38.28 |
| Ranlux64Engine luxury level 0 |
None | 24.39 | 24.71 | 25.01 |
| Ranlux64Engine luxury level 1 |
None | 41.84 | 41.33 | 41.9 |
| Ranlux64Engine luxury level 2 |
None | 77.26 | 76.97 | 78.26 |
| RanshiEngine | None | 4.89 | 2.49 | 2.18 |
| TripleRand | None | 8.72 | 7.42 | 7.52 |
![]()