21 Jun
2010
21 Jun
'10
9:01 p.m.
AMDG Matthias Fuchs wrote:
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".
_r2 is in the range [0, 1). log(0) is a bad idea, so the algorithm uses 1-_r2 to flip the range to (0, 1]. In Christ, Steven Watanabe