29 #define M_PI 3.14159265358979323846
43 return (
x << bits) | (
x >> (64 - bits));
56 uint64 s0 =
state->s0,
61 state->s0 =
rotl(s0, 24) ^ sx ^ (sx << 16);
75 uint64
val = (*
state += UINT64CONST(0x9E3779B97f4A7C15));
78 val = (
val ^ (
val >> 30)) * UINT64CONST(0xBF58476D1CE4E5B9);
79 val = (
val ^ (
val >> 27)) * UINT64CONST(0x94D049BB133111EB);
105 int64 seed = ((double) ((UINT64CONST(1) << 52) - 1)) * fseed;
122 state->s0 = UINT64CONST(0x5851F42D4C957F2D);
123 state->s1 = UINT64CONST(0x14057B7EF767814F);
155 uint64
range = rmax - rmin;
204 uval = (uint64) rmin +
236 return (
uint32) (v >> 32);
247 return (
int32) (v >> 32);
258 return (
int32) (v >> 33);
277 return ldexp((
double) (v >> (64 - 52)), -52);
305 z0 = sqrt(-2.0 * log(u1)) * sin(2.0 *
M_PI * u2);
317 return (
bool) (v >> 63);
static int pg_leftmost_one_pos64(uint64 word)
int64 pg_prng_int64_range(pg_prng_state *state, int64 rmin, int64 rmax)
double pg_prng_double(pg_prng_state *state)
uint64 pg_prng_uint64_range(pg_prng_state *state, uint64 rmin, uint64 rmax)
int32 pg_prng_int32(pg_prng_state *state)
static uint64 splitmix64(uint64 *state)
uint32 pg_prng_uint32(pg_prng_state *state)
uint64 pg_prng_uint64(pg_prng_state *state)
int32 pg_prng_int32p(pg_prng_state *state)
int64 pg_prng_int64(pg_prng_state *state)
void pg_prng_seed(pg_prng_state *state, uint64 seed)
pg_prng_state pg_global_prng_state
int64 pg_prng_int64p(pg_prng_state *state)
static uint64 rotl(uint64 x, int bits)
bool pg_prng_seed_check(pg_prng_state *state)
double pg_prng_double_normal(pg_prng_state *state)
bool pg_prng_bool(pg_prng_state *state)
void pg_prng_fseed(pg_prng_state *state, double fseed)
static uint64 xoroshiro128ss(pg_prng_state *state)
static struct cvec * range(struct vars *v, chr a, chr b, int cases)