...
1# Floating-point conversion test cases.
2# Empty lines and lines beginning with # are ignored.
3# The rest have four fields per line: type, format, input, and output.
4# The input is given either in decimal or binary scientific notation.
5# The output is the string that should be produced by formatting the
6# input with the given format.
7#
8# The formats are as in C's printf, except that %b means print
9# binary scientific notation: NpE = N x 2^E.
10
11# TODO:
12# Powers of 10.
13# Powers of 2.
14# %.20g versions.
15# random sources
16# random targets
17# random targets ± half a ULP
18
19# Difficult boundary cases, derived from tables given in
20# Vern Paxson, A Program for Testing IEEE Decimal-Binary Conversion
21# ftp://ftp.ee.lbl.gov/testbase-report.ps.Z
22
23# Table 1: Stress Inputs for Conversion to 53-bit Binary, < 1/2 ULP
24float64 %b 5e+125 6653062250012735p+365
25float64 %b 69e+267 4705683757438170p+841
26float64 %b 999e-026 6798841691080350p-129
27float64 %b 7861e-034 8975675289889240p-153
28float64 %b 75569e-254 6091718967192243p-880
29float64 %b 928609e-261 7849264900213743p-900
30float64 %b 9210917e+080 8341110837370930p+236
31float64 %b 84863171e+114 4625202867375927p+353
32float64 %b 653777767e+273 5068902999763073p+884
33float64 %b 5232604057e-298 5741343011915040p-1010
34float64 %b 27235667517e-109 6707124626673586p-380
35float64 %b 653532977297e-123 7078246407265384p-422
36float64 %b 3142213164987e-294 8219991337640559p-988
37float64 %b 46202199371337e-072 5224462102115359p-246
38float64 %b 231010996856685e-073 5224462102115359p-247
39float64 %b 9324754620109615e+212 5539753864394442p+705
40float64 %b 78459735791271921e+049 8388176519442766p+166
41float64 %b 272104041512242479e+200 5554409530847367p+670
42float64 %b 6802601037806061975e+198 5554409530847367p+668
43float64 %b 20505426358836677347e-221 4524032052079546p-722
44float64 %b 836168422905420598437e-234 5070963299887562p-760
45float64 %b 4891559871276714924261e+222 6452687840519111p+757
46
47# Table 2: Stress Inputs for Conversion to 53-bit Binary, > 1/2 ULP
48float64 %b 9e-265 8168427841980010p-930
49float64 %b 85e-037 6360455125664090p-169
50float64 %b 623e+100 6263531988747231p+289
51float64 %b 3571e+263 6234526311072170p+833
52float64 %b 81661e+153 6696636728760206p+472
53float64 %b 920657e-023 5975405561110124p-109
54float64 %b 4603285e-024 5975405561110124p-110
55float64 %b 87575437e-309 8452160731874668p-1053
56float64 %b 245540327e+122 4985336549131723p+381
57float64 %b 6138508175e+120 4985336549131723p+379
58float64 %b 83356057653e+193 5986732817132056p+625
59float64 %b 619534293513e+124 4798406992060657p+399
60float64 %b 2335141086879e+218 5419088166961646p+713
61float64 %b 36167929443327e-159 8135819834632444p-536
62float64 %b 609610927149051e-255 4576664294594737p-850
63float64 %b 3743626360493413e-165 6898586531774201p-549
64float64 %b 94080055902682397e-242 6273271706052298p-800
65float64 %b 899810892172646163e+283 7563892574477827p+947
66float64 %b 7120190517612959703e+120 5385467232557565p+409
67float64 %b 25188282901709339043e-252 5635662608542340p-825
68float64 %b 308984926168550152811e-052 5644774693823803p-157
69float64 %b 6372891218502368041059e+064 4616868614322430p+233
70
71# Table 3: Stress Inputs for Converting 53-bit Binary to Decimal, < 1/2 ULP
72float64 %.0e 8511030020275656p-342 9e-88
73float64 %.1e 5201988407066741p-824 4.6e-233
74float64 %.2e 6406892948269899p+237 1.41e+87
75float64 %.3e 8431154198732492p+72 3.981e+37
76float64 %.4e 6475049196144587p+99 4.1040e+45
77float64 %.5e 8274307542972842p+726 2.92084e+234
78float64 %.6e 5381065484265332p-456 2.891946e-122
79float64 %.7e 6761728585499734p-1057 4.3787718e-303
80float64 %.8e 7976538478610756p+376 1.22770163e+129
81float64 %.9e 5982403858958067p+377 1.841552452e+129
82float64 %.10e 5536995190630837p+93 5.4835744350e+43
83float64 %.11e 7225450889282194p+710 3.89190181146e+229
84float64 %.12e 7225450889282194p+709 1.945950905732e+229
85float64 %.13e 8703372741147379p+117 1.4460958381605e+51
86float64 %.14e 8944262675275217p-1001 4.17367747458531e-286
87float64 %.15e 7459803696087692p-707 1.107950772878888e-197
88float64 %.16e 6080469016670379p-381 1.2345501366327440e-99
89float64 %.17e 8385515147034757p+721 9.25031711960365024e+232
90float64 %.18e 7514216811389786p-828 4.198047150284889840e-234
91float64 %.19e 8397297803260511p-345 1.1716315319786511046e-88
92float64 %.20e 6733459239310543p+202 4.32810072844612493629e+76
93float64 %.21e 8091450587292794p-473 3.317710118160031081518e-127
94
95# Table 4: Stress Inputs for Converting 53-bit Binary to Decimal, > 1/2 ULP
96float64 %.0e 6567258882077402p+952 3e+302
97float64 %.1e 6712731423444934p+535 7.6e+176
98float64 %.2e 6712731423444934p+534 3.78e+176
99float64 %.3e 5298405411573037p-957 4.350e-273
100float64 %.4e 5137311167659507p-144 2.3037e-28
101float64 %.5e 6722280709661868p+363 1.26301e+125
102float64 %.6e 5344436398034927p-169 7.142211e-36
103float64 %.7e 8369123604277281p-853 1.3934574e-241
104float64 %.8e 8995822108487663p-780 1.41463449e-219
105float64 %.9e 8942832835564782p-383 4.539277920e-100
106float64 %.10e 8942832835564782p-384 2.2696389598e-100
107float64 %.11e 8942832835564782p-385 1.13481947988e-100
108float64 %.12e 6965949469487146p-249 7.700366561890e-60
109float64 %.13e 6965949469487146p-250 3.8501832809448e-60
110float64 %.14e 6965949469487146p-251 1.92509164047238e-60
111float64 %.15e 7487252720986826p+548 6.898586531774201e+180
112float64 %.16e 5592117679628511p+164 1.3076622631878654e+65
113float64 %.17e 8887055249355788p+665 1.36052020756121240e+216
114float64 %.18e 6994187472632449p+690 3.592810217475959676e+223
115float64 %.19e 8797576579012143p+588 8.9125197712484551899e+192
116float64 %.20e 7363326733505337p+272 5.58769757362301140950e+97
117float64 %.21e 8549497411294502p-448 1.176257830728540379990e-119
118
119# Table 14: Stress Inputs for Conversion to 24-bit Binary, <1/2 ULP
120# NOTE: The lines with exponent p-149 have been changed from the
121# paper. Those entries originally read p-150 and had a mantissa
122# twice as large (and even), but IEEE single-precision has no p-150:
123# that's the start of the denormals.
124float32 %b 5e-20 15474250p-88
125float32 %b 67e+14 12479722p+29
126float32 %b 985e+15 14333636p+36
127# float32 %b 7693e-42 10979816p-150
128float32 %b 7693e-42 5489908p-149
129float32 %b 55895e-16 12888509p-61
130# float32 %b 996622e-44 14224264p-150
131float32 %b 996622e-44 7112132p-149
132float32 %b 7038531e-32 11420669p-107
133# float32 %b 60419369e-46 8623340p-150
134float32 %b 60419369e-46 4311670p-149
135float32 %b 702990899e-20 16209866p-61
136# float32 %b 6930161142e-48 9891056p-150
137float32 %b 6930161142e-48 4945528p-149
138float32 %b 25933168707e+13 14395800p+54
139float32 %b 596428896559e+20 12333860p+82
140
141# Table 15: Stress Inputs for Conversion to 24-bit Binary, >1/2 ULP
142float32 %b 3e-23 9507380p-98
143float32 %b 57e+18 12960300p+42
144float32 %b 789e-35 10739312p-130
145float32 %b 2539e-18 11990089p-72
146float32 %b 76173e+28 9845130p+86
147float32 %b 887745e-11 9760860p-40
148float32 %b 5382571e-37 11447463p-124
149float32 %b 82381273e-35 8554961p-113
150float32 %b 750486563e-38 9975678p-120
151float32 %b 3752432815e-39 9975678p-121
152float32 %b 75224575729e-45 13105970p-137
153float32 %b 459926601011e+15 12466336p+65
154
155# Table 16: Stress Inputs for Converting 24-bit Binary to Decimal, < 1/2 ULP
156float32 %.0e 12676506p-102 2e-24
157float32 %.1e 12676506p-103 1.2e-24
158float32 %.2e 15445013p+86 1.19e+33
159float32 %.3e 13734123p-138 3.941e-35
160float32 %.4e 12428269p-130 9.1308e-33
161float32 %.5e 15334037p-146 1.71900e-37
162float32 %.6e 11518287p-41 5.237910e-06
163float32 %.7e 12584953p-145 2.8216440e-37
164float32 %.8e 15961084p-125 3.75243281e-31
165float32 %.9e 14915817p-146 1.672120916e-37
166float32 %.10e 10845484p-102 2.1388945814e-24
167float32 %.11e 16431059p-61 7.12583594561e-12
168
169# Table 17: Stress Inputs for Converting 24-bit Binary to Decimal, > 1/2 ULP
170float32 %.0e 16093626p+69 1e+28
171float32 %.1e 9983778p+25 3.4e+14
172float32 %.2e 12745034p+104 2.59e+38
173float32 %.3e 12706553p+72 6.001e+28
174float32 %.4e 11005028p+45 3.8721e+20
175float32 %.5e 15059547p+71 3.55584e+28
176float32 %.6e 16015691p-99 2.526831e-23
177float32 %.7e 8667859p+56 6.2458507e+23
178float32 %.8e 14855922p-82 3.07213267e-18
179float32 %.9e 14855922p-83 1.536066333e-18
180float32 %.10e 10144164p-110 7.8147796834e-27
181float32 %.11e 13248074p+95 5.24810279937e+35
View as plain text