Date: 2023-06-24 07:58 (UTC)
bens_dad: (Default)
From: [personal profile] bens_dad
Why isn't it better to just return pcg64_random(rng) * 0x1.0p-64? Then even if the high 11 bits of the value are zero, you still get a full mantissa's worth of randomness.

Even better, go back to the bit-hacking approach, and set all 52 mantissa bits to random values, and set the exponent to 0x3fe - __builtin_clz64(pcg64_random())? Then your exponent can go all the way down to -64, and you still have a full mantissa even at the low end.


I think the implicit one at the start of the mantissa is the issue here.
IIUC these versions bias for 1.1abcdef * 2^g at the expense of 1.0hijklm * 2^n.
This account has disabled anonymous posting.
(will be screened if not on Access List)
(will be screened if not on Access List)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

May 2025

S M T W T F S
     123
45678910
1112 1314151617
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2025-05-25 18:50
Powered by Dreamwidth Studios