This source file includes following definitions.
- test_function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 static void
20 test_function (DOUBLE (*my_fma) (DOUBLE, DOUBLE, DOUBLE))
21 {
22 volatile DOUBLE x;
23 volatile DOUBLE y;
24 volatile DOUBLE z;
25 volatile DOUBLE result;
26 volatile DOUBLE expected;
27
28
29
30 {
31 x = NAN;
32 y = NAN;
33 z = NAN;
34 result = my_fma (x, y, z);
35 ASSERT (ISNAN (result));
36 }
37 {
38 x = NAN;
39 y = NAN;
40 z = L_(1.0);
41 result = my_fma (x, y, z);
42 ASSERT (ISNAN (result));
43 }
44 {
45 x = NAN;
46 y = L_(0.0);
47 z = NAN;
48 result = my_fma (x, y, z);
49 ASSERT (ISNAN (result));
50 }
51 {
52 x = NAN;
53 y = L_(0.0);
54 z = L_(1.0);
55 result = my_fma (x, y, z);
56 ASSERT (ISNAN (result));
57 }
58 {
59 x = L_(0.0);
60 y = NAN;
61 z = NAN;
62 result = my_fma (x, y, z);
63 ASSERT (ISNAN (result));
64 }
65 {
66 x = L_(0.0);
67 y = NAN;
68 z = L_(1.0);
69 result = my_fma (x, y, z);
70 ASSERT (ISNAN (result));
71 }
72
73 {
74 x = L_(3.0);
75 y = - L_(2.0);
76 z = NAN;
77 result = my_fma (x, y, z);
78 ASSERT (ISNAN (result));
79 }
80
81
82 {
83 x = INFINITY;
84 y = L_(0.0);
85 z = NAN;
86 result = my_fma (x, y, z);
87 ASSERT (ISNAN (result));
88 }
89 {
90 x = L_(0.0);
91 y = INFINITY;
92 z = NAN;
93 result = my_fma (x, y, z);
94 ASSERT (ISNAN (result));
95 }
96
97
98
99
100
101 {
102 x = INFINITY;
103 y = L_(3.0);
104 z = - INFINITY;
105 result = my_fma (x, y, z);
106 ASSERT (ISNAN (result));
107 }
108 {
109 x = INFINITY;
110 y = - L_(3.0);
111 z = INFINITY;
112 result = my_fma (x, y, z);
113 ASSERT (ISNAN (result));
114 }
115 {
116 x = L_(3.0);
117 y = INFINITY;
118 z = - INFINITY;
119 result = my_fma (x, y, z);
120 ASSERT (ISNAN (result));
121 }
122 {
123 x = - L_(3.0);
124 y = INFINITY;
125 z = INFINITY;
126 result = my_fma (x, y, z);
127 ASSERT (ISNAN (result));
128 }
129
130
131
132 {
133 x = INFINITY;
134 y = L_(0.0);
135 z = L_(5.0);
136 result = my_fma (x, y, z);
137 ASSERT (ISNAN (result));
138 }
139 {
140 x = L_(0.0);
141 y = INFINITY;
142 z = L_(5.0);
143 result = my_fma (x, y, z);
144 ASSERT (ISNAN (result));
145 }
146
147 {
148 x = - L_(2.0);
149 y = L_(3.0);
150 z = INFINITY;
151 result = my_fma (x, y, z);
152 expected = INFINITY;
153 ASSERT (result == expected);
154 }
155 {
156 x = INFINITY;
157 y = L_(3.0);
158 z = INFINITY;
159 result = my_fma (x, y, z);
160 expected = INFINITY;
161 ASSERT (result == expected);
162 }
163 {
164 x = INFINITY;
165 y = - L_(3.0);
166 z = - INFINITY;
167 result = my_fma (x, y, z);
168 expected = - INFINITY;
169 ASSERT (result == expected);
170 }
171 {
172 x = L_(3.0);
173 y = INFINITY;
174 z = INFINITY;
175 result = my_fma (x, y, z);
176 expected = INFINITY;
177 ASSERT (result == expected);
178 }
179 {
180 x = - L_(3.0);
181 y = INFINITY;
182 z = - INFINITY;
183 result = my_fma (x, y, z);
184 expected = - INFINITY;
185 ASSERT (result == expected);
186 }
187
188
189 {
190 x = L_(0.0);
191 y = L_(3.0);
192 z = L_(11.0);
193 result = my_fma (x, y, z);
194 expected = L_(11.0);
195 ASSERT (result == expected);
196 }
197 {
198 x = L_(3.0);
199 y = L_(0.0);
200 z = L_(11.0);
201 result = my_fma (x, y, z);
202 expected = L_(11.0);
203 ASSERT (result == expected);
204 }
205 {
206 x = L_(3.0);
207 y = L_(4.0);
208 z = L_(0.0);
209 result = my_fma (x, y, z);
210 expected = L_(12.0);
211 ASSERT (result == expected);
212 }
213 }