4 ms·
This is not really too relevant to the article, but that random generator makes me cringe. You can replace it with a decent quality one (xorshift) with about as
by pbsd 13y ago
This is not really too relevant to the article, but that random generator makes me cringe. You can replace it with a decent quality one (xorshift) with about as many lines of code:
uint32_t genrand(uint32_t *seed)
{
uint32_t x = *seed;
x ^= x << 13;
x ^= x >> 17;
x ^= x << 5;
*seed = x;
return x;
}
- dbaupp 13y agoIt actually was changed from stdlib RNG -> xorshift -> this RNG when the previous (non-parallel) article was posted.