This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git


The following commit(s) were added to refs/heads/master by this push:
     new bbbba939 Use same method for double and open double generation 
performance
bbbba939 is described below

commit bbbba939c25413ea479e585986b5b8d44a2b91ca
Author: Alex Herbert <[email protected]>
AuthorDate: Fri Feb 13 16:41:43 2026 +0000

    Use same method for double and open double generation performance
---
 .../rng/examples/jmh/core/FloatingPointGenerationPerformance.java  | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git 
a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/FloatingPointGenerationPerformance.java
 
b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/FloatingPointGenerationPerformance.java
index e2628856..47ff5a97 100644
--- 
a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/FloatingPointGenerationPerformance.java
+++ 
b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/FloatingPointGenerationPerformance.java
@@ -99,12 +99,7 @@ public class FloatingPointGenerationPerformance {
         // 0x300L = 256 + 512 = 768
         // 0x0ff  = 255
         // This makes a number in the range 1.0 to 2.0 so subtract 1.0
-        //
-        // Note: This variant using a long constant can be slower:
-        // Double.longBitsToDouble((source.nextLong() >>> 12) | 
0x3ff0000000000001L) - 1.0
-        // It matches the performance of nextOpenDoubleUsingBitsToDouble so is 
not
-        // formally included as a variant.
-        return Double.longBitsToDouble((source.nextLong() >>> 12) | (0x3ffL << 
52)) - 1.0;
+        return Double.longBitsToDouble((source.nextLong() >>> 12) | 
0x3ff0000000000000L) - 1.0;
     }
 
     /**

Reply via email to