3 ms·
"Grisu3 works on 99.49% of random IEEE doubles." What a curious benchmark! It makes you wonder all kinds of things like how many IEEE doubles there are; how yo
by nemoniac 15y ago
"Grisu3 works on 99.49% of random IEEE doubles."
What a curious benchmark! It makes you wonder all kinds of things like how many IEEE doubles there are; how you sample from them randomly; what kind of coverage of the reals you get; and how relevant it all is.
- JoachimSchipper 15y agoIEEE doubles are just 64-bit words; so there are 2^64 and you sample randomly by picking a random 64-bit word. (There are some subtleties: a "random 64-bit word interpreted as a double" is clearly not uniformly distributed over the reals; x86/amd64 uses 80-bit doubles for intermediate results, except when it doesn't; there are things like subnormals ("really small numbers"), Not-a-Number, Infinity, -Infinity, -0; but the above should give you the right general idea)
- nemoniac 15y agoSure, but to take an extreme example, suppose you have a division operator that fails to check for division-by-zero. Then your operator works in 100 * (1 - 2^63)% of all cases. That gives you 18 nines and sounds pretty convincing but it's hardly the point. In the same way I'm wondering how meaningful it is to say that an algorithm works for 99.49% of all doubles, sampled uniformly. In other words, how could I use that benchmark to make a judgement about using grisu3?