Haven't been able to install dieharder yet due a multiple definition error that pops up an uncounted times (far too many for to bother with that) however the result of seed 0 with
gcc -D RNG_PIC %f && ./a.out > pic.ppm && eog pic.ppm
brought a decent result, no sign of any lines, tried it a few times with time & clock and didn't see any tears like I sometimes do with the rand_r()
Code:
size_t my_rng( size_t x )
{
size_t n;
size_t const move = (bitsof(size_t)/4);
size_t const add = (9999 << move) | 9999;
x += add + 33333;
n = x >> 1;
x *= n;
return x + 777;
}
Are there any alternatives to dieharder?
For anyone looking for my previous related thread (myself included) here's the link:
Seeded/Seedless random number
Edit: Noticed I made a mistake in the code while I was editing it prior to the tests (which makes it interesting that it still produced a noisy result), so here is the version without the mistake, same noisy result but should be better as far as the bits go:
Code:
size_t my_rng( size_t x )
{
size_t n;
size_t const move = (bitsof(size_t)/4);
size_t const add = (9999 << move) | 9999;
x += add + 33333;
n = x >> move;
x *= n;
return x + 777;
}
Learned of testu01 which seemed to install fine so after getting something to eat I'm gonna look through it's documentation to see how I should use it