You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2017/12/08 14:39:00 UTC

[jira] [Commented] (RNG-37) Ziggurat algorithm

    [ https://issues.apache.org/jira/browse/RNG-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16283664#comment-16283664 ] 

Gilles commented on RNG-37:
---------------------------

Hi [~cur4so].

I ran the benchmark; table is available in the [userguide|https://git1-us-west.apache.org/repos/asf?p=commons-rng.git;a=blob_plain;f=src/site/apt/userguide/rng.apt;hb=5b88619b732e0d556e61a48b8fbb8d628bf16ea8] (commit 5b88619b732e0d556e61a48b8fbb8d628bf16ea8).

Better performance was expected; however, although a {{double}} value is computed, it seems that 64-bits sources lost their edge.
Indeed, for each sample, the implementation calls {{nextInt()}} and keeps only 7 bits out of the 32 (resp. 64) that were computed by the underlying source.
I wonder whether performance could be improved if we kept bits for reuse at the next call to {{sample()}}...


> Ziggurat algorithm
> ------------------
>
>                 Key: RNG-37
>                 URL: https://issues.apache.org/jira/browse/RNG-37
>             Project: Commons RNG
>          Issue Type: Wish
>            Reporter: Gilles
>            Priority: Minor
>
> Fast algorithm for sampling a Gaussian distribution: https://en.wikipedia.org/wiki/Ziggurat_algorithm



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)