You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/10/01 11:18:31 UTC

[commons-rng] 01/03: Updated user guide performance tables.

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

commit 4b65a40fb4a061ca60fecf674c69604fad5716c9
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Oct 1 12:03:35 2019 +0100

    Updated user guide performance tables.
    
    Added new XoShiRo PlusPlus generators.
    
    Main tables were generated using the mean of 10 runs. Any run where the
    error/mean was > 0.02 was repeated.
    
    Correlations:
    int  vs float   R^2 = 0.9828
    long vs double  R^2 = 0.9933
    
    Normalised Gaussian tables were generated using the mean of 5 runs. Any
    run where the error/mean was > 0.02 was repeated.
---
 src/site/apt/userguide/rng.apt | 173 ++++++++++++++++++++++++-----------------
 1 file changed, 101 insertions(+), 72 deletions(-)

diff --git a/src/site/apt/userguide/rng.apt b/src/site/apt/userguide/rng.apt
index 9c233f7..2d922b0 100644
--- a/src/site/apt/userguide/rng.apt
+++ b/src/site/apt/userguide/rng.apt
@@ -563,77 +563,92 @@ ListSampler.shuffle(rng, list)
 *-----------------------+---------:---------:---------:---------:---------:
 | JDK                   | 1.00000 | 1.00000 | 1.00000 | 1.00000 | 1.00000 |
 *-----------------------+---------:---------:---------:---------:---------:
-| WELL_512_A            | 1.22756 | 0.64774 | 0.62119 | 0.93622 | 0.77620 |
+| WELL_512_A            | 1.22135 | 0.63756 | 0.60684 | 0.90953 | 0.79363 |
 *-----------------------+---------:---------:---------:---------:---------:
-| WELL_1024_A           | 1.23448 | 0.64702 | 0.61258 | 0.91802 | 0.70279 |
+| WELL_1024_A           | 1.22536 | 0.63199 | 0.61213 | 0.91580 | 0.71210 |
 *-----------------------+---------:---------:---------:---------:---------:
-| WELL_19937_A          | 1.26780 | 0.95420 | 0.90732 | 1.16158 | 1.11143 |
+| WELL_19937_A          | 1.27715 | 0.95424 | 0.91068 | 1.09435 | 1.11319 |
 *-----------------------+---------:---------:---------:---------:---------:
-| WELL_19937_C          | 1.28621 | 1.05665 | 0.93851 | 1.20811 | 1.12241 |
+| WELL_19937_C          | 1.27868 | 1.05484 | 0.94517 | 1.21650 | 1.12486 |
 *-----------------------+---------:---------:---------:---------:---------:
-| WELL_44497_A          | 1.28290 | 1.04643 | 0.97920 | 1.18315 | 1.13812 |
+| WELL_44497_A          | 1.28431 | 1.05087 | 0.97923 | 1.18770 | 1.14345 |
 *-----------------------+---------:---------:---------:---------:---------:
-| WELL_44497_B          | 1.29803 | 1.08804 | 1.03050 | 1.27588 | 1.19919 |
+| WELL_44497_B          | 1.29366 | 1.09522 | 1.03174 | 1.28343 | 1.21057 |
 *-----------------------+---------:---------:---------:---------:---------:
-| MT                    | 1.18727 | 0.49954 | 0.43062 | 0.69037 | 0.58075 |
+| MT                    | 1.34824 | 0.49765 | 0.43397 | 0.68068 | 0.60217 |
 *-----------------------+---------:---------:---------:---------:---------:
-| ISAAC                 | 0.98206 | 0.54405 | 0.48967 | 0.60378 | 0.50929 |
+| ISAAC                 | 0.97850 | 0.54703 | 0.49186 | 0.59288 | 0.51175 |
 *-----------------------+---------:---------:---------:---------:---------:
