The formula: X = S * Sqr(-2 * Log(R1)) * Cos(2 * Pi * R2) + M works very nicely. But where did you find it? Even "Numerical Recipes in C" didn't give it.
-Philip
It is called the Box-Muller Transformation
Box, G.E.P. and Muller, M. E. "A Note on the Generation of Random Normal Deviates." Ann. Math. Stat.
29, 610-611, 1958.
Note that using Sin(2*Pi*R2) instead of Cos gives a second Normal Deviate, so for two uniform random numbers you get 2 normal ones.
Victor