Arcetri Sts Versions Save

Improved version of the NIST Statistical Test Suite (STS)

3.2.7

1 month ago

release sts version 3.2.7

Fixed a bug where the uniformity p-value was incorrectly computed due to an integer division that should have been a double precision division.

Fixed by changing lines of the form:

        expCount = sampleCount / state->tp.uniformity_bins;

to:

        expCount = (double)sampleCount / state->tp.uniformity_bins;

for each of the 15 classes of test.

The impact on sts version 3.2.6 and earlier was minimal for when sampleCount was a reasonable value. However when testing trivially sized data sets (where the overall statistical results were likely compromised anyway), the integer division round off is notable.

For example on this small set with 10 bins:

6,   8,   6,   6,  16,   4,   3,   5,   5,   5

the computed expCount was 0.01791240452984323 (using improper integer division) vs 0.029796344939787778 (using proper double precision floating point).

Changed sts version from "3.2.6" to "3.2.7".

Many thanks to the GitHub user @tajuma for discovering this problem and taking the time to report it via GitHub and for recommending a solution. We extended their solution to all 15 classes of tests.

We HIGHLY recommend this fix.