You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: The current implementation is buggy, because it may not fill
all of the mantissa with random bits. I'm unsure how to fill a
(to-be-invented) @c boost::bigfloat class with random bits efficiently.
We do have an efficient algorithm (see section 4 of this preprint) and a C++ implementation capable of generating all representable floating-point numbers in [0,1). It fills the mantissa with a random integer and generates a geometric random number for the exponent. In the double precision case, it is even faster than simply multiplying a 64-bit integer by 2-64 and in the single precision case it's only 25% slower than multiplying a 32-bit integer by 2-32 (when used with the MT19937 URBG).
If you are interested we can help to integrate it into boost.
The text was updated successfully, but these errors were encountered:
There's this comment in
uniform_01.hpp
:We do have an efficient algorithm (see section 4 of this preprint) and a C++ implementation capable of generating all representable floating-point numbers in [0,1). It fills the mantissa with a random integer and generates a geometric random number for the exponent. In the double precision case, it is even faster than simply multiplying a 64-bit integer by 2-64 and in the single precision case it's only 25% slower than multiplying a 32-bit integer by 2-32 (when used with the MT19937 URBG).
If you are interested we can help to integrate it into boost.
The text was updated successfully, but these errors were encountered: