Skip to content

Commit f23060d

Browse files
burblebeetkoeppe
authored andcommitted
LWG4134 Issue with Philox algorithm specification
1 parent f630484 commit f23060d

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

source/numerics.tex

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3134,15 +3134,13 @@
31343134
$f_n(j)$ is defined in \tref{rand.eng.philox.f}.
31353135

31363136
\begin{floattable}{Values for the word permutation $\bm{f}_{\bm{n}}\bm{(j)}$}{rand.eng.philox.f}
3137-
{l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l}
3137+
{l|l|l|l|l|l}
31383138
\topline
3139-
\multicolumn{2}{|c|}{$\bm{f}_{\bm{n}}\bm{(j)}$} & \multicolumn{16}{c|}{$\bm{j}$} \\ \cline{3-18}
3139+
\multicolumn{2}{|c|}{$\bm{f}_{\bm{n}}\bm{(j)}$} & \multicolumn{4}{c|}{$\bm{j}$} \\ \cline{3-6}
31403140
\multicolumn{2}{|c|}{}
3141-
& 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline
3142-
$\bm{n} $ & 2 & 0 & 1 & \multicolumn{14}{c|}{} \\ \cline{2-18}
3143-
& 4 & 0 & 3 & 2 & 1 & \multicolumn{12}{c|}{} \\ \cline{2-18}
3144-
& 8 & 2 & 1 & 4 & 7 & 6 & 5 & 0 & 3 & \multicolumn{8}{c|}{} \\ \cline{2-18}
3145-
& 16 & 0 & 9 & 2 & 13 & 6 & 11 & 4 & 15 & 10 & 7 & 12 & 3 & 14 & 5 & 8 & 1 \\ \cline{2-18}
3141+
& 0 & 1 & 2 & 3 \\ \hline
3142+
$\bm{n} $ & 2 & 0 & 1 & \multicolumn{2}{c|}{} \\ \cline{2-6}
3143+
& 4 & 2 & 1 & 0 & 3 \\ \cline{2-6}
31463144
\end{floattable}
31473145
\begin{note}
31483146
For $n = 2$ the sequence is not permuted.
@@ -3151,8 +3149,8 @@
31513149
\item
31523150
The following computations are applied to the elements of the $V$ sequence:
31533151
\begin{codeblock}
3154-
@$X_{2k + 0} = \mullo(V_{2k + 1}, M_{k}, w)$@
3155-
@$X_{2k + 1} = \mulhi(V_{2k + 1}, M_{k}, w) \xor \mathit{key}^q_k \xor V_{2k}$@
3152+
@$X_{2k + 0} = \mulhi(V_{2k}, M_{k}, w) \xor \mathit{key}^q_k \xor V_{2k + 1}$@
3153+
@$X_{2k + 1} = \mullo(V_{2k}, M_{k}, w)$@
31563154
\end{codeblock}
31573155
where:
31583156
\begin{itemize}
@@ -3243,7 +3241,7 @@
32433241
\mandates
32443242
\begin{itemize}
32453243
\item \tcode{sizeof...(consts) == n} is \tcode{true}, and
3246-
\item \tcode{n == 2 || n == 4 || n == 8 || n == 16} is \tcode{true}, and
3244+
\item \tcode{n == 2 || n == 4} is \tcode{true}, and
32473245
\item \tcode{0 < r} is \tcode{true}, and
32483246
\item \tcode{0 < w \&\& w <= numeric_limits<UIntType>::digits} is \tcode{true}.
32493247
\end{itemize}
@@ -3911,7 +3909,7 @@
39113909
\begin{itemdecl}
39123910
using philox4x32 =
39133911
philox_engine<uint_fast32_t, 32, 4, 10,
3914-
0xD2511F53, 0x9E3779B9, 0xCD9E8D57, 0xBB67AE85>;
3912+
0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85>;
39153913
\end{itemdecl}
39163914

39173915
\begin{itemdescr}
@@ -3926,7 +3924,7 @@
39263924
\begin{itemdecl}
39273925
using philox4x64 =
39283926
philox_engine<uint_fast64_t, 64, 4, 10,
3929-
0xD2E7470EE14C6C93, 0x9E3779B97F4A7C15, 0xCA5A826395121157, 0xBB67AE8584CAA73B>;
3927+
0xCA5A826395121157, 0x9E3779B97F4A7C15, 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B>;
39303928
\end{itemdecl}
39313929

39323930
\begin{itemdescr}

0 commit comments

Comments
 (0)