-| SPLIT_MIX_64          | 1.14541 | 0.13405 | 0.09897 | 0.28460 | 0.19431 |
+| SPLIT_MIX_64          | 1.14891 | 0.13411 | 0.09746 | 0.27066 | 0.20567 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XOR_SHIFT_1024_S      | 1.15061 | 0.18243 | 0.14459 | 0.34174 | 0.25242 |
+| XOR_SHIFT_1024_S      | 1.14255 | 0.18260 | 0.14336 | 0.33799 | 0.25541 |
 *-----------------------+---------:---------:---------:---------:---------:
-| TWO_CMRES             | 1.16284 | 0.18267 | 0.15281 | 0.34984 | 0.28657 |
+| TWO_CMRES             | 1.14709 | 0.18246 | 0.15193 | 0.33651 | 0.29568 |
 *-----------------------+---------:---------:---------:---------:---------:
-| MT_64                 | 1.17461 | 0.27294 | 0.23374 | 0.48280 | 0.35967 |
+| MT_64                 | 1.16541 | 0.27305 | 0.23295 | 0.47006 | 0.37093 |
 *-----------------------+---------:---------:---------:---------:---------:
-| MWC_256               | 1.15759 | 0.25411 | 0.21631 | 0.36768 | 0.25554 |
+| MWC_256               | 1.14802 | 0.25419 | 0.21431 | 0.35105 | 0.26027 |
 *-----------------------+---------:---------:---------:---------:---------:
-| KISS                  | 1.17760 | 0.41165 | 0.41526 | 0.54227 | 0.42641 |
+| KISS                  | 1.21902 | 0.41307 | 0.41465 | 0.53279 | 0.42893 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XOR_SHIFT_1024_S_PHI  | 1.16893 | 0.18236 | 0.14382 | 0.34424 | 0.24821 |
+| XOR_SHIFT_1024_S_PHI  | 1.14458 | 0.18517 | 0.14383 | 0.32811 | 0.25110 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_RO_SHI_RO_64_S     | 1.16685 | 0.18914 | 0.13536 | 0.24512 | 0.18364 |
+| XO_RO_SHI_RO_64_S     | 1.13170 | 0.18987 | 0.13436 | 0.22981 | 0.18354 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_RO_SHI_RO_64_SS    | 1.15470 | 0.24486 | 0.17811 | 0.29518 | 0.20803 |
+| XO_RO_SHI_RO_64_SS    | 1.14729 | 0.24748 | 0.17767 | 0.28196 | 0.21002 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_SHI_RO_128_PLUS    | 1.15176 | 0.26227 | 0.18374 | 0.32524 | 0.25558 |
+| XO_SHI_RO_128_PLUS    | 1.15035 | 0.26150 | 0.18227 | 0.31113 | 0.25720 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_SHI_RO_128_SS      | 1.15975 | 0.32451 | 0.25989 | 0.40865 | 0.28614 |
+| XO_SHI_RO_128_SS      | 1.15228 | 0.32567 | 0.25913 | 0.39303 | 0.28834 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_RO_SHI_RO_128_PLUS | 1.16683 | 0.10546 | 0.08192 | 0.25955 | 0.17326 |
+| XO_RO_SHI_RO_128_PLUS | 1.16473 | 0.10786 | 0.08123 | 0.21719 | 0.17516 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_RO_SHI_RO_128_SS   | 1.15738 | 0.13400 | 0.10186 | 0.27885 | 0.19879 |
+| XO_RO_SHI_RO_128_SS   | 1.14305 | 0.13467 | 0.10081 | 0.26687 | 0.20151 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_SHI_RO_256_PLUS    | 1.14354 | 0.14036 | 0.11078 | 0.29566 | 0.21558 |
+| XO_SHI_RO_256_PLUS    | 1.13274 | 0.13942 | 0.10975 | 0.27536 | 0.21673 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_SHI_RO_256_SS      | 1.14810 | 0.17469 | 0.12788 | 0.32338 | 0.23577 |
+| XO_SHI_RO_256_SS      | 1.13733 | 0.17227 | 0.12742 | 0.30620 | 0.23934 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_SHI_RO_512_PLUS    | 1.16148 | 0.25360 | 0.19347 | 0.40327 | 0.34086 |
+| XO_SHI_RO_512_PLUS    | 1.14604 | 0.25573 | 0.19287 | 0.38956 | 0.34018 |
 *-----------------------+---------:---------:---------:---------:---------:
