Hello,

Boost random library implements GRNG (Gaussian Random Number Generator) with Box-Muller transform (code here). I want to discuss about this line of code:
_cached_rho = sqrt(-result_type(2) * log(result_type(1)-_r2));
I don't know why log is applied to 1-r2, instead of r2 directly, yielding
_cached_rho = sqrt(-result_type(2) * log(_r2));
According with [1, 2, 3] the uniform random variable r2 is always used directly (never 1-r2). I'd like to know why 1-r2 is used.

I've tried to compare with other scientific libraries like GSL, Scythestat and LTILib, but they use the Box-Muller polar form (or Marsaglia polar method) or even Ziggurat algorithm, which are supposed to be more efficient. Why isn't polar form implemented? I'd like to know why 1-r2 is used anyway.

Regards,
  Enrique