Provoni wrote:Original method by me.
Not quite - see
Parameters in common use - second entry. However, your implementation is, admittedly, a variation.
The original description of the opening post's generator was "'- Fast low quality random integer generator". It was subject to what has been described as "a really fancy predictor" the results of which has elevated the description to "'- Fast and unpredictable random integer generator". That is quite an elevation for a single algorithm test. The code for "a really fancy predictor" should have been published.
It will take more than "a really fancy predictor" to do that. 'Unpredictable' is normally reserved for cryptographically secure pseudorandom number generators (CSPRNG)
With regard to "a really fancy predictor" it may be worthwhile to read up on
Autocorrelation. Autocorrelation (Serial correlation) is used by John Walker's
ENT and is the only aspect of the tests which are related to randomness - all the others are related to uniformiity.
It should be noted that all the metrics used in dodicat's code examine uniformity and not randomness. The difference is looked at in the thread
PRNGs randomness versus uniformity.
As Provoni noted FB #4 has a comparatively short period, 2^24 = 16777216, so to keep a level playing field we should choose a 'limit' of 16777216 as opposed to 20000000. If we then consider a range of 0 to 15 as opposed to a range of 0 to 10 we see FB #4 producing perfect uniformity ie a(i) = 1048576 for i = 0 to 15. This gives a standard deviation and chi-square of zero.
dodicat wrote:Again randomize ,4 seems the best.
We cannot better perfection. <smile> However, that is from a uniformity perspective. From a randomness perspective, FB #4 is poor compared with the other generators considered.
I was interested in what one of my generators would do in dodicat's code so I chose PCG32II. Sometimes it's uniformity was second only to FRI and FB #4 and sometimes it was the worst in the bunch. The reason for this is that PCG32II has a very high level of randomness. As the number of tests increases so would it's uniformity. In fact, 'true' random numbers would tend to perfect uniformity as the number of tests tends to infinity. The contrary is not true. A high level of uniformity does not imply randomness as Provoni's (0,1,2,3,4,5,6,7,8,9,10,0,1,2,3,4,.....) points out. PCG32II was the second fastest after FRI. PCG32II's predictability, according to its author, is 'challenging' but Melissa O'Neill points out that PCG32II is not a CSPRNG. CryptoR(0,15), from CryptoRndII, was faster than FRI in both 32-bit and 64-bit tests. CryptoRndII uses a CSPRNG which would normally suggest unpredictability but my implementation kills that relegating it to a fast PRNG.
So, FRI is a good stab at being a PRNG but there are faster generators and some of them give good quality randomness as well.