PageRenderTime 36ms CodeModel.GetById 18ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/Lib/test/decimaltestdata/ddFMA.decTest

http://unladen-swallow.googlecode.com/
Unknown | 1698 lines | 1561 code | 137 blank | 0 comment | 0 complexity | 61cf3b51d9aa76e50b6062935955f12f MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1------------------------------------------------------------------------
  2-- ddFMA.decTest -- decDouble Fused Multiply Add                      --
  3-- Copyright (c) IBM Corporation, 1981, 2008.  All rights reserved.   --
  4------------------------------------------------------------------------
  5-- Please see the document "General Decimal Arithmetic Testcases"     --
  6-- at http://www2.hursley.ibm.com/decimal for the description of      --
  7-- these testcases.                                                   --
  8--                                                                    --
  9-- These testcases are experimental ('beta' versions), and they       --
 10-- may contain errors.  They are offered on an as-is basis.  In       --
 11-- particular, achieving the same results as the tests here is not    --
 12-- a guarantee that an implementation complies with any Standard      --
 13-- or specification.  The tests are not exhaustive.                   --
 14--                                                                    --
 15-- Please send comments, suggestions, and corrections to the author:  --
 16--   Mike Cowlishaw, IBM Fellow                                       --
 17--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
 18--   mfc@uk.ibm.com                                                   --
 19------------------------------------------------------------------------
 20version: 2.58
 21
 22precision:   16
 23maxExponent: 384
 24minExponent: -383
 25extended:    1
 26clamp:       1
 27rounding:    half_even
 28
 29-- These tests comprese three parts:
 30--   1. Sanity checks and other three-operand tests (especially those
 31--      where the fused operation makes a difference)
 32--   2. Multiply tests (third operand is neutral zero [0E+emax])
 33--   3. Addition tests (first operand is 1)
 34-- The multiply and addition tests are extensive because FMA may have
 35-- its own dedicated multiplication or addition routine(s), and they
 36-- also inherently check the left-to-right properties.
 37
 38-- Sanity checks
 39ddfma0001 fma  1   1   1 ->   2
 40ddfma0002 fma  1   1   2 ->   3
 41ddfma0003 fma  2   2   3 ->   7
 42ddfma0004 fma  9   9   9 ->  90
 43ddfma0005 fma -1   1   1 ->   0
 44ddfma0006 fma -1   1   2 ->   1
 45ddfma0007 fma -2   2   3 ->  -1
 46ddfma0008 fma -9   9   9 -> -72
 47ddfma0011 fma  1  -1   1 ->   0
 48ddfma0012 fma  1  -1   2 ->   1
 49ddfma0013 fma  2  -2   3 ->  -1
 50ddfma0014 fma  9  -9   9 -> -72
 51ddfma0015 fma  1   1  -1 ->   0
 52ddfma0016 fma  1   1  -2 ->  -1
 53ddfma0017 fma  2   2  -3 ->   1
 54ddfma0018 fma  9   9  -9 ->  72
 55
 56-- non-integer exacts
 57ddfma0100  fma    25.2   63.6   -438  ->  1164.72
 58ddfma0101  fma   0.301  0.380    334  ->  334.114380
 59ddfma0102  fma    49.2   -4.8   23.3  ->  -212.86
 60ddfma0103  fma    4.22  0.079  -94.6  ->  -94.26662
 61ddfma0104  fma     903  0.797  0.887  ->  720.578
 62ddfma0105  fma    6.13   -161   65.9  ->  -921.03
 63ddfma0106  fma    28.2    727   5.45  ->  20506.85
 64ddfma0107  fma       4    605    688  ->  3108
 65ddfma0108  fma    93.3   0.19  0.226  ->  17.953
 66ddfma0109  fma   0.169   -341   5.61  ->  -52.019
 67ddfma0110  fma   -72.2     30  -51.2  ->  -2217.2
 68ddfma0111  fma  -0.409     13   20.4  ->  15.083
 69ddfma0112  fma     317   77.0   19.0  ->  24428.0
 70ddfma0113  fma      47   6.58   1.62  ->  310.88
 71ddfma0114  fma    1.36  0.984  0.493  ->  1.83124
 72ddfma0115  fma    72.7    274   1.56  ->  19921.36
 73ddfma0116  fma     335    847     83  ->  283828
 74ddfma0117  fma     666  0.247   25.4  ->  189.902
 75ddfma0118  fma   -3.87   3.06   78.0  ->  66.1578
 76ddfma0119  fma   0.742    192   35.6  ->  178.064
 77ddfma0120  fma   -91.6   5.29  0.153  ->  -484.411
 78
 79-- cases where result is different from separate multiply + add; each
 80-- is preceded by the result of unfused multiply and add
 81-- [this is about 20% of all similar  cases in general]
 82--                                                                      ->  7.123356429257969E+16
 83ddfma0201  fma       27583489.6645      2582471078.04      2593183.42371  ->  7.123356429257970E+16  Inexact Rounded
 84--                                                                      ->  22813275328.80506
 85ddfma0208  fma        24280.355566      939577.397653        2032.013252  ->  22813275328.80507      Inexact Rounded
 86--                                                                      ->  -2.030397734278062E+16
 87ddfma0209  fma          7848976432      -2586831.2281      137903.517909  ->  -2.030397734278061E+16 Inexact Rounded
 88--                                                                      ->  2040774094814.077
 89ddfma0217  fma        56890.388731      35872030.4255      339337.123410  ->  2040774094814.078      Inexact Rounded
 90--                                                                      ->  2.714469575205049E+18
 91ddfma0220  fma       7533543.57445       360317763928      5073392.31638  ->  2.714469575205050E+18  Inexact Rounded
 92--                                                                      ->  1.011676297716716E+19
 93ddfma0223  fma       739945255.563      13672312784.1      -994381.53572  ->  1.011676297716715E+19  Inexact Rounded
 94--                                                                      ->  -2.914135721455315E+23
 95ddfma0224  fma       -413510957218       704729988550       9234162614.0  ->  -2.914135721455314E+23 Inexact Rounded
 96--                                                                      ->  2.620119863365786E+17
 97ddfma0226  fma        437484.00601       598906432790      894450638.442  ->  2.620119863365787E+17  Inexact Rounded
 98--                                                                      ->  1.272647995808178E+19
 99ddfma0253  fma         73287556929      173651305.784     -358312568.389  ->  1.272647995808177E+19  Inexact Rounded
