
Properties of the Correction Loop in David Gay’s strtod()  - wglb
http://www.exploringbinary.com/properties-of-the-correction-loop-in-david-gays-strtod/
======
nitrogen
Is testing random values sufficient to prove the worst case required
iterations, or was that just an initial pass before performing a rigorous
mathematical analysis? In other words, how do you know that you haven't missed
another almost-pathological case that would require some large, but finite,
number of correction loop iterations?

~~~
CountHackulus
That seems like something that could be run in a parallel fashion on EC2. Run
it for every possible value up to 40 significant digits.

It's not really something that can be run as a unit test, but it might be nice
to be absolutely sure all the bugs have been ferreted out.

~~~
nitrogen
10^40 is a very big number. If my rough calculations are correct, even
ignoring shifts in the decimal point, you're talking about a minimum of a
hundred quadrillion billion years of computing time, assuming a hopelessly
optimistic 1 cycle per iteration on a 3GHz processor.

    
    
      10e40/3e9/86400/365/1e9~=1.4e14
    

Edit: though there aren't 10^40 possible 40-digit 64-bit IEEE-754 values
(log10(2^64)~=19.27).

