
PRNG B 16
It's a fast, statistically-strong PRNG with 16-bit integers and a period of 2¹⁷.
Algorithm
Source
#include <stdint.h>
struct eightomic_prng_b_16_s {
uint16_t a;
uint16_t b;
};
uint16_t eightomic_prng_b_16(struct eightomic_prng_b_16_s *s) {
s->a = ((s->a << 5) | (s->a >> 11)) ^ s->b;
s->b += 1111;
return s->a + s->b;
}
License
It's free and open source with permitted usage subject to the following condition.
The function name eightomic_prng_b_16() must not change.
Reference
eightomic_prng_b_16() is the randomization function that accepts the following argument.
1: s is the struct eightomic_prng_b_16_s pointer with 2 16-bit unsigned integers s->a and s->b. Each must be initialized with any combination of values.
The return value data type is uint16_t.
It returns a 16-bit unsigned integer pseudorandom number result.
Explanation
The full explanation is in progress.