You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2017/12/08 00:28:41 UTC

[1/3] commons-rng git commit: Upgrade example (web site).

Repository: commons-rng
Updated Branches:
  refs/heads/master 7c1079426 -> 5b88619b7


Upgrade example (web site).


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/070ff4ad
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/070ff4ad
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/070ff4ad

Branch: refs/heads/master
Commit: 070ff4ad8b14e009f75e7bfdfe4e4c7c1cc6e277
Parents: 7c10794
Author: Gilles <er...@apache.org>
Authored: Thu Dec 7 13:10:30 2017 +0100
Committer: Gilles <er...@apache.org>
Committed: Thu Dec 7 13:10:30 2017 +0100

----------------------------------------------------------------------
 commons-rng-sampling/src/site/xdoc/index.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/070ff4ad/commons-rng-sampling/src/site/xdoc/index.xml
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/site/xdoc/index.xml b/commons-rng-sampling/src/site/xdoc/index.xml
index 78d7a79..f53aab2 100644
--- a/commons-rng-sampling/src/site/xdoc/index.xml
+++ b/commons-rng-sampling/src/site/xdoc/index.xml
@@ -41,13 +41,13 @@
 
 <source>import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.distribution.ContinuousSampler;
-import org.apache.commons.rng.sampling.distribution.BoxMullerGaussianSampler;
+import org.apache.commons.rng.sampling.distribution.MarsagliaNormalizedGaussianSampler;
 
 public class NormalDeviates {
    private final ContinuousSampler normalizedGaussian;
 
     public NormalDeviates(UniformRandomProvider rng) {
-        normalizedGaussian = new BoxMullerGaussianSampler(rng, 0, 1);
+        normalizedGaussian = new MarsagliaNormalizedGaussianSampler(rng);
     }
 
     public double sample(double mean,


[3/3] commons-rng git commit: Benchmarks (user guide).

Posted by er...@apache.org.
Benchmarks (user guide).


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/5b88619b
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/5b88619b
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/5b88619b

Branch: refs/heads/master
Commit: 5b88619b732e0d556e61a48b8fbb8d628bf16ea8
Parents: 3cec661
Author: Gilles <er...@apache.org>
Authored: Thu Dec 7 18:07:37 2017 +0100
Committer: Gilles <er...@apache.org>
Committed: Thu Dec 7 18:07:37 2017 +0100

----------------------------------------------------------------------
 src/site/apt/userguide/rng.apt | 71 +++++++++++++++++++------------------
 1 file changed, 36 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/5b88619b/src/site/apt/userguide/rng.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/userguide/rng.apt b/src/site/apt/userguide/rng.apt
index f46bb5b..6451ad6 100644
--- a/src/site/apt/userguide/rng.apt
+++ b/src/site/apt/userguide/rng.apt
@@ -577,41 +577,42 @@ String word = sampler.sample().get(0);
 | WELL_44497_B             |        1.03380 |
 *--------------------------*----------------+
 
-  ** Comparing <<<MarsagliaNormalizedGaussianSampler>>> with <<<java.util.Random>>>
-
-*--------------------------*----------------+
-|| RNG identifier          || Score (normalized to the score of {{{https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#nextGaussian--}nextGaussian()}} method) |
-*--------------------------*----------------+
-| SPLIT_MIX_64             |        0.30320 |
-*--------------------------*----------------+
-| XOR_SHIFT_1024_S         |        0.31566 |
-*--------------------------*----------------+
-| TWO_CMRES                |        0.35477 |
-*--------------------------*----------------+
-| MWC_256                  |        0.36204 |
-*--------------------------*----------------+
-| MT_64                    |        0.37767 |
-*--------------------------*----------------+
-| ISAAC                    |        0.42038 |
-*--------------------------*----------------+
-| KISS                     |        0.42985 |
-*--------------------------*----------------+
-| MT                       |        0.44593 |
-*--------------------------*----------------+
-| WELL_512_A               |        0.50492 |
-*--------------------------*----------------+
-| WELL_1024_A              |        0.53313 |
-*--------------------------*----------------+
-| WELL_19937_A             |        0.60641 |
-*--------------------------*----------------+
-| WELL_19937_C             |        0.63817 |
-*--------------------------*----------------+
-| WELL_44497_A             |        0.64607 |
-*--------------------------*----------------+
-| JDK                      |        0.64854 |
-*--------------------------*----------------+
-| WELL_44497_B             |        0.67046 |
-*--------------------------*----------------+
+  ** Comparing {{{../commons-rng-sampling/apidocs/org/apache/commons/rng/sampling/distribution/BoxMullerNormalizedGaussianSampler.html}BoxMullerNormalizedGaussianSampler}}, {{{../commons-rng-sampling/apidocs/org/apache/commons/rng/sampling/distribution/MarsagliaNormalizedGaussianSampler.html}MarsagliaNormalizedGaussianSampler}}, {{{../commons-rng-sampling/apidocs/org/apache/commons/rng/sampling/distribution/ZigguratNormalizedGaussianSampler.html}ZigguratNormalizedGaussianSampler}}.
+     Each score is normalized to the score of {{{https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#nextGaussian--}nextGaussian()}} method of <<<java.util.Random>>>.
+
+*--------------------------*----------------+----------------+----------------+
+|| RNG identifier          || <<<BoxMullerNormalizedGaussianSampler>>> || <<<MarsagliaNormalizedGaussianSampler>>> || <<<ZigguratNormalizedGaussianSampler>>> |
+*--------------------------*----------------+----------------+----------------+
+| ISAAC                    |        0.96494 |        0.41090 |        0.11707 |
+*--------------------------*----------------+----------------+----------------+
+| JDK                      |        1.04037 |        0.65917 |        0.14461 |
+*--------------------------*----------------+----------------+----------------+
+| KISS                     |        0.93580 |        0.41354 |        0.12162 |
+*--------------------------*----------------+----------------+----------------+
+| MT                       |        0.95563 |        0.43966 |        0.12944 |
+*--------------------------*----------------+----------------+----------------+
+| MT_64                    |        0.85963 |        0.37269 |        0.14390 |
+*--------------------------*----------------+----------------+----------------+
+| MWC_256                  |        0.90648 |        0.34902 |        0.09656 |
+*--------------------------*----------------+----------------+----------------+
+| SPLIT_MIX_64             |        0.82831 |        0.29894 |        0.10303 |
+*--------------------------*----------------+----------------+----------------+
+| TWO_CMRES                |        0.84886 |        0.35546 |        0.11496 |
+*--------------------------*----------------+----------------+----------------+
+| WELL_1024_A              |        1.00718 |        0.52266 |        0.15347 |
+*--------------------------*----------------+----------------+----------------+
+| WELL_19937_A             |        1.06638 |        0.61714 |        0.17292 |
+*--------------------------*----------------+----------------+----------------+
+| WELL_19937_C             |        1.09771 |        0.61585 |        0.18022 |
+*--------------------------*----------------+----------------+----------------+
+| WELL_44497_A             |        1.10244 |        0.62584 |        0.16854 |
+*--------------------------*----------------+----------------+----------------+
+| WELL_44497_B             |        1.10634 |        0.65012 |        0.18699 |
+*--------------------------*----------------+----------------+----------------+
+| WELL_512_A               |        0.99513 |        0.50448 |        0.15273 |
+*--------------------------*----------------+----------------+----------------+
+| XOR_SHIFT_1024_S         |        0.84066 |        0.30669 |        0.11498 |
+*--------------------------*----------------+----------------+----------------+
 
 
 5. Quality


[2/3] commons-rng git commit: Add "ZigguratNormalizedGaussianSampler" (benchmark).

Posted by er...@apache.org.
Add "ZigguratNormalizedGaussianSampler" (benchmark).


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/3cec661a
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/3cec661a
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/3cec661a

Branch: refs/heads/master
Commit: 3cec661a4a763ed06d41019051910dd78db6afc9
Parents: 070ff4a
Author: Gilles <er...@apache.org>
Authored: Thu Dec 7 18:06:58 2017 +0100
Committer: Gilles <er...@apache.org>
Committed: Thu Dec 7 18:06:58 2017 +0100

----------------------------------------------------------------------
 .../rng/jmh/distribution/SamplersPerformance.java      | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/3cec661a/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
----------------------------------------------------------------------
diff --git a/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java b/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
index d24664c..ba50f3a 100644
--- a/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
+++ b/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
@@ -38,6 +38,7 @@ import org.apache.commons.rng.sampling.distribution.DiscreteSampler;
 import org.apache.commons.rng.sampling.distribution.BoxMullerGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.BoxMullerNormalizedGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.MarsagliaNormalizedGaussianSampler;
+import org.apache.commons.rng.sampling.distribution.ZigguratNormalizedGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.AhrensDieterExponentialSampler;
 import org.apache.commons.rng.sampling.distribution.AhrensDieterMarsagliaTsangGammaSampler;
 import org.apache.commons.rng.sampling.distribution.BoxMullerLogNormalSampler;
@@ -159,7 +160,7 @@ public class SamplersPerformance {
      */
     @Benchmark
     public void runMarsagliaNormalizedGaussianSampler(Sources sources,
-                                                                   Blackhole bh) {
+                                                      Blackhole bh) {
         runSample(new MarsagliaNormalizedGaussianSampler(sources.getGenerator()), bh);
     }
 
@@ -168,6 +169,16 @@ public class SamplersPerformance {
      * @param bh Data sink.
      */
     @Benchmark
+    public void runZigguratNormalizedGaussianSampler(Sources sources,
+                                                     Blackhole bh) {
+        runSample(new ZigguratNormalizedGaussianSampler(sources.getGenerator()), bh);
+    }
+
+    /**
+     * @param sources Source of randomness.
+     * @param bh Data sink.
+     */
+    @Benchmark
     public void runAhrensDieterExponentialSampler(Sources sources,
                                                   Blackhole bh) {
         runSample(new AhrensDieterExponentialSampler(sources.getGenerator(), 4.56), bh);