SFMT - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English

SFMT is known as SIMD-oriented Fast Mersenne Twister which is a new variant of Mersenne Twister. SFMT is a Linear Feedbacked Shift Register generator that generates 128-bit pseudorandom integer recursively. The algorithm is as follows:

  • Set some arbitrary initial values \(W_0, W_1, · · · , W_{N-1}\), each consisting of 128 bits.

  • Perform recursive operation:

\[g(W_0,…,W_{N-1}) = W_0A ⊕ W_MB ⊕W_{N-2}C ⊕W_{N-1}D\]

Where \(W_0, W_M,…\) are 128-bit integers, and A,B,C,D are sparse \(128 \times 128\) matrices over (0,1) for which \(W_A,W_B,W_C,W_D\) can be computed. The degree of recursion N is [19937/128] = 156, and the linear transformations A,B,C,D are as follows.

\[\begin{split}\begin{align} wA& = (w^{128} \ll 8) ⊕ w; \verb| w is considered as a single 128-bit integer.| \\ wB& = (w^{32} \gg 11)\ \& \ (BFFFFFF6 BFFAFFFF DDFECB7F DFFFFFEF); \\ & \verb|w is considered as a quadruple of 32-bit integers for right-shift operation| \\ wC& = (w^{128} \gg 8); \verb| w is considered as a single 128-bit integer.| \\ wD& = (w^{32} \ll 18); \verb| w is considered as a quadruple of 32-bit integer.| \\ \end{align}\end{split}\]

This algorithm has a period length of approximately \(2^{19,937} − 1\) and has better equidistribution property than Mersenne Twister. [SFMT]