100--                                                                      ->  -1.753769320861851E+18
101ddfma0257  fma        203258304486      -8628278.8066      153127.446727  ->  -1.753769320861850E+18 Inexact Rounded
102--                                                                      ->  -1.550737835263346E+17
103ddfma0260  fma       42560533.1774     -3643605282.86       178277.96377  ->  -1.550737835263347E+17 Inexact Rounded
104--                                                                      ->  2.897624620576005E+22
105ddfma0269  fma        142656587375       203118879670       604576103991  ->  2.897624620576004E+22  Inexact Rounded
106
107-- Cases where multiply would overflow or underflow if separate
108fma0300  fma   9e+384    10   0         -> Infinity  Overflow Inexact Rounded
109fma0301  fma   1e+384    10   0         -> Infinity  Overflow Inexact Rounded
110fma0302  fma   1e+384    10   -1e+384   -> 9.000000000000000E+384  Clamped
111fma0303  fma   1e+384    10   -9e+384   -> 1.000000000000000E+384  Clamped
112-- subnormal etc.
113fma0305  fma   1e-398    0.1  0         -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
114fma0306  fma   1e-398    0.1  1         -> 1.000000000000000 Inexact Rounded
115fma0307  fma   1e-398    0.1  1e-398    -> 1E-398 Underflow Subnormal Inexact Rounded
116
117-- Infinite combinations
118ddfma0800 fma  Inf   Inf   Inf    ->  Infinity
119ddfma0801 fma  Inf   Inf  -Inf    ->  NaN Invalid_operation
120ddfma0802 fma  Inf  -Inf   Inf    ->  NaN Invalid_operation
121ddfma0803 fma  Inf  -Inf  -Inf    -> -Infinity
122ddfma0804 fma -Inf   Inf   Inf    ->  NaN Invalid_operation
123ddfma0805 fma -Inf   Inf  -Inf    -> -Infinity
124ddfma0806 fma -Inf  -Inf   Inf    ->  Infinity
125ddfma0807 fma -Inf  -Inf  -Inf    ->  NaN Invalid_operation
126
127-- Triple NaN propagation
128ddfma0900 fma  NaN2  NaN3  NaN5   ->  NaN2
129ddfma0901 fma  0     NaN3  NaN5   ->  NaN3
130ddfma0902 fma  0     0     NaN5   ->  NaN5
131-- first sNaN wins (consider qNaN from earlier sNaN being
132-- overridden by an sNaN in third operand)
133ddfma0903 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation
134ddfma0904 fma  0     sNaN2 sNaN3  ->  NaN2 Invalid_operation
135ddfma0905 fma  0     0     sNaN3  ->  NaN3 Invalid_operation
136ddfma0906 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation
137ddfma0907 fma  NaN7  sNaN2 sNaN3  ->  NaN2 Invalid_operation
138ddfma0908 fma  NaN7  NaN5  sNaN3  ->  NaN3 Invalid_operation
139
140-- MULTIPLICATION TESTS ------------------------------------------------
141
142-- sanity checks
143ddfma2000 fma  2      2   0e+384  ->  4
144ddfma2001 fma  2      3   0e+384  ->  6
145ddfma2002 fma  5      1   0e+384  ->  5
146ddfma2003 fma  5      2   0e+384  ->  10
147ddfma2004 fma  1.20   2   0e+384  ->  2.40
148ddfma2005 fma  1.20   0   0e+384  ->  0.00
149ddfma2006 fma  1.20  -2   0e+384  ->  -2.40
150ddfma2007 fma  -1.20  2   0e+384  ->  -2.40
151ddfma2008 fma  -1.20  0   0e+384  ->  0.00
152ddfma2009 fma  -1.20 -2   0e+384  ->  2.40
153ddfma2010 fma  5.09 7.1   0e+384  ->  36.139
154ddfma2011 fma  2.5    4   0e+384  ->  10.0
155ddfma2012 fma  2.50   4   0e+384  ->  10.00
156ddfma2013 fma  1.23456789 1.00000000   0e+384  ->  1.234567890000000 Rounded
157ddfma2015 fma  2.50   4   0e+384  ->  10.00
158ddfma2016 fma   9.999999999  9.999999999   0e+384  ->   99.99999998000000 Inexact Rounded
159ddfma2017 fma   9.999999999 -9.999999999   0e+384  ->  -99.99999998000000 Inexact Rounded
160ddfma2018 fma  -9.999999999  9.999999999   0e+384  ->  -99.99999998000000 Inexact Rounded
161ddfma2019 fma  -9.999999999 -9.999999999   0e+384  ->   99.99999998000000 Inexact Rounded
162
163-- zeros, etc.
164ddfma2021 fma   0      0       0e+384  ->   0
165ddfma2022 fma   0     -0       0e+384  ->   0
166ddfma2023 fma  -0      0       0e+384  ->   0
167ddfma2024 fma  -0     -0       0e+384  ->   0
168ddfma2025 fma  -0.0   -0.0     0e+384  ->   0.00
169ddfma2026 fma  -0.0   -0.0     0e+384  ->   0.00
170ddfma2027 fma  -0.0   -0.0     0e+384  ->   0.00
171ddfma2028 fma  -0.0   -0.0     0e+384  ->   0.00
172ddfma2030 fma   5.00   1E-3    0e+384  ->   0.00500
173ddfma2031 fma   00.00  0.000   0e+384  ->   0.00000
174ddfma2032 fma   00.00  0E-3    0e+384  ->   0.00000     -- rhs is 0
175ddfma2033 fma   0E-3   00.00   0e+384  ->   0.00000     -- lhs is 0
176ddfma2034 fma  -5.00   1E-3    0e+384  ->  -0.00500
177ddfma2035 fma  -00.00  0.000   0e+384  ->   0.00000
178ddfma2036 fma  -00.00  0E-3    0e+384  ->   0.00000     -- rhs is 0
179ddfma2037 fma  -0E-3   00.00   0e+384  ->   0.00000     -- lhs is 0
180ddfma2038 fma   5.00  -1E-3    0e+384  ->  -0.00500
181ddfma2039 fma   00.00 -0.000   0e+384  ->   0.00000
182ddfma2040 fma   00.00 -0E-3    0e+384  ->   0.00000     -- rhs is 0
183ddfma2041 fma   0E-3  -00.00   0e+384  ->   0.00000     -- lhs is 0
184ddfma2042 fma  -5.00  -1E-3    0e+384  ->   0.00500
185ddfma2043 fma  -00.00 -0.000   0e+384  ->   0.00000
186ddfma2044 fma  -00.00 -0E-3    0e+384  ->   0.00000     -- rhs is 0
187ddfma2045 fma  -0E-3  -00.00  -0e+384  ->   0.00000     -- lhs is 0
188ddfma2046 fma  -0E-3   00.00  -0e+384  ->  -0.00000
189ddfma2047 fma   0E-3  -00.00  -0e+384  ->  -0.00000
190ddfma2048 fma   0E-3   00.00  -0e+384  ->   0.00000
191
192-- examples from decarith
193ddfma2050 fma  1.20 3          0e+384  ->  3.60
194ddfma2051 fma  7    3          0e+384  ->  21
195ddfma2052 fma  0.9  0.8        0e+384  ->  0.72
196ddfma2053 fma  0.9  -0         0e+384  ->  0.0
197ddfma2054 fma  654321 654321   0e+384  ->  428135971041
198
199ddfma2060 fma  123.45 1e7    0e+384  ->   1.2345E+9
200ddfma2061 fma  123.45 1e8    0e+384  ->   1.2345E+10
201ddfma2062 fma  123.45 1e+9   0e+384  ->   1.2345E+11
202ddfma2063 fma  123.45 1e10   0e+384  ->   1.2345E+12
203ddfma2064 fma  123.45 1e11   0e+384  ->   1.2345E+13
204ddfma2065 fma  123.45 1e12   0e+384  ->   1.2345E+14
205ddfma2066 fma  123.45 1e13   0e+384  ->   1.2345E+15
206
207
208-- test some intermediate lengths
209--                    1234567890123456
210ddfma2080 fma  0.1 1230123456456789       0e+384  ->  123012345645678.9
211ddfma2084 fma  0.1 1230123456456789       0e+384  ->  123012345645678.9
212ddfma2090 fma  1230123456456789     0.1   0e+384  ->  123012345645678.9
213ddfma2094 fma  1230123456456789     0.1   0e+384  ->  123012345645678.9
214
215-- test some more edge cases and carries
216ddfma2101 fma  9 9     0e+384  ->  81
217ddfma2102 fma  9 90     0e+384  ->  810
218ddfma2103 fma  9 900     0e+384  ->  8100
219ddfma2104 fma  9 9000     0e+384  ->  81000
220ddfma2105 fma  9 90000     0e+384  ->  810000
221ddfma2106 fma  9 900000     0e+384  ->  8100000
222ddfma2107 fma  9 9000000     0e+384  ->  81000000
223ddfma2108 fma  9 90000000     0e+384  ->  810000000
224ddfma2109 fma  9 900000000     0e+384  ->  8100000000
225ddfma2110 fma  9 9000000000     0e+384  ->  81000000000
226ddfma2111 fma  9 90000000000     0e+384  ->  810000000000
227ddfma2112 fma  9 900000000000     0e+384  ->  8100000000000
228ddfma2113 fma  9 9000000000000     0e+384  ->  81000000000000
229ddfma2114 fma  9 90000000000000     0e+384  ->  810000000000000
230ddfma2115 fma  9 900000000000000     0e+384  ->  8100000000000000
231--ddfma2116 fma  9 9000000000000000     0e+384  ->  81000000000000000
232--ddfma2117 fma  9 90000000000000000     0e+384  ->  810000000000000000
233--ddfma2118 fma  9 900000000000000000     0e+384  ->  8100000000000000000
234--ddfma2119 fma  9 9000000000000000000     0e+384  ->  81000000000000000000
235--ddfma2120 fma  9 90000000000000000000     0e+384  ->  810000000000000000000
236--ddfma2121 fma  9 900000000000000000000     0e+384  ->  8100000000000000000000
237--ddfma2122 fma  9 9000000000000000000000     0e+384  ->  81000000000000000000000
238--ddfma2123 fma  9 90000000000000000000000     0e+384  ->  810000000000000000000000
239-- test some more edge cases without carries
240ddfma2131 fma  3 3     0e+384  ->  9
241ddfma2132 fma  3 30     0e+384  ->  90
242ddfma2133 fma  3 300     0e+384  ->  900
243ddfma2134 fma  3 3000     0e+384  ->  9000
244ddfma2135 fma  3 30000     0e+384  ->  90000
245ddfma2136 fma  3 300000     0e+384  ->  900000
246ddfma2137 fma  3 3000000     0e+384  ->  9000000
247ddfma2138 fma  3 30000000     0e+384  ->  90000000
248ddfma2139 fma  3 300000000     0e+384  ->  900000000
249ddfma2140 fma  3 3000000000     0e+384  ->  9000000000
250ddfma2141 fma  3 30000000000     0e+384  ->  90000000000
251ddfma2142 fma  3 300000000000     0e+384  ->  900000000000
252ddfma2143 fma  3 3000000000000     0e+384  ->  9000000000000
253ddfma2144 fma  3 30000000000000     0e+384  ->  90000000000000
254ddfma2145 fma  3 300000000000000     0e+384  ->  900000000000000
255
256-- test some edge cases with exact rounding
257ddfma2301 fma  9 9     0e+384  ->  81
258ddfma2302 fma  9 90     0e+384  ->  810
259ddfma2303 fma  9 900     0e+384  ->  8100
260ddfma2304 fma  9 9000     0e+384  ->  81000
261ddfma2305 fma  9 90000     0e+384  ->  810000
262ddfma2306 fma  9 900000     0e+384  ->  8100000
263ddfma2307 fma  9 9000000     0e+384  ->  81000000
264ddfma2308 fma  9 90000000     0e+384  ->  810000000
265ddfma2309 fma  9 900000000     0e+384  ->  8100000000
266ddfma2310 fma  9 9000000000     0e+384  ->  81000000000
267ddfma2311 fma  9 90000000000     0e+384  ->  810000000000
268ddfma2312 fma  9 900000000000     0e+384  ->  8100000000000
269ddfma2313 fma  9 9000000000000     0e+384  ->  81000000000000
270ddfma2314 fma  9 90000000000000     0e+384  ->  810000000000000
271ddfma2315 fma  9 900000000000000     0e+384  ->  8100000000000000
272ddfma2316 fma  9 9000000000000000     0e+384  ->  8.100000000000000E+16  Rounded
273ddfma2317 fma  90 9000000000000000     0e+384  ->  8.100000000000000E+17  Rounded
274ddfma2318 fma  900 9000000000000000     0e+384  ->  8.100000000000000E+18  Rounded
275ddfma2319 fma  9000 9000000000000000     0e+384  ->  8.100000000000000E+19  Rounded
276ddfma2320 fma  90000 9000000000000000     0e+384  ->  8.100000000000000E+20  Rounded
277ddfma2321 fma  900000 9000000000000000     0e+384  ->  8.100000000000000E+21  Rounded
278ddfma2322 fma  9000000 9000000000000000     0e+384  ->  8.100000000000000E+22  Rounded
279ddfma2323 fma  90000000 9000000000000000     0e+384  ->  8.100000000000000E+23  Rounded
280
281-- tryzeros cases
282ddfma2504  fma   0E-260 1000E-260    0e+384  ->  0E-398 Clamped
283ddfma2505  fma   100E+260 0E+260     0e+384  ->  0E+369 Clamped
284
285-- mixed with zeros
286ddfma2541 fma   0    -1       0e+384  ->   0
287ddfma2542 fma  -0    -1       0e+384  ->   0
288ddfma2543 fma   0     1       0e+384  ->   0
289ddfma2544 fma  -0     1       0e+384  ->   0
290ddfma2545 fma  -1     0       0e+384  ->   0
291ddfma2546 fma  -1    -0       0e+384  ->   0
292ddfma2547 fma   1     0       0e+384  ->   0
293ddfma2548 fma   1    -0       0e+384  ->   0
294
295ddfma2551 fma   0.0  -1       0e+384  ->   0.0
296ddfma2552 fma  -0.0  -1       0e+384  ->   0.0
297ddfma2553 fma   0.0   1       0e+384  ->   0.0
298ddfma2554 fma  -0.0   1       0e+384  ->   0.0
299ddfma2555 fma  -1.0   0       0e+384  ->   0.0
300ddfma2556 fma  -1.0  -0       0e+384  ->   0.0
301ddfma2557 fma   1.0   0       0e+384  ->   0.0
302ddfma2558 fma   1.0  -0       0e+384  ->   0.0
303
304ddfma2561 fma   0    -1.0     0e+384  ->   0.0
305ddfma2562 fma  -0    -1.0     0e+384  ->   0.0
306ddfma2563 fma   0     1.0     0e+384  ->   0.0
307ddfma2564 fma  -0     1.0     0e+384  ->   0.0
308ddfma2565 fma  -1     0.0     0e+384  ->   0.0
309ddfma2566 fma  -1    -0.0     0e+384  ->   0.0
310ddfma2567 fma   1     0.0     0e+384  ->   0.0
311ddfma2568 fma   1    -0.0     0e+384  ->   0.0
312
313ddfma2571 fma   0.0  -1.0     0e+384  ->   0.00
314ddfma2572 fma  -0.0  -1.0     0e+384  ->   0.00
315ddfma2573 fma   0.0   1.0     0e+384  ->   0.00
316ddfma2574 fma  -0.0   1.0     0e+384  ->   0.00
317ddfma2575 fma  -1.0   0.0     0e+384  ->   0.00
318ddfma2576 fma  -1.0  -0.0     0e+384  ->   0.00
319ddfma2577 fma   1.0   0.0     0e+384  ->   0.00
320ddfma2578 fma   1.0  -0.0     0e+384  ->   0.00
321
322-- Specials
323ddfma2580 fma   Inf  -Inf     0e+384  ->  -Infinity
324ddfma2581 fma   Inf  -1000    0e+384  ->  -Infinity
325ddfma2582 fma   Inf  -1       0e+384  ->  -Infinity
326ddfma2583 fma   Inf  -0       0e+384  ->   NaN  Invalid_operation
327ddfma2584 fma   Inf   0       0e+384  ->   NaN  Invalid_operation
328ddfma2585 fma   Inf   1       0e+384  ->   Infinity
329ddfma2586 fma   Inf   1000    0e+384  ->   Infinity
330ddfma2587 fma   Inf   Inf     0e+384  ->   Infinity
331ddfma2588 fma  -1000  Inf     0e+384  ->  -Infinity
332ddfma2589 fma  -Inf   Inf     0e+384  ->  -Infinity
333ddfma2590 fma  -1     Inf     0e+384  ->  -Infinity
334ddfma2591 fma  -0     Inf     0e+384  ->   NaN  Invalid_operation
335ddfma2592 fma   0     Inf     0e+384  ->   NaN  Invalid_operation
336ddfma2593 fma   1     Inf     0e+384  ->   Infinity
337ddfma2594 fma   1000  Inf     0e+384  ->   Infinity
338ddfma2595 fma   Inf   Inf     0e+384  ->   Infinity
339
340ddfma2600 fma  -Inf  -Inf     0e+384  ->   Infinity
341ddfma2601 fma  -Inf  -1000    0e+384  ->   Infinity
342ddfma2602 fma  -Inf  -1       0e+384  ->   Infinity
343ddfma2603 fma  -Inf  -0       0e+384  ->   NaN  Invalid_operation
344ddfma2604 fma  -Inf   0       0e+384  ->   NaN  Invalid_operation
345ddfma2605 fma  -Inf   1       0e+384  ->  -Infinity
346ddfma2606 fma  -Inf   1000    0e+384  ->  -Infinity
347ddfma2607 fma  -Inf   Inf     0e+384  ->  -Infinity
348ddfma2608 fma  -1000  Inf     0e+384  ->  -Infinity
349ddfma2609 fma  -Inf  -Inf     0e+384  ->   Infinity
350ddfma2610 fma  -1    -Inf     0e+384  ->   Infinity
351ddfma2611 fma  -0    -Inf     0e+384  ->   NaN  Invalid_operation
352ddfma2612 fma   0    -Inf     0e+384  ->   NaN  Invalid_operation
353ddfma2613 fma   1    -Inf     0e+384  ->  -Infinity
354ddfma2614 fma   1000 -Inf     0e+384  ->  -Infinity
355ddfma2615 fma   Inf  -Inf     0e+384  ->  -Infinity
356
357ddfma2621 fma   NaN -Inf      0e+384  ->   NaN
358ddfma2622 fma   NaN -1000     0e+384  ->   NaN
359ddfma2623 fma   NaN -1        0e+384  ->   NaN
360ddfma2624 fma   NaN -0        0e+384  ->   NaN
361ddfma2625 fma   NaN  0        0e+384  ->   NaN
362ddfma2626 fma   NaN  1        0e+384  ->   NaN
363ddfma2627 fma   NaN  1000     0e+384  ->   NaN
364ddfma2628 fma   NaN  Inf      0e+384  ->   NaN
365ddfma2629 fma   NaN  NaN      0e+384  ->   NaN
366ddfma2630 fma  -Inf  NaN      0e+384  ->   NaN
367ddfma2631 fma  -1000 NaN      0e+384  ->   NaN
368ddfma2632 fma  -1    NaN      0e+384  ->   NaN
369ddfma2633 fma  -0    NaN      0e+384  ->   NaN
370ddfma2634 fma   0    NaN      0e+384  ->   NaN
371ddfma2635 fma   1    NaN      0e+384  ->   NaN
372ddfma2636 fma   1000 NaN      0e+384  ->   NaN
373ddfma2637 fma   Inf  NaN      0e+384  ->   NaN
374
375ddfma2641 fma   sNaN -Inf     0e+384  ->   NaN  Invalid_operation
376ddfma2642 fma   sNaN -1000    0e+384  ->   NaN  Invalid_operation
377ddfma2643 fma   sNaN -1       0e+384  ->   NaN  Invalid_operation
378ddfma2644 fma   sNaN -0       0e+384  ->   NaN  Invalid_operation
379ddfma2645 fma   sNaN  0       0e+384  ->   NaN  Invalid_operation
380ddfma2646 fma   sNaN  1       0e+384  ->   NaN  Invalid_operation
381ddfma2647 fma   sNaN  1000    0e+384  ->   NaN  Invalid_operation
382ddfma2648 fma   sNaN  NaN     0e+384  ->   NaN  Invalid_operation
383ddfma2649 fma   sNaN sNaN     0e+384  ->   NaN  Invalid_operation
384ddfma2650 fma   NaN  sNaN     0e+384  ->   NaN  Invalid_operation
385ddfma2651 fma  -Inf  sNaN     0e+384  ->   NaN  Invalid_operation
386ddfma2652 fma  -1000 sNaN     0e+384  ->   NaN  Invalid_operation
387ddfma2653 fma  -1    sNaN     0e+384  ->   NaN  Invalid_operation
388ddfma2654 fma  -0    sNaN     0e+384  ->   NaN  Invalid_operation
389ddfma2655 fma   0    sNaN     0e+384  ->   NaN  Invalid_operation
390ddfma2656 fma   1    sNaN     0e+384  ->   NaN  Invalid_operation
391ddfma2657 fma   1000 sNaN     0e+384  ->   NaN  Invalid_operation
392ddfma2658 fma   Inf  sNaN     0e+384  ->   NaN  Invalid_operation
393ddfma2659 fma   NaN  sNaN     0e+384  ->   NaN  Invalid_operation
394
395-- propagating NaNs
396ddfma2661 fma   NaN9 -Inf     0e+384  ->   NaN9
397ddfma2662 fma   NaN8  999     0e+384  ->   NaN8
398ddfma2663 fma   NaN71 Inf     0e+384  ->   NaN71
399ddfma2664 fma   NaN6  NaN5    0e+384  ->   NaN6
400ddfma2665 fma  -Inf   NaN4    0e+384  ->   NaN4
401ddfma2666 fma  -999   NaN33   0e+384  ->   NaN33
402ddfma2667 fma   Inf   NaN2    0e+384  ->   NaN2
403
404ddfma2671 fma   sNaN99 -Inf      0e+384  ->   NaN99 Invalid_operation
405ddfma2672 fma   sNaN98 -11       0e+384  ->   NaN98 Invalid_operation
406ddfma2673 fma   sNaN97  NaN      0e+384  ->   NaN97 Invalid_operation
407ddfma2674 fma   sNaN16 sNaN94    0e+384  ->   NaN16 Invalid_operation
408ddfma2675 fma   NaN95  sNaN93    0e+384  ->   NaN93 Invalid_operation
409ddfma2676 fma  -Inf    sNaN92    0e+384  ->   NaN92 Invalid_operation
410ddfma2677 fma   088    sNaN91    0e+384  ->   NaN91 Invalid_operation
411ddfma2678 fma   Inf    sNaN90    0e+384  ->   NaN90 Invalid_operation
412ddfma2679 fma   NaN    sNaN89    0e+384  ->   NaN89 Invalid_operation
413
414ddfma2681 fma  -NaN9 -Inf     0e+384  ->  -NaN9
415ddfma2682 fma  -NaN8  999     0e+384  ->  -NaN8
416ddfma2683 fma  -NaN71 Inf     0e+384  ->  -NaN71
417ddfma2684 fma  -NaN6 -NaN5    0e+384  ->  -NaN6
418ddfma2685 fma  -Inf  -NaN4    0e+384  ->  -NaN4
419ddfma2686 fma  -999  -NaN33   0e+384  ->  -NaN33
420ddfma2687 fma   Inf  -NaN2    0e+384  ->  -NaN2
421
422ddfma2691 fma  -sNaN99 -Inf      0e+384  ->  -NaN99 Invalid_operation
423ddfma2692 fma  -sNaN98 -11       0e+384  ->  -NaN98 Invalid_operation
424ddfma2693 fma  -sNaN97  NaN      0e+384  ->  -NaN97 Invalid_operation
425ddfma2694 fma  -sNaN16 -sNaN94   0e+384  ->  -NaN16 Invalid_operation
426ddfma2695 fma  -NaN95  -sNaN93   0e+384  ->  -NaN93 Invalid_operation
427ddfma2696 fma  -Inf    -sNaN92   0e+384  ->  -NaN92 Invalid_operation
428ddfma2697 fma   088    -sNaN91   0e+384  ->  -NaN91 Invalid_operation
429ddfma2698 fma   Inf    -sNaN90   0e+384  ->  -NaN90 Invalid_operation
430ddfma2699 fma  -NaN    -sNaN89   0e+384  ->  -NaN89 Invalid_operation
431
432ddfma2701 fma  -NaN  -Inf     0e+384  ->  -NaN
433ddfma2702 fma  -NaN   999     0e+384  ->  -NaN
434ddfma2703 fma  -NaN   Inf     0e+384  ->  -NaN
435ddfma2704 fma  -NaN  -NaN     0e+384  ->  -NaN
436ddfma2705 fma  -Inf  -NaN0    0e+384  ->  -NaN
437ddfma2706 fma  -999  -NaN     0e+384  ->  -NaN
438ddfma2707 fma   Inf  -NaN     0e+384  ->  -NaN
439
440ddfma2711 fma  -sNaN   -Inf      0e+384  ->  -NaN Invalid_operation
441ddfma2712 fma  -sNaN   -11       0e+384  ->  -NaN Invalid_operation
442ddfma2713 fma  -sNaN00  NaN      0e+384  ->  -NaN Invalid_operation
443ddfma2714 fma  -sNaN   -sNaN     0e+384  ->  -NaN Invalid_operation
444ddfma2715 fma  -NaN    -sNaN     0e+384  ->  -NaN Invalid_operation
445ddfma2716 fma  -Inf    -sNaN     0e+384  ->  -NaN Invalid_operation
446ddfma2717 fma   088    -sNaN     0e+384  ->  -NaN Invalid_operation
447ddfma2718 fma   Inf    -sNaN     0e+384  ->  -NaN Invalid_operation
448ddfma2719 fma  -NaN    -sNaN     0e+384  ->  -NaN Invalid_operation
449
450-- overflow and underflow tests .. note subnormal results
451-- signs
452ddfma2751 fma   1e+277  1e+311   0e+384  ->   Infinity Overflow Inexact Rounded
453ddfma2752 fma   1e+277 -1e+311   0e+384  ->  -Infinity Overflow Inexact Rounded
454ddfma2753 fma  -1e+277  1e+311   0e+384  ->  -Infinity Overflow Inexact Rounded
455ddfma2754 fma  -1e+277 -1e+311   0e+384  ->   Infinity Overflow Inexact Rounded
456ddfma2755 fma   1e-277  1e-311   0e+384  ->   0E-398 Underflow Subnormal Inexact Rounded Clamped
457ddfma2756 fma   1e-277 -1e-311   0e+384  ->  -0E-398 Underflow Subnormal Inexact Rounded Clamped
458ddfma2757 fma  -1e-277  1e-311   0e+384  ->  -0E-398 Underflow Subnormal Inexact Rounded Clamped
459ddfma2758 fma  -1e-277 -1e-311   0e+384  ->   0E-398 Underflow Subnormal Inexact Rounded Clamped
460
461-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
462ddfma2760 fma  1e-291 1e-101   0e+384  ->  1E-392 Subnormal
463ddfma2761 fma  1e-291 1e-102   0e+384  ->  1E-393 Subnormal
464ddfma2762 fma  1e-291 1e-103   0e+384  ->  1E-394 Subnormal
465ddfma2763 fma  1e-291 1e-104   0e+384  ->  1E-395 Subnormal
466ddfma2764 fma  1e-291 1e-105   0e+384  ->  1E-396 Subnormal
467ddfma2765 fma  1e-291 1e-106   0e+384  ->  1E-397 Subnormal
468ddfma2766 fma  1e-291 1e-107   0e+384  ->  1E-398 Subnormal
469ddfma2767 fma  1e-291 1e-108   0e+384  ->  0E-398 Underflow Subnormal Inexact Rounded Clamped
470ddfma2768 fma  1e-291 1e-109   0e+384  ->  0E-398 Underflow Subnormal Inexact Rounded Clamped
471ddfma2769 fma  1e-291 1e-110   0e+384  ->  0E-398 Underflow Subnormal Inexact Rounded Clamped
472-- [no equivalent of 'subnormal' for overflow]
473ddfma2770 fma  1e+60 1e+321   0e+384  ->  1.000000000000E+381  Clamped
474ddfma2771 fma  1e+60 1e+322   0e+384  ->  1.0000000000000E+382  Clamped
475ddfma2772 fma  1e+60 1e+323   0e+384  ->  1.00000000000000E+383  Clamped
476ddfma2773 fma  1e+60 1e+324   0e+384  ->  1.000000000000000E+384  Clamped
477ddfma2774 fma  1e+60 1e+325   0e+384  ->  Infinity Overflow Inexact Rounded
478ddfma2775 fma  1e+60 1e+326   0e+384  ->  Infinity Overflow Inexact Rounded
479ddfma2776 fma  1e+60 1e+327   0e+384  ->  Infinity Overflow Inexact Rounded
480ddfma2777 fma  1e+60 1e+328   0e+384  ->  Infinity Overflow Inexact Rounded
481ddfma2778 fma  1e+60 1e+329   0e+384  ->  Infinity Overflow Inexact Rounded
482ddfma2779 fma  1e+60 1e+330   0e+384  ->  Infinity Overflow Inexact Rounded
483
484ddfma2801 fma   1.0000E-394  1       0e+384  ->  1.0000E-394 Subnormal
485ddfma2802 fma   1.000E-394   1e-1    0e+384  ->  1.000E-395  Subnormal
486ddfma2803 fma   1.00E-394    1e-2    0e+384  ->  1.00E-396   Subnormal
487ddfma2804 fma   1.0E-394     1e-3    0e+384  ->  1.0E-397    Subnormal
488ddfma2805 fma   1.0E-394     1e-4    0e+384  ->  1E-398     Subnormal Rounded
489ddfma2806 fma   1.3E-394     1e-4    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded
490ddfma2807 fma   1.5E-394     1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded
491ddfma2808 fma   1.7E-394     1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded
492ddfma2809 fma   2.3E-394     1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded
493ddfma2810 fma   2.5E-394     1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded
494ddfma2811 fma   2.7E-394     1e-4    0e+384  ->  3E-398     Underflow Subnormal Inexact Rounded
495ddfma2812 fma   1.49E-394    1e-4    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded
496ddfma2813 fma   1.50E-394    1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded
497ddfma2814 fma   1.51E-394    1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded
498ddfma2815 fma   2.49E-394    1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded
499ddfma2816 fma   2.50E-394    1e-4    0e+384  ->  2E-398     Underflow Subnormal Inexact Rounded
500ddfma2817 fma   2.51E-394    1e-4    0e+384  ->  3E-398     Underflow Subnormal Inexact Rounded
501
502ddfma2818 fma   1E-394       1e-4    0e+384  ->  1E-398     Subnormal
503ddfma2819 fma   3E-394       1e-5    0e+384  ->  0E-398     Underflow Subnormal Inexact Rounded Clamped
504ddfma2820 fma   5E-394       1e-5    0e+384  ->  0E-398     Underflow Subnormal Inexact Rounded Clamped
505ddfma2821 fma   7E-394       1e-5    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded
506ddfma2822 fma   9E-394       1e-5    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded
507ddfma2823 fma   9.9E-394     1e-5    0e+384  ->  1E-398     Underflow Subnormal Inexact Rounded
508
509ddfma2824 fma   1E-394      -1e-4    0e+384  ->  -1E-398    Subnormal
510ddfma2825 fma   3E-394      -1e-5    0e+384  ->  -0E-398    Underflow Subnormal Inexact Rounded Clamped
511ddfma2826 fma  -5E-394       1e-5    0e+384  ->  -0E-398    Underflow Subnormal Inexact Rounded Clamped
512ddfma2827 fma   7E-394      -1e-5    0e+384  ->  -1E-398    Underflow Subnormal Inexact Rounded
513ddfma2828 fma  -9E-394       1e-5    0e+384  ->  -1E-398    Underflow Subnormal Inexact Rounded
514ddfma2829 fma   9.9E-394    -1e-5    0e+384  ->  -1E-398    Underflow Subnormal Inexact Rounded
515ddfma2830 fma   3.0E-394    -1e-5    0e+384  ->  -0E-398    Underflow Subnormal Inexact Rounded Clamped
516
517ddfma2831 fma   1.0E-199     1e-200   0e+384  ->  0E-398 Underflow Subnormal Inexact Rounded Clamped
518ddfma2832 fma   1.0E-199     1e-199   0e+384  ->  1E-398    Subnormal Rounded
519ddfma2833 fma   1.0E-199     1e-198   0e+384  ->  1.0E-397    Subnormal
520ddfma2834 fma   2.0E-199     2e-198   0e+384  ->  4.0E-397    Subnormal
521ddfma2835 fma   4.0E-199     4e-198   0e+384  ->  1.60E-396   Subnormal
522ddfma2836 fma  10.0E-199    10e-198   0e+384  ->  1.000E-395  Subnormal
523ddfma2837 fma  30.0E-199    30e-198   0e+384  ->  9.000E-395  Subnormal
524ddfma2838 fma  40.0E-199    40e-188   0e+384  ->  1.6000E-384 Subnormal
525ddfma2839 fma  40.0E-199    40e-187   0e+384  ->  1.6000E-383
526ddfma2840 fma  40.0E-199    40e-186   0e+384  ->  1.6000E-382
527
528-- Long operand overflow may be a different path
529ddfma2870 fma  100  9.999E+383           0e+384  ->   Infinity Inexact Overflow Rounded
530ddfma2871 fma  100 -9.999E+383       0e+384  ->  -Infinity Inexact Overflow Rounded
531ddfma2872 fma       9.999E+383 100   0e+384  ->   Infinity Inexact Overflow Rounded
532ddfma2873 fma      -9.999E+383 100   0e+384  ->  -Infinity Inexact Overflow Rounded
533
534-- check for double-rounded subnormals
535ddfma2881 fma   1.2347E-355 1.2347E-40    0e+384  ->   1.524E-395 Inexact Rounded Subnormal Underflow
536ddfma2882 fma   1.234E-355 1.234E-40      0e+384  ->   1.523E-395 Inexact Rounded Subnormal Underflow
537ddfma2883 fma   1.23E-355  1.23E-40       0e+384  ->   1.513E-395 Inexact Rounded Subnormal Underflow
538ddfma2884 fma   1.2E-355   1.2E-40        0e+384  ->   1.44E-395  Subnormal
539ddfma2885 fma   1.2E-355   1.2E-41        0e+384  ->   1.44E-396  Subnormal
540ddfma2886 fma   1.2E-355   1.2E-42        0e+384  ->   1.4E-397   Subnormal Inexact Rounded Underflow
541ddfma2887 fma   1.2E-355   1.3E-42        0e+384  ->   1.6E-397   Subnormal Inexact Rounded Underflow
542ddfma2888 fma   1.3E-355   1.3E-42        0e+384  ->   1.7E-397   Subnormal Inexact Rounded Underflow
543ddfma2889 fma   1.3E-355   1.3E-43        0e+384  ->     2E-398   Subnormal Inexact Rounded Underflow
544ddfma2890 fma   1.3E-356   1.3E-43        0e+384  ->     0E-398   Clamped Subnormal Inexact Rounded Underflow
545
546ddfma2891 fma   1.2345E-39   1.234E-355   0e+384  ->   1.5234E-394 Inexact Rounded Subnormal Underflow
547ddfma2892 fma   1.23456E-39  1.234E-355   0e+384  ->   1.5234E-394 Inexact Rounded Subnormal Underflow
548ddfma2893 fma   1.2345E-40   1.234E-355   0e+384  ->   1.523E-395  Inexact Rounded Subnormal Underflow
549ddfma2894 fma   1.23456E-40  1.234E-355   0e+384  ->   1.523E-395  Inexact Rounded Subnormal Underflow
550ddfma2895 fma   1.2345E-41   1.234E-355   0e+384  ->   1.52E-396   Inexact Rounded Subnormal Underflow
551ddfma2896 fma   1.23456E-41  1.234E-355   0e+384  ->   1.52E-396   Inexact Rounded Subnormal Underflow
552
553-- Now explore the case where we get a normal result with Underflow
554ddfma2900 fma   0.3000000000E-191 0.3000000000E-191   0e+384  ->  9.00000000000000E-384 Subnormal Rounded
555ddfma2901 fma   0.3000000001E-191 0.3000000001E-191   0e+384  ->  9.00000000600000E-384 Underflow Inexact Subnormal Rounded
556ddfma2902 fma   9.999999999999999E-383  0.0999999999999           0e+384  ->  9.99999999999000E-384 Underflow Inexact Subnormal Rounded
557ddfma2903 fma   9.999999999999999E-383  0.09999999999999          0e+384  ->  9.99999999999900E-384 Underflow Inexact Subnormal Rounded
558ddfma2904 fma   9.999999999999999E-383  0.099999999999999         0e+384  ->  9.99999999999990E-384 Underflow Inexact Subnormal Rounded
559ddfma2905 fma   9.999999999999999E-383  0.0999999999999999        0e+384  ->  9.99999999999999E-384 Underflow Inexact Subnormal Rounded
560-- prove operands are exact
561ddfma2906 fma   9.999999999999999E-383  1                         0e+384  ->  9.999999999999999E-383
562ddfma2907 fma                        1  0.09999999999999999       0e+384  ->  0.09999999999999999
563-- the next rounds to Nmin
564ddfma2908 fma   9.999999999999999E-383  0.09999999999999999       0e+384  ->  1.000000000000000E-383 Underflow Inexact Subnormal Rounded
565
566-- hugest
567ddfma2909 fma   9999999999999999 9999999999999999   0e+384  ->  9.999999999999998E+31 Inexact Rounded
568
569-- Null tests
570ddfma2990 fma  10  #   0e+384  ->  NaN Invalid_operation
571ddfma2991 fma   # 10   0e+384  ->  NaN Invalid_operation
572
573
574-- ADDITION TESTS ------------------------------------------------------
575
576-- [first group are 'quick confidence check']
577ddfma3001 fma  1  1       1       ->  2
578ddfma3002 fma  1  2       3       ->  5
579ddfma3003 fma  1  '5.75'  '3.3'   ->  9.05
580ddfma3004 fma  1  '5'     '-3'    ->  2
581ddfma3005 fma  1  '-5'    '-3'    ->  -8
582ddfma3006 fma  1  '-7'    '2.5'   ->  -4.5
583ddfma3007 fma  1  '0.7'   '0.3'   ->  1.0
584ddfma3008 fma  1  '1.25'  '1.25'  ->  2.50
585ddfma3009 fma  1  '1.23456789'  '1.00000000' -> '2.23456789'
586ddfma3010 fma  1  '1.23456789'  '1.00000011' -> '2.23456800'
587
588--             1234567890123456      1234567890123456
589ddfma3011 fma  1  '0.4444444444444446'  '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
590ddfma3012 fma  1  '0.4444444444444445'  '0.5555555555555555' -> '1.000000000000000' Rounded
591ddfma3013 fma  1  '0.4444444444444444'  '0.5555555555555555' -> '0.9999999999999999'
592ddfma3014 fma  1    '4444444444444444' '0.49'   -> '4444444444444444' Inexact Rounded
593ddfma3015 fma  1    '4444444444444444' '0.499'  -> '4444444444444444' Inexact Rounded
594ddfma3016 fma  1    '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
595ddfma3017 fma  1    '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
596ddfma3018 fma  1    '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
597ddfma3019 fma  1    '4444444444444444' '0.501'  -> '4444444444444445' Inexact Rounded
598ddfma3020 fma  1    '4444444444444444' '0.51'   -> '4444444444444445' Inexact Rounded
599
600ddfma3021 fma  1  0 1 -> 1
601ddfma3022 fma  1  1 1 -> 2
602ddfma3023 fma  1  2 1 -> 3
603ddfma3024 fma  1  3 1 -> 4
604ddfma3025 fma  1  4 1 -> 5
605ddfma3026 fma  1  5 1 -> 6
606ddfma3027 fma  1  6 1 -> 7
607ddfma3028 fma  1  7 1 -> 8
608ddfma3029 fma  1  8 1 -> 9
609ddfma3030 fma  1  9 1 -> 10
610
611-- some carrying effects
612ddfma3031 fma  1  '0.9998'  '0.0000' -> '0.9998'
613ddfma3032 fma  1  '0.9998'  '0.0001' -> '0.9999'
614ddfma3033 fma  1  '0.9998'  '0.0002' -> '1.0000'
615ddfma3034 fma  1  '0.9998'  '0.0003' -> '1.0001'
616
617ddfma3035 fma  1  '70'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
618ddfma3036 fma  1  '700'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
619ddfma3037 fma  1  '7000'  '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
620ddfma3038 fma  1  '70000'  '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
621ddfma3039 fma  1  '700000'  '10000e+16' -> '1.000000000000007E+20' Rounded
622
623-- symmetry:
624ddfma3040 fma  1  '10000e+16'  '70' -> '1.000000000000000E+20' Inexact Rounded
625ddfma3041 fma  1  '10000e+16'  '700' -> '1.000000000000000E+20' Inexact Rounded
626ddfma3042 fma  1  '10000e+16'  '7000' -> '1.000000000000000E+20' Inexact Rounded
627ddfma3044 fma  1  '10000e+16'  '70000' -> '1.000000000000001E+20' Inexact Rounded
628ddfma3045 fma  1  '10000e+16'  '700000' -> '1.000000000000007E+20' Rounded
629
630-- same, without rounding
631ddfma3046 fma  1  '10000e+9'  '7' -> '10000000000007'
632ddfma3047 fma  1  '10000e+9'  '70' -> '10000000000070'
633ddfma3048 fma  1  '10000e+9'  '700' -> '10000000000700'
634ddfma3049 fma  1  '10000e+9'  '7000' -> '10000000007000'
635ddfma3050 fma  1  '10000e+9'  '70000' -> '10000000070000'
636ddfma3051 fma  1  '10000e+9'  '700000' -> '10000000700000'
637ddfma3052 fma  1  '10000e+9'  '7000000' -> '10000007000000'
638
639-- examples from decarith
640ddfma3053 fma  1  '12' '7.00' -> '19.00'
641ddfma3054 fma  1  '1.3' '-1.07' -> '0.23'
642ddfma3055 fma  1  '1.3' '-1.30' -> '0.00'
643ddfma3056 fma  1  '1.3' '-2.07' -> '-0.77'
644ddfma3057 fma  1  '1E+2' '1E+4' -> '1.01E+4'
645
646-- leading zero preservation
647ddfma3061 fma  1  1 '0.0001' -> '1.0001'
648ddfma3062 fma  1  1 '0.00001' -> '1.00001'
649ddfma3063 fma  1  1 '0.000001' -> '1.000001'
650ddfma3064 fma  1  1 '0.0000001' -> '1.0000001'
651ddfma3065 fma  1  1 '0.00000001' -> '1.00000001'
652
653-- some funny zeros [in case of bad signum]
654ddfma3070 fma  1  1  0    -> 1
655ddfma3071 fma  1  1 0.    -> 1
656ddfma3072 fma  1  1  .0   -> 1.0
657ddfma3073 fma  1  1 0.0   -> 1.0
658ddfma3074 fma  1  1 0.00  -> 1.00
659ddfma3075 fma  1   0  1   -> 1
660ddfma3076 fma  1  0.  1   -> 1
661ddfma3077 fma  1   .0 1   -> 1.0
662ddfma3078 fma  1  0.0 1   -> 1.0
663ddfma3079 fma  1  0.00 1  -> 1.00
664
665-- some carries
666ddfma3080 fma  1  999999998 1  -> 999999999
667ddfma3081 fma  1  999999999 1  -> 1000000000
668ddfma3082 fma  1   99999999 1  -> 100000000
669ddfma3083 fma  1    9999999 1  -> 10000000
670ddfma3084 fma  1     999999 1  -> 1000000
671ddfma3085 fma  1      99999 1  -> 100000
672ddfma3086 fma  1       9999 1  -> 10000
673ddfma3087 fma  1        999 1  -> 1000
674ddfma3088 fma  1         99 1  -> 100
675ddfma3089 fma  1          9 1  -> 10
676
677
678-- more LHS swaps
679ddfma3090 fma  1  '-56267E-10'   0 ->  '-0.0000056267'
680ddfma3091 fma  1  '-56267E-6'    0 ->  '-0.056267'
681ddfma3092 fma  1  '-56267E-5'    0 ->  '-0.56267'
682ddfma3093 fma  1  '-56267E-4'    0 ->  '-5.6267'
683ddfma3094 fma  1  '-56267E-3'    0 ->  '-56.267'
684ddfma3095 fma  1  '-56267E-2'    0 ->  '-562.67'
685ddfma3096 fma  1  '-56267E-1'    0 ->  '-5626.7'
686ddfma3097 fma  1  '-56267E-0'    0 ->  '-56267'
687ddfma3098 fma  1  '-5E-10'       0 ->  '-5E-10'
688ddfma3099 fma  1  '-5E-7'        0 ->  '-5E-7'
689ddfma3100 fma  1  '-5E-6'        0 ->  '-0.000005'
690ddfma3101 fma  1  '-5E-5'        0 ->  '-0.00005'
691ddfma3102 fma  1  '-5E-4'        0 ->  '-0.0005'
692ddfma3103 fma  1  '-5E-1'        0 ->  '-0.5'
693ddfma3104 fma  1  '-5E0'         0 ->  '-5'
694ddfma3105 fma  1  '-5E1'         0 ->  '-50'
695ddfma3106 fma  1  '-5E5'         0 ->  '-500000'
696ddfma3107 fma  1  '-5E15'        0 ->  '-5000000000000000'
697ddfma3108 fma  1  '-5E16'        0 ->  '-5.000000000000000E+16'  Rounded
698ddfma3109 fma  1  '-5E17'        0 ->  '-5.000000000000000E+17'  Rounded
699ddfma3110 fma  1  '-5E18'        0 ->  '-5.000000000000000E+18'  Rounded
700ddfma3111 fma  1  '-5E100'       0 ->  '-5.000000000000000E+100' Rounded
701
702-- more RHS swaps
703ddfma3113 fma  1  0  '-56267E-10' ->  '-0.0000056267'
704ddfma3114 fma  1  0  '-56267E-6'  ->  '-0.056267'
705ddfma3116 fma  1  0  '-56267E-5'  ->  '-0.56267'
706ddfma3117 fma  1  0  '-56267E-4'  ->  '-5.6267'
707ddfma3119 fma  1  0  '-56267E-3'  ->  '-56.267'
708ddfma3120 fma  1  0  '-56267E-2'  ->  '-562.67'
709ddfma3121 fma  1  0  '-56267E-1'  ->  '-5626.7'
710ddfma3122 fma  1  0  '-56267E-0'  ->  '-56267'
711ddfma3123 fma  1  0  '-5E-10'     ->  '-5E-10'
712ddfma3124 fma  1  0  '-5E-7'      ->  '-5E-7'
713ddfma3125 fma  1  0  '-5E-6'      ->  '-0.000005'
714ddfma3126 fma  1  0  '-5E-5'      ->  '-0.00005'
715ddfma3127 fma  1  0  '-5E-4'      ->  '-0.0005'
716ddfma3128 fma  1  0  '-5E-1'      ->  '-0.5'
717ddfma3129 fma  1  0  '-5E0'       ->  '-5'
718ddfma3130 fma  1  0  '-5E1'       ->  '-50'
719ddfma3131 fma  1  0  '-5E5'       ->  '-500000'
720ddfma3132 fma  1  0  '-5E15'      ->  '-5000000000000000'
721ddfma3133 fma  1  0  '-5E16'      ->  '-5.000000000000000E+16'   Rounded
722ddfma3134 fma  1  0  '-5E17'      ->  '-5.000000000000000E+17'   Rounded
723ddfma3135 fma  1  0  '-5E18'      ->  '-5.000000000000000E+18'   Rounded
724ddfma3136 fma  1  0  '-5E100'     ->  '-5.000000000000000E+100'  Rounded
725
726-- related
727ddfma3137 fma  1   1  '0E-19'      ->  '1.000000000000000'  Rounded
728ddfma3138 fma  1  -1  '0E-19'      ->  '-1.000000000000000' Rounded
729ddfma3139 fma  1  '0E-19' 1        ->  '1.000000000000000'  Rounded
730ddfma3140 fma  1  '0E-19' -1       ->  '-1.000000000000000' Rounded
731ddfma3141 fma  1  1E+11   0.0000   ->  '100000000000.0000'
732ddfma3142 fma  1  1E+11   0.00000  ->  '100000000000.0000'  Rounded
733ddfma3143 fma  1  0.000   1E+12    ->  '1000000000000.000'
734ddfma3144 fma  1  0.0000  1E+12    ->  '1000000000000.000'  Rounded
735
736-- [some of the next group are really constructor tests]
737ddfma3146 fma  1  '00.0'  0       ->  '0.0'
738ddfma3147 fma  1  '0.00'  0       ->  '0.00'
739ddfma3148 fma  1   0      '0.00'  ->  '0.00'
740ddfma3149 fma  1   0      '00.0'  ->  '0.0'
741ddfma3150 fma  1  '00.0'  '0.00'  ->  '0.00'
742ddfma3151 fma  1  '0.00'  '00.0'  ->  '0.00'
743ddfma3152 fma  1  '3'     '.3'    ->  '3.3'
744ddfma3153 fma  1  '3.'    '.3'    ->  '3.3'
745ddfma3154 fma  1  '3.0'   '.3'    ->  '3.3'
746ddfma3155 fma  1  '3.00'  '.3'    ->  '3.30'
747ddfma3156 fma  1  '3'     '3'     ->  '6'
748ddfma3157 fma  1  '3'     '+3'    ->  '6'
749ddfma3158 fma  1  '3'     '-3'    ->  '0'
750ddfma3159 fma  1  '0.3'   '-0.3'  ->  '0.0'
751ddfma3160 fma  1  '0.03'  '-0.03' ->  '0.00'
752
753-- try borderline precision, with carries, etc.
754ddfma3161 fma  1  '1E+12' '-1'    -> '999999999999'
755ddfma3162 fma  1  '1E+12'  '1.11' -> '1000000000001.11'
756ddfma3163 fma  1  '1.11'  '1E+12' -> '1000000000001.11'
757ddfma3164 fma  1  '-1'    '1E+12' -> '999999999999'
758ddfma3165 fma  1  '7E+12' '-1'    -> '6999999999999'
759ddfma3166 fma  1  '7E+12'  '1.11' -> '7000000000001.11'
760ddfma3167 fma  1  '1.11'  '7E+12' -> '7000000000001.11'
761ddfma3168 fma  1  '-1'    '7E+12' -> '6999999999999'
762
763rounding: half_up
764--           1.234567890123456      1234567890123456      1 234567890123456
765ddfma3170 fma  1  '4.444444444444444'  '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
766ddfma3171 fma  1  '4.444444444444444'  '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
767ddfma3172 fma  1  '4.444444444444444'  '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
768ddfma3173 fma  1  '4.444444444444444'  '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
769ddfma3174 fma  1  '4.444444444444444'  '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
770ddfma3175 fma  1  '4.444444444444444'  '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
771ddfma3176 fma  1  '4.444444444444444'  '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
772ddfma3177 fma  1  '4.444444444444444'  '0.5555555555555550' -> '4.999999999999999' Rounded
773ddfma3178 fma  1  '4.444444444444444'  '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
774ddfma3179 fma  1  '4.444444444444444'  '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
775ddfma3180 fma  1  '4.444444444444444'  '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
776ddfma3181 fma  1  '4.444444444444444'  '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
777ddfma3182 fma  1  '4.444444444444444'  '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
778ddfma3183 fma  1  '4.444444444444444'  '0.5555555555555540' -> '4.999999999999998' Rounded
779
780-- and some more, including residue effects and different roundings
781rounding: half_up
782ddfma3200 fma  1  '1234560123456789' 0             -> '1234560123456789'
783ddfma3201 fma  1  '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded
784ddfma3202 fma  1  '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded
785ddfma3203 fma  1  '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded
786ddfma3204 fma  1  '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded
787ddfma3205 fma  1  '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded
788ddfma3206 fma  1  '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded
789ddfma3207 fma  1  '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded
790ddfma3208 fma  1  '1234560123456789' 0.5           -> '1234560123456790' Inexact Rounded
791ddfma3209 fma  1  '1234560123456789' 0.500000001   -> '1234560123456790' Inexact Rounded
792ddfma3210 fma  1  '1234560123456789' 0.500001      -> '1234560123456790' Inexact Rounded
793ddfma3211 fma  1  '1234560123456789' 0.51          -> '1234560123456790' Inexact Rounded
794ddfma3212 fma  1  '1234560123456789' 0.6           -> '1234560123456790' Inexact Rounded
795ddfma3213 fma  1  '1234560123456789' 0.9           -> '1234560123456790' Inexact Rounded
796ddfma3214 fma  1  '1234560123456789' 0.99999       -> '1234560123456790' Inexact Rounded
797ddfma3215 fma  1  '1234560123456789' 0.999999999   -> '1234560123456790' Inexact Rounded
798ddfma3216 fma  1  '1234560123456789' 1             -> '1234560123456790'
799ddfma3217 fma  1  '1234560123456789' 1.000000001   -> '1234560123456790' Inexact Rounded
800ddfma3218 fma  1  '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded
801ddfma3219 fma  1  '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded
802
803rounding: half_even
804ddfma3220 fma  1  '1234560123456789' 0             -> '1234560123456789'
805ddfma3221 fma  1  '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded
806ddfma3222 fma  1  '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded
807ddfma3223 fma  1  '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded
808ddfma3224 fma  1  '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded
809ddfma3225 fma  1  '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded
810ddfma3226 fma  1  '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded
811ddfma3227 fma  1  '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded
812ddfma3228 fma  1  '1234560123456789' 0.5           -> '1234560123456790' Inexact Rounded
813ddfma3229 fma  1  '1234560123456789' 0.500000001   -> '1234560123456790' Inexact Rounded
814ddfma3230 fma  1  '1234560123456789' 0.500001      -> '1234560123456790' Inexact Rounded
815ddfma3231 fma  1  '1234560123456789' 0.51          -> '1234560123456790' Inexact Rounded
816ddfma3232 fma  1  '1234560123456789' 0.6           -> '1234560123456790' Inexact Rounded
817ddfma3233 fma  1  '1234560123456789' 0.9           -> '1234560123456790' Inexact Rounded
818ddfma3234 fma  1  '1234560123456789' 0.99999       -> '1234560123456790' Inexact Rounded
819ddfma3235 fma  1  '1234560123456789' 0.999999999   -> '1234560123456790' Inexact Rounded
820ddfma3236 fma  1  '1234560123456789' 1             -> '1234560123456790'
821ddfma3237 fma  1  '1234560123456789' 1.00000001    -> '1234560123456790' Inexact Rounded
822ddfma3238 fma  1  '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded
823ddfma3239 fma  1  '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded
824-- critical few with even bottom digit...
825ddfma3240 fma  1  '1234560123456788' 0.499999999   -> '1234560123456788' Inexact Rounded
826ddfma3241 fma  1  '1234560123456788' 0.5           -> '1234560123456788' Inexact Rounded
827ddfma3242 fma  1  '1234560123456788' 0.500000001   -> '1234560123456789' Inexact Rounded
828
829rounding: down
830ddfma3250 fma  1  '1234560123456789' 0             -> '1234560123456789'
831ddfma3251 fma  1  '1234560123456789' 0.000000001   -> '1234560123456789' Inexact Rounded
832ddfma3252 fma  1  '1234560123456789' 0.000001      -> '1234560123456789' Inexact Rounded
833ddfma3253 fma  1  '1234560123456789' 0.1           -> '1234560123456789' Inexact Rounded
834ddfma3254 fma  1  '1234560123456789' 0.4           -> '1234560123456789' Inexact Rounded
835ddfma3255 fma  1  '1234560123456789' 0.49          -> '1234560123456789' Inexact Rounded
836ddfma3256 fma  1  '1234560123456789' 0.499999      -> '1234560123456789' Inexact Rounded
837ddfma3257 fma  1  '1234560123456789' 0.499999999   -> '1234560123456789' Inexact Rounded
838ddfma3258 fma  1  '1234560123456789' 0.5           -> '1234560123456789' Inexact Rounded
839ddfma3259 fma  1  '1234560123456789' 0.500000001   -> '1234560123456789' Inexact Rounded
840ddfma3260 fma  1  '1234560123456789' 0.500001      -> '1234560123456789' Inexact Rounded
841ddfma3261 fma  1  '1234560123456789' 0.51          -> '1234560123456789' Inexact Rounded
842ddfma3262 fma  1  '1234560123456789' 0.6           -> '1234560123456789' Inexact Rounded
843ddfma3263 fma  1  '1234560123456789' 0.9           -> '1234560123456789' Inexact Rounded
844ddfma3264 fma  1  '1234560123456789' 0.99999       -> '1234560123456789' Inexact Rounded
845ddfma3265 fma  1  '1234560123456789' 0.999999999   -> '1234560123456789' Inexact Rounded
846ddfma3266 fma  1  '1234560123456789' 1             -> '1234560123456790'
847ddfma3267 fma  1  '1234560123456789' 1.00000001    -> '1234560123456790' Inexact Rounded
848ddfma3268 fma  1  '1234560123456789' 1.00001       -> '1234560123456790' Inexact Rounded
849ddfma3269 fma  1  '1234560123456789' 1.1           -> '1234560123456790' Inexact Rounded
850
851-- 1 in last place tests
852rounding: half_up
853ddfma3301 fma  1   -1   1      ->   0
854ddfma3302 fma  1    0   1      ->   1
855ddfma3303 fma  1    1   1  …

Large files files are truncated, but you can click here to view the full file