resetting manifest requested domain to floor
[platform/upstream/mpc.git] / tests / mul.dat
1 # Data file for mpc_mul
2 #
3 # Copyright (C) 2008, 2010, 2011, 2012 INRIA
4 #
5 # This file is part of GNU MPC.
6 #
7 # GNU MPC is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU Lesser General Public License as published by the
9 # Free Software Foundation; either version 3 of the License, or (at your
10 #o ption) any later version.
11 #
12 # GNU MPC is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15 # more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with this program. If not, see http://www.gnu.org/licenses/ .
19 #
20 # The line format respects the parameter order in function prototype as
21 # follow:
22 #
23 # INEX_RE  INEX_IM  PREC_ROP_RE  ROP_RE  PREC_ROP_IM  ROP_IM  PREC_OP1_RE  OP1_RE  PREC_OP1_IM  OP1_IM  PREC_OP2_RE  OP2_RE  PREC_OP2_IM  OP2_IM  RND_RE  RND_IM
24 #
25 # See add.dat for more details.
26
27 # special values (following ISO C99 standard, G.5.1)
28 0 0 53  nan 53 +inf    53 -inf 53 -inf 53 -inf 53 -inf N Z
29 0 0 53  nan 53 +inf    53 -inf 53 +inf 53   +1 53 -inf Z U
30 0 0 53 +inf 53 -inf    53 +inf 53 -inf 53 +inf 53   +0 U D
31 0 0 53 +inf 53 -inf    53 +inf 53 +inf 53   -0 53   -1 D N
32 0 0 53 -inf 53 +inf    53 -inf 53 -inf 53   -0 53   -1 N U
33 0 0 53 -inf 53 +inf    53 -inf 53 +inf 53 +inf 53  nan Z D
34 0 0 53 -inf 53 -inf    53 +inf 53 -inf 53  nan 53   -1 U N
35 0 0 53  nan 53  nan    53 +inf 53 +inf 53   -0 53  nan D Z
36 0 0 53  nan 53  nan    53 -inf 53 -inf 53  nan 53  nan N D
37
38 0 0 53 -inf 53 -inf    53   -1 53 -inf 53 +inf 53   -1 N D
39 0 0 53 -inf 53  nan    53 -inf 53   +1 53 +inf 53   -0 Z N
40 0 0 53 +inf 53  nan    53   +1 53 -inf 53   -0 53   +1 U Z
41 0 0 53  nan 53  nan    53 +inf 53   +1 53   -0 53   -0 D U
42 0 0 53  nan 53 -inf    53   -1 53 -inf 53 +inf 53  nan N N
43 0 0 53  nan 53 -inf    53 -inf 53   +1 53  nan 53   +1 Z Z
44 0 0 53  nan 53  nan    53   +1 53 -inf 53   -0 53  nan U U
45 0 0 53  nan 53  nan    53 +inf 53   +1 53  nan 53  nan D D
46
47 0 0 53 +inf 53  nan    53   -0 53 -inf 53   +0 53 +inf D D
48 0 0 53 -inf 53  nan    53 -inf 53   +0 53   +1 53   -0 N Z
49 0 0 53  nan 53  nan    53   +0 53 -inf 53   -0 53   -0 Z U
50 0 0 53 -inf 53  nan    53 +inf 53   +0 53 -inf 53  nan U D
51 0 0 53 -inf 53  nan    53   -0 53 -inf 53  nan 53   -1 D N
52 0 0 53  nan 53  nan    53 -inf 53   +0 53   +0 53  nan N U
53 0 0 53  nan 53  nan    53   +0 53 -inf 53  nan 53  nan Z D
54
55 0 0 53   +1 53   -0    53   +0 53   +1 53   -0 53   -1 Z D
56 0 0 53   -0 53   +0    53   -1 53   -0 53   +0 53   -0 U N
57 0 0 53 -inf 53  nan    53   -0 53   +1 53  nan 53 +inf D Z
58 0 0 53  nan 53  nan    53   +1 53   -0 53   -1 53  nan N D
59 0 0 53  nan 53  nan    53   +0 53   +1 53  nan 53   -0 Z N
60 0 0 53  nan 53  nan    53   -1 53   -0 53  nan 53  nan U Z
61
62 0 0 53   +0 53   +0    53   -0 53   +0 53   +0 53   -0 U Z
63 0 0 53  nan 53  nan    53   +0 53   -0 53  nan 53 -inf D U
64 0 0 53  nan 53  nan    53   +0 53   +0 53   -1 53  nan N N
65 0 0 53  nan 53  nan    53   -0 53   -0 53  nan 53   -0 Z Z
66 0 0 53  nan 53  nan    53   -0 53   +0 53  nan 53  nan U U
67
68 0 0 53 +inf 53  nan    53  nan 53 -inf 53  nan 53 +inf U U
69 0 0 53 -inf 53  nan    53 +inf 53  nan 53   -1 53  nan D D
70 0 0 53  nan 53  nan    53  nan 53 -inf 53  nan 53   -0 N Z
71 0 0 53  nan 53  nan    53 -inf 53  nan 53  nan 53  nan Z U
72
73 0 0 53  nan 53  nan    53   +1 53  nan 53  nan 53   -1 Z U
74 0 0 53  nan 53  nan    53  nan 53   +1 53   -0 53  nan U D
75 0 0 53  nan 53  nan    53   -1 53  nan 53  nan 53  nan D N
76
77 0 0 53  nan 53  nan    53  nan 53   +0 53   +0 53  nan D N
78 0 0 53  nan 53  nan    53   +0 53  nan 53  nan 53  nan N U
79
80 0 0 53  nan 53  nan    53  nan 53  nan 53  nan 53  nan N U
81
82 # pure real arguments
83 0 0 53  0x10000000000001p-52 53 -0    53 +1 53 -0 53 0x10000000000001p-52 53 -0 N N
84 0 0 53  0x10000000000001p-52 53 -0    53 +1 53 -0 53 0x10000000000001p-52 53 -0 Z Z
85 0 0 53  0x10000000000001p-52 53 -0    53 +1 53 -0 53 0x10000000000001p-52 53 -0 U U
86 0 0 53 -0x10000000000001p-52 53 -0    53 -1 53 -0 53 0x10000000000001p-52 53 -0 D D
87
88 # one pure real argument
89 0 0 53  0x10000000000001p-52 53  0x10000000000001p-52    53 +1 53 +1 53 0x10000000000001p-52 53 -0 N N
90 0 0 53  0x10000000000001p-52 53 -0x10000000000001p-51    53 +1 53 -2 53 0x10000000000001p-52 53 -0 Z Z
91 - + 53 -0x30000000000004p-52 53  0x30000000000004p-52    53 -3 53 +3 53 0x10000000000001p-52 53 +0 N N
92 + - 53 -0x30000000000002p-52 53  0x30000000000002p-52    53 -3 53 +3 53 0x10000000000001p-52 53 +0 Z Z
93 + + 53 -0x30000000000002p-52 53  0x30000000000004p-52    53 -3 53 +3 53 0x10000000000001p-52 53 +0 U U
94 - - 53 -0x30000000000004p-52 53  0x30000000000002p-52    53 -3 53 +3 53 0x10000000000001p-52 53 +0 D D
95 0 0 53 -0x10000000000001p-52 53 -0x10000000000001p-50    53 -1 53 -4 53 0x10000000000001p-52 53 +0 D D
96 0 0 53                    +0 53                    +0    53 +0 53 +0 53 0x10000000000001p-52 53 -1 N N
97 0 0 53                    +0 53                    -0    53 +0 53 -0 53 0x10000000000001p-52 53 -2 Z Z
98 0 0 53                    +0 53                    +0    53 +0 53 +0 53 0x10000000000001p-52 53 +3 U U
99 0 0 53                    -0 53                    -0    53 -0 53 -0 53 0x10000000000001p-52 53 +4 D D
100
101 # pure imaginary arguments
102 0 0 53 -0x10000000000001p-52 53 -0     53 -0 53 0x10000000000001p-52 53 -0 53 +1 N N
103 0 0 53 -0x10000000000001p-52 53 +0     53 +0 53 0x10000000000001p-52 53 -0 53 +1 Z Z
104 0 0 53 -0x10000000000001p-52 53 +0     53 +0 53 0x10000000000001p-52 53 -0 53 +1 U U
105 0 0 53 -0x10000000000001p-52 53 -0     53 -0 53 0x10000000000001p-52 53 -0 53 +1 D D
106
107 # one pure imaginary argument
108 0 0 53 -0x10000000000001p-52 53 -0x10000000000001p-52   53 -0 53 0x10000000000001p-52 53 -1 53 +1 N N
109 0 0 53 +0x10000000000001p-52 53 -0x10000000000001p-51   53 +0 53 0x10000000000001p-52 53 -2 53 -1 Z Z
110 + - 53  0x30000000000004p-52 53 -0x30000000000004p-52   53 +0 53 0x10000000000001p-52 53 -3 53 -3 N N
111 - + 53  0x30000000000002p-52 53 -0x30000000000002p-52   53 +0 53 0x10000000000001p-52 53 -3 53 -3 Z Z
112 + + 53  0x30000000000004p-52 53 -0x30000000000002p-52   53 +0 53 0x10000000000001p-52 53 -3 53 -3 U U
113 - - 53  0x30000000000002p-52 53 -0x30000000000004p-52   53 +0 53 0x10000000000001p-52 53 -3 53 -3 D D
114 0 0 53 +0x10000000000001p-52 53 -0x10000000000001p-50   53 -0 53 0x10000000000001p-52 53 -4 53 -1 D D
115
116 # big precision uses Karatsuba method
117 0 0 4096 0x1420176785BD601FC018AD36471p-96 4096 -0x1ECCDBDA38B2611A32848E7ADF43p-100    53  0x6B2E363676587p-44 53  0x1AC20AAC49ED37p-47 53  0x12264C57B44C6Bp-53 53 -0x138639A4B8D8B3p-50 N N
118
119 # Karatsuba case where x=0 since ad=bc: (1+i)^2 at artificially high
120 # precision so that Karatsuba is actually used.
121 0 0 4096 0 4096 2    4096 1 4096 1  4096 1 4096 1  N N
122 # trigger the line reducing prec_x to prec_u
123 0 0 4096 0 4096 2    40960 1 40960 1  40960 1 40960 1  N N
124 # another particular cases
125 + + 6 -0x9p-497 6 0x33p-315    6 -0x1dp-73 6  0x3p148   6  0x11p-463 6 0x3p-645  N N
126 + - 6 0x33p-315 6 0x9p-497     6   0x3p148 6  0x1dp-73  6  0x11p-463 6 0x3p-645  N N
127 0 0 4 0x1p-1902 4 0x3p-1085    4 -0x1p-892 4 -0x3p-75   4 -0x1p-1010 4 0         N N
128
129 # a few particular values
130 0 0 8 10 8 -5  8 4 8 3  8 1 8 -2 N N
131 + + 27 0b1.10110000001100010010000000e-3 27 0b1.00111100000010100001011001e-1  27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3  27 0b1.10100101110110011011100100e-1 27 0b1.10111100011000001100110011e-1 N N
132 0 0 15 2 15 0  15 -1 15 -1 15 -1 15 1 N N
133
134 # check squares, copied from sqr.dat
135 + - 53  0xfdbac097c8dc58p+2096 53 -0x7f6e5d4c3b2a2p+1036   53 -0xfedcba9876543p+1024 53  0x10000000000001p-42  53 -0xfedcba9876543p+1024 53  0x10000000000001p-42  U D
136 + 0 30 309485009533114692573069312 30 18889465966662952943616  30 17592186044416 30 536870913 30 17592186044416 30 536870913 N N
137 0 0 4 0 4 2  4 1 4 1 4 1 4 1 N N
138 + + 8 0b1.1000111e-3 8 0b1.1100111e-3  27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3 27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3 N N
139 ? + 3464 inf 3464 inf  866 -0x2.5763c6519ef1510f8afa101a210b8030b1909cc17004db561a25d9b53e2c08c41c01e8bbac5af6299b9d8786030aa14943d841798c8c369287942e4d4cec42a60ab0922af931159805e631128e97f973754ad53972d5d320a651a3b4a667f0ef2b92dbd698d159c3642675140@192158913 866 -0xd.15f2d530934dd930d66e89d70762d2337a8f973dd6915eb6b532fd372fcc955df1d852632d4e46fe64154ceda991a1302caf1b0ec622497e3e5724dd05b1c89a06e28d7e18e8af58f5ff4c9998cb31714688867524f41e0b31e847c1bf40de5127f858069998efd7c3e599080@192158893 866 -0x2.5763c6519ef1510f8afa101a210b8030b1909cc17004db561a25d9b53e2c08c41c01e8bbac5af6299b9d8786030aa14943d841798c8c369287942e4d4cec42a60ab0922af931159805e631128e97f973754ad53972d5d320a651a3b4a667f0ef2b92dbd698d159c3642675140@192158913 866 -0xd.15f2d530934dd930d66e89d70762d2337a8f973dd6915eb6b532fd372fcc955df1d852632d4e46fe64154ceda991a1302caf1b0ec622497e3e5724dd05b1c89a06e28d7e18e8af58f5ff4c9998cb31714688867524f41e0b31e847c1bf40de5127f858069998efd7c3e599080@192158893 N N
140 ? + 2256 0 2256 -0  564 0xc.87999bfd1cb1a64288881e214b7cf1af979863b23c030b79c4a8bebb39177967608388a2e4df527977e7755a25df8af8f72fdd6dd2f42bd00de83088b4e9b59ce85caf2e6b0c0@-184298749 564 -0x2.5109af459d4daf357e09475ec991cdc9b02c8f7dfacdc060d2a24710d09c997f8aea6dbd46f10828c30b583fdcc90d7dcbb895689d594d3813db40784d2309e450d1fb6e38da8@-184298726 564 0xc.87999bfd1cb1a64288881e214b7cf1af979863b23c030b79c4a8bebb39177967608388a2e4df527977e7755a25df8af8f72fdd6dd2f42bd00de83088b4e9b59ce85caf2e6b0c0@-184298749 564 -0x2.5109af459d4daf357e09475ec991cdc9b02c8f7dfacdc060d2a24710d09c997f8aea6dbd46f10828c30b583fdcc90d7dcbb895689d594d3813db40784d2309e450d1fb6e38da8@-184298726 N N
141
142 # intermediate over- and underflows
143 - + 100 -inf 100 +inf  100 0x1@125000750 100 0x3@125000750  100 0x1@225000750 100 0x2@225000750 N N
144 - + 100 -inf 100 +inf  100 0x1@225000750 100 0x2@225000750  100 0x1@125000750 100 0x3@125000750 N N
145 - - 100 -inf 100 -inf  100 0x1@225000750 100 -0x2@225000750  100 0x1@125000750 100 -0x3@125000750 N N
146 + - 100 -0   100 +0    100 0x1@-125000750 100 0x3@-125000750  100 0x1@-225000750 100 0x2@-225000750 N N
147 + - 100 -0   100 +0    100 0x1@-225000750 100 0x2@-225000750  100 0x1@-125000750 100 0x3@-125000750 N N
148 - - 100 +0   100 +0    100 0x3@-125000750 100 0x1@-125000750  100 0x1@-225000750 100 0x2@-225000750 N N
149 - - 100 +0   100 +0    100 0x4@-125000750 100 0x1@-125000750  100 0x1@-225000750 100 0x2@-225000750 N N
150 + - 100 -0   100 +0    100 0x2@-225000750 100 0x1@-225000750  100 0x1@-125000750 100 0x3@-125000750 N N
151 0 - 100 +0   100 +0    100 0x1@-225000750 100 0x1@-225000750  100 0x1@-125000750 100 0x1@-125000750 N N
152 0 + 100 +0   100 +inf  100 0x1@125000750 100 0x1@125000750  100 0x1@225000750 100 0x1@225000750 N N
153 + 0 100 +inf 100 +0    100 0x1@125000750 100 0x1@125000750  100 0x1@225000750 100 -0x1@225000750 N N
154 # the same with directed rounding
155 - + 10 -inf 10 +inf 10 0x1@125000750 10 0x3@125000750  10 0x1@225000750 10 0x2@225000750 D U
156 + - 10 -0b1.111111111e1073741822 10 0b1.111111111e1073741822  10 0x1@125000750 10 0x3@125000750  10 0x1@225000750 10 0x2@225000750 U D
157 + - 10 -0   10 +0    10 0x1@-125000750 10 0x3@-125000750  10 0x1@-225000750 10 0x2@-225000750 U D
158 - + 10 -0b1e-1073741824   10 0b1e-1073741824    10 0x1@-125000750 10 0x3@-125000750  10 0x1@-225000750 10 0x2@-225000750 D U
159 # starting with Karatsuba
160 - + 10000 -inf 100 +inf  100 0x1@125000750 100 0x3@125000750  100 0x1@225000750 100 0x2@225000750 N N
161 - + 10000 -inf 100 +inf  100 0x1@225000750 100 0x2@225000750  100 0x1@125000750 100 0x3@125000750 N N
162 - - 10000 -inf 100 -inf  100 0x1@225000750 100 -0x2@225000750  100 0x1@125000750 100 -0x3@125000750 N N
163 + - 10000 -0   100 +0    100 0x1@-125000750 100 0x3@-125000750  100 0x1@-225000750 100 0x2@-225000750 N N
164 + - 10000 -0   100 +0    100 0x1@-225000750 100 0x2@-225000750  100 0x1@-125000750 100 0x3@-125000750 N N
165 - - 10000 +0   100 +0    100 0x3@-125000750 100 0x1@-125000750  100 0x1@-225000750 100 0x2@-225000750 N N
166 - - 10000 +0   100 +0    100 0x4@-125000750 100 0x1@-125000750  100 0x1@-225000750 100 0x2@-225000750 N N
167 + - 10000 -0   100 +0    100 0x2@-225000750 100 0x1@-225000750  100 0x1@-125000750 100 0x3@-125000750 N N
168 0 - 10000 +0   100 +0    100 0x1@-225000750 100 0x1@-225000750  100 0x1@-125000750 100 0x1@-125000750 N N
169 0 + 10000 +0   100 +inf  100 0x1@125000750 100 0x1@125000750  100 0x1@225000750 100 0x1@225000750 N N
170 + 0 10000 +inf 100 +0    100 0x1@125000750 100 0x1@125000750  100 0x1@225000750 100 -0x1@225000750 N N
171 + + 10000 +inf 100 +inf  100 0x1@125000750 100 0x3@125000750  100 0x1@143434706 100 0x2@143434705 N N
172
173 # improve code coverage: case where sign_x==0 in mpc_mul_karatsuba
174 0 0 2000 6 2000 8  2000 4 2000 2 2000 2 2000 1 N N
175 0 0 2000 0 2000 4  2000 2 2000 2 2000 1 2000 1 N N
176
177 + 0 2 1 2 0x2p-536870913 2 1 2 0x1p-536870913 2 1 2 0x1p-536870913 N N
178 0 - 2 0 2 1 2 0x1p-536870913 2 1 2 1 2 0x1p-536870913 N N