Skip to content

Commit 3a7a0aa

Browse files
burblebeetkoeppe
authored andcommitted
LWG4134 Issue with Philox algorithm specification
1 parent dcd81b3 commit 3a7a0aa

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
@@ -3133,15 +3133,13 @@
31333133
$f_n(j)$ is defined in \tref{rand.eng.philox.f}.
31343134

31353135
\begin{floattable}{Values for the word permutation $\bm{f}_{\bm{n}}\bm{(j)}$}{rand.eng.philox.f}
3136-
{l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l}
3136+
{l|l|l|l|l|l}
31373137
\topline
3138-
\multicolumn{2}{|c|}{$\bm{f}_{\bm{n}}\bm{(j)}$} & \multicolumn{16}{c|}{$\bm{j}$} \\ \cline{3-18}
3138+
\multicolumn{2}{|c|}{$\bm{f}_{\bm{n}}\bm{(j)}$} & \multicolumn{4}{c|}{$\bm{j}$} \\ \cline{3-6}
31393139
\multicolumn{2}{|c|}{}
3140-
& 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline
3141-
$\bm{n} $ & 2 & 0 & 1 & \multicolumn{14}{c|}{} \\ \cline{2-18}
3142-
& 4 & 0 & 3 & 2 & 1 & \multicolumn{12}{c|}{} \\ \cline{2-18}
3143-
& 8 & 2 & 1 & 4 & 7 & 6 & 5 & 0 & 3 & \multicolumn{8}{c|}{} \\ \cline{2-18}
3144-
& 16 & 0 & 9 & 2 & 13 & 6 & 11 & 4 & 15 & 10 & 7 & 12 & 3 & 14 & 5 & 8 & 1 \\ \cline{2-18}
3140+
& 0 & 1 & 2 & 3 \\ \hline
3141+
$\bm{n} $ & 2 & 0 & 1 & \multicolumn{2}{c|}{} \\ \cline{2-6}
3142+
& 4 & 2 & 1 & 0 & 3 \\ \cline{2-6}
31453143
\end{floattable}
31463144
\begin{note}
31473145
For $n = 2$ the sequence is not permuted.
@@ -3150,8 +3148,8 @@
31503148
\item
31513149
The following computations are applied to the elements of the $V$ sequence:
31523150
\begin{codeblock}
3153-
@$X_{2k + 0} = \mullo(V_{2k + 1}, M_{k}, w)$@
3154-
@$X_{2k + 1} = \mulhi(V_{2k + 1}, M_{k}, w) \xor \mathit{key}^q_k \xor V_{2k}$@
3151+
@$X_{2k + 0} = \mulhi(V_{2k}, M_{k}, w) \xor \mathit{key}^q_k \xor V_{2k + 1}$@
3152+
@$X_{2k + 1} = \mullo(V_{2k}, M_{k}, w)$@
31553153
\end{codeblock}
31563154
where:
31573155
\begin{itemize}
@@ -3242,7 +3240,7 @@
32423240
\mandates
32433241
\begin{itemize}
32443242
\item \tcode{sizeof...(consts) == n} is \tcode{true}, and
3245-
\item \tcode{n == 2 || n == 4 || n == 8 || n == 16} is \tcode{true}, and
3243+
\item \tcode{n == 2 || n == 4} is \tcode{true}, and
32463244
\item \tcode{0 < r} is \tcode{true}, and
32473245
\item \tcode{0 < w \&\& w <= numeric_limits<UIntType>::digits} is \tcode{true}.
32483246
\end{itemize}
@@ -3910,7 +3908,7 @@
39103908
\begin{itemdecl}
39113909
using philox4x32 =
39123910
philox_engine<uint_fast32_t, 32, 4, 10,
3913-
0xD2511F53, 0x9E3779B9, 0xCD9E8D57, 0xBB67AE85>;
3911+
0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85>;
39143912
\end{itemdecl}
39153913

39163914
\begin{itemdescr}
@@ -3925,7 +3923,7 @@
39253923
\begin{itemdecl}
39263924
using philox4x64 =
39273925
philox_engine<uint_fast64_t, 64, 4, 10,
3928-
0xD2E7470EE14C6C93, 0x9E3779B97F4A7C15, 0xCA5A826395121157, 0xBB67AE8584CAA73B>;
3926+
0xCA5A826395121157, 0x9E3779B97F4A7C15, 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B>;
39293927
\end{itemdecl}
39303928

39313929
\begin{itemdescr}

0 commit comments

Comments
 (0)