Boost logo

Boost Users :

Subject: [Boost-users] Box-Muller - normal distributed random numbers
From: Matthias Fuchs (mat69_at_[hidden])
Date: 2010-06-21 13:24:04


Hi,

I wonder why _cached_rho is calclulated this way:

sqrt(-result_type(2) * log(result_type(1)-_r2));

in normal_distribution.hpp:70 and not

sqrt(-result_type(2) * log(_r2));

So I don't understand why there is "result_type(1) - _r2" instead of just
"_r2".

Cheers!
matthias

PS.: I hope this was not a stupid question, if so please forgive me as I am
just a newbie.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net