-| XO_SHI_RO_512_SS      | 1.16359 | 0.27005 | 0.21910 | 0.41828 | 0.35155 |
+| XO_SHI_RO_512_SS      | 1.14679 | 0.26977 | 0.22337 | 0.41464 | 0.35788 |
 *-----------------------+---------:---------:---------:---------:---------:
-| PCG_XSH_RR_32         | 0.94365 | 0.30150 | 0.26162 | 0.39426 | 0.19832 |
+| PCG_XSH_RR_32         | 0.93987 | 0.30306 | 0.26355 | 0.38115 | 0.20150 |
 *-----------------------+---------:---------:---------:---------:---------:
-| PCG_XSH_RS_32         | 0.94766 | 0.23958 | 0.18884 | 0.29117 | 0.20081 |
+| PCG_XSH_RS_32         | 0.93948 | 0.24078 | 0.18863 | 0.26774 | 0.20346 |
 *-----------------------+---------:---------:---------:---------:---------:
-| PCG_RXS_M_XS_64       | 1.15168 | 0.13238 | 0.11352 | 0.29651 | 0.20707 |
+| PCG_RXS_M_XS_64       | 1.14968 | 0.13220 | 0.11337 | 0.27695 | 0.21406 |
 *-----------------------+---------:---------:---------:---------:---------:
-| PCG_MCG_XSH_RR_32     | 0.94123 | 0.28870 | 0.28352 | 0.36381 | 0.17816 |
+| PCG_MCG_XSH_RR_32     | 1.09668 | 0.29003 | 0.28306 | 0.35251 | 0.18246 |
 *-----------------------+---------:---------:---------:---------:---------:
-| PCG_MCG_XSH_RS_32     | 0.93742 | 0.22574 | 0.17845 | 0.26411 | 0.16822 |
+| PCG_MCG_XSH_RS_32     | 0.94494 | 0.22776 | 0.17786 | 0.24978 | 0.17817 |
 *-----------------------+---------:---------:---------:---------:---------:
-| MSWS                  | 1.12821 | 0.17897 | 0.15428 | 0.23731 | 0.15224 |
+| MSWS                  | 1.11994 | 0.17966 | 0.15163 | 0.22052 | 0.15654 |
 *-----------------------+---------:---------:---------:---------:---------:
-| SFC_32                | 1.15334 | 0.28210 | 0.19387 | 0.32224 | 0.26020 |
+| SFC_32                | 1.16818 | 0.28341 | 0.19159 | 0.31184 | 0.26237 |
 *-----------------------+---------:---------:---------:---------:---------:
-| SFC_64                | 1.13927 | 0.14057 | 0.11686 | 0.31031 | 0.23761 |
+| SFC_64                | 1.14182 | 0.14043 | 0.11612 | 0.30155 | 0.23111 |
 *-----------------------+---------:---------:---------:---------:---------:
-| JSF_32                | 1.14659 | 0.24439 | 0.17106 | 0.29932 | 0.22710 |
+| JSF_32                | 1.15687 | 0.24286 | 0.16946 | 0.28196 | 0.23416 |
 *-----------------------+---------:---------:---------:---------:---------:
-| JSF_64                | 1.13970 | 0.13366 | 0.10999 | 0.28153 | 0.21406 |
+| JSF_64                | 1.13157 | 0.13346 | 0.10875 | 0.27424 | 0.21291 |
+*-----------------------+---------:---------:---------:---------:---------:
+| XO_SHI_RO_128_PP      | 1.14795 | 0.29165 | 0.21145 | 0.35185 | 0.27282 |
+*-----------------------+---------:---------:---------:---------:---------:
+| XO_RO_SHI_RO_128_PP   | 1.13511 | 0.12115 | 0.09061 | 0.24181 | 0.18749 |
+*-----------------------+---------:---------:---------:---------:---------:
+| XO_SHI_RO_256_PP      | 1.14166 | 0.15008 | 0.11580 | 0.29205 | 0.22667 |
+*-----------------------+---------:---------:---------:---------:---------:
+| XO_SHI_RO_512_PP      | 1.14859 | 0.26896 | 0.21928 | 0.39196 | 0.34223 |
+*-----------------------+---------:---------:---------:---------:---------:
+| XO_RO_SHI_RO_1024_PP  | 1.06705 | 0.19035 | 0.16039 | 0.32584 | 0.26999 |
+*-----------------------+---------:---------:---------:---------:---------:
+| XO_RO_SHI_RO_1024_S   | 1.09278 | 0.18145 | 0.14870 | 0.32135 | 0.27322 |
+*-----------------------+---------:---------:---------:---------:---------:
+| XO_RO_SHI_RO_1024_SS  | 1.07087 | 0.20239 | 0.17359 | 0.34873 | 0.28468 |
 *-----------------------+---------:---------:---------:---------:---------:
 
+
   The <<<RandomSource.JDK>>> generator uses thread-safe (synchronized) <<<int>>> generation which has a performance overhead (see the <<<int>>> generation results). For the <<<boolean>>> generation the synchronization occurs 1 in 32 calls and the resulting performance is good. However the output will be low quality and this generator should not be used. See the {{{a5._Quality}Quality}} section for details.
 
 
@@ -646,80 +661,94 @@ ListSampler.shuffle(rng, list)
 
   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>>> |
+*-----------------------+---------:----------:---------:
+| JDK                   | 0.77877 | 0.73264 | 0.36637 |
+*-----------------------+---------:---------:---------:
+| WELL_512_A            | 0.74445 | 0.56462 | 0.28636 |
+*-----------------------+---------:---------:---------:
+| WELL_1024_A           | 0.77007 | 0.59756 | 0.29257 |
+*-----------------------+---------:---------:---------:
+| WELL_19937_A          | 0.82748 | 0.69269 | 0.33740 |
+*-----------------------+---------:---------:---------:
+| WELL_19937_C          | 0.84789 | 0.73891 | 0.36717 |
+*-----------------------+---------:---------:---------:
+| WELL_44497_A          | 0.87112 | 0.70183 | 0.36227 |
+*-----------------------+---------:---------:---------:
+| WELL_44497_B          | 0.87857 | 0.72934 | 0.38255 |
 *-----------------------+---------:---------:---------:
-| JDK                   | 0.77702 | 0.73404 | 0.35962 |
+| MT                    | 0.67691 | 0.47800 | 0.26109 |
 *-----------------------+---------:---------:---------:
-| WELL_512_A            | 0.74382 | 0.55948 | 0.29644 |
+| ISAAC                 | 0.68059 | 0.46536 | 0.27033 |
 *-----------------------+---------:---------:---------:
-| WELL_1024_A           | 0.76090 | 0.58622 | 0.28907 |
+| SPLIT_MIX_64          | 0.58001 | 0.32004 | 0.17078 |
 *-----------------------+---------:---------:---------:
-| WELL_19937_A          | 0.82990 | 0.69155 | 0.33604 |
+| XOR_SHIFT_1024_S      | 0.57795 | 0.33331 | 0.17935 |
 *-----------------------+---------:---------:---------:
-| WELL_19937_C          | 0.84971 | 0.68691 | 0.36119 |
+| TWO_CMRES             | 0.62947 | 0.35806 | 0.17582 |
 *-----------------------+---------:---------:---------:
