Rename xorshift functions
This commit is contained in:
parent
d661312cfa
commit
74428f1caf
@ -12,7 +12,7 @@ struct split_mix_64_state {
|
|||||||
internal u64 rol64(u64 x, u64 bits);
|
internal u64 rol64(u64 x, u64 bits);
|
||||||
internal u64 split_mix_64(SplitMix64State *state);
|
internal u64 split_mix_64(SplitMix64State *state);
|
||||||
|
|
||||||
XOR256State wapp_init_xor_256_state(void) {
|
XOR256State wapp_prng_xorshift_init_state(void) {
|
||||||
persistent bool seeded = false;
|
persistent bool seeded = false;
|
||||||
if (!seeded) {
|
if (!seeded) {
|
||||||
seeded = true;
|
seeded = true;
|
||||||
@ -33,7 +33,7 @@ XOR256State wapp_init_xor_256_state(void) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 wapp_xorshift_256_generate(XOR256State *state) {
|
u64 wapp_prng_xorshift_256(XOR256State *state) {
|
||||||
u64 t = state->x ^ (state->x << 11);
|
u64 t = state->x ^ (state->x << 11);
|
||||||
|
|
||||||
state->x = state->y;
|
state->x = state->y;
|
||||||
@ -44,7 +44,7 @@ u64 wapp_xorshift_256_generate(XOR256State *state) {
|
|||||||
return state->w;
|
return state->w;
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 wapp_xoshiro_256ss_generate(XOR256State *state) {
|
u64 wapp_prng_xorshift_256ss(XOR256State *state) {
|
||||||
const u64 result = rol64(state->z * 5, 7) * 9;
|
const u64 result = rol64(state->z * 5, 7) * 9;
|
||||||
const u64 t = state->z << 17;
|
const u64 t = state->z << 17;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ u64 wapp_xoshiro_256ss_generate(XOR256State *state) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 wapp_xoshiro_256p_generate(XOR256State *state) {
|
u64 wapp_prng_xorshift_256p(XOR256State *state) {
|
||||||
const u64 result = state->w + state->x;
|
const u64 result = state->w + state->x;
|
||||||
const u64 t = state->z << 17;
|
const u64 t = state->z << 17;
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@ struct xor_256_state {
|
|||||||
u64 w;
|
u64 w;
|
||||||
};
|
};
|
||||||
|
|
||||||
XOR256State wapp_init_xor_256_state(void);
|
XOR256State wapp_prng_xorshift_init_state(void);
|
||||||
u64 wapp_xorshift_256_generate(XOR256State *state);
|
u64 wapp_prng_xorshift_256(XOR256State *state);
|
||||||
u64 wapp_xoshiro_256ss_generate(XOR256State *state);
|
u64 wapp_prng_xorshift_256ss(XOR256State *state);
|
||||||
u64 wapp_xoshiro_256p_generate(XOR256State *state);
|
u64 wapp_prng_xorshift_256p(XOR256State *state);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
END_C_LINKAGE
|
END_C_LINKAGE
|
||||||
|
Loading…
Reference in New Issue
Block a user