Author: aherbert
Date: Tue Apr 21 12:38:47 2026
New Revision: 1092798

Log:
Update PHILOX_4X64 Gaussian sampler performance

Modified:
   websites/production/commons/content/proper/commons-rng/userguide/rng.html

Modified: 
websites/production/commons/content/proper/commons-rng/userguide/rng.html
==============================================================================
--- websites/production/commons/content/proper/commons-rng/userguide/rng.html   
Tue Apr 21 11:21:38 2026        (r1092797)
+++ websites/production/commons/content/proper/commons-rng/userguide/rng.html   
Tue Apr 21 12:38:47 2026        (r1092798)
@@ -1410,12 +1410,13 @@ double[] coordinate = sampler.sample();<
 <td style="text-align: center;">0.37289</td></tr>
 <tr class="a">
 <td style="text-align: center;">PHILOX_4X64</td>
-<td style="text-align: center;">1.12164</td>
-<td style="text-align: center;">1.37654</td>
-<td style="text-align: center;">0.52689</td>
-<td style="text-align: center;">0.51213</td></tr></table>
+<td style="text-align: center;">0.91379</td>
+<td style="text-align: center;">0.91941</td>
+<td style="text-align: center;">0.26007</td>
+<td style="text-align: center;">0.24542</td></tr></table>
 <p>Notes:</p>
-<p>The reference <code>java.util.Random</code> nextGaussian() method uses 
synchronized method calls per sample. The <code>RandomSource.JDK</code> RNG 
will use synchronized method calls when generating numbers for the 
<code>BoxMullerNormalizedGaussianSampler</code> but the calls to obtain the 
samples are not synchronized, hence the observed difference. All the other RNGs 
are not synchronized.</p></section></section><section><a id="a5._Quality"></a>
+<p>The reference <code>java.util.Random</code> nextGaussian() method uses 
synchronized method calls per sample. The <code>RandomSource.JDK</code> RNG 
will use synchronized method calls when generating numbers for the 
<code>BoxMullerNormalizedGaussianSampler</code> but the calls to obtain the 
samples are not synchronized, hence the observed difference. All the other RNGs 
are not synchronized.</p>
+<p>The <code>RandomSource.PHILOX_4X64</code> generator uses multiply high 
methods from <code>java.lang.Math</code> if available. The 
<code>multiplyHigh</code> (JDK 9+) and <code>unsignedMultiplyHigh</code> (JDK 
18+) significantly increase performance if the 128-bit product of two 64-bit 
factors is supported by hardware instructions. These results are on a platform 
with supported hardware.</p></section></section><section><a 
id="a5._Quality"></a>
 <h1>5. Quality</h1>
 <p>This section reports results of <a 
href="../commons-rng-examples/apidocs/org/apache/commons/rng/examples/stress/package-summary.html">performing
 &quot;stress tests&quot;</a> that aim at detecting failures of an 
implementation to produce sequences of numbers that follow a uniform 
distribution.</p>
 <p>Three different test suites were used:</p>

Reply via email to