Box-Muller transform
A Box-Muller transform is a method of generating pairs of independent normally distributed random numbers, given a source of uniformly distributed random numbers. There are two kinds:
The second method is faster because it uses only one transcendental function[?] instead of three, even though it throws away 21% of the numbers.
z_0 = \cos(2 \pi \varphi) \cdot \sqrt{-2 \ln r}
</math>
z_1 = \sin(2 \pi \varphi) \cdot \sqrt{-2 \ln r}
</math>
z_0 = x \cdot \sqrt{\frac{-2 \ln r}{r}}
</math>
z_1 = y \cdot \sqrt{\frac{-2 \ln r}{r}}
</math>
External links