-| WELL_44497_A          | 0.87142 | 0.68325 | 0.36127 |
+| MT_64                 | 0.62248 | 0.38571 | 0.21970 |
 *-----------------------+---------:---------:---------:
-| WELL_44497_B          | 0.87542 | 0.72058 | 0.37799 |
+| MWC_256               | 0.59030 | 0.36393 | 0.18993 |
 *-----------------------+---------:---------:---------:
-| MT                    | 0.66909 | 0.47290 | 0.25770 |
+| KISS                  | 0.65810 | 0.45252 | 0.23848 |
 *-----------------------+---------:---------:---------:
-| ISAAC                 | 0.68446 | 0.44854 | 0.26808 |
+| XOR_SHIFT_1024_S_PHI  | 0.57803 | 0.33260 | 0.17968 |
 *-----------------------+---------:---------:---------:
-| SPLIT_MIX_64          | 0.57968 | 0.31845 | 0.16815 |
+| XO_RO_SHI_RO_64_S     | 0.58363 | 0.34124 | 0.17522 |
 *-----------------------+---------:---------:---------:
-| XOR_SHIFT_1024_S      | 0.57622 | 0.32793 | 0.18497 |
+| XO_RO_SHI_RO_64_SS    | 0.59167 | 0.35355 | 0.19744 |
 *-----------------------+---------:---------:---------:
-| TWO_CMRES             | 0.62548 | 0.35266 | 0.20977 |
+| XO_SHI_RO_128_PLUS    | 0.59485 | 0.34544 | 0.19495 |
 *-----------------------+---------:---------:---------:
-| MT_64                 | 0.62083 | 0.37632 | 0.21736 |
+| XO_SHI_RO_128_SS      | 0.60230 | 0.38200 | 0.20840 |
 *-----------------------+---------:---------:---------:
-| MWC_256               | 0.58796 | 0.35393 | 0.18765 |
+| XO_RO_SHI_RO_128_PLUS | 0.56040 | 0.30974 | 0.15410 |
 *-----------------------+---------:---------:---------:
-| KISS                  | 0.65734 | 0.45035 | 0.22921 |
+| XO_RO_SHI_RO_128_SS   | 0.55593 | 0.32892 | 0.16156 |
 *-----------------------+---------:---------:---------:
-| XOR_SHIFT_1024_S_PHI  | 0.57800 | 0.32762 | 0.18537 |
+| XO_SHI_RO_256_PLUS    | 0.56583 | 0.31493 | 0.15552 |
 *-----------------------+---------:---------:---------:
-| XO_RO_SHI_RO_64_S     | 0.58318 | 0.33575 | 0.17617 |
+| XO_SHI_RO_256_SS      | 0.57781 | 0.32193 | 0.17085 |
 *-----------------------+---------:---------:---------:
-| XO_RO_SHI_RO_64_SS    | 0.59105 | 0.34913 | 0.19439 |
+| XO_SHI_RO_512_PLUS    | 0.58922 | 0.36533 | 0.19035 |
 *-----------------------+---------:---------:---------:
-| XO_SHI_RO_128_PLUS    | 0.59106 | 0.33631 | 0.17957 |
+| XO_SHI_RO_512_SS      | 0.58811 | 0.33545 | 0.19263 |
 *-----------------------+---------:---------:---------:
-| XO_SHI_RO_128_SS      | 0.61742 | 0.37101 | 0.19600 |
+| PCG_XSH_RR_32         | 0.60552 | 0.41318 | 0.21311 |
 *-----------------------+---------:---------:---------:
-| XO_RO_SHI_RO_128_PLUS | 0.55609 | 0.30674 | 0.14833 |
+| PCG_XSH_RS_32         | 0.59166 | 0.35733 | 0.18407 |
 *-----------------------+---------:---------:---------:
-| XO_RO_SHI_RO_128_SS   | 0.55722 | 0.32036 | 0.15569 |
+| PCG_RXS_M_XS_64       | 0.57445 | 0.32554 | 0.16350 |
 *-----------------------+---------:---------:---------:
-| XO_SHI_RO_256_PLUS    | 0.56563 | 0.30972 | 0.15639 |
+| PCG_MCG_XSH_RR_32     | 0.60252 | 0.41204 | 0.21687 |
 *-----------------------+---------:---------:---------:
-| XO_SHI_RO_256_SS      | 0.57758 | 0.31364 | 0.16399 |
+| PCG_MCG_XSH_RS_32     | 0.58558 | 0.35372 | 0.18327 |
 *-----------------------+---------:---------:---------:
-| XO_SHI_RO_512_PLUS    | 0.58733 | 0.36153 | 0.18189 |
+| MSWS                  | 0.58084 | 0.34002 | 0.17617 |
 *-----------------------+---------:---------:---------:
-| XO_SHI_RO_512_SS      | 0.58114 | 0.32797 | 0.19000 |
+| SFC_32                | 0.59413 | 0.35255 | 0.18698 |
 *-----------------------+---------:---------:---------:
-| PCG_XSH_RR_32         | 0.60315 | 0.41543 | 0.22119 |
+| SFC_64                | 0.55220 | 0.32147 | 0.16161 |
 *-----------------------+---------:---------:---------:
-| PCG_XSH_RS_32         | 0.59535 | 0.35324 | 0.20068 |
+| JSF_32                | 0.59929 | 0.34080 | 0.18532 |
 *-----------------------+---------:---------:---------:
-| PCG_RXS_M_XS_64       | 0.57059 | 0.32078 | 0.18113 |
+| JSF_64                | 0.56529 | 0.31836 | 0.15325 |
 *-----------------------+---------:---------:---------:
-| PCG_MCG_XSH_RR_32     | 0.59735 | 0.41154 | 0.21198 |
+| XO_SHI_RO_128_PP      | 0.59851 | 0.35367 | 0.19666 |
 *-----------------------+---------:---------:---------:
-| PCG_MCG_XSH_RS_32     | 0.58732 | 0.34865 | 0.18043 |
+| XO_RO_SHI_RO_128_PP   | 0.56427 | 0.31718 | 0.15767 |
 *-----------------------+---------:---------:---------:
-| MSWS                  | 0.57420 | 0.33353 | 0.17289 |
+| XO_SHI_RO_256_PP      | 0.57554 | 0.31834 | 0.16573 |
 *-----------------------+---------:---------:---------:
-| SFC_32                | 0.58872 | 0.34649 | 0.18663 |
+| XO_SHI_RO_512_PP      | 0.59131 | 0.36728 | 0.19869 |
 *-----------------------+---------:---------:---------:
-| SFC_64                | 0.55058 | 0.38304 | 0.15942 |
+| XO_RO_SHI_RO_1024_PP  | 0.58844 | 0.33181 | 0.18223 |
 *-----------------------+---------:---------:---------:
-| JSF_32                | 0.63566 | 0.35527 | 0.17554 |
+| XO_RO_SHI_RO_1024_S   | 0.57474 | 0.32710 | 0.17992 |
 *-----------------------+---------:---------:---------:
-| JSF_64                | 0.56291 | 0.31014 | 0.15530 |
+| XO_RO_SHI_RO_1024_SS  | 0.58185 | 0.33993 | 0.18551 |
 *-----------------------+---------:---------:---------:
 
   Note that the reference <<<java.util.Random>>> nextGaussian() method uses the Box-Muller algorithm and a synchronized method call per sample. The <<<RandomSource.JDK>>> RNG will use 1 synchronized method call for two samples when using the <<<BoxMullerNormalizedGaussianSampler>>>, hence the observed difference. All the other RNGs are not synchronized.