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.