Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marc-B-Reynolds/82bcd9bd016246787c95 to your computer and use it in GitHub Desktop.
Save Marc-B-Reynolds/82bcd9bd016246787c95 to your computer and use it in GitHub Desktop.
// no failures from small crush,
// one questionable from small crush (bit reversed)
// 6 MaxOft
// failure from crush
// 72 LinearComp, r = 29
uint32_t xorshift32ma(void)
{
int s0 = state;
state ^= (state << 13);
state ^= (state >> 17);
state ^= (state << 5);
return (state*1597334677) + s0;
}
// small crush
// 9 HammingIndep (questionable pvalue=0.9994)
// failure from crush
// 11 BirthdaySpacings, t = 2
// 72 LinearComp, r = 29
uint32_t xorshift32am(void)
{
int s0 = state*1597334677;
state ^= (state << 13);
state ^= (state >> 17);
state ^= (state << 5);
return state + s0;
}
// small crush = pass
// small cruch bit reversed = pass
// failure from crush
// 72 LinearComp, r = 29
uint32_t xorshift32max(void)
{
int s0 = __builtin_bswap32(state);
state ^= (state << 13);
state ^= (state >> 17);
state ^= (state << 5);
return (state*1597334677) + s0;
}
// from crush:
// 1 SerialOver, t = 2 1- 9.4e-8
uint32_t xorshift32amx(void)
{
int s0 = __builtin_bswap32(state*1597334677);
state ^= (state << 13);
state ^= (state >> 17);
state ^= (state << 5);
return state + s0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment