8000 math/rand: remove statistical correlation in ziggurat algorithms · Issue #8731 · golang/go · GitHub
[go: up one dir, main page]

Skip to content
math/rand: remove statistical correlation in ziggurat algorithms #8731
Closed
@zephyrtronium

Description

@zephyrtronium
A statistical correlation is present in the algorithms used to generate normally and
exponentially distributed values due to the reuse of random bits for both the
x-coordinate and the segment index. This reuse could be avoided by generating a 63-bit
number, taking the low 32 bits for the x-coordinate, the next 7 or 8 bits for the
segment number, and on the normal distribution, one more bit to determine the sign of
values generated from the tail.

For example: http://play.golang.org/p/xeCjwEFUSs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0