Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

## possible documentation error for initialization of Philox4x32-10 BRNG in MKL VSL

Beginner
553 Views

There seems to be a discrepancy between the method of initialization of the Philox-4x32-10 random number generator in the following two web-pages when more than a single 32-bit integer is used for initialization:

(1) https://software.intel.com/en-us/mkl-vsnotes-philox4x32-10
Stream Initialization by Function vslNewStreamEx

and the following article:

The case in (1) seems a bit odd to me, since k is meant to be a 64-bit (2x32-bit) key, while the counter c is a128-bit (4x32-bit). Yet, the method described for n>2 is trying to initialize k with more than 64-bits. Perhaps the text is wrong for (1) and that for n>2 the params[3,4,5,6] should instead be setting c?

Has anyone used this BRNG with multiple-word initialization?

Thanks.  P.

1 Solution
Employee
553 Views

Hi Peter,
Thanks for bringing us this observation!

Yes, the description of the vslNewStreamEx function for Philox 4x32-10 in VS Notes contains a bug.
The right description is expected to be like this:

Philox4x32-10 generates the stream and initializes it specifying the array params[] of n 32-bit integers:

1. If n = 0, assume c = k0 = k1 = 0.
2. If n = 1, assume k = params[0], c = 0.
3. If n = 2, assume k = params[0] + params[1]*232c = 0.
4. If n = 3, assume k = params[0] + params[1]*232c = params[2].
5. If n = 4, assume k = params[0] + params[1]*232c = params[2] + params[3]*232.
6. If n = 5, assume k = params[0] + params[1]*232c = params[2] + params[3]*232+ params[4]*264.
7. If n >= 6, assume k = params[0] + params[1]*232c = params[2] + params[3]*232+ params[4]*264 + params[5]*296.

We will update the documentation in one of the future releases of the library.

Regards,
Pavel

3 Replies
Employee
554 Views

Hi Peter,
Thanks for bringing us this observation!

Yes, the description of the vslNewStreamEx function for Philox 4x32-10 in VS Notes contains a bug.
The right description is expected to be like this:

Philox4x32-10 generates the stream and initializes it specifying the array params[] of n 32-bit integers:

1. If n = 0, assume c = k0 = k1 = 0.
2. If n = 1, assume k = params[0], c = 0.
3. If n = 2, assume k = params[0] + params[1]*232c = 0.
4. If n = 3, assume k = params[0] + params[1]*232c = params[2].
5. If n = 4, assume k = params[0] + params[1]*232c = params[2] + params[3]*232.
6. If n = 5, assume k = params[0] + params[1]*232c = params[2] + params[3]*232+ params[4]*264.
7. If n >= 6, assume k = params[0] + params[1]*232c = params[2] + params[3]*232+ params[4]*264 + params[5]*296.

We will update the documentation in one of the future releases of the library.

Regards,
Pavel

Beginner
553 Views

OK, Thanks Pavel!

Moderator
553 Views

The problem is escalated and this thread will be updated when the fix will be released.