PageRenderTime 43ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/Lib/test/decimaltestdata/fma.decTest

http://unladen-swallow.googlecode.com/
Unknown | 3426 lines | 3169 code | 257 blank | 0 comment | 0 complexity | 9d6f9a30130484e3a7ad442f56915cf4 MD5 | raw file

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

  1------------------------------------------------------------------------
  2-- fma.decTest -- decimal 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
 22extended:    1
 23precision:   9
 24rounding:    half_up
 25maxExponent: 384
 26minexponent: -383
 27
 28-- These tests comprese three parts:
 29--   1. Sanity checks and other three-operand tests (especially those
 30--      where the fused operation makes a difference)
 31--   2. Multiply tests (third operand is neutral zero [0E+emax])
 32--   3. Addition tests (first operand is 1)
 33-- The multiply and addition tests are extensive because FMA may have
 34-- its own dedicated multiplication or addition routine(s), and they
 35-- also inherently check the left-to-right properties.
 36
 37-- Sanity checks
 38fmax0001 fma  1   1   1 ->   2
 39fmax0002 fma  1   1   2 ->   3
 40fmax0003 fma  2   2   3 ->   7
 41fmax0004 fma  9   9   9 ->  90
 42fmax0005 fma -1   1   1 ->   0
 43fmax0006 fma -1   1   2 ->   1
 44fmax0007 fma -2   2   3 ->  -1
 45fmax0008 fma -9   9   9 -> -72
 46fmax0011 fma  1  -1   1 ->   0
 47fmax0012 fma  1  -1   2 ->   1
 48fmax0013 fma  2  -2   3 ->  -1
 49fmax0014 fma  9  -9   9 -> -72
 50fmax0015 fma  1   1  -1 ->   0
 51fmax0016 fma  1   1  -2 ->  -1
 52fmax0017 fma  2   2  -3 ->   1
 53fmax0018 fma  9   9  -9 ->  72
 54fmax0019 fma  3   5   7 ->  22
 55fmax0029 fma  3  -5   7 ->  -8
 56
 57-- non-integer exacts
 58fma0100  fma    25.2   63.6   -438  ->  1164.72
 59fma0101  fma   0.301  0.380    334  ->  334.114380
 60fma0102  fma    49.2   -4.8   23.3  ->  -212.86
 61fma0103  fma    4.22  0.079  -94.6  ->  -94.26662
 62fma0104  fma     903  0.797  0.887  ->  720.578
 63fma0105  fma    6.13   -161   65.9  ->  -921.03
 64fma0106  fma    28.2    727   5.45  ->  20506.85
 65fma0107  fma       4    605    688  ->  3108
 66fma0108  fma    93.3   0.19  0.226  ->  17.953
 67fma0109  fma   0.169   -341   5.61  ->  -52.019
 68fma0110  fma   -72.2     30  -51.2  ->  -2217.2
 69fma0111  fma  -0.409     13   20.4  ->  15.083
 70fma0112  fma     317   77.0   19.0  ->  24428.0
 71fma0113  fma      47   6.58   1.62  ->  310.88
 72fma0114  fma    1.36  0.984  0.493  ->  1.83124
 73fma0115  fma    72.7    274   1.56  ->  19921.36
 74fma0116  fma     335    847     83  ->  283828
 75fma0117  fma     666  0.247   25.4  ->  189.902
 76fma0118  fma   -3.87   3.06   78.0  ->  66.1578
 77fma0119  fma   0.742    192   35.6  ->  178.064
 78fma0120  fma   -91.6   5.29  0.153  ->  -484.411
 79
 80-- cases where result is different from separate multiply + add; each
 81-- is preceded by the result of unfused multiply and add
 82-- [this is about 20% of all similar  cases in general]
 83--               888565290   1557.96930  -86087.7578  -> 1.38435735E+12
 84fma0201  fma     888565290   1557.96930  -86087.7578  -> 1.38435736E+12  Inexact Rounded
 85--             -85519342.9    735155419     42010431  -> -6.28700084E+16
 86fma0205  fma   -85519342.9    735155419     42010431  -> -6.28700083E+16 Inexact Rounded
 87--                -98025.5  -294603.472   10414348.2  -> 2.88890669E+10
 88fma0208  fma      -98025.5  -294603.472   10414348.2  -> 2.88890670E+10  Inexact Rounded
 89--              5967627.39   83526540.6   498494.810  -> 4.98455271E+14
 90fma0211  fma    5967627.39   83526540.6   498494.810  -> 4.98455272E+14  Inexact Rounded
 91--               3456.9433    874.39518   197866.615  ->  3220601.18
 92fma0216  fma     3456.9433    874.39518   197866.615  ->  3220601.17     Inexact Rounded
 93--              62769.8287   2096.98927    48.420317  ->  131627705
 94fma0218  fma    62769.8287   2096.98927    48.420317  ->  131627706      Inexact Rounded
 95--               -68.81500   59961113.9     -8988862  -> -4.13521291E+9
 96fma0219  fma     -68.81500   59961113.9     -8988862  -> -4.13521292E+9  Inexact Rounded
 97--              2126341.02   63491.5152    302427455  -> 1.35307040E+11
 98fma0226  fma    2126341.02   63491.5152    302427455  -> 1.35307041E+11  Inexact Rounded
 99
