xso::generator — Predefined Type Aliases

Introduction

Our xoshiro/xoroshiro implementations depend on up to 10 template parameters:

  1. The unsigned word type used to store the state is also the generator’s output type.
  2. The number of words used to store the state. More words mean more state.
  3. Up to three parameters are labelled \(A\), \(B\), and \(C\) which determines how the state is advanced.
  4. Up to three further parameters are labelled \(R\), \(S\), and \(T\) which determines how the state is scrambled to produce the required single word of output.
  5. Up to two indices that determine the words of the state taking part in the output function.

The code in xoshiro.h covers all possible cases, but typing many parameters is a pain. Moreover, while we can instantiate any generator in the family, only a limited number have been properly vetted for suitability as “good.”

Therefore, we provide a few type aliases for the generators you should use in most cases.

Analyzed Generators

Beyond the recommended and simplest type aliases above, we also provide rationally named type aliases for 17 variants, which are analyzed in some detail in this original paper.

# Type Alias Output Bits State Bits State State Output Function
1 xoroshiro_2x32_star 32 64 xoroshiro<26,9,13> star<0x9E3779BB,0>
2 xoroshiro_2x32_star_star 32 64 xoroshiro<26,9,13> star_star<0x9E3779BBu,5,5,0>
3 xoroshiro_2x64_plus 64 128 xoroshiro<24,16,37> plus<0,1>
4 xoroshiro_2x64_plus_plus 64 128 xoroshiro<49,21,28> plus_plus<17,0,1>
5 xoroshiro_2x64_star_star 64 128 xoroshiro<24,16,37> star_star<5,7,9,0>
6 xoroshiro_16x64_star 64 1024 xoroshiro<25,27,36> star<0x9e3779b97f4a7c13,0>
7 xoroshiro_16x64_star_star 64 1024 xoroshiro<25,27,36> star_star<5,7,9,0>
8 xoroshiro_16x64_plus_plus 64 1024 xoroshiro<25,27,36> plus_plus<23,15,0>
9 xoshiro_4x32_plus 32 128 xoshiro<9,11> plus<0,3>
10 xoshiro_4x32_plus_plus 32 128 xoshiro<9,11> plus_plus<7,0,3>
11 xoshiro_4x32_star_star 32 128 xoshiro<9,11> plus_plus<7,0,3>
12 xoshiro_4x64_plus 64 256 xoshiro<17,45> plus<0,3>
13 xoshiro_4x64_plus_plus 64 256 xoshiro<17,45> plus_plus<23,0,3>
14 xoshiro_4x64_star_star 64 256 xoshiro<17,45> star_star<5,7,9,1>
15 xoshiro_8x64_plus 64 512 xoshiro<11,21> plus<2,0>
16 xoshiro_8x64_plus_plus 64 512 xoshiro<11,21> plus_plus<17,2,0>
17 xoshiro_8x64_star_star 64 512 xoshiro<11,21> star_star<5,7,9,1>

The naming convention should be fairly obvious — xoshiro or xoroshiro followed by the number of words of state and the size of those words, followed by some information about the type of output function that is used. The specific choices for the A, B, C, R, S, and T parameters are shown in the final two columns of the table.

All the type aliases, engines, and output functions above are actually in the xso namespace — that has been dropped in the table for the sake of brevity. ### See Also

xso::generator
State
Scrambler

Back to top