Some more bad decimal -> IEEE double input cases

Tim Peters uunet!ksr.com!tim
Sun Mar 24 15:26:36 PST 1991


The attached tables show ten of what may be the worst input cases (in
the sense of being closest to, but not exactly at, a nearest/even
rounding boundary), for inputs with 1 decimal digit in the significand,
and 2, and 3, ..., and 20.  The first column gives the input case, and
the second the number of excess bits of precision needed to nail it.
E.g., the first entry in the "#digits = 17" table is:

7.8459735791271921e65     66

To 121 bits, 7.8459735791271921e65 is

  <-------------------- 52 bits --------------------->
1.1101110011010000000010001001110000010011000101001110
  0111111111111111111111111111111111111111111111111111
  1111111111111001 *2^218
	       x

where "x" marks the bit that finally assures we're not at a nearest/even
end case -- and that's the 66th bit beyond the 53 retained in the IEEE
double format (so that's where the "66" comes from in the table).

I could burn an hour trying to explain what these cases do & don't
really show, but suffice it to say that I suspect the first entry in
each table really is "the worst" input case for its number of digits.
Saying more than that gets too involved (e.g., the 8.35796101381e-310
case is outside the normalized double range, so you might want to know
what it's doing here -- no time to tell you <grin>).

In any case, the num_digits=17 table demonstrates that even IEEE quad
precision isn't enough to do correct <=-17-digit-decimal -> IEEE double
input, so I would again like to know what people here (Jim T?) mean when
they hint that "efficient" algorithms are known (albeit not publically
yet) for doing <=-17-digit-decimal -> IEEE double input.  Still doesn't
look likely to me.

but-then-i-take-"efficient"-to-mean-"fast"<grin>-ly y'rs  - tim

Tim Peters   Kendall Square Research Corp
timaksr.com,  ksr!timaharvard.harvard.edu


10 of the worst cases for #digits = 1
2.e126	  13
5.e125	  13
1.e126	  13
4.e126	  13
8.e126	  13
9.e-265	  13
7.e-141	  11
7.e-161	  11
1.e210	  11
4.e210	  11

10 of the worst cases for #digits = 2
6.9e268	   17
3.1e203	   16
6.2e203	   16
3.4e-35	   16
6.8e-35	   16
8.5e-36	   16
1.7e-35	   16
7.4e47	   15
3.7e47	   15
8.7e-273   15

10 of the worst cases for #digits = 3
6.23e102    20
9.99e-24    20
9.06e177    19
4.53e177    19
1.51e178    19
6.04e178    19
3.02e178    19
9.14e-100   18
4.57e-100   18
9.67e142    18

10 of the worst cases for #digits = 4
3.571e266    24
7.142e266    24
8.345e-294   22
3.338e-293   22
1.669e-293   22
6.676e-293   22
7.861e-31    21
7.963e38     21
4.984e103    20
3.115e102    20

10 of the worst cases for #digits = 5
7.5569e-250   28
8.1661e157    26
6.4009e-179   25
7.1420e266    24
8.9275e265    24
5.7136e267    24
1.7855e266    24
1.4284e267    24
2.8568e267    24
3.5710e266    24

10 of the worst cases for #digits = 6
9.20657e-18    30
9.28609e-256   30
3.77845e-250   28
3.02276e-249   28
7.55690e-250   28
1.51138e-249   28
6.04552e-249   28
8.32242e202    28
4.16121e202    28
9.33587e-135   27

10 of the worst cases for #digits = 7
9.210917e86	31
4.603285e-18	30
9.206570e-18	30
3.682628e-17	30
1.841314e-17	30
7.365256e-17	30
4.643045e-256	30
3.714436e-255	30
1.857218e-255	30
7.428872e-255	30

10 of the worst cases for #digits = 8
8.7575437e-302	 37
2.9485531e-139	 36
5.8971062e-139	 36
8.4863171e121	 34
2.7966061e152	 34
5.5932122e152	 34
8.9396333e271	 34
4.0487251e-121	 33
8.0974502e-121	 33
5.9540836e-244	 33

10 of the worst cases for #digits = 9
4.91080654e130	  42
2.45540327e130	  42
9.82161308e130	  42
6.53777767e281	  40
5.25452622e-302	  37
2.62726311e-302	  37
5.66446538e-249	  37
2.83223269e-249	  37
2.63125459e296	  37
5.26250918e296	  37

10 of the worst cases for #digits = 10
2.455403270e130	   42
9.821613080e130	   42
1.227701635e130	   42
1.964322616e131	   42
7.857290464e131	   42
3.928645232e131	   42
4.910806540e130	   42
6.138508175e129	   42
5.232604057e-289   41
5.378822089e-167   41

10 of the worst cases for #digits = 11
8.3356057653e203    45
5.4471335034e-99    45
2.7235667517e-99    45
5.3587107423e-51    45
7.1803914657e303    44
4.5256834646e-108   43
9.0513669292e-108   43
2.2628417323e-108   43
5.3827010643e-190   43
8.6860597053e-196   43

10 of the worst cases for #digits = 12
6.19534293513e135    49
5.73112917422e92     47
2.86556458711e92     47
6.53532977297e-112   47
8.73947086081e-225   46
8.35796101381e-310   46
9.52918668151e83     46
6.58028932206e44     46
3.29014466103e44     46
3.33424230612e204    45

10 of the worst cases for #digits = 13
9.340564347516e230    53
4.670282173758e230    53
2.335141086879e230    53
6.284426329974e-282   51
3.142213164987e-282   51
9.224786422069e-279   51
9.199302046091e-50    50
8.340483752889e-289   50
6.336156586177e281    50
9.165341057119e-122   50

10 of the worst cases for #digits = 14
9.2404398742674e-59    58
4.6202199371337e-59    58
7.2335858886654e-146   57
3.6167929443327e-146   57
1.5400733123779e-58    57
6.1602932495116e-58    57
3.0801466247558e-58    57
5.2656615219377e115    56
9.9021992302453e-12    55
7.8262967875297e-305   53

10 of the worst cases for #digits = 15
9.24043987426740e-59	58
3.69617594970696e-58	58
4.62021993713370e-59	58
7.39235189941392e-58	58
1.84808797485348e-58	58
2.31010996856685e-59	58
5.78686871093232e-145	57
2.89343435546616e-145	57
3.61679294433270e-146	57
1.44671717773308e-145	57

10 of the worst cases for #digits = 16
3.743626360493413e-150	 63
7.487252720986826e-150	 63
6.353227084707473e170	 61
4.431803091515554e-196	 61
2.215901545757777e-196	 61
8.863606183031108e-196	 61
7.297662880581139e-271	 61
3.729901848043846e228	 61
1.864950924021923e228	 61
7.459803696087692e228	 61

10 of the worst cases for #digits = 17
7.8459735791271921e65	  66
9.4080055902682397e-226	  64
5.4897030182071313e45	  64
5.8483921078398283e73	  64
5.7726114730189486e192	  63
2.8863057365094743e192	  63
9.7338774138954421e-273	  63
5.4223535416644243e163	  63
8.2978329466832258e-154	  63
4.1489164733416129e-154	  63

10 of the worst cases for #digits = 18
2.72104041512242479e217	   72
5.44208083024484958e217	   72
7.92644927852378159e96	   69
8.99810892172646163e300	   69
9.29167076892018333e204	   68
9.26145344610700019e-208   68
7.83308178698887621e243	   67
8.79216434457803817e297	   66
6.80429695511221511e209	   66
6.27677886330175368e66	   66

10 of the worst cases for #digits = 19
7.120190517612959703e138    73
7.015330170006592562e-55    72
3.507665085003296281e-55    72
2.721040415122424790e217    72
2.176832332097939832e218    72
5.442080830244849580e217    72
1.360520207561212395e217    72
6.802601037806061975e216    72
1.088416166048969916e218    72
4.353664664195879664e218    72

10 of the worst cases for #digits = 20
2.0505426358836677347e-202   74
4.1010852717673354694e-202   74
8.2021705435346709388e-202   74
3.3051223951904955802e74     73
1.6525611975952477901e74     73
8.2628059879762389505e73     73
6.6102447903809911604e74     73
7.1201905176129597030e138    73
5.6961524140903677624e139    73
1.4240381035225919406e139    73



More information about the Numeric-interest mailing list