Xoshiro128++#

Implementation of Xoshiro128++[[1]] random number generator. This is a wrapper around the original source code of the paper authors [[2]]. Based on:

Distribution#

The following figures shows the generation of 5000 random numbers using Xoshiro128++ generator. Additionally, the Histogram of the generated values is shown. The generated random values are uniformly distributed, but not in a perfect manner. The specific pattern and distribution depends on the random seed.

(Source code, png, hires.png, pdf)

../../../../_images/uz_prng_xoshiro-1.png

Fig. 343 Distribution generated by Xoshiro128++ using seed 0.#

Reference#

typedef struct uz_prng_xoshiro_t uz_prng_xoshiro_t#

Object of Xoshiro128++ generator.

uz_prng_xoshiro_t *uz_prng_xoshiro_init(uint64_t seed)#

Initializes the Xoshiro128++ random generator. The supplied Seed is shuffled using Splitmix64 to ensure that the lower bits are not zero.

Parameters:
  • seed – Seed for the initial properties of the generator.

Returns:

uz_prng_xoshiro_t*

uint32_t uz_prng_xoshiro_get_uniform_uint32(uz_prng_xoshiro_t *self)#

Returns a uniformly distributed unsigned integer within 0…UINT32_MAX (i.e., 2^32-1=4,294,967,295)

Parameters:
  • self

Returns:

uint32_t

void uz_prng_xoshiro_reset(uz_prng_xoshiro_t *self, uint64_t seed)#

Resets generator to seed.

Parameters:
  • self

  • seed

Sources#