100
101-- Infinite combinations
102fmax0800 fma  Inf   Inf   Inf    ->  Infinity
103fmax0801 fma  Inf   Inf  -Inf    ->  NaN Invalid_operation
104fmax0802 fma  Inf  -Inf   Inf    ->  NaN Invalid_operation
105fmax0803 fma  Inf  -Inf  -Inf    -> -Infinity
106fmax0804 fma -Inf   Inf   Inf    ->  NaN Invalid_operation
107fmax0805 fma -Inf   Inf  -Inf    -> -Infinity
108fmax0806 fma -Inf  -Inf   Inf    ->  Infinity
109fmax0807 fma -Inf  -Inf  -Inf    ->  NaN Invalid_operation
110fmax0808 fma -Inf   0       1    ->  NaN Invalid_operation
111fmax0809 fma -Inf   0     NaN    ->  NaN Invalid_operation
112
113-- Triple NaN propagation
114fmax0900 fma  NaN2  NaN3  NaN5   ->  NaN2
115fmax0901 fma  0     NaN3  NaN5   ->  NaN3
116fmax0902 fma  0     0     NaN5   ->  NaN5
117-- first sNaN wins (consider qNaN from earlier sNaN being
118-- overridden by an sNaN in third operand)
119fmax0903 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation
120fmax0904 fma  0     sNaN2 sNaN3  ->  NaN2 Invalid_operation
121fmax0905 fma  0     0     sNaN3  ->  NaN3 Invalid_operation
122fmax0906 fma  sNaN1 sNaN2 sNaN3  ->  NaN1 Invalid_operation
123fmax0907 fma  NaN7  sNaN2 sNaN3  ->  NaN2 Invalid_operation
124fmax0908 fma  NaN7  NaN5  sNaN3  ->  NaN3 Invalid_operation
125
126-- MULTIPLICATION TESTS ------------------------------------------------
127-- sanity checks (as base, above)
128fmax2000 fma 2      2  0E+999999  -> 4
129fmax2001 fma 2      3  0E+999999  -> 6
130fmax2002 fma 5      1  0E+999999  -> 5
131fmax2003 fma 5      2  0E+999999  -> 10
132fmax2004 fma 1.20   2  0E+999999  -> 2.40
133fmax2005 fma 1.20   0  0E+999999  -> 0.00
134fmax2006 fma 1.20  -2  0E+999999  -> -2.40
135fmax2007 fma -1.20  2  0E+999999  -> -2.40
136fmax2008 fma -1.20  0  0E+999999  -> 0.00
137fmax2009 fma -1.20 -2  0E+999999  -> 2.40
138fmax2010 fma 5.09 7.1  0E+999999  -> 36.139
139fmax2011 fma 2.5    4  0E+999999  -> 10.0
140fmax2012 fma 2.50   4  0E+999999  -> 10.00
141fmax2013 fma 1.23456789 1.00000000  0E+999999  -> 1.23456789 Rounded
142fmax2014 fma 9.999999999 9.999999999  0E+999999  -> 100.000000 Inexact Rounded
143fmax2015 fma 2.50   4  0E+999999  -> 10.00
144precision: 6
145fmax2016 fma 2.50   4  0E+999999  -> 10.00
146fmax2017 fma  9.999999  9.999999  0E+999999  ->  100.000 Inexact Rounded
147fmax2018 fma  9.999999 -9.999999  0E+999999  -> -100.000 Inexact Rounded
148fmax2019 fma -9.999999  9.999999  0E+999999  -> -100.000 Inexact Rounded
149fmax2020 fma -9.999999 -9.999999  0E+999999  ->  100.000 Inexact Rounded
150
151-- 1999.12.21: next one is a edge case if intermediate longs are used
152precision: 15
153fmax2059 fma 999999999999 9765625  0E+999999  -> 9.76562499999023E+18 Inexact Rounded
154precision: 30
155fmax2160 fma 999999999999 9765625  0E+999999  -> 9765624999990234375
156precision: 9
157-----
158
159-- zeros, etc.
160fmax2021 fma  0      0      0E+999999  ->  0
161fmax2022 fma  0     -0      0E+999999  ->  0
162fmax2023 fma -0      0      0E+999999  ->  0
163fmax2024 fma -0     -0      0E+999999  ->  0
164fmax2025 fma -0.0   -0.0    0E+999999  ->  0.00
165fmax2026 fma -0.0   -0.0    0E+999999  ->  0.00
166fmax2027 fma -0.0   -0.0    0E+999999  ->  0.00
167fmax2028 fma -0.0   -0.0    0E+999999  ->  0.00
168fmax2030 fma  5.00   1E-3   0E+999999  ->  0.00500
169fmax2031 fma  00.00  0.000  0E+999999  ->  0.00000
170fmax2032 fma  00.00  0E-3   0E+999999  ->  0.00000     -- rhs is 0
171fmax2033 fma  0E-3   00.00  0E+999999  ->  0.00000     -- lhs is 0
172fmax2034 fma -5.00   1E-3   0E+999999  -> -0.00500
173fmax2035 fma -00.00  0.000  0E+999999  ->  0.00000
174fmax2036 fma -00.00  0E-3   0E+999999  ->  0.00000     -- rhs is 0
175fmax2037 fma -0E-3   00.00  0E+999999  ->  0.00000     -- lhs is 0
176fmax2038 fma  5.00  -1E-3   0E+999999  -> -0.00500
177fmax2039 fma  00.00 -0.000  0E+999999  ->  0.00000
178fmax2040 fma  00.00 -0E-3   0E+999999  ->  0.00000     -- rhs is 0
179fmax2041 fma  0E-3  -00.00  0E+999999  ->  0.00000     -- lhs is 0
180fmax2042 fma -5.00  -1E-3   0E+999999  ->  0.00500
181fmax2043 fma -00.00 -0.000  0E+999999  ->  0.00000
182fmax2044 fma -00.00 -0E-3   0E+999999  ->  0.00000     -- rhs is 0
183fmax2045 fma -0E-3  -00.00  0E+999999  ->  0.00000     -- lhs is 0
184
185-- examples from decarith multiply
186fmax2050 fma 1.20 3         0E+999999  -> 3.60
187fmax2051 fma 7    3         0E+999999  -> 21
188fmax2052 fma 0.9  0.8       0E+999999  -> 0.72
189fmax2053 fma 0.9  -0        0E+999999  -> 0.0
190fmax2054 fma 654321 654321  0E+999999  -> 4.28135971E+11  Inexact Rounded
191
192fmax2060 fma 123.45 1e7   0E+999999  ->  1.2345E+9
193fmax2061 fma 123.45 1e8   0E+999999  ->  1.2345E+10
194fmax2062 fma 123.45 1e+9  0E+999999  ->  1.2345E+11
195fmax2063 fma 123.45 1e10  0E+999999  ->  1.2345E+12
196fmax2064 fma 123.45 1e11  0E+999999  ->  1.2345E+13
197fmax2065 fma 123.45 1e12  0E+999999  ->  1.2345E+14
198fmax2066 fma 123.45 1e13  0E+999999  ->  1.2345E+15
199
200
201-- test some intermediate lengths
202precision: 9
203fmax2080 fma 0.1 123456789           0E+999999  -> 12345678.9
204fmax2081 fma 0.1 1234567891          0E+999999  -> 123456789 Inexact Rounded
205fmax2082 fma 0.1 12345678912         0E+999999  -> 1.23456789E+9 Inexact Rounded
206fmax2083 fma 0.1 12345678912345      0E+999999  -> 1.23456789E+12 Inexact Rounded
207fmax2084 fma 0.1 123456789           0E+999999  -> 12345678.9
208precision: 8
209fmax2085 fma 0.1 12345678912         0E+999999  -> 1.2345679E+9 Inexact Rounded
210fmax2086 fma 0.1 12345678912345      0E+999999  -> 1.2345679E+12 Inexact Rounded
211precision: 7
212fmax2087 fma 0.1 12345678912         0E+999999  -> 1.234568E+9 Inexact Rounded
213fmax2088 fma 0.1 12345678912345      0E+999999  -> 1.234568E+12 Inexact Rounded
214
215precision: 9
216fmax2090 fma 123456789          0.1  0E+999999  -> 12345678.9
217fmax2091 fma 1234567891         0.1  0E+999999  -> 123456789 Inexact Rounded
218fmax2092 fma 12345678912        0.1  0E+999999  -> 1.23456789E+9 Inexact Rounded
219fmax2093 fma 12345678912345     0.1  0E+999999  -> 1.23456789E+12 Inexact Rounded
220fmax2094 fma 123456789          0.1  0E+999999  -> 12345678.9
221precision: 8
222fmax2095 fma 12345678912        0.1  0E+999999  -> 1.2345679E+9 Inexact Rounded
223fmax2096 fma 12345678912345     0.1  0E+999999  -> 1.2345679E+12 Inexact Rounded
224precision: 7
225fmax2097 fma 12345678912        0.1  0E+999999  -> 1.234568E+9 Inexact Rounded
226fmax2098 fma 12345678912345     0.1  0E+999999  -> 1.234568E+12 Inexact Rounded
227
228-- test some more edge cases and carries
229maxexponent: 9999
230minexponent: -9999
231precision: 33
232fmax2101 fma 9 9    0E+999999  -> 81
233fmax2102 fma 9 90    0E+999999  -> 810
234fmax2103 fma 9 900    0E+999999  -> 8100
235fmax2104 fma 9 9000    0E+999999  -> 81000
236fmax2105 fma 9 90000    0E+999999  -> 810000
237fmax2106 fma 9 900000    0E+999999  -> 8100000
238fmax2107 fma 9 9000000    0E+999999  -> 81000000
239fmax2108 fma 9 90000000    0E+999999  -> 810000000
240fmax2109 fma 9 900000000    0E+999999  -> 8100000000
241fmax2110 fma 9 9000000000    0E+999999  -> 81000000000
242fmax2111 fma 9 90000000000    0E+999999  -> 810000000000
243fmax2112 fma 9 900000000000    0E+999999  -> 8100000000000
244fmax2113 fma 9 9000000000000    0E+999999  -> 81000000000000
245fmax2114 fma 9 90000000000000    0E+999999  -> 810000000000000
246fmax2115 fma 9 900000000000000    0E+999999  -> 8100000000000000
247fmax2116 fma 9 9000000000000000    0E+999999  -> 81000000000000000
248fmax2117 fma 9 90000000000000000    0E+999999  -> 810000000000000000
249fmax2118 fma 9 900000000000000000    0E+999999  -> 8100000000000000000
250fmax2119 fma 9 9000000000000000000    0E+999999  -> 81000000000000000000
251fmax2120 fma 9 90000000000000000000    0E+999999  -> 810000000000000000000
252fmax2121 fma 9 900000000000000000000    0E+999999  -> 8100000000000000000000
253fmax2122 fma 9 9000000000000000000000    0E+999999  -> 81000000000000000000000
254fmax2123 fma 9 90000000000000000000000    0E+999999  -> 810000000000000000000000
255-- test some more edge cases without carries
256fmax2131 fma 3 3    0E+999999  -> 9
257fmax2132 fma 3 30    0E+999999  -> 90
258fmax2133 fma 3 300    0E+999999  -> 900
259fmax2134 fma 3 3000    0E+999999  -> 9000
260fmax2135 fma 3 30000    0E+999999  -> 90000
261fmax2136 fma 3 300000    0E+999999  -> 900000
262fmax2137 fma 3 3000000    0E+999999  -> 9000000
263fmax2138 fma 3 30000000    0E+999999  -> 90000000
264fmax2139 fma 3 300000000    0E+999999  -> 900000000
265fmax2140 fma 3 3000000000    0E+999999  -> 9000000000
266fmax2141 fma 3 30000000000    0E+999999  -> 90000000000
267fmax2142 fma 3 300000000000    0E+999999  -> 900000000000
268fmax2143 fma 3 3000000000000    0E+999999  -> 9000000000000
269fmax2144 fma 3 30000000000000    0E+999999  -> 90000000000000
270fmax2145 fma 3 300000000000000    0E+999999  -> 900000000000000
271fmax2146 fma 3 3000000000000000    0E+999999  -> 9000000000000000
272fmax2147 fma 3 30000000000000000    0E+999999  -> 90000000000000000
273fmax2148 fma 3 300000000000000000    0E+999999  -> 900000000000000000
274fmax2149 fma 3 3000000000000000000    0E+999999  -> 9000000000000000000
275fmax2150 fma 3 30000000000000000000    0E+999999  -> 90000000000000000000
276fmax2151 fma 3 300000000000000000000    0E+999999  -> 900000000000000000000
277fmax2152 fma 3 3000000000000000000000    0E+999999  -> 9000000000000000000000
278fmax2153 fma 3 30000000000000000000000    0E+999999  -> 90000000000000000000000
279
280maxexponent: 999999
281minexponent: -999999
282precision: 9
283-- test some cases that are close to exponent overflow/underflow
284fmax2170 fma 1 9e999999     0E+999999  -> 9E+999999
285fmax2171 fma 1 9.9e999999   0E+999999  -> 9.9E+999999
286fmax2172 fma 1 9.99e999999  0E+999999  -> 9.99E+999999
287fmax2173 fma 9e999999    1  0E+999999  -> 9E+999999
288fmax2174 fma 9.9e999999  1  0E+999999  -> 9.9E+999999
289fmax2176 fma 9.99e999999 1  0E+999999  -> 9.99E+999999
290fmax2177 fma 1 9.99999e999999  0E+999999  -> 9.99999E+999999
291fmax2178 fma 9.99999e999999 1  0E+999999  -> 9.99999E+999999
292
293fmax2180 fma 0.1 9e-999998    0E+999999  -> 9E-999999
294fmax2181 fma 0.1 99e-999998   0E+999999  -> 9.9E-999998
295fmax2182 fma 0.1 999e-999998  0E+999999  -> 9.99E-999997
296
297fmax2183 fma 0.1 9e-999998      0E+999999  -> 9E-999999
298fmax2184 fma 0.1 99e-999998     0E+999999  -> 9.9E-999998
299fmax2185 fma 0.1 999e-999998    0E+999999  -> 9.99E-999997
300fmax2186 fma 0.1 999e-999997    0E+999999  -> 9.99E-999996
301fmax2187 fma 0.1 9999e-999997   0E+999999  -> 9.999E-999995
302fmax2188 fma 0.1 99999e-999997  0E+999999  -> 9.9999E-999994
303
304fmax2190 fma 1 9e-999998    0E+999999  -> 9E-999998
305fmax2191 fma 1 99e-999998   0E+999999  -> 9.9E-999997
306fmax2192 fma 1 999e-999998  0E+999999  -> 9.99E-999996
307fmax2193 fma 9e-999998   1  0E+999999  -> 9E-999998
308fmax2194 fma 99e-999998  1  0E+999999  -> 9.9E-999997
309fmax2195 fma 999e-999998 1  0E+999999  -> 9.99E-999996
310
311-- long operand triangle
312precision: 33
313fmax2246 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369671916511992830 Inexact Rounded
314precision: 32
315fmax2247 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967191651199283  Inexact Rounded
316precision: 31
317fmax2248 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933696719165119928   Inexact Rounded
318precision: 30
319fmax2249 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369671916511993    Inexact Rounded
320precision: 29
321fmax2250 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967191651199     Inexact Rounded
322precision: 28
323fmax2251 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933696719165120      Inexact Rounded
324precision: 27
325fmax2252 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369671916512       Inexact Rounded
326precision: 26
327fmax2253 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967191651        Inexact Rounded
328precision: 25
329fmax2254 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933696719165         Inexact Rounded
330precision: 24
331fmax2255 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369671917          Inexact Rounded
332precision: 23
333fmax2256 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967192           Inexact Rounded
334precision: 22
335fmax2257 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933696719            Inexact Rounded
336precision: 21
337fmax2258 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193369672             Inexact Rounded
338precision: 20
339fmax2259 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119336967              Inexact Rounded
340precision: 19
341fmax2260 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011933697               Inexact Rounded
342precision: 18
343fmax2261 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193370                Inexact Rounded
344precision: 17
345fmax2262 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119337                 Inexact Rounded
346precision: 16
347fmax2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908011934                  Inexact Rounded
348precision: 15
349fmax2264 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801193                   Inexact Rounded
350precision: 14
351fmax2265 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080119                    Inexact Rounded
352precision: 13
353fmax2266 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908012                     Inexact Rounded
354precision: 12
355fmax2267 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.290801                      Inexact Rounded
356precision: 11
357fmax2268 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29080                       Inexact Rounded
358precision: 10
359fmax2269 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.2908                        Inexact Rounded
360precision:  9
361fmax2270 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.291                         Inexact Rounded
362precision:  8
363fmax2271 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.29                          Inexact Rounded
364precision:  7
365fmax2272 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433.3                           Inexact Rounded
366precision:  6
367fmax2273 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 145433                            Inexact Rounded
368precision:  5
369fmax2274 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1.4543E+5                         Inexact Rounded
370precision:  4
371fmax2275 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1.454E+5                         Inexact Rounded
372precision:  3
373fmax2276 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1.45E+5                         Inexact Rounded
374precision:  2
375fmax2277 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1.5E+5                         Inexact Rounded
376precision:  1
377fmax2278 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543  0E+999999  -> 1E+5                          Inexact Rounded
378
379-- test some edge cases with exact rounding
380maxexponent: 9999
381minexponent: -9999
382precision: 9
383fmax2301 fma 9 9    0E+999999  -> 81
384fmax2302 fma 9 90    0E+999999  -> 810
385fmax2303 fma 9 900    0E+999999  -> 8100
386fmax2304 fma 9 9000    0E+999999  -> 81000
387fmax2305 fma 9 90000    0E+999999  -> 810000
388fmax2306 fma 9 900000    0E+999999  -> 8100000
389fmax2307 fma 9 9000000    0E+999999  -> 81000000
390fmax2308 fma 9 90000000    0E+999999  -> 810000000
391fmax2309 fma 9 900000000    0E+999999  -> 8.10000000E+9   Rounded
392fmax2310 fma 9 9000000000    0E+999999  -> 8.10000000E+10  Rounded
393fmax2311 fma 9 90000000000    0E+999999  -> 8.10000000E+11  Rounded
394fmax2312 fma 9 900000000000    0E+999999  -> 8.10000000E+12  Rounded
395fmax2313 fma 9 9000000000000    0E+999999  -> 8.10000000E+13  Rounded
396fmax2314 fma 9 90000000000000    0E+999999  -> 8.10000000E+14  Rounded
397fmax2315 fma 9 900000000000000    0E+999999  -> 8.10000000E+15  Rounded
398fmax2316 fma 9 9000000000000000    0E+999999  -> 8.10000000E+16  Rounded
399fmax2317 fma 9 90000000000000000    0E+999999  -> 8.10000000E+17  Rounded
400fmax2318 fma 9 900000000000000000    0E+999999  -> 8.10000000E+18  Rounded
401fmax2319 fma 9 9000000000000000000    0E+999999  -> 8.10000000E+19  Rounded
402fmax2320 fma 9 90000000000000000000    0E+999999  -> 8.10000000E+20  Rounded
403fmax2321 fma 9 900000000000000000000    0E+999999  -> 8.10000000E+21  Rounded
404fmax2322 fma 9 9000000000000000000000    0E+999999  -> 8.10000000E+22  Rounded
405fmax2323 fma 9 90000000000000000000000    0E+999999  -> 8.10000000E+23  Rounded
406
407-- fastpath breakers
408precision:   29
409fmax2330 fma 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603  0E+999999  -> 1.6487212707001281468486507878 Inexact Rounded
410precision:   55
411fmax2331 fma 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428  0E+999999  -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded
412
413
414-- tryzeros cases
415precision:   7
416rounding:    half_up
417maxExponent: 92
418minexponent: -92
419fmax2504  fma  0E-60 1000E-60   0E+999999  -> 0E-98 Clamped
420fmax2505  fma  100E+60 0E+60    0E+999999  -> 0E+92 Clamped
421
422-- mixed with zeros
423maxexponent: 999999
424minexponent: -999999
425precision: 9
426fmax2541 fma  0    -1      0E+999999  ->  0
427fmax2542 fma -0    -1      0E+999999  ->  0
428fmax2543 fma  0     1      0E+999999  ->  0
429fmax2544 fma -0     1      0E+999999  ->  0
430fmax2545 fma -1     0      0E+999999  ->  0
431fmax2546 fma -1    -0      0E+999999  ->  0
432fmax2547 fma  1     0      0E+999999  ->  0
433fmax2548 fma  1    -0      0E+999999  ->  0
434
435fmax2551 fma  0.0  -1      0E+999999  ->  0.0
436fmax2552 fma -0.0  -1      0E+999999  ->  0.0
437fmax2553 fma  0.0   1      0E+999999  ->  0.0
438fmax2554 fma -0.0   1      0E+999999  ->  0.0
439fmax2555 fma -1.0   0      0E+999999  ->  0.0
440fmax2556 fma -1.0  -0      0E+999999  ->  0.0
441fmax2557 fma  1.0   0      0E+999999  ->  0.0
442fmax2558 fma  1.0  -0      0E+999999  ->  0.0
443
444fmax2561 fma  0    -1.0    0E+999999  ->  0.0
445fmax2562 fma -0    -1.0    0E+999999  ->  0.0
446fmax2563 fma  0     1.0    0E+999999  ->  0.0
447fmax2564 fma -0     1.0    0E+999999  ->  0.0
448fmax2565 fma -1     0.0    0E+999999  ->  0.0
449fmax2566 fma -1    -0.0    0E+999999  ->  0.0
450fmax2567 fma  1     0.0    0E+999999  ->  0.0
451fmax2568 fma  1    -0.0    0E+999999  ->  0.0
452
453fmax2571 fma  0.0  -1.0    0E+999999  ->  0.00
454fmax2572 fma -0.0  -1.0    0E+999999  ->  0.00
455fmax2573 fma  0.0   1.0    0E+999999  ->  0.00
456fmax2574 fma -0.0   1.0    0E+999999  ->  0.00
457fmax2575 fma -1.0   0.0    0E+999999  ->  0.00
458fmax2576 fma -1.0  -0.0    0E+999999  ->  0.00
459fmax2577 fma  1.0   0.0    0E+999999  ->  0.00
460fmax2578 fma  1.0  -0.0    0E+999999  ->  0.00
461
462
463-- Specials
464fmax2580 fma  Inf  -Inf    0E+999999  -> -Infinity
465fmax2581 fma  Inf  -1000   0E+999999  -> -Infinity
466fmax2582 fma  Inf  -1      0E+999999  -> -Infinity
467fmax2583 fma  Inf  -0      0E+999999  ->  NaN  Invalid_operation
468fmax2584 fma  Inf   0      0E+999999  ->  NaN  Invalid_operation
469fmax2585 fma  Inf   1      0E+999999  ->  Infinity
470fmax2586 fma  Inf   1000   0E+999999  ->  Infinity
471fmax2587 fma  Inf   Inf    0E+999999  ->  Infinity
472fmax2588 fma -1000  Inf    0E+999999  -> -Infinity
473fmax2589 fma -Inf   Inf    0E+999999  -> -Infinity
474fmax2590 fma -1     Inf    0E+999999  -> -Infinity
475fmax2591 fma -0     Inf    0E+999999  ->  NaN  Invalid_operation
476fmax2592 fma  0     Inf    0E+999999  ->  NaN  Invalid_operation
477fmax2593 fma  1     Inf    0E+999999  ->  Infinity
478fmax2594 fma  1000  Inf    0E+999999  ->  Infinity
479fmax2595 fma  Inf   Inf    0E+999999  ->  Infinity
480
481fmax2600 fma -Inf  -Inf    0E+999999  ->  Infinity
482fmax2601 fma -Inf  -1000   0E+999999  ->  Infinity
483fmax2602 fma -Inf  -1      0E+999999  ->  Infinity
484fmax2603 fma -Inf  -0      0E+999999  ->  NaN  Invalid_operation
485fmax2604 fma -Inf   0      0E+999999  ->  NaN  Invalid_operation
486fmax2605 fma -Inf   1      0E+999999  -> -Infinity
487fmax2606 fma -Inf   1000   0E+999999  -> -Infinity
488fmax2607 fma -Inf   Inf    0E+999999  -> -Infinity
489fmax2608 fma -1000  Inf    0E+999999  -> -Infinity
490fmax2609 fma -Inf  -Inf    0E+999999  ->  Infinity
491fmax2610 fma -1    -Inf    0E+999999  ->  Infinity
492fmax2611 fma -0    -Inf    0E+999999  ->  NaN  Invalid_operation
493fmax2612 fma  0    -Inf    0E+999999  ->  NaN  Invalid_operation
494fmax2613 fma  1    -Inf    0E+999999  -> -Infinity
495fmax2614 fma  1000 -Inf    0E+999999  -> -Infinity
496fmax2615 fma  Inf  -Inf    0E+999999  -> -Infinity
497
498fmax2621 fma  NaN -Inf     0E+999999  ->  NaN
499fmax2622 fma  NaN -1000    0E+999999  ->  NaN
500fmax2623 fma  NaN -1       0E+999999  ->  NaN
501fmax2624 fma  NaN -0       0E+999999  ->  NaN
502fmax2625 fma  NaN  0       0E+999999  ->  NaN
503fmax2626 fma  NaN  1       0E+999999  ->  NaN
504fmax2627 fma  NaN  1000    0E+999999  ->  NaN
505fmax2628 fma  NaN  Inf     0E+999999  ->  NaN
506fmax2629 fma  NaN  NaN     0E+999999  ->  NaN
507fmax2630 fma -Inf  NaN     0E+999999  ->  NaN
508fmax2631 fma -1000 NaN     0E+999999  ->  NaN
509fmax2632 fma -1    NaN     0E+999999  ->  NaN
510fmax2633 fma -0    NaN     0E+999999  ->  NaN
511fmax2634 fma  0    NaN     0E+999999  ->  NaN
512fmax2635 fma  1    NaN     0E+999999  ->  NaN
513fmax2636 fma  1000 NaN     0E+999999  ->  NaN
514fmax2637 fma  Inf  NaN     0E+999999  ->  NaN
515
516fmax2641 fma  sNaN -Inf    0E+999999  ->  NaN  Invalid_operation
517fmax2642 fma  sNaN -1000   0E+999999  ->  NaN  Invalid_operation
518fmax2643 fma  sNaN -1      0E+999999  ->  NaN  Invalid_operation
519fmax2644 fma  sNaN -0      0E+999999  ->  NaN  Invalid_operation
520fmax2645 fma  sNaN  0      0E+999999  ->  NaN  Invalid_operation
521fmax2646 fma  sNaN  1      0E+999999  ->  NaN  Invalid_operation
522fmax2647 fma  sNaN  1000   0E+999999  ->  NaN  Invalid_operation
523fmax2648 fma  sNaN  NaN    0E+999999  ->  NaN  Invalid_operation
524fmax2649 fma  sNaN sNaN    0E+999999  ->  NaN  Invalid_operation
525fmax2650 fma  NaN  sNaN    0E+999999  ->  NaN  Invalid_operation
526fmax2651 fma -Inf  sNaN    0E+999999  ->  NaN  Invalid_operation
527fmax2652 fma -1000 sNaN    0E+999999  ->  NaN  Invalid_operation
528fmax2653 fma -1    sNaN    0E+999999  ->  NaN  Invalid_operation
529fmax2654 fma -0    sNaN    0E+999999  ->  NaN  Invalid_operation
530fmax2655 fma  0    sNaN    0E+999999  ->  NaN  Invalid_operation
531fmax2656 fma  1    sNaN    0E+999999  ->  NaN  Invalid_operation
532fmax2657 fma  1000 sNaN    0E+999999  ->  NaN  Invalid_operation
533fmax2658 fma  Inf  sNaN    0E+999999  ->  NaN  Invalid_operation
534fmax2659 fma  NaN  sNaN    0E+999999  ->  NaN  Invalid_operation
535
536-- propagating NaNs
537fmax2661 fma  NaN9 -Inf    0E+999999  ->  NaN9
538fmax2662 fma  NaN8  999    0E+999999  ->  NaN8
539fmax2663 fma  NaN71 Inf    0E+999999  ->  NaN71
540fmax2664 fma  NaN6  NaN5   0E+999999  ->  NaN6
541fmax2665 fma -Inf   NaN4   0E+999999  ->  NaN4
542fmax2666 fma -999   NaN33  0E+999999  ->  NaN33
543fmax2667 fma  Inf   NaN2   0E+999999  ->  NaN2
544
545fmax2671 fma  sNaN99 -Inf     0E+999999  ->  NaN99 Invalid_operation
546fmax2672 fma  sNaN98 -11      0E+999999  ->  NaN98 Invalid_operation
547fmax2673 fma  sNaN97  NaN     0E+999999  ->  NaN97 Invalid_operation
548fmax2674 fma  sNaN16 sNaN94   0E+999999  ->  NaN16 Invalid_operation
549fmax2675 fma  NaN95  sNaN93   0E+999999  ->  NaN93 Invalid_operation
550fmax2676 fma -Inf    sNaN92   0E+999999  ->  NaN92 Invalid_operation
551fmax2677 fma  088    sNaN91   0E+999999  ->  NaN91 Invalid_operation
552fmax2678 fma  Inf    sNaN90   0E+999999  ->  NaN90 Invalid_operation
553fmax2679 fma  NaN    sNaN89   0E+999999  ->  NaN89 Invalid_operation
554
555fmax2681 fma -NaN9 -Inf    0E+999999  -> -NaN9
556fmax2682 fma -NaN8  999    0E+999999  -> -NaN8
557fmax2683 fma -NaN71 Inf    0E+999999  -> -NaN71
558fmax2684 fma -NaN6 -NaN5   0E+999999  -> -NaN6
559fmax2685 fma -Inf  -NaN4   0E+999999  -> -NaN4
560fmax2686 fma -999  -NaN33  0E+999999  -> -NaN33
561fmax2687 fma  Inf  -NaN2   0E+999999  -> -NaN2
562
563fmax2691 fma -sNaN99 -Inf     0E+999999  -> -NaN99 Invalid_operation
564fmax2692 fma -sNaN98 -11      0E+999999  -> -NaN98 Invalid_operation
565fmax2693 fma -sNaN97  NaN     0E+999999  -> -NaN97 Invalid_operation
566fmax2694 fma -sNaN16 -sNaN94  0E+999999  -> -NaN16 Invalid_operation
567fmax2695 fma -NaN95  -sNaN93  0E+999999  -> -NaN93 Invalid_operation
568fmax2696 fma -Inf    -sNaN92  0E+999999  -> -NaN92 Invalid_operation
569fmax2697 fma  088    -sNaN91  0E+999999  -> -NaN91 Invalid_operation
570fmax2698 fma  Inf    -sNaN90  0E+999999  -> -NaN90 Invalid_operation
571fmax2699 fma -NaN    -sNaN89  0E+999999  -> -NaN89 Invalid_operation
572
573fmax2701 fma -NaN  -Inf    0E+999999  -> -NaN
574fmax2702 fma -NaN   999    0E+999999  -> -NaN
575fmax2703 fma -NaN   Inf    0E+999999  -> -NaN
576fmax2704 fma -NaN  -NaN    0E+999999  -> -NaN
577fmax2705 fma -Inf  -NaN0   0E+999999  -> -NaN
578fmax2706 fma -999  -NaN    0E+999999  -> -NaN
579fmax2707 fma  Inf  -NaN    0E+999999  -> -NaN
580
581fmax2711 fma -sNaN   -Inf     0E+999999  -> -NaN Invalid_operation
582fmax2712 fma -sNaN   -11      0E+999999  -> -NaN Invalid_operation
583fmax2713 fma -sNaN00  NaN     0E+999999  -> -NaN Invalid_operation
584fmax2714 fma -sNaN   -sNaN    0E+999999  -> -NaN Invalid_operation
585fmax2715 fma -NaN    -sNaN    0E+999999  -> -NaN Invalid_operation
586fmax2716 fma -Inf    -sNaN    0E+999999  -> -NaN Invalid_operation
587fmax2717 fma  088    -sNaN    0E+999999  -> -NaN Invalid_operation
588fmax2718 fma  Inf    -sNaN    0E+999999  -> -NaN Invalid_operation
589fmax2719 fma -NaN    -sNaN    0E+999999  -> -NaN Invalid_operation
590
591-- overflow and underflow tests .. note subnormal results
592maxexponent: 999999
593minexponent: -999999
594fmax2730 fma +1.23456789012345E-0 9E+999999  0E+999999  -> Infinity Inexact Overflow Rounded
595fmax2731 fma 9E+999999 +1.23456789012345E-0  0E+999999  -> Infinity Inexact Overflow Rounded
596fmax2732 fma +0.100 9E-999999  0E+999999  -> 9.00E-1000000 Subnormal
597fmax2733 fma 9E-999999 +0.100  0E+999999  -> 9.00E-1000000 Subnormal
598fmax2735 fma -1.23456789012345E-0 9E+999999  0E+999999  -> -Infinity Inexact Overflow Rounded
599fmax2736 fma 9E+999999 -1.23456789012345E-0  0E+999999  -> -Infinity Inexact Overflow Rounded
600fmax2737 fma -0.100 9E-999999  0E+999999  -> -9.00E-1000000 Subnormal
601fmax2738 fma 9E-999999 -0.100  0E+999999  -> -9.00E-1000000 Subnormal
602
603-- signs
604fmax2751 fma  1e+777777  1e+411111  0E+999999  ->  Infinity Overflow Inexact Rounded
605fmax2752 fma  1e+777777 -1e+411111  0E+999999  -> -Infinity Overflow Inexact Rounded
606fmax2753 fma -1e+777777  1e+411111  0E+999999  -> -Infinity Overflow Inexact Rounded
607fmax2754 fma -1e+777777 -1e+411111  0E+999999  ->  Infinity Overflow Inexact Rounded
608fmax2755 fma  1e-777777  1e-411111  0E+999999  ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
609fmax2756 fma  1e-777777 -1e-411111  0E+999999  -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
610fmax2757 fma -1e-777777  1e-411111  0E+999999  -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
611fmax2758 fma -1e-777777 -1e-411111  0E+999999  ->  0E-1000007 Underflow Subnormal Inexact Rounded Clamped
612
613-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
614precision: 9
615fmax2760 fma 1e-600000 1e-400001  0E+999999  -> 1E-1000001 Subnormal
616fmax2761 fma 1e-600000 1e-400002  0E+999999  -> 1E-1000002 Subnormal
617fmax2762 fma 1e-600000 1e-400003  0E+999999  -> 1E-1000003 Subnormal
618fmax2763 fma 1e-600000 1e-400004  0E+999999  -> 1E-1000004 Subnormal
619fmax2764 fma 1e-600000 1e-400005  0E+999999  -> 1E-1000005 Subnormal
620fmax2765 fma 1e-600000 1e-400006  0E+999999  -> 1E-1000006 Subnormal
621fmax2766 fma 1e-600000 1e-400007  0E+999999  -> 1E-1000007 Subnormal
622fmax2767 fma 1e-600000 1e-400008  0E+999999  -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
623fmax2768 fma 1e-600000 1e-400009  0E+999999  -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
624fmax2769 fma 1e-600000 1e-400010  0E+999999  -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
625-- [no equivalent of 'subnormal' for overflow]
626fmax2770 fma 1e+600000 1e+400001  0E+999999  -> Infinity Overflow Inexact Rounded
627fmax2771 fma 1e+600000 1e+400002  0E+999999  -> Infinity Overflow Inexact Rounded
628fmax2772 fma 1e+600000 1e+400003  0E+999999  -> Infinity Overflow Inexact Rounded
629fmax2773 fma 1e+600000 1e+400004  0E+999999  -> Infinity Overflow Inexact Rounded
630fmax2774 fma 1e+600000 1e+400005  0E+999999  -> Infinity Overflow Inexact Rounded
631fmax2775 fma 1e+600000 1e+400006  0E+999999  -> Infinity Overflow Inexact Rounded
632fmax2776 fma 1e+600000 1e+400007  0E+999999  -> Infinity Overflow Inexact Rounded
633fmax2777 fma 1e+600000 1e+400008  0E+999999  -> Infinity Overflow Inexact Rounded
634fmax2778 fma 1e+600000 1e+400009  0E+999999  -> Infinity Overflow Inexact Rounded
635fmax2779 fma 1e+600000 1e+400010  0E+999999  -> Infinity Overflow Inexact Rounded
636
637-- 'subnormal' test edge condition at higher precisions
638precision: 99
639fmax2780 fma 1e-600000 1e-400007  0E+999999  -> 1E-1000007 Subnormal
640fmax2781 fma 1e-600000 1e-400008  0E+999999  -> 1E-1000008 Subnormal
641fmax2782 fma 1e-600000 1e-400097  0E+999999  -> 1E-1000097 Subnormal
642fmax2783 fma 1e-600000 1e-400098  0E+999999  -> 0E-1000097 Underflow Subnormal Inexact Rounded Clamped
643precision: 999
644fmax2784 fma 1e-600000 1e-400997  0E+999999  -> 1E-1000997 Subnormal
645fmax2785 fma 1e-600000 1e-400998  0E+999999  -> 0E-1000997 Underflow Subnormal Inexact Rounded Clamped
646
647-- test subnormals rounding
648precision:   5
649maxExponent: 999
650minexponent: -999
651rounding:    half_even
652
653fmax2801 fma  1.0000E-999  1      0E+999999  -> 1.0000E-999
654fmax2802 fma  1.000E-999   1e-1   0E+999999  -> 1.000E-1000 Subnormal
655fmax2803 fma  1.00E-999    1e-2   0E+999999  -> 1.00E-1001  Subnormal
656fmax2804 fma  1.0E-999     1e-3   0E+999999  -> 1.0E-1002   Subnormal
657fmax2805 fma  1.0E-999     1e-4   0E+999999  -> 1E-1003     Subnormal Rounded
658fmax2806 fma  1.3E-999     1e-4   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded
659fmax2807 fma  1.5E-999     1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded
660fmax2808 fma  1.7E-999     1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded
661fmax2809 fma  2.3E-999     1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded
662fmax2810 fma  2.5E-999     1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded
663fmax2811 fma  2.7E-999     1e-4   0E+999999  -> 3E-1003     Underflow Subnormal Inexact Rounded
664fmax2812 fma  1.49E-999    1e-4   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded
665fmax2813 fma  1.50E-999    1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded
666fmax2814 fma  1.51E-999    1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded
667fmax2815 fma  2.49E-999    1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded
668fmax2816 fma  2.50E-999    1e-4   0E+999999  -> 2E-1003     Underflow Subnormal Inexact Rounded
669fmax2817 fma  2.51E-999    1e-4   0E+999999  -> 3E-1003     Underflow Subnormal Inexact Rounded
670
671fmax2818 fma  1E-999       1e-4   0E+999999  -> 1E-1003     Subnormal
672fmax2819 fma  3E-999       1e-5   0E+999999  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
673fmax2820 fma  5E-999       1e-5   0E+999999  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
674fmax2821 fma  7E-999       1e-5   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded
675fmax2822 fma  9E-999       1e-5   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded
676fmax2823 fma  9.9E-999     1e-5   0E+999999  -> 1E-1003     Underflow Subnormal Inexact Rounded
677
678fmax2824 fma  1E-999      -1e-4   0E+999999  -> -1E-1003    Subnormal
679fmax2825 fma  3E-999      -1e-5   0E+999999  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped
680fmax2826 fma -5E-999       1e-5   0E+999999  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped
681fmax2827 fma  7E-999      -1e-5   0E+999999  -> -1E-1003    Underflow Subnormal Inexact Rounded
682fmax2828 fma -9E-999       1e-5   0E+999999  -> -1E-1003    Underflow Subnormal Inexact Rounded
683fmax2829 fma  9.9E-999    -1e-5   0E+999999  -> -1E-1003    Underflow Subnormal Inexact Rounded
684fmax2830 fma  3.0E-999    -1e-5   0E+999999  -> -0E-1003    Underflow Subnormal Inexact Rounded Clamped
685
686fmax2831 fma  1.0E-501     1e-501  0E+999999  -> 1.0E-1002   Subnormal
687fmax2832 fma  2.0E-501     2e-501  0E+999999  -> 4.0E-1002   Subnormal
688fmax2833 fma  4.0E-501     4e-501  0E+999999  -> 1.60E-1001  Subnormal
689fmax2834 fma 10.0E-501    10e-501  0E+999999  -> 1.000E-1000 Subnormal
690fmax2835 fma 30.0E-501    30e-501  0E+999999  -> 9.000E-1000 Subnormal
691fmax2836 fma 40.0E-501    40e-501  0E+999999  -> 1.6000E-999
692
693-- squares
694fmax2840 fma  1E-502       1e-502  0E+999999  -> 0E-1003     Underflow Subnormal Inexact Rounded Clamped
695fmax2841 fma  1E-501       1e-501  0E+999999  -> 1E-1002     Subnormal
696fmax2842 fma  2E-501       2e-501  0E+999999  -> 4E-1002     Subnormal
697fmax2843 fma  4E-501       4e-501  0E+999999  -> 1.6E-1001   Subnormal
698fmax2844 fma 10E-501      10e-501  0E+999999  -> 1.00E-1000  Subnormal
699fmax2845 fma 30E-501      30e-501  0E+999999  -> 9.00E-1000  Subnormal
700fmax2846 fma 40E-501      40e-501  0E+999999  -> 1.600E-999
701
702-- cubes
703fmax2850 fma  1E-670     1e-335  0E+999999  -> 0E-1003    Underflow Subnormal Inexact Rounded Clamped
704fmax2851 fma  1E-668     1e-334  0E+999999  -> 1E-1002    Subnormal
705fmax2852 fma  4E-668     2e-334  0E+999999  -> 8E-1002    Subnormal
706fmax2853 fma  9E-668     3e-334  0E+999999  -> 2.7E-1001  Subnormal
707fmax2854 fma 16E-668     4e-334  0E+999999  -> 6.4E-1001  Subnormal
708fmax2855 fma 25E-668     5e-334  0E+999999  -> 1.25E-1000 Subnormal
709fmax2856 fma 10E-668   100e-334  0E+999999  -> 1.000E-999
710
711-- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent
712precision: 19
713fmax2860 fma  6636851557994578716E-520 6636851557994578716E-520  0E+999999  -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded
714
715-- Long operand overflow may be a different path
716precision: 3
717maxExponent: 999999
718minexponent: -999999
719fmax2870 fma 1  9.999E+999999    0E+999999  ->  Infinity Inexact Overflow Rounded
720fmax2871 fma 1 -9.999E+999999    0E+999999  -> -Infinity Inexact Overflow Rounded
721fmax2872 fma    9.999E+999999 1  0E+999999  ->  Infinity Inexact Overflow Rounded
722fmax2873 fma   -9.999E+999999 1  0E+999999  -> -Infinity Inexact Overflow Rounded
723
724-- check for double-rounded subnormals
725precision:   5
726maxexponent: 79
727minexponent: -79
728fmax2881 fma  1.2347E-40  1.2347E-40   0E+999999  ->  1.524E-80  Inexact Rounded Subnormal Underflow
729fmax2882 fma  1.234E-40  1.234E-40     0E+999999  ->  1.523E-80  Inexact Rounded Subnormal Underflow
730fmax2883 fma  1.23E-40   1.23E-40      0E+999999  ->  1.513E-80  Inexact Rounded Subnormal Underflow
731fmax2884 fma  1.2E-40    1.2E-40       0E+999999  ->  1.44E-80   Subnormal
732fmax2885 fma  1.2E-40    1.2E-41       0E+999999  ->  1.44E-81   Subnormal
733fmax2886 fma  1.2E-40    1.2E-42       0E+999999  ->  1.4E-82    Subnormal Inexact Rounded Underflow
734fmax2887 fma  1.2E-40    1.3E-42       0E+999999  ->  1.6E-82    Subnormal Inexact Rounded Underflow
735fmax2888 fma  1.3E-40    1.3E-42       0E+999999  ->  1.7E-82    Subnormal Inexact Rounded Underflow
736fmax2889 fma  1.3E-40    1.3E-43       0E+999999  ->    2E-83    Subnormal Inexact Rounded Underflow
737fmax2890 fma  1.3E-41    1.3E-43       0E+999999  ->    0E-83    Clamped Subnormal Inexact Rounded Underflow
738
739fmax2891 fma  1.2345E-39   1.234E-40   0E+999999  ->  1.5234E-79 Inexact Rounded
740fmax2892 fma  1.23456E-39  1.234E-40   0E+999999  ->  1.5234E-79 Inexact Rounded
741fmax2893 fma  1.2345E-40   1.234E-40   0E+999999  ->  1.523E-80  Inexact Rounded Subnormal Underflow
742fmax2894 fma  1.23456E-40  1.234E-40   0E+999999  ->  1.523E-80  Inexact Rounded Subnormal Underflow
743fmax2895 fma  1.2345E-41   1.234E-40   0E+999999  ->  1.52E-81   Inexact Rounded Subnormal Underflow
744fmax2896 fma  1.23456E-41  1.234E-40   0E+999999  ->  1.52E-81   Inexact Rounded Subnormal Underflow
745
746-- Now explore the case where we get a normal result with Underflow
747precision:   16
748rounding:    half_up
749maxExponent: 384
750minExponent: -383
751
752fmax2900 fma  0.3000000000E-191 0.3000000000E-191  0E+999999  -> 9.00000000000000E-384 Subnormal Rounded
753fmax2901 fma  0.3000000001E-191 0.3000000001E-191  0E+999999  -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
754fmax2902 fma  9.999999999999999E-383  0.0999999999999          0E+999999  -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
755fmax2903 fma  9.999999999999999E-383  0.09999999999999         0E+999999  -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
756fmax2904 fma  9.999999999999999E-383  0.099999999999999        0E+999999  -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
757fmax2905 fma  9.999999999999999E-383  0.0999999999999999       0E+999999  -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
758-- prove operands are exact
759fmax2906 fma  9.999999999999999E-383  1                        0E+999999  -> 9.999999999999999E-383
760fmax2907 fma                       1  0.09999999999999999      0E+999999  -> 0.09999999999999999
761-- the next rounds to Nmin
762fmax2908 fma  9.999999999999999E-383  0.09999999999999999      0E+999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
763fmax2909 fma  9.999999999999999E-383  0.099999999999999999     0E+999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
764fmax2910 fma  9.999999999999999E-383  0.0999999999999999999    0E+999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
765fmax2911 fma  9.999999999999999E-383  0.09999999999999999999   0E+999999  -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
766
767-- Examples from SQL proposal (Krishna Kulkarni)
768precision:   34
769rounding:    half_up
770maxExponent: 6144
771minExponent: -6143
772fmax2921  fma 130E-2  120E-2  0E+999999  -> 1.5600
773fmax2922  fma 130E-2  12E-1   0E+999999  -> 1.560
774fmax2923  fma 130E-2  1E0     0E+999999  -> 1.30
775
776-- Null tests
777fmax2990 fma  # 10  0E+999999  -> NaN Invalid_operation
778fmax2991 fma 10  #  0E+999999  -> NaN Invalid_operation
779
780-- ADDITION TESTS ------------------------------------------------------
781precision:   9
782rounding:    half_up
783maxExponent: 384
784minexponent: -383
785
786-- [first group are 'quick confidence check']
787fmax3001 fma  1   1       1       ->  2
788fmax3002 fma  1   2       3       ->  5
789fmax3003 fma  1   '5.75'  '3.3'   ->  9.05
790fmax3004 fma  1   '5'     '-3'    ->  2
791fmax3005 fma  1   '-5'    '-3'    ->  -8
792fmax3006 fma  1   '-7'    '2.5'   ->  -4.5
793fmax3007 fma  1   '0.7'   '0.3'   ->  1.0
794fmax3008 fma  1   '1.25'  '1.25'  ->  2.50
795fmax3009 fma  1   '1.23456789'  '1.00000000' -> '2.23456789'
796fmax3010 fma  1   '1.23456789'  '1.00000011' -> '2.23456800'
797
798fmax3011 fma  1   '0.4444444444'  '0.5555555555' -> '1.00000000' Inexact Rounded
799fmax3012 fma  1   '0.4444444440'  '0.5555555555' -> '1.00000000' Inexact Rounded
800fmax3013 fma  1   '0.4444444444'  '0.5555555550' -> '0.999999999' Inexact Rounded
801fmax3014 fma  1   '0.44444444449'    '0' -> '0.444444444' Inexact Rounded
802fmax3015 fma  1   '0.444444444499'   '0' -> '0.444444444' Inexact Rounded
803fmax3016 fma  1   '0.4444444444999'  '0' -> '0.444444444' Inexact Rounded
804fmax3017 fma  1   '0.4444444445000'  '0' -> '0.444444445' Inexact Rounded
805fmax3018 fma  1   '0.4444444445001'  '0' -> '0.444444445' Inexact Rounded
806fmax3019 fma  1   '0.444444444501'   '0' -> '0.444444445' Inexact Rounded
807fmax3020 fma  1   '0.44444444451'    '0' -> '0.444444445' Inexact Rounded
808
809fmax3021 fma  1   0 1 -> 1
810fmax3022 fma  1   1 1 -> 2
811fmax3023 fma  1   2 1 -> 3
812fmax3024 fma  1   3 1 -> 4
813fmax3025 fma  1   4 1 -> 5
814fmax3026 fma  1   5 1 -> 6
815fmax3027 fma  1   6 1 -> 7
816fmax3028 fma  1   7 1 -> 8
817fmax3029 fma  1   8 1 -> 9
818fmax3030 fma  1   9 1 -> 10
819
820-- some carrying effects
821fmax3031 fma  1   '0.9998'  '0.0000' -> '0.9998'
822fmax3032 fma  1   '0.9998'  '0.0001' -> '0.9999'
823fmax3033 fma  1   '0.9998'  '0.0002' -> '1.0000'
824fmax3034 fma  1   '0.9998'  '0.0003' -> '1.0001'
825
826fmax3035 fma  1   '70'  '10000e+9' -> '1.00000000E+13' Inexact Rounded
827fmax3036 fma  1   '700'  '10000e+9' -> '1.00000000E+13' Inexact Rounded
828fmax3037 fma  1   '7000'  '10000e+9' -> '1.00000000E+13' Inexact Rounded
829fmax3038 fma  1   '70000'  '10000e+9' -> '1.00000001E+13' Inexact Rounded
830fmax3039 fma  1   '700000'  '10000e+9' -> '1.00000007E+13' Rounded
831
832-- symmetry:
833fmax3040 fma  1   '10000e+9'  '70' -> '1.00000000E+13' Inexact Rounded
834fmax3041 fma  1   '10000e+9'  '700' -> '1.00000000E+13' Inexact Rounded
835fmax3042 fma  1   '10000e+9'  '7000' -> '1.00000000E+13' Inexact Rounded
836fmax3044 fma  1   '10000e+9'  '70000' -> '1.00000001E+13' Inexact Rounded
837fmax3045 fma  1   '10000e+9'  '700000' -> '1.00000007E+13' Rounded
838
839-- same, higher precision
840precision: 15
841fmax3046 fma  1   '10000e+9'  '7' -> '10000000000007'
842fmax3047 fma  1   '10000e+9'  '70' -> '10000000000070'
843fmax3048 fma  1   '10000e+9'  '700' -> '10000000000700'
844fmax3049 fma  1   '10000e+9'  '7000' -> '10000000007000'
845fmax3050 fma  1   '10000e+9'  '70000' -> '10000000070000'
846fmax3051 fma  1   '10000e+9'  '700000' -> '10000000700000'
847fmax3052 fma  1   '10000e+9'  '7000000' -> '10000007000000'
848
849-- examples from decarith
850fmax3053 fma  1   '12' '7.00' -> '19.00'
851fmax3054 fma  1   '1.3' '-1.07' -> '0.23'
852fmax3055 fma  1   '1.3' '-1.30' -> '0.00'
853fmax3056 fma  1   '1.3' '-2.07' -> '-0.77'
854fmax3057 fma  1   '1E+2' '1E+4' -> '1.01E+4'
855
856-- zero preservation
857precision: 6
858fmax3060 fma  1   '10000e+9'  '70000' -> '1.00000E+13' Inexact Rounded
859fmax3061 fma  1   1 '0.0001' -> '1.0001'
860fmax3062 fma  1   1 '0.00001' -> '1.00001'
861fmax3063 fma  1   1 '0.000001' -> '1.00000' Inexact Rounded
862fmax3064 fma  1   1 '0.0000001' -> '1.00000' Inexact Rounded
863fmax3065 fma  1   1 '0.00000001' -> '1.00000' Inexact Rounded
864
865-- some funny zeros [in case of bad signum]
866fmax3070 fma  1   1  0    -> 1
867fmax3071 fma  1   1 0.    -> 1
868fmax3072 fma  1   1  .0   -> 1.0
869fmax3073 fma  1   1 0.0   -> 1.0
870fmax3074 fma  1   1 0.00  -> 1.00
871fmax3075 fma  1    0  1   -> 1
872fmax3076 fma  1   0.  1   -> 1
873fmax3077 fma  1    .0 1   -> 1.0
874fmax3078 fma  1   0.0 1   -> 1.0
875fmax3079 fma  1   0.00 1  -> 1.00
876
877precision: 9
878
879-- some carries
880fmax3080 fma  1   999999998 1  -> 999999999
881fmax3081 fma  1   999999999 1  -> 1.00000000E+9 Rounded
882fmax3082 fma  1    99999999 1  -> 100000000
883fmax3083 fma  1     9999999 1  -> 10000000
884fmax3084 fma  1      999999 1  -> 1000000
885fmax3085 fma  1       99999 1  -> 100000
886fmax3086 fma  1        9999 1  -> 10000
887fmax3087 fma  1         999 1  -> 1000
888fmax3088 fma  1          99 1  -> 100
889fmax3089 fma  1           9 1  -> 10
890
891
892-- more LHS swaps
893fmax3090 fma  1   '-56267E-10'   0 ->  '-0.0000056267'
894fmax3091 fma  1   '-56267E-6'    0 ->  '-0.056267'
895fmax3092 fma  1   '-56267E-5'    0 ->  '-0.56267'
896fmax3093 fma  1   '-56267E-4'    0 ->  '-5.6267'
897fmax3094 fma  1   '-56267E-3'    0 ->  '-56.267'
898fmax3095 fma  1   '-56267E-2'    0 ->  '-562.67'
899fmax3096 fma  1   '-56267E-1'    0 ->  '-5626.7'
900fmax3097 fma  1   '-56267E-0'    0 ->  '-56267'
901fmax3098 fma  1   '-5E-10'       0 ->  '-5E-10'
902fmax3099 fma  1   '-5E-7'        0 ->  '-5E-7'
903fmax3100 fma  1   '-5E-6'        0 ->  '-0.000005'
904fmax3101 fma  1   '-5E-5'        0 ->  '-0.00005'
905fmax3102 fma  1   '-5E-4'        0 ->  '-0.0005'
906fmax3103 fma  1   '-5E-1'        0 ->  '-0.5'
907fmax3104 fma  1   '-5E0'         0 ->  '-5'
908fmax3105 fma  1   '-5E1'         0 ->  '-50'
909fmax3106 fma  1   '-5E5'         0 ->  '-500000'
910fmax3107 fma  1   '-5E8'         0 ->  '-500000000'
911fmax3108 fma  1   '-5E9'         0 ->  '-5.00000000E+9'   Rounded
912

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