Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Fix the documentation for RandNormal.
Browse files Browse the repository at this point in the history
As pointed out by Jim Roseborough, this is the Marsaglia Polar
method and not the Box-Muller method.

Change-Id: Id5332bcd4b4c23a3885cc296729b44eaa5edd0a8
  • Loading branch information
sandwichmaker committed Apr 28, 2014
1 parent 3253078 commit 02db941
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ inline double RandDouble() {
return r / RAND_MAX;
}

// Box-Muller algorithm for normal random number generation.
// http://en.wikipedia.org/wiki/Box-Muller_transform
// Marsaglia Polar method for generation standard normal (pseudo)
// random numbers http://en.wikipedia.org/wiki/Marsaglia_polar_method
inline double RandNormal() {
double x1, x2, w;
do {
Expand Down

0 comments on commit 02db941

Please sign in to comment.