Ras wrote: ↑Tue Jan 15, 2019 12:37 am
Just out of curiosity, can you please post the corresponding images for MS-rand and ISO-rand using the 8 LSBs from the RNG directly for each byte, i.e. with one RNG call per byte and so that the LSB of the RNG is also the LSB of the greyscale value? The image I had made was something entirely different with (x,y) plots.
I see, so you generated the image in a different way.
I simply choose a setup where the correlations are clearly visible without having to post very large images.
I could post the images, but MS LCG exhibits no problems up to 512x512 when I map 8 LSBs directly so I assume the same will hold for ISO multiplier.
You would notice no problems at 256x256.
I have uploaded a 256x256 subset of 1kx1k to show when it starts to break (should still be well below the period of the generator):
KISS still 1 bit per sample
Microsoft LCG 8 bits per sample:
LCG with ISO multiplier 8 bits per sample:
One would ideally utilize all the bits generated by the PRNG, using 1 bit per call is wasteful, even for HQ generators it still reduces the period.
Even in the case where I grab full byte (assuming RAND_MAX is 32k), I still waste 7 bits so it would be better to accumulate.
In C++, using uniform_int_distribution not only gives you uniform distribution but also accumulates the output for you so for the range of <0,1> no bit would be wasted.
Nevertheless, I would say that LCG is ok for small number of samples, like generating Zobrist keys, but I prefer to avoid it in general.
As for Mersenne Twister, it generates very high quality sequences and has insane period (2^19k?) + amortized relatively low cost. Still a small burst each 625 values if I remember correctly but one can't go wrong with MT.