I found a formula last night for "closeness" to an known distribution:

Sum of (Actual - Expected) squared / Expected

This is related to Chi-Square and is different from my |Actual - Expected| / Expected quality measure.

I have the full results for xoroshiro32+ and xoroshiro32++ but unfortunately I can't attach files using this PC so there will be a delay in posting them.

I calculated the sums as follows.
Let a = Actual and b = Expected, then
(a-b)^2/b = (a^2 - 2ab + b^2)/b = a^2/b - 2a + b = a(a/b - 2) + b

Here are the best Chi-Square scores for xoroshiro32++ pair frequency, identical to what the XORO32 output frequency would be for the same [a,b,c,d]. Unsurprisingly none of the xoroshiro32+ candidates (using d = 0 slot) make the cut.

total = sum of pfreq0-pfreq12 (total > 9999 excluded)
total0-3 = sum of pfreq0-pfreq3

total = sum of pfreq0-pfreq12 (total > 9999 excluded)
total0-3 = sum of pfreq0-pfreq3

And lower totals are better right. How big do the worst totals get?

Yes, lower is better. I think the worst score is 5 x 10^12 or 2^42. Most of the + and a few ++ are > 2^31. QuickBASIC 32-bit integers are signed, in range -2^31 to +2^31-1 (- 2147483648 to +2147483647) and I store any scores greater than the latter as 2147483647 in my files.

At first look there is a total lack of correlation of best with best against the grid summary charts.

And another nail here is there is also d=15 cases with very good distribution scores. d=15 (for s16++) is always extremely poor scoring in Practrand. I only left them in because they don't consume any significant MIPS to be culled.

The correlation between PractRand scores and these new Chi-Square scores will be interesting.

EDIT:
Written before previous post seen. As I've said several times before, the distributions could be used as tie-breakers for the candidates with good PractRand scores. A few of the new Chi-Square scores are amazingly low.

Evan, how big is a .7z file with all the xoroshiro32++ grid scores?

When you say *all*, you do know I've only got a limited number of candidates with completed grids, right? They are the ones already charted. I built a list of promising candidates from the culling run, plus a few we wanted to compare with. The gridding was run only on that list.

To grid every double summing (++) candidate for the 84 full-period engine triplets, 84 x 15 x 256 = 322560 Practrand files, the run time will be over 100 years 5 months. EDIT: Err, it's 3 hours per grid, not per score.

Evan, how big is a .7z file with all the xoroshiro32++ grid scores?

When you say *all*, you do know I've only got a limited number of candidates with completed grids, right? They are the ones already charted. I built a list of promising candidates from the culling run, plus a few we wanted to compare with. The gridding was run only on that list.

To grid every double summing (++) candidate for the 84 full-period engine triplets, 84 x 15 x 256 = 322560 Practrand files, the run time will be over 100 years 5 months. EDIT: It's 3 hours per grid, not per score.

You had some grid tests running, which took a while and finished a few days ago. I meant all of those.

[5,2,6,5] and [8,5,13,2] and a few others with Chi-Square total < 100 and half-decent PractRand culling scores could be worth gridding later this week.

I'm itching to know what Chris's distribution looks like.

Oh, those are the grids of even-apertured double-iterated. It doesn't directly compare to the existing chart because that one uses full grids. I should either make the even-apertured version of the already posted chart, or finish the double-iterated grids by also doing their odd-apertures.

At first look there is a total lack of correlation of best with best against the grid summary charts.

And another nail here is there is also d=15 cases with very good distribution scores. d=15 (for s16++) is always extremely poor scoring in Practrand. I only left them in because they don't consume any significant MIPS to be culled.

Most of the [a,b,c,15] are poor or worse. Here are the 84 Chi-Square scores, with a couple clipped at 2147483647:

I was too tired to concentrate earlier so I went to bed. I've just hacked in Chris's algorithm, named it "Scro-rarns", and started it running. Everything is coming up either 16G or 32G and it's a 32x32 grid so it'll be a lot longer to run than anything from the Xoroshiro32 generators. Luckily it's also only a single grid.

I was too tired to concentrate earlier so I went to bed. I've just hacked in Chris's algorithm, named it "Scro-rarns", and started it running. Everything is coming up either 16G or 32G and it's a 32x32 grid so it'll be a lot longer to run than anything from the Xoroshiro32 generators. Luckily it's also only a single grid.

It's the output distribution I'm interested in, not the grid scores!
You'll need to replace the double-iterated xoroshiro32 with Chris's algorithm, the rest of the C code can stay the same.

P.S. Full xoroshiro32 Chi-Square results sent by email.

On that note, there isn't any distribution data done for double iterated Xoroshiro either. I had, in fact, entirely removed any attempt to handle double iteration. I gather you are wanting it in a similar fashion to Chris's one - without the pairing step.

On that note, there isn't any distribution data done for double iterated Xoroshiro either. I had, in fact, entirely removed any attempt to handle double iteration. I gather you are wanting it in a similar fashion to Chris's one - without the pairing step.

You have 1344 lots of distribution data for double iterated xoroshiro32+ and xoroshiro32++! Simply replace the 32-bit xoroshiro output pair with Chris's single output and use that as the 4GB array index.

Oh, I see I didn't have that detail specified in the data files. No, there's nothing but single iterated data in every 7zip file. For the s8 right up to even the one s17 I did.

I did try to explain the difficulties I was having with making pairing work when double iterated. That why I'd scrapped it totally.

Here's the frequency distribution data for Chris's generator plain, without any pairing. I'll work on reintroducing Xoroshiro double iteration code in the morning.

Here's the frequency distribution data for Chris's generator plain, without any pairing. I'll work on reintroducing Xoroshiro double iteration code in the morning.

Thanks, Evan. This was the final frequency distribution I wanted. What xoroshiro double iteration do you think I was requesting?

Chris's generator has the best output distribution but a few xoroshiro32++ get quite close.

Chris's generator is also excellent on zero distribution and better than the top 12 xoroshiro32++ above, which are ranked in that table on XORO32 output frequency (= xoroshiro32++ pair frequency).

Here's the frequency distribution data for Chris's generator plain, without any pairing. I'll work on reintroducing Xoroshiro double iteration code in the morning.

Thanks, Evan. This was the final frequency distribution I wanted. What xoroshiro double iteration do you think I was requesting?

Chris's generator has the best output distribution but a few xoroshiro32++ get quite close.

Evan, did you get my email? I could send the zero run results later.

Some of the best xoroshiro32++ above have good culling scores, e.g. [8,15,3,2]. The distributions for Chris's generator prove it's a very good 32-bit state, 32-bit output PRNG and confirm that the distributions for double-iterated xoroshiro32++ / XORO32 tell us something useful. By treating pairs of outputs as a single 32-bit output we can get fairly close in quality to Chris's generator, which passes PractRand because there is no equidistribution within his 32 bits, whereas both of our 16-bit values are equidistributed within themselves and PractRand cannot distinguish between one 32-bit and two 16-bit outputs.

Do all the grid failures occur only for the FPF tests? I'm wondering whether we would get max scores for everything if the FPF were removed. If other tests fail then we could use those to cull candidates, then use the distributions to select the best.

## Comments

2,059Here are the best Chi-Square scores for xoroshiro32++ pair frequency, identical to what the XORO32 output frequency would be for the same [a,b,c,d]. Unsurprisingly none of the xoroshiro32+ candidates (using d = 0 slot) make the cut.

total = sum of pfreq0-pfreq12 (

total > 9999 excluded)total0-3 = sum of pfreq0-pfreq3

14,137From earlier comments, admittedly Z80, I was thinking you might be using some novel OS where assembly coding was still the expected norm.

14,1372,059Just the formatted grid tables, please.

Next year is my 20th anniversary of using Win98SE. My 1024 x 768 LCD monitor is 20 years old and not one pixel is stuck on.

2,059Yes, lower is better. I think the worst score is 5 x 10^12 or 2^42. Most of the + and a few ++ are > 2^31. QuickBASIC 32-bit integers are signed, in range -2^31 to +2^31-1 (- 2147483648 to +2147483647) and I store any scores greater than the latter as 2147483647 in my files.

14,137And another nail here is there is also d=15 cases with very good distribution scores. d=15 (for s16++) is always extremely poor scoring in Practrand. I only left them in because they don't consume any significant MIPS to be culled.

2,059EDIT:

Written before previous post seen. As I've said several times before, the distributions could be used as tie-breakers for the candidates with good PractRand scores. A few of the new Chi-Square scores are amazingly low.

14,137When you say *all*, you do know I've only got a limited number of candidates with completed grids, right? They are the ones already charted. I built a list of promising candidates from the culling run, plus a few we wanted to compare with. The gridding was run only on that list.

To grid every double summing (++) candidate for the 84 full-period engine triplets, 84 x 15 x 256 = 322560 Practrand files, the run time will be over 100 years 5 months. EDIT: Err, it's 3 hours per grid, not per score.

2,059You had some grid tests running, which took a while and finished a few days ago. I meant all of those.

2,059I'm itching to know what Chris's distribution looks like.

14,13714,13721,23021 years ago I deleted Windows 95 or whatever from my 100MHz AMD 486 and went all Linux.

Until I got embroiled with an MS Surface Pro 4 and Win 10 two years back.

2,059Most of the [a,b,c,15] are poor or worse. Here are the 84 Chi-Square scores, with a couple clipped at 2147483647:

2,059Win98SE - the best DOS app ever written!

14,13714,137And if not, what would that imply about Xoroshiro's erratic scores?

2,059It's the output distribution I'm interested in, not the grid scores!

You'll need to replace the double-iterated xoroshiro32 with Chris's algorithm, the rest of the C code can stay the same.

P.S. Full xoroshiro32 Chi-Square results sent by email.

14,137Haven't seen an email as yet.

14,1372,059You have 1344 lots of distribution data for double iterated xoroshiro32+ and xoroshiro32++! Simply replace the 32-bit xoroshiro output pair with Chris's single output and use that as the 4GB array index.

14,137I did try to explain the difficulties I was having with making pairing work when double iterated. That why I'd scrapped it totally.

14,13714,1372,059Thanks, Evan. This was the final frequency distribution I wanted. What xoroshiro double iteration do you think I was requesting?

Chris's generator has the best output distribution but a few xoroshiro32++ get quite close.

14,137Until yesterday, none at all. I've never once done even a single case in the form like Scro-rarns, that's for sure.

2,0592,0592,059Evan, did you get my email? I could send the zero run results later.

Some of the best xoroshiro32++ above have good culling scores, e.g. [8,15,3,2]. The distributions for Chris's generator prove it's a very good 32-bit state, 32-bit output PRNG and confirm that the distributions for double-iterated xoroshiro32++ / XORO32 tell us something useful. By treating pairs of outputs as a single 32-bit output we can get fairly close in quality to Chris's generator, which passes PractRand because there is no equidistribution within his 32 bits, whereas both of our 16-bit values are equidistributed within themselves and PractRand cannot distinguish between one 32-bit and two 16-bit outputs.

Do all the grid failures occur only for the FPF tests? I'm wondering whether we would get max scores for everything if the FPF were removed. If other tests fail then we could use those to cull candidates, then use the distributions to select the best.

14,137