[
https://issues.apache.org/jira/browse/RNG-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16285686#comment-16285686
]
Gilles commented on RNG-37:
---------------------------
bq. All parameters values has been taken from the paper and are for 32 bits.
Then it looks like the whole procedure needs to be adapted, not only the tail.
Indeed generating a single 32-bits value ({{nextInt()}}, at line 98) won't
return any of the {{double}} values (64-bits) that would require a different
setting of any one of the missing 32-bits.
bq. how to make the adjustment
As Bruno suggested previously, a good start would be to replace hard-coded
numbers with named constants that make it clear what they mean ("m" at line 59,
for example). It will fairly surely give us a hint about the needed adjustments.
Table "KN" should probably contain {{long}} values, and calls to {{nextInt()}}
be replaced with {{nextLong()}} (method to be added to {{SamplerBase}}).
Then, I wonder how to make sure that no holes remain. Is it possible to set up
a unit test? If not, a last resort idea might be to make a plot of many
generated values, superimposed with a plot of a uniform sampling, and look for
anomalies (empty regions).
Such a program could be a usage example for the {{commons-rng-examples}} module
of the project.
> 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)