1 /* Copyright JS Foundation and other contributors, http://js.foundation
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 /*
17 * Unit test generator for jerry-libm.
18 * To be compiled separately from the rest of jerry and to be linked to a trusted libm.
19 * Its output should be redirected to test-libm.inc.h.
20 *
21 * Example:
22 * gcc gen-test-libm.c -o gen-test-libm -lm
23 * ./gen-test-libm >test-libm.inc.h
24 */
25
26 #include <math.h>
27 #include <stdio.h>
28
29 #define GEN_INT_TEST(EXPR) printf("check_int (\"%s\", %s, %d);\n", #EXPR, #EXPR, EXPR);
30 #define GEN_DBL_TEST(EXPR) printf("check_double (\"%s\", %s, %.20E);\n", #EXPR, #EXPR, EXPR);
31
32 int
main(int argc,char ** args)33 main (int argc, char **args)
34 {
35 printf ("/* Copyright JS Foundation and other contributors, http://js.foundation\n"
36 " *\n"
37 " * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
38 " * you may not use this file except in compliance with the License.\n"
39 " * You may obtain a copy of the License at\n"
40 " *\n"
41 " * http://www.apache.org/licenses/LICENSE-2.0\n"
42 " *\n"
43 " * Unless required by applicable law or agreed to in writing, software\n"
44 " * distributed under the License is distributed on an \"AS IS\" BASIS\n"
45 " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
46 " * See the License for the specific language governing permissions and\n"
47 " * limitations under the License.\n"
48 " */\n"
49 "\n"
50 "/* This file is automatically generated by the gen-test-libm.sh script.\n"
51 " * Do not edit! */\n"
52 "\n");
53
54 /* acos tests */
55 GEN_DBL_TEST (acos (0.0));
56 GEN_DBL_TEST (acos (-0.0));
57 GEN_DBL_TEST (acos (1.0));
58 GEN_DBL_TEST (acos (-1.0));
59 GEN_DBL_TEST (acos (0.5));
60 GEN_DBL_TEST (acos (-0.5));
61 GEN_DBL_TEST (acos (INFINITY));
62 GEN_DBL_TEST (acos (-INFINITY));
63 GEN_DBL_TEST (acos (NAN));
64 GEN_DBL_TEST (acos (6.9e-18));
65 GEN_DBL_TEST (acos (-6.9e-18));
66 GEN_DBL_TEST (acos (7.0e-18));
67 GEN_DBL_TEST (acos (-7.0e-18));
68 GEN_DBL_TEST (acos (7.4e-9));
69 GEN_DBL_TEST (acos (-7.4e-9));
70 GEN_DBL_TEST (acos (7.5e-9));
71 GEN_DBL_TEST (acos (-7.5e-9));
72 GEN_DBL_TEST (acos (0.1));
73 GEN_DBL_TEST (acos (-0.1));
74 GEN_DBL_TEST (acos (0.4));
75 GEN_DBL_TEST (acos (-0.4));
76 GEN_DBL_TEST (acos (0.6));
77 GEN_DBL_TEST (acos (-0.6));
78 GEN_DBL_TEST (acos (0.99));
79 GEN_DBL_TEST (acos (-0.99));
80 GEN_DBL_TEST (acos (1.1));
81 GEN_DBL_TEST (acos (-1.1));
82 GEN_DBL_TEST (acos (0.7));
83
84 /* asin tests*/
85 GEN_DBL_TEST (asin (0.0));
86 GEN_DBL_TEST (asin (-0.0));
87 GEN_DBL_TEST (asin (1.0));
88 GEN_DBL_TEST (asin (-1.0));
89 GEN_DBL_TEST (asin (0.5));
90 GEN_DBL_TEST (asin (-0.5));
91 GEN_DBL_TEST (asin (0.98));
92 GEN_DBL_TEST (asin (-0.98));
93 GEN_DBL_TEST (asin (INFINITY));
94 GEN_DBL_TEST (asin (-INFINITY));
95 GEN_DBL_TEST (asin (NAN));
96 GEN_DBL_TEST (asin (6.9e-18));
97 GEN_DBL_TEST (asin (-6.9e-18));
98 GEN_DBL_TEST (asin (7.0e-18));
99 GEN_DBL_TEST (asin (-7.0e-18));
100 GEN_DBL_TEST (asin (7.4e-9));
101 GEN_DBL_TEST (asin (-7.4e-9));
102 GEN_DBL_TEST (asin (7.5e-9));
103 GEN_DBL_TEST (asin (-7.5e-9));
104 GEN_DBL_TEST (asin (0.1));
105 GEN_DBL_TEST (asin (-0.1));
106 GEN_DBL_TEST (asin (0.4));
107 GEN_DBL_TEST (asin (-0.4));
108 GEN_DBL_TEST (asin (0.6));
109 GEN_DBL_TEST (asin (-0.6));
110 GEN_DBL_TEST (asin (0.97));
111 GEN_DBL_TEST (asin (-0.97));
112 GEN_DBL_TEST (asin (0.99));
113 GEN_DBL_TEST (asin (-0.99));
114 GEN_DBL_TEST (asin (1.1));
115 GEN_DBL_TEST (asin (-1.1));
116 GEN_DBL_TEST (asin (0.7));
117
118 /* atan tests*/
119 GEN_DBL_TEST (atan (0.0));
120 GEN_DBL_TEST (atan (-0.0));
121 GEN_DBL_TEST (atan (7.0 / 16.0));
122 GEN_DBL_TEST (atan (-7.0 / 16.0));
123 GEN_DBL_TEST (atan (11.0 / 16.0));
124 GEN_DBL_TEST (atan (-11.0 / 16.0));
125 GEN_DBL_TEST (atan (19.0 / 16.0));
126 GEN_DBL_TEST (atan (-19.0 / 16.0));
127 GEN_DBL_TEST (atan (39.0 / 16.0));
128 GEN_DBL_TEST (atan (-39.0 / 16.0));
129 GEN_DBL_TEST (atan (1.0));
130 GEN_DBL_TEST (atan (-1.0));
131 GEN_DBL_TEST (atan (INFINITY));
132 GEN_DBL_TEST (atan (-INFINITY));
133 GEN_DBL_TEST (atan (NAN));
134 GEN_DBL_TEST (atan (6.9 / 16.0));
135 GEN_DBL_TEST (atan (-6.9 / 16.0));
136 GEN_DBL_TEST (atan (7.1 / 16.0));
137 GEN_DBL_TEST (atan (-7.1 / 16.0));
138 GEN_DBL_TEST (atan (10.9 / 16.0));
139 GEN_DBL_TEST (atan (-10.9 / 16.0));
140 GEN_DBL_TEST (atan (11.1 / 16.0));
141 GEN_DBL_TEST (atan (-11.1 / 16.0));
142 GEN_DBL_TEST (atan (18.9 / 16.0));
143 GEN_DBL_TEST (atan (-18.9 / 16.0));
144 GEN_DBL_TEST (atan (19.1 / 16.0));
145 GEN_DBL_TEST (atan (-19.1 / 16.0));
146 GEN_DBL_TEST (atan (38.9 / 16.0));
147 GEN_DBL_TEST (atan (-38.9 / 16.0));
148 GEN_DBL_TEST (atan (39.1 / 16.0));
149 GEN_DBL_TEST (atan (-39.1 / 16.0));
150 GEN_DBL_TEST (atan (0.99));
151 GEN_DBL_TEST (atan (-0.99));
152 GEN_DBL_TEST (atan (1.1));
153 GEN_DBL_TEST (atan (-1.1));
154 GEN_DBL_TEST (atan (7.37e+19));
155 GEN_DBL_TEST (atan (-7.37e+19));
156 GEN_DBL_TEST (atan (7.38e+19));
157 GEN_DBL_TEST (atan (-7.38e+19));
158 GEN_DBL_TEST (atan (0.7));
159
160 /* atan2 tests*/
161 GEN_DBL_TEST (atan2 (NAN, NAN));
162 GEN_DBL_TEST (atan2 (0.0, NAN));
163 GEN_DBL_TEST (atan2 (-0.0, NAN));
164 GEN_DBL_TEST (atan2 (1.0, NAN));
165 GEN_DBL_TEST (atan2 (-1.0, NAN));
166 GEN_DBL_TEST (atan2 (INFINITY, NAN));
167 GEN_DBL_TEST (atan2 (-INFINITY, NAN));
168 GEN_DBL_TEST (atan2 (NAN, 0.0));
169 GEN_DBL_TEST (atan2 (NAN, -0.0));
170 GEN_DBL_TEST (atan2 (NAN, 1.0));
171 GEN_DBL_TEST (atan2 (NAN, -1.0));
172 GEN_DBL_TEST (atan2 (NAN, INFINITY));
173 GEN_DBL_TEST (atan2 (NAN, -INFINITY));
174 GEN_DBL_TEST (atan2 (0.0, 0.0));
175 GEN_DBL_TEST (atan2 (0.0, -0.0));
176 GEN_DBL_TEST (atan2 (-0.0, 0.0));
177 GEN_DBL_TEST (atan2 (-0.0, -0.0));
178 GEN_DBL_TEST (atan2 (0.0, 1.0));
179 GEN_DBL_TEST (atan2 (0.0, -1.0));
180 GEN_DBL_TEST (atan2 (0.0, INFINITY));
181 GEN_DBL_TEST (atan2 (0.0, -INFINITY));
182 GEN_DBL_TEST (atan2 (-0.0, 1.0));
183 GEN_DBL_TEST (atan2 (-0.0, -1.0));
184 GEN_DBL_TEST (atan2 (-0.0, INFINITY));
185 GEN_DBL_TEST (atan2 (-0.0, -INFINITY));
186 GEN_DBL_TEST (atan2 (1.0, 0.0));
187 GEN_DBL_TEST (atan2 (1.0, -0.0));
188 GEN_DBL_TEST (atan2 (INFINITY, 0.0));
189 GEN_DBL_TEST (atan2 (INFINITY, -0.0));
190 GEN_DBL_TEST (atan2 (-1.0, 0.0));
191 GEN_DBL_TEST (atan2 (-1.0, -0.0));
192 GEN_DBL_TEST (atan2 (-INFINITY, 0.0));
193 GEN_DBL_TEST (atan2 (-INFINITY, -0.0));
194 GEN_DBL_TEST (atan2 (1.0, INFINITY));
195 GEN_DBL_TEST (atan2 (-1.0, INFINITY));
196 GEN_DBL_TEST (atan2 (1.0, -INFINITY));
197 GEN_DBL_TEST (atan2 (-1.0, -INFINITY));
198 GEN_DBL_TEST (atan2 (INFINITY, INFINITY));
199 GEN_DBL_TEST (atan2 (INFINITY, -INFINITY));
200 GEN_DBL_TEST (atan2 (-INFINITY, INFINITY));
201 GEN_DBL_TEST (atan2 (-INFINITY, -INFINITY));
202 GEN_DBL_TEST (atan2 (INFINITY, 1.0));
203 GEN_DBL_TEST (atan2 (INFINITY, -1.0));
204 GEN_DBL_TEST (atan2 (-INFINITY, 1.0));
205 GEN_DBL_TEST (atan2 (-INFINITY, -1.0));
206 GEN_DBL_TEST (atan2 (0.7, 1.0));
207 GEN_DBL_TEST (atan2 (-0.7, 1.0));
208 GEN_DBL_TEST (atan2 (0.7, -1.0));
209 GEN_DBL_TEST (atan2 (-0.7, -1.0));
210 GEN_DBL_TEST (atan2 (0.4, 0.0003));
211 GEN_DBL_TEST (atan2 (1.4, -0.93));
212
213 /* acosh tests */
214 GEN_DBL_TEST (acosh (0.0));
215 GEN_DBL_TEST (acosh (-0.0));
216 GEN_DBL_TEST (acosh (1.0));
217 GEN_DBL_TEST (acosh (-1.0));
218 GEN_DBL_TEST (acosh (INFINITY));
219 GEN_DBL_TEST (acosh (-INFINITY));
220 GEN_DBL_TEST (acosh (NAN));
221 GEN_DBL_TEST (acosh (7.08e+02));
222 GEN_DBL_TEST (acosh (7.10e+02));
223 GEN_DBL_TEST (acosh (-7.40e+02));
224 GEN_DBL_TEST (acosh (-7.50e+02));
225 GEN_DBL_TEST (acosh (0.34));
226 GEN_DBL_TEST (acosh (-0.34));
227 GEN_DBL_TEST (acosh (0.35));
228 GEN_DBL_TEST (acosh (-0.35));
229 GEN_DBL_TEST (acosh (1.03));
230 GEN_DBL_TEST (acosh (-1.03));
231 GEN_DBL_TEST (acosh (1.04));
232 GEN_DBL_TEST (acosh (-1.04));
233 GEN_DBL_TEST (acosh (3.72e-09));
234 GEN_DBL_TEST (acosh (-3.72e-09));
235 GEN_DBL_TEST (acosh (3.73e-09));
236 GEN_DBL_TEST (acosh (-3.73e-09));
237 GEN_DBL_TEST (acosh (2.0));
238 GEN_DBL_TEST (acosh (3.0));
239 GEN_DBL_TEST (acosh (0.7));
240 GEN_DBL_TEST (acosh (38.0));
241
242 /* asinh tests */
243 GEN_DBL_TEST (asinh (0.0));
244 GEN_DBL_TEST (asinh (-0.0));
245 GEN_DBL_TEST (asinh (1.0));
246 GEN_DBL_TEST (asinh (-1.0));
247 GEN_DBL_TEST (asinh (INFINITY));
248 GEN_DBL_TEST (asinh (-INFINITY));
249 GEN_DBL_TEST (asinh (NAN));
250 GEN_DBL_TEST (asinh (7.08e+02));
251 GEN_DBL_TEST (asinh (7.10e+02));
252 GEN_DBL_TEST (asinh (-7.40e+02));
253 GEN_DBL_TEST (asinh (-7.50e+02));
254 GEN_DBL_TEST (asinh (0.34));
255 GEN_DBL_TEST (asinh (-0.34));
256 GEN_DBL_TEST (asinh (0.35));
257 GEN_DBL_TEST (asinh (-0.35));
258 GEN_DBL_TEST (asinh (1.03));
259 GEN_DBL_TEST (asinh (-1.03));
260 GEN_DBL_TEST (asinh (1.04));
261 GEN_DBL_TEST (asinh (-1.04));
262 GEN_DBL_TEST (asinh (3.72e-09));
263 GEN_DBL_TEST (asinh (-3.72e-09));
264 GEN_DBL_TEST (asinh (3.73e-09));
265 GEN_DBL_TEST (asinh (-3.73e-09));
266 GEN_DBL_TEST (asinh (2.0));
267 GEN_DBL_TEST (asinh (3.0));
268 GEN_DBL_TEST (asinh (0.7));
269 GEN_DBL_TEST (asinh (38.0));
270
271 /* atanh tests */
272 GEN_DBL_TEST (atanh (0.0));
273 GEN_DBL_TEST (atanh (-0.0));
274 GEN_DBL_TEST (atanh (1.0));
275 GEN_DBL_TEST (atanh (-1.0));
276 GEN_DBL_TEST (atanh (INFINITY));
277 GEN_DBL_TEST (atanh (-INFINITY));
278 GEN_DBL_TEST (atanh (NAN));
279 GEN_DBL_TEST (atanh (7.08e+02));
280 GEN_DBL_TEST (atanh (7.10e+02));
281 GEN_DBL_TEST (atanh (-7.40e+02));
282 GEN_DBL_TEST (atanh (-7.50e+02));
283 GEN_DBL_TEST (atanh (0.34));
284 GEN_DBL_TEST (atanh (-0.34));
285 GEN_DBL_TEST (atanh (0.35));
286 GEN_DBL_TEST (atanh (-0.35));
287 GEN_DBL_TEST (atanh (1.03));
288 GEN_DBL_TEST (atanh (-1.03));
289 GEN_DBL_TEST (atanh (1.04));
290 GEN_DBL_TEST (atanh (-1.04));
291 GEN_DBL_TEST (atanh (3.72e-09));
292 GEN_DBL_TEST (atanh (-3.72e-09));
293 GEN_DBL_TEST (atanh (3.73e-09));
294 GEN_DBL_TEST (atanh (-3.73e-09));
295 GEN_DBL_TEST (atanh (2.0));
296 GEN_DBL_TEST (atanh (3.0));
297 GEN_DBL_TEST (atanh (0.7));
298 GEN_DBL_TEST (atanh (38.0));
299
300 /* ceil tests */
301 GEN_DBL_TEST (ceil (0.0));
302 GEN_DBL_TEST (ceil (-0.0));
303 GEN_DBL_TEST (ceil (INFINITY));
304 GEN_DBL_TEST (ceil (-INFINITY));
305 GEN_DBL_TEST (ceil (NAN));
306 GEN_DBL_TEST (ceil (3.14));
307 GEN_DBL_TEST (ceil (-3.14));
308 GEN_DBL_TEST (ceil (3.72e-09));
309 GEN_DBL_TEST (ceil (-3.72e-09));
310 GEN_DBL_TEST (ceil (7.37e+19));
311 GEN_DBL_TEST (ceil (-7.37e+19));
312
313 /* copysign tests */
314 /* SKIPPED: not publicly declared in jerry-libm
315 GEN_DBL_TEST (copysign (0.0, 0.0));
316 GEN_DBL_TEST (copysign (0.0, -0.0));
317 GEN_DBL_TEST (copysign (-0.0, 0.0));
318 GEN_DBL_TEST (copysign (-0.0, -0.0));
319 GEN_DBL_TEST (copysign (0.0, 1.0));
320 GEN_DBL_TEST (copysign (0.0, -1.0));
321 GEN_DBL_TEST (copysign (-0.0, 1.0));
322 GEN_DBL_TEST (copysign (-0.0, -1.0));
323 GEN_DBL_TEST (copysign (0.0, INFINITY));
324 GEN_DBL_TEST (copysign (0.0, -INFINITY));
325 GEN_DBL_TEST (copysign (-0.0, INFINITY));
326 GEN_DBL_TEST (copysign (-0.0, -INFINITY));
327 GEN_DBL_TEST (copysign (0.0, NAN));
328 GEN_DBL_TEST (copysign (-0.0, NAN));
329 GEN_DBL_TEST (copysign (1.0, 0.0));
330 GEN_DBL_TEST (copysign (1.0, -0.0));
331 GEN_DBL_TEST (copysign (-1.0, 0.0));
332 GEN_DBL_TEST (copysign (-1.0, -0.0));
333 GEN_DBL_TEST (copysign (1.0, 1.0));
334 GEN_DBL_TEST (copysign (1.0, -1.0));
335 GEN_DBL_TEST (copysign (-1.0, 1.0));
336 GEN_DBL_TEST (copysign (-1.0, -1.0));
337 GEN_DBL_TEST (copysign (1.0, INFINITY));
338 GEN_DBL_TEST (copysign (1.0, -INFINITY));
339 GEN_DBL_TEST (copysign (-1.0, INFINITY));
340 GEN_DBL_TEST (copysign (-1.0, -INFINITY));
341 GEN_DBL_TEST (copysign (1.0, NAN));
342 GEN_DBL_TEST (copysign (-1.0, NAN));
343 GEN_DBL_TEST (copysign (INFINITY, 0.0));
344 GEN_DBL_TEST (copysign (INFINITY, -0.0));
345 GEN_DBL_TEST (copysign (-INFINITY, 0.0));
346 GEN_DBL_TEST (copysign (-INFINITY, -0.0));
347 GEN_DBL_TEST (copysign (INFINITY, 1.0));
348 GEN_DBL_TEST (copysign (INFINITY, -1.0));
349 GEN_DBL_TEST (copysign (-INFINITY, 1.0));
350 GEN_DBL_TEST (copysign (-INFINITY, -1.0));
351 GEN_DBL_TEST (copysign (INFINITY, INFINITY));
352 GEN_DBL_TEST (copysign (INFINITY, -INFINITY));
353 GEN_DBL_TEST (copysign (-INFINITY, INFINITY));
354 GEN_DBL_TEST (copysign (-INFINITY, -INFINITY));
355 GEN_DBL_TEST (copysign (INFINITY, NAN));
356 GEN_DBL_TEST (copysign (-INFINITY, NAN));
357 GEN_DBL_TEST (copysign (NAN, 0.0));
358 GEN_DBL_TEST (copysign (NAN, -0.0));
359 GEN_DBL_TEST (copysign (NAN, 1.0));
360 GEN_DBL_TEST (copysign (NAN, -1.0));
361 GEN_DBL_TEST (copysign (NAN, INFINITY));
362 GEN_DBL_TEST (copysign (NAN, -INFINITY));
363 GEN_DBL_TEST (copysign (NAN, NAN));
364 GEN_DBL_TEST (copysign (3.14, -1.0));
365 GEN_DBL_TEST (copysign (-3.14, 1.0));
366 GEN_DBL_TEST (copysign (1.0, -3.14));
367 GEN_DBL_TEST (copysign (-1.0, 3.14));
368 */
369
370 /* exp tests */
371 GEN_DBL_TEST (exp (0.0));
372 GEN_DBL_TEST (exp (-0.0));
373 GEN_DBL_TEST (exp (1.0));
374 GEN_DBL_TEST (exp (-1.0));
375 GEN_DBL_TEST (exp (INFINITY));
376 GEN_DBL_TEST (exp (-INFINITY));
377 GEN_DBL_TEST (exp (NAN));
378 GEN_DBL_TEST (exp (7.08e+02));
379 GEN_DBL_TEST (exp (7.10e+02));
380 GEN_DBL_TEST (exp (-7.40e+02));
381 GEN_DBL_TEST (exp (-7.50e+02));
382 GEN_DBL_TEST (exp (0.34));
383 GEN_DBL_TEST (exp (-0.34));
384 GEN_DBL_TEST (exp (0.35));
385 GEN_DBL_TEST (exp (-0.35));
386 GEN_DBL_TEST (exp (1.03));
387 GEN_DBL_TEST (exp (-1.03));
388 GEN_DBL_TEST (exp (1.04));
389 GEN_DBL_TEST (exp (-1.04));
390 GEN_DBL_TEST (exp (3.72e-09));
391 GEN_DBL_TEST (exp (-3.72e-09));
392 GEN_DBL_TEST (exp (3.73e-09));
393 GEN_DBL_TEST (exp (-3.73e-09));
394 GEN_DBL_TEST (exp (2.0));
395 GEN_DBL_TEST (exp (3.0));
396 GEN_DBL_TEST (exp (0.7));
397 GEN_DBL_TEST (exp (38.0));
398
399 /* expm1 tests */
400 GEN_DBL_TEST (expm1 (0.0));
401 GEN_DBL_TEST (expm1 (-0.0));
402 GEN_DBL_TEST (expm1 (1.0));
403 GEN_DBL_TEST (expm1 (-1.0));
404 GEN_DBL_TEST (expm1 (INFINITY));
405 GEN_DBL_TEST (expm1 (-INFINITY));
406 GEN_DBL_TEST (expm1 (NAN));
407 GEN_DBL_TEST (expm1 (7.08e+02));
408 GEN_DBL_TEST (expm1 (7.10e+02));
409 GEN_DBL_TEST (expm1 (-7.40e+02));
410 GEN_DBL_TEST (expm1 (-7.50e+02));
411 GEN_DBL_TEST (expm1 (0.34));
412 GEN_DBL_TEST (expm1 (-0.34));
413 GEN_DBL_TEST (expm1 (0.35));
414 GEN_DBL_TEST (expm1 (-0.35));
415 GEN_DBL_TEST (expm1 (1.03));
416 GEN_DBL_TEST (expm1 (-1.03));
417 GEN_DBL_TEST (expm1 (1.04));
418 GEN_DBL_TEST (expm1 (-1.04));
419 GEN_DBL_TEST (expm1 (3.72e-09));
420 GEN_DBL_TEST (expm1 (-3.72e-09));
421 GEN_DBL_TEST (expm1 (3.73e-09));
422 GEN_DBL_TEST (expm1 (-3.73e-09));
423 GEN_DBL_TEST (expm1 (2.0));
424 GEN_DBL_TEST (expm1 (3.0));
425 GEN_DBL_TEST (expm1 (0.7));
426 GEN_DBL_TEST (expm1 (38.0));
427
428 /* fabs tests */
429 GEN_DBL_TEST (fabs (0.0));
430 GEN_DBL_TEST (fabs (-0.0));
431 GEN_DBL_TEST (fabs (1.0));
432 GEN_DBL_TEST (fabs (-1.0));
433 GEN_DBL_TEST (fabs (INFINITY));
434 GEN_DBL_TEST (fabs (-INFINITY));
435 GEN_DBL_TEST (fabs (NAN));
436 GEN_DBL_TEST (fabs (3.14));
437 GEN_DBL_TEST (fabs (-3.14));
438 GEN_DBL_TEST (fabs (0.7));
439 GEN_DBL_TEST (fabs (-0.7));
440 GEN_DBL_TEST (fabs (3.72e-09));
441 GEN_DBL_TEST (fabs (-3.72e-09));
442 GEN_DBL_TEST (fabs (7.37e+19));
443 GEN_DBL_TEST (fabs (-7.37e+19));
444
445 /* finite tests */
446 /* SKIPPED: not publicly declared in jerry-libm
447 GEN_INT_TEST (finite (0.0));
448 GEN_INT_TEST (finite (-0.0));
449 GEN_INT_TEST (finite (1.0));
450 GEN_INT_TEST (finite (-1.0));
451 GEN_INT_TEST (finite (INFINITY));
452 GEN_INT_TEST (finite (-INFINITY));
453 GEN_INT_TEST (finite (NAN));
454 GEN_INT_TEST (finite (3.14));
455 GEN_INT_TEST (finite (-3.14));
456 GEN_INT_TEST (finite (0.7));
457 GEN_INT_TEST (finite (-0.7));
458 GEN_INT_TEST (finite (3.72e-09));
459 GEN_INT_TEST (finite (-3.72e-09));
460 GEN_INT_TEST (finite (7.37e+19));
461 GEN_INT_TEST (finite (-7.37e+19));
462 */
463
464 /* floor tests */
465 GEN_DBL_TEST (floor (0.0));
466 GEN_DBL_TEST (floor (-0.0));
467 GEN_DBL_TEST (floor (INFINITY));
468 GEN_DBL_TEST (floor (-INFINITY));
469 GEN_DBL_TEST (floor (NAN));
470 GEN_DBL_TEST (floor (3.14));
471 GEN_DBL_TEST (floor (-3.14));
472 GEN_DBL_TEST (floor (3.72e-09));
473 GEN_DBL_TEST (floor (-3.72e-09));
474 GEN_DBL_TEST (floor (7.37e+19));
475 GEN_DBL_TEST (floor (-7.37e+19));
476
477 /* fmod tests */
478 GEN_DBL_TEST (fmod (0.0, 0.0));
479 GEN_DBL_TEST (fmod (0.0, -0.0));
480 GEN_DBL_TEST (fmod (-0.0, 0.0));
481 GEN_DBL_TEST (fmod (-0.0, -0.0));
482 GEN_DBL_TEST (fmod (0.0, 3.0));
483 GEN_DBL_TEST (fmod (0.0, -3.0));
484 GEN_DBL_TEST (fmod (-0.0, 3.0));
485 GEN_DBL_TEST (fmod (-0.0, -3.0));
486 GEN_DBL_TEST (fmod (0.0, INFINITY));
487 GEN_DBL_TEST (fmod (0.0, -INFINITY));
488 GEN_DBL_TEST (fmod (-0.0, INFINITY));
489 GEN_DBL_TEST (fmod (-0.0, -INFINITY));
490 GEN_DBL_TEST (fmod (0.0, NAN));
491 GEN_DBL_TEST (fmod (-0.0, NAN));
492 GEN_DBL_TEST (fmod (3.0, 0.0));
493 GEN_DBL_TEST (fmod (3.0, -0.0));
494 GEN_DBL_TEST (fmod (-3.0, 0.0));
495 GEN_DBL_TEST (fmod (-3.0, -0.0));
496 GEN_DBL_TEST (fmod (3.0, 3.0));
497 GEN_DBL_TEST (fmod (3.0, -3.0));
498 GEN_DBL_TEST (fmod (-3.0, 3.0));
499 GEN_DBL_TEST (fmod (-3.0, -3.0));
500 GEN_DBL_TEST (fmod (3.0, INFINITY));
501 GEN_DBL_TEST (fmod (3.0, -INFINITY));
502 GEN_DBL_TEST (fmod (-3.0, INFINITY));
503 GEN_DBL_TEST (fmod (-3.0, -INFINITY));
504 GEN_DBL_TEST (fmod (3.0, NAN));
505 GEN_DBL_TEST (fmod (-3.0, NAN));
506 GEN_DBL_TEST (fmod (INFINITY, 0.0));
507 GEN_DBL_TEST (fmod (INFINITY, -0.0));
508 GEN_DBL_TEST (fmod (-INFINITY, 0.0));
509 GEN_DBL_TEST (fmod (-INFINITY, -0.0));
510 GEN_DBL_TEST (fmod (INFINITY, 3.0));
511 GEN_DBL_TEST (fmod (INFINITY, -3.0));
512 GEN_DBL_TEST (fmod (-INFINITY, 3.0));
513 GEN_DBL_TEST (fmod (-INFINITY, -3.0));
514 GEN_DBL_TEST (fmod (INFINITY, INFINITY));
515 GEN_DBL_TEST (fmod (INFINITY, -INFINITY));
516 GEN_DBL_TEST (fmod (-INFINITY, INFINITY));
517 GEN_DBL_TEST (fmod (-INFINITY, -INFINITY));
518 GEN_DBL_TEST (fmod (INFINITY, NAN));
519 GEN_DBL_TEST (fmod (-INFINITY, NAN));
520 GEN_DBL_TEST (fmod (NAN, 0.0));
521 GEN_DBL_TEST (fmod (NAN, -0.0));
522 GEN_DBL_TEST (fmod (NAN, 3.0));
523 GEN_DBL_TEST (fmod (NAN, -3.0));
524 GEN_DBL_TEST (fmod (NAN, INFINITY));
525 GEN_DBL_TEST (fmod (NAN, -INFINITY));
526 GEN_DBL_TEST (fmod (NAN, NAN));
527 GEN_DBL_TEST (fmod (3.0, 1.0));
528 GEN_DBL_TEST (fmod (3.0, -1.0));
529 GEN_DBL_TEST (fmod (-3.0, 1.0));
530 GEN_DBL_TEST (fmod (-3.0, -1.0));
531 GEN_DBL_TEST (fmod (6.5, 2.3));
532 GEN_DBL_TEST (fmod (6.5, -2.3));
533 GEN_DBL_TEST (fmod (-6.5, 2.3));
534 GEN_DBL_TEST (fmod (-6.5, -2.3));
535
536 /* isnan tests */
537 GEN_INT_TEST (isnan (0.0));
538 GEN_INT_TEST (isnan (-0.0));
539 GEN_INT_TEST (isnan (1.0));
540 GEN_INT_TEST (isnan (-1.0));
541 GEN_INT_TEST (isnan (INFINITY));
542 GEN_INT_TEST (isnan (-INFINITY));
543 GEN_INT_TEST (isnan (NAN));
544 GEN_INT_TEST (isnan (3.14));
545 GEN_INT_TEST (isnan (-3.14));
546 GEN_INT_TEST (isnan (0.7));
547 GEN_INT_TEST (isnan (-0.7));
548 GEN_INT_TEST (isnan (3.72e-09));
549 GEN_INT_TEST (isnan (-3.72e-09));
550 GEN_INT_TEST (isnan (7.37e+19));
551 GEN_INT_TEST (isnan (-7.37e+19));
552
553 /* log tests */
554 GEN_DBL_TEST (log (0.0));
555 GEN_DBL_TEST (log (-0.0));
556 GEN_DBL_TEST (log (1.0));
557 GEN_DBL_TEST (log (-1.0));
558 GEN_DBL_TEST (log (INFINITY));
559 GEN_DBL_TEST (log (-INFINITY));
560 GEN_DBL_TEST (log (NAN));
561 GEN_DBL_TEST (log (M_E));
562 GEN_DBL_TEST (log (1.0 / M_E));
563 GEN_DBL_TEST (log (2));
564 GEN_DBL_TEST (log (10));
565 GEN_DBL_TEST (log (0.7));
566 GEN_DBL_TEST (log (2.22e-308));
567 GEN_DBL_TEST (log (2.23e-308));
568 GEN_DBL_TEST (log (0.17));
569 GEN_DBL_TEST (log (0.18));
570 GEN_DBL_TEST (log (1999.0));
571 GEN_DBL_TEST (log (2000.0));
572 GEN_DBL_TEST (log (2001.0));
573
574 /* log1p tests */
575 GEN_DBL_TEST (log1p (0.0));
576 GEN_DBL_TEST (log1p (-0.0));
577 GEN_DBL_TEST (log1p (1.0));
578 GEN_DBL_TEST (log1p (-1.0));
579 GEN_DBL_TEST (log1p (INFINITY));
580 GEN_DBL_TEST (log1p (-INFINITY));
581 GEN_DBL_TEST (log1p (NAN));
582 GEN_DBL_TEST (log1p (M_E));
583 GEN_DBL_TEST (log1p (1.0 / M_E));
584 GEN_DBL_TEST (log1p (2));
585 GEN_DBL_TEST (log1p (10));
586 GEN_DBL_TEST (log1p (0.7));
587 GEN_DBL_TEST (log1p (2.22e-308));
588 GEN_DBL_TEST (log1p (2.23e-308));
589 GEN_DBL_TEST (log1p (0.17));
590 GEN_DBL_TEST (log1p (0.18));
591 GEN_DBL_TEST (log1p (1999.0));
592 GEN_DBL_TEST (log1p (2000.0));
593 GEN_DBL_TEST (log1p (2001.0));
594
595 /* log2 tests */
596 GEN_DBL_TEST (log2 (0.0));
597 GEN_DBL_TEST (log2 (-0.0));
598 GEN_DBL_TEST (log2 (1.0));
599 GEN_DBL_TEST (log2 (-1.0));
600 GEN_DBL_TEST (log2 (INFINITY));
601 GEN_DBL_TEST (log2 (-INFINITY));
602 GEN_DBL_TEST (log2 (NAN));
603 GEN_DBL_TEST (log2 (M_E));
604 GEN_DBL_TEST (log2 (1.0 / M_E));
605 GEN_DBL_TEST (log2 (2));
606 GEN_DBL_TEST (log2 (10));
607 GEN_DBL_TEST (log2 (0.7));
608 GEN_DBL_TEST (log2 (2.22e-308));
609 GEN_DBL_TEST (log2 (2.23e-308));
610 GEN_DBL_TEST (log2 (0.17));
611 GEN_DBL_TEST (log2 (0.18));
612 GEN_DBL_TEST (log2 (1999.0));
613 GEN_DBL_TEST (log2 (2000.0));
614 GEN_DBL_TEST (log2 (2001.0));
615
616 /* log10 tests */
617 GEN_DBL_TEST (log10 (0.0));
618 GEN_DBL_TEST (log10 (-0.0));
619 GEN_DBL_TEST (log10 (1.0));
620 GEN_DBL_TEST (log10 (-1.0));
621 GEN_DBL_TEST (log10 (INFINITY));
622 GEN_DBL_TEST (log10 (-INFINITY));
623 GEN_DBL_TEST (log10 (NAN));
624 GEN_DBL_TEST (log10 (M_E));
625 GEN_DBL_TEST (log10 (1.0 / M_E));
626 GEN_DBL_TEST (log10 (2));
627 GEN_DBL_TEST (log10 (10));
628 GEN_DBL_TEST (log10 (0.7));
629 GEN_DBL_TEST (log10 (2.22e-308));
630 GEN_DBL_TEST (log10 (2.23e-308));
631 GEN_DBL_TEST (log10 (0.17));
632 GEN_DBL_TEST (log10 (0.18));
633 GEN_DBL_TEST (log10 (1999.0));
634 GEN_DBL_TEST (log10 (2000.0));
635 GEN_DBL_TEST (log10 (2001.0));
636
637 /* pow tests */
638 GEN_DBL_TEST (pow (0.0, 0.0));
639 GEN_DBL_TEST (pow (0.0, -0.0));
640 GEN_DBL_TEST (pow (-0.0, 0.0));
641 GEN_DBL_TEST (pow (-0.0, -0.0));
642 GEN_DBL_TEST (pow (0.0, 1.0));
643 GEN_DBL_TEST (pow (0.0, -1.0));
644 GEN_DBL_TEST (pow (-0.0, 1.0));
645 GEN_DBL_TEST (pow (-0.0, -1.0));
646 GEN_DBL_TEST (pow (0.0, INFINITY));
647 GEN_DBL_TEST (pow (0.0, -INFINITY));
648 GEN_DBL_TEST (pow (-0.0, INFINITY));
649 GEN_DBL_TEST (pow (-0.0, -INFINITY));
650 GEN_DBL_TEST (pow (0.0, NAN));
651 GEN_DBL_TEST (pow (-0.0, NAN));
652 GEN_DBL_TEST (pow (1.0, 0.0));
653 GEN_DBL_TEST (pow (1.0, -0.0));
654 GEN_DBL_TEST (pow (-1.0, 0.0));
655 GEN_DBL_TEST (pow (-1.0, -0.0));
656 GEN_DBL_TEST (pow (1.0, 1.0));
657 GEN_DBL_TEST (pow (1.0, -1.0));
658 GEN_DBL_TEST (pow (-1.0, 1.0));
659 GEN_DBL_TEST (pow (-1.0, -1.0));
660 GEN_DBL_TEST (pow (1.0, INFINITY));
661 GEN_DBL_TEST (pow (1.0, -INFINITY));
662 GEN_DBL_TEST (pow (-1.0, INFINITY));
663 GEN_DBL_TEST (pow (-1.0, -INFINITY));
664 GEN_DBL_TEST (pow (1.0, NAN));
665 GEN_DBL_TEST (pow (-1.0, NAN));
666 GEN_DBL_TEST (pow (INFINITY, 0.0));
667 GEN_DBL_TEST (pow (INFINITY, -0.0));
668 GEN_DBL_TEST (pow (-INFINITY, 0.0));
669 GEN_DBL_TEST (pow (-INFINITY, -0.0));
670 GEN_DBL_TEST (pow (INFINITY, 1.0));
671 GEN_DBL_TEST (pow (INFINITY, -1.0));
672 GEN_DBL_TEST (pow (-INFINITY, 1.0));
673 GEN_DBL_TEST (pow (-INFINITY, -1.0));
674 GEN_DBL_TEST (pow (INFINITY, INFINITY));
675 GEN_DBL_TEST (pow (INFINITY, -INFINITY));
676 GEN_DBL_TEST (pow (-INFINITY, INFINITY));
677 GEN_DBL_TEST (pow (-INFINITY, -INFINITY));
678 GEN_DBL_TEST (pow (INFINITY, NAN));
679 GEN_DBL_TEST (pow (-INFINITY, NAN));
680 GEN_DBL_TEST (pow (NAN, 0.0));
681 GEN_DBL_TEST (pow (NAN, -0.0));
682 GEN_DBL_TEST (pow (NAN, 1.0));
683 GEN_DBL_TEST (pow (NAN, -1.0));
684 GEN_DBL_TEST (pow (NAN, INFINITY));
685 GEN_DBL_TEST (pow (NAN, -INFINITY));
686 GEN_DBL_TEST (pow (NAN, NAN));
687 GEN_DBL_TEST (pow (0.9, INFINITY));
688 GEN_DBL_TEST (pow (0.9, -INFINITY));
689 GEN_DBL_TEST (pow (-0.9, INFINITY));
690 GEN_DBL_TEST (pow (-0.9, -INFINITY));
691 GEN_DBL_TEST (pow (1.1, INFINITY));
692 GEN_DBL_TEST (pow (1.1, -INFINITY));
693 GEN_DBL_TEST (pow (-1.1, INFINITY));
694 GEN_DBL_TEST (pow (-1.1, -INFINITY));
695 GEN_DBL_TEST (pow (0.0, 2.0));
696 GEN_DBL_TEST (pow (0.0, -2.0));
697 GEN_DBL_TEST (pow (-0.0, 2.0));
698 GEN_DBL_TEST (pow (-0.0, -2.0));
699 GEN_DBL_TEST (pow (0.0, 3.0));
700 GEN_DBL_TEST (pow (0.0, -3.0));
701 GEN_DBL_TEST (pow (-0.0, 3.0));
702 GEN_DBL_TEST (pow (-0.0, -3.0));
703 GEN_DBL_TEST (pow (0.0, 3.14));
704 GEN_DBL_TEST (pow (0.0, -3.14));
705 GEN_DBL_TEST (pow (-0.0, 3.14));
706 GEN_DBL_TEST (pow (-0.0, -3.14));
707 GEN_DBL_TEST (pow (1.0, 3.14));
708 GEN_DBL_TEST (pow (1.0, -3.14));
709 GEN_DBL_TEST (pow (-1.0, 3.14));
710 GEN_DBL_TEST (pow (-1.0, -3.14));
711 GEN_DBL_TEST (pow (3.14, 0.0));
712 GEN_DBL_TEST (pow (3.14, -0.0));
713 GEN_DBL_TEST (pow (-3.14, 0.0));
714 GEN_DBL_TEST (pow (-3.14, -0.0));
715 GEN_DBL_TEST (pow (3.14, 1.0));
716 GEN_DBL_TEST (pow (3.14, -1.0));
717 GEN_DBL_TEST (pow (-3.14, 1.0));
718 GEN_DBL_TEST (pow (-3.14, -1.0));
719 GEN_DBL_TEST (pow (3.14, 2.0));
720 GEN_DBL_TEST (pow (3.14, -2.0));
721 GEN_DBL_TEST (pow (-3.14, 2.0));
722 GEN_DBL_TEST (pow (-3.14, -2.0));
723 GEN_DBL_TEST (pow (3.14, 3.0));
724 GEN_DBL_TEST (pow (3.14, -3.0));
725 GEN_DBL_TEST (pow (-3.14, 3.0));
726 GEN_DBL_TEST (pow (-3.14, -3.0));
727 GEN_DBL_TEST (pow (3.14, 3.14));
728 GEN_DBL_TEST (pow (3.14, -3.14));
729 GEN_DBL_TEST (pow (-3.14, 3.14));
730 GEN_DBL_TEST (pow (-3.14, -3.14));
731 GEN_DBL_TEST (pow (INFINITY, 2.0));
732 GEN_DBL_TEST (pow (INFINITY, -2.0));
733 GEN_DBL_TEST (pow (-INFINITY, 2.0));
734 GEN_DBL_TEST (pow (-INFINITY, -2.0));
735 GEN_DBL_TEST (pow (INFINITY, 3.0));
736 GEN_DBL_TEST (pow (INFINITY, -3.0));
737 GEN_DBL_TEST (pow (-INFINITY, 3.0));
738 GEN_DBL_TEST (pow (-INFINITY, -3.0));
739 GEN_DBL_TEST (pow (INFINITY, 3.14));
740 GEN_DBL_TEST (pow (INFINITY, -3.14));
741 GEN_DBL_TEST (pow (-INFINITY, 3.14));
742 GEN_DBL_TEST (pow (-INFINITY, -3.14));
743 GEN_DBL_TEST (pow (0.7, 1.2));
744
745 /* scalbn tests */
746 /* SKIPPED: not publicly declared in jerry-libm
747 GEN_DBL_TEST (scalbn (0.0, 0));
748 GEN_DBL_TEST (scalbn (-0.0, 0));
749 GEN_DBL_TEST (scalbn (0.0, 1));
750 GEN_DBL_TEST (scalbn (0.0, -1));
751 GEN_DBL_TEST (scalbn (-0.0, 1));
752 GEN_DBL_TEST (scalbn (-0.0, -1));
753 GEN_DBL_TEST (scalbn (1.0, 0));
754 GEN_DBL_TEST (scalbn (-1.0, 0));
755 GEN_DBL_TEST (scalbn (1.0, 1));
756 GEN_DBL_TEST (scalbn (1.0, -1));
757 GEN_DBL_TEST (scalbn (-1.0, 1));
758 GEN_DBL_TEST (scalbn (-1.0, -1));
759 GEN_DBL_TEST (scalbn (INFINITY, 0));
760 GEN_DBL_TEST (scalbn (-INFINITY, 0));
761 GEN_DBL_TEST (scalbn (INFINITY, 1));
762 GEN_DBL_TEST (scalbn (INFINITY, -1));
763 GEN_DBL_TEST (scalbn (-INFINITY, 1));
764 GEN_DBL_TEST (scalbn (-INFINITY, -1));
765 GEN_DBL_TEST (scalbn (NAN, 0));
766 GEN_DBL_TEST (scalbn (NAN, 1));
767 GEN_DBL_TEST (scalbn (NAN, -1));
768 GEN_DBL_TEST (scalbn (3.14, -1));
769 GEN_DBL_TEST (scalbn (-3.14, 1));
770 GEN_DBL_TEST (scalbn (0.7, 4));
771 GEN_DBL_TEST (scalbn (0.7, -4));
772 GEN_DBL_TEST (scalbn (-0.7, 4));
773 GEN_DBL_TEST (scalbn (-0.7, -4));
774 GEN_DBL_TEST (scalbn (0.8, 5));
775 GEN_DBL_TEST (scalbn (0.8, -5));
776 GEN_DBL_TEST (scalbn (-0.8, 5));
777 GEN_DBL_TEST (scalbn (-0.8, -5));
778 GEN_DBL_TEST (scalbn (5.55e-18, 49999));
779 GEN_DBL_TEST (scalbn (5.55e-18, 50000));
780 GEN_DBL_TEST (scalbn (5.55e-18, 50001));
781 GEN_DBL_TEST (scalbn (1.0, -49999));
782 GEN_DBL_TEST (scalbn (1.0, -50000));
783 GEN_DBL_TEST (scalbn (1.0, -50001));
784 */
785
786 /* sqrt tests */
787 GEN_DBL_TEST (sqrt (0.0));
788 GEN_DBL_TEST (sqrt (-0.0));
789 GEN_DBL_TEST (sqrt (1.0));
790 GEN_DBL_TEST (sqrt (-1.0));
791 GEN_DBL_TEST (sqrt (INFINITY));
792 GEN_DBL_TEST (sqrt (-INFINITY));
793 GEN_DBL_TEST (sqrt (NAN));
794 GEN_DBL_TEST (sqrt (0.7));
795 GEN_DBL_TEST (sqrt (2));
796 GEN_DBL_TEST (sqrt (10));
797 GEN_DBL_TEST (sqrt (2.22e-308));
798 GEN_DBL_TEST (sqrt (2.23e-308));
799 GEN_DBL_TEST (sqrt (3.72e-09));
800 GEN_DBL_TEST (sqrt (7.37e+19));
801 GEN_DBL_TEST (sqrt (2209));
802 GEN_DBL_TEST (sqrt (4));
803 GEN_DBL_TEST (sqrt (0.25));
804 GEN_DBL_TEST (sqrt (6642.25));
805 GEN_DBL_TEST (sqrt (15239.9025));
806
807 /* cbrt tests */
808 GEN_DBL_TEST (cbrt (0.0));
809 GEN_DBL_TEST (cbrt (-0.0));
810 GEN_DBL_TEST (cbrt (1.0));
811 GEN_DBL_TEST (cbrt (-1.0));
812 GEN_DBL_TEST (cbrt (INFINITY));
813 GEN_DBL_TEST (cbrt (-INFINITY));
814 GEN_DBL_TEST (cbrt (NAN));
815 GEN_DBL_TEST (cbrt (0.7));
816 GEN_DBL_TEST (cbrt (2));
817 GEN_DBL_TEST (cbrt (10));
818 GEN_DBL_TEST (cbrt (2.22e-308));
819 GEN_DBL_TEST (cbrt (2.23e-308));
820 GEN_DBL_TEST (cbrt (3.72e-09));
821 GEN_DBL_TEST (cbrt (7.37e+19));
822 GEN_DBL_TEST (cbrt (2209));
823 GEN_DBL_TEST (cbrt (4));
824 GEN_DBL_TEST (cbrt (0.25));
825 GEN_DBL_TEST (cbrt (6642.25));
826 GEN_DBL_TEST (cbrt (15239.9025));
827 GEN_DBL_TEST (cbrt (3));
828 GEN_DBL_TEST (cbrt (9));
829 GEN_DBL_TEST (cbrt (-17.87));
830 GEN_DBL_TEST (cbrt (-8941));
831
832 /* sin tests */
833 GEN_DBL_TEST (sin (0.0));
834 GEN_DBL_TEST (sin (-0.0));
835 GEN_DBL_TEST (sin (1.0));
836 GEN_DBL_TEST (sin (-1.0));
837 GEN_DBL_TEST (sin (INFINITY));
838 GEN_DBL_TEST (sin (-INFINITY));
839 GEN_DBL_TEST (sin (NAN));
840 GEN_DBL_TEST (sin (M_PI));
841 GEN_DBL_TEST (sin (-M_PI));
842 GEN_DBL_TEST (sin (2.0 * M_PI));
843 GEN_DBL_TEST (sin (-2.0 * M_PI));
844 GEN_DBL_TEST (sin (M_PI / 2.0));
845 GEN_DBL_TEST (sin (-M_PI / 2.0));
846 GEN_DBL_TEST (sin (M_PI / 3.0));
847 GEN_DBL_TEST (sin (-M_PI / 3.0));
848 GEN_DBL_TEST (sin (M_PI / 4.0));
849 GEN_DBL_TEST (sin (-M_PI / 4.0));
850 GEN_DBL_TEST (sin (M_PI / 6.0));
851 GEN_DBL_TEST (sin (-M_PI / 6.0));
852 GEN_DBL_TEST (sin (M_PI * 2.0 / 3.0));
853 GEN_DBL_TEST (sin (-M_PI * 2.0 / 3.0));
854 GEN_DBL_TEST (sin (M_PI * 5.0 / 6.0));
855 GEN_DBL_TEST (sin (-M_PI * 5.0 / 6.0));
856 GEN_DBL_TEST (sin (6.9e-18));
857 GEN_DBL_TEST (sin (-6.9e-18));
858 GEN_DBL_TEST (sin (7.0e-18));
859 GEN_DBL_TEST (sin (-7.0e-18));
860 GEN_DBL_TEST (sin (7.4e-9));
861 GEN_DBL_TEST (sin (-7.4e-9));
862 GEN_DBL_TEST (sin (7.5e-9));
863 GEN_DBL_TEST (sin (-7.5e-9));
864 GEN_DBL_TEST (sin (0.2));
865 GEN_DBL_TEST (sin (-0.2));
866 GEN_DBL_TEST (sin (0.4));
867 GEN_DBL_TEST (sin (-0.4));
868 GEN_DBL_TEST (sin (0.7));
869 GEN_DBL_TEST (sin (-0.7));
870 GEN_DBL_TEST (sin (0.8));
871 GEN_DBL_TEST (sin (-0.8));
872 GEN_DBL_TEST (sin (3.0));
873 GEN_DBL_TEST (sin (-3.0));
874 GEN_DBL_TEST (sin (4.0));
875 GEN_DBL_TEST (sin (-4.0));
876 GEN_DBL_TEST (sin (6.0));
877 GEN_DBL_TEST (sin (-6.0));
878 GEN_DBL_TEST (sin (7.0));
879 GEN_DBL_TEST (sin (-7.0));
880
881 /* cos tests */
882 GEN_DBL_TEST (cos (0.0));
883 GEN_DBL_TEST (cos (-0.0));
884 GEN_DBL_TEST (cos (1.0));
885 GEN_DBL_TEST (cos (-1.0));
886 GEN_DBL_TEST (cos (INFINITY));
887 GEN_DBL_TEST (cos (-INFINITY));
888 GEN_DBL_TEST (cos (NAN));
889 GEN_DBL_TEST (cos (M_PI));
890 GEN_DBL_TEST (cos (-M_PI));
891 GEN_DBL_TEST (cos (2.0 * M_PI));
892 GEN_DBL_TEST (cos (-2.0 * M_PI));
893 GEN_DBL_TEST (cos (M_PI / 2.0));
894 GEN_DBL_TEST (cos (-M_PI / 2.0));
895 GEN_DBL_TEST (cos (M_PI / 3.0));
896 GEN_DBL_TEST (cos (-M_PI / 3.0));
897 GEN_DBL_TEST (cos (M_PI / 4.0));
898 GEN_DBL_TEST (cos (-M_PI / 4.0));
899 GEN_DBL_TEST (cos (M_PI / 6.0));
900 GEN_DBL_TEST (cos (-M_PI / 6.0));
901 GEN_DBL_TEST (cos (M_PI * 2.0 / 3.0));
902 GEN_DBL_TEST (cos (-M_PI * 2.0 / 3.0));
903 GEN_DBL_TEST (cos (M_PI * 5.0 / 6.0));
904 GEN_DBL_TEST (cos (-M_PI * 5.0 / 6.0));
905 GEN_DBL_TEST (cos (6.9e-18));
906 GEN_DBL_TEST (cos (-6.9e-18));
907 GEN_DBL_TEST (cos (7.0e-18));
908 GEN_DBL_TEST (cos (-7.0e-18));
909 GEN_DBL_TEST (cos (7.4e-9));
910 GEN_DBL_TEST (cos (-7.4e-9));
911 GEN_DBL_TEST (cos (7.5e-9));
912 GEN_DBL_TEST (cos (-7.5e-9));
913 GEN_DBL_TEST (cos (0.2));
914 GEN_DBL_TEST (cos (-0.2));
915 GEN_DBL_TEST (cos (0.4));
916 GEN_DBL_TEST (cos (-0.4));
917 GEN_DBL_TEST (cos (0.7));
918 GEN_DBL_TEST (cos (-0.7));
919 GEN_DBL_TEST (cos (0.8));
920 GEN_DBL_TEST (cos (-0.8));
921 GEN_DBL_TEST (cos (3.0));
922 GEN_DBL_TEST (cos (-3.0));
923 GEN_DBL_TEST (cos (4.0));
924 GEN_DBL_TEST (cos (-4.0));
925 GEN_DBL_TEST (cos (6.0));
926 GEN_DBL_TEST (cos (-6.0));
927 GEN_DBL_TEST (cos (7.0));
928 GEN_DBL_TEST (cos (-7.0));
929
930 /* tan tests */
931 GEN_DBL_TEST (tan (0.0));
932 GEN_DBL_TEST (tan (-0.0));
933 GEN_DBL_TEST (tan (1.0));
934 GEN_DBL_TEST (tan (-1.0));
935 GEN_DBL_TEST (tan (INFINITY));
936 GEN_DBL_TEST (tan (-INFINITY));
937 GEN_DBL_TEST (tan (NAN));
938 GEN_DBL_TEST (tan (M_PI));
939 GEN_DBL_TEST (tan (-M_PI));
940 GEN_DBL_TEST (tan (2.0 * M_PI));
941 GEN_DBL_TEST (tan (-2.0 * M_PI));
942 GEN_DBL_TEST (tan (M_PI / 2.0));
943 GEN_DBL_TEST (tan (-M_PI / 2.0));
944 GEN_DBL_TEST (tan (M_PI / 3.0));
945 GEN_DBL_TEST (tan (-M_PI / 3.0));
946 GEN_DBL_TEST (tan (M_PI / 4.0));
947 GEN_DBL_TEST (tan (-M_PI / 4.0));
948 GEN_DBL_TEST (tan (M_PI / 6.0));
949 GEN_DBL_TEST (tan (-M_PI / 6.0));
950 GEN_DBL_TEST (tan (M_PI * 2.0 / 3.0));
951 GEN_DBL_TEST (tan (-M_PI * 2.0 / 3.0));
952 GEN_DBL_TEST (tan (M_PI * 5.0 / 6.0));
953 GEN_DBL_TEST (tan (-M_PI * 5.0 / 6.0));
954 GEN_DBL_TEST (tan (3.7e-9));
955 GEN_DBL_TEST (tan (-3.7e-9));
956 GEN_DBL_TEST (tan (3.8e-9));
957 GEN_DBL_TEST (tan (-3.8e-9));
958 GEN_DBL_TEST (tan (0.6));
959 GEN_DBL_TEST (tan (-0.6));
960 GEN_DBL_TEST (tan (0.7));
961 GEN_DBL_TEST (tan (-0.7));
962 GEN_DBL_TEST (tan (3.0));
963 GEN_DBL_TEST (tan (-3.0));
964 GEN_DBL_TEST (tan (4.0));
965 GEN_DBL_TEST (tan (-4.0));
966 GEN_DBL_TEST (tan (6.0));
967 GEN_DBL_TEST (tan (-6.0));
968 GEN_DBL_TEST (tan (7.0));
969 GEN_DBL_TEST (tan (-7.0));
970
971 /* cosh tests */
972 GEN_DBL_TEST (cosh (0.0));
973 GEN_DBL_TEST (cosh (-0.0));
974 GEN_DBL_TEST (cosh (1.0));
975 GEN_DBL_TEST (cosh (-1.0));
976 GEN_DBL_TEST (cosh (INFINITY));
977 GEN_DBL_TEST (cosh (-INFINITY));
978 GEN_DBL_TEST (cosh (NAN));
979 GEN_DBL_TEST (cosh (M_PI));
980 GEN_DBL_TEST (cosh (-M_PI));
981 GEN_DBL_TEST (cosh (2.0 * M_PI));
982 GEN_DBL_TEST (cosh (-2.0 * M_PI));
983 GEN_DBL_TEST (cosh (M_PI / 2.0));
984 GEN_DBL_TEST (cosh (-M_PI / 2.0));
985 GEN_DBL_TEST (cosh (M_PI / 3.0));
986 GEN_DBL_TEST (cosh (-M_PI / 3.0));
987 GEN_DBL_TEST (cosh (M_PI / 4.0));
988 GEN_DBL_TEST (cosh (-M_PI / 4.0));
989 GEN_DBL_TEST (cosh (M_PI / 6.0));
990 GEN_DBL_TEST (cosh (-M_PI / 6.0));
991 GEN_DBL_TEST (cosh (M_PI * 2.0 / 3.0));
992 GEN_DBL_TEST (cosh (-M_PI * 2.0 / 3.0));
993 GEN_DBL_TEST (cosh (M_PI * 5.0 / 6.0));
994 GEN_DBL_TEST (cosh (-M_PI * 5.0 / 6.0));
995 GEN_DBL_TEST (cosh (6.9e-18));
996 GEN_DBL_TEST (cosh (-6.9e-18));
997 GEN_DBL_TEST (cosh (7.0e-18));
998 GEN_DBL_TEST (cosh (-7.0e-18));
999 GEN_DBL_TEST (cosh (7.4e-9));
1000 GEN_DBL_TEST (cosh (-7.4e-9));
1001 GEN_DBL_TEST (cosh (7.5e-9));
1002 GEN_DBL_TEST (cosh (-7.5e-9));
1003 GEN_DBL_TEST (cosh (0.2));
1004 GEN_DBL_TEST (cosh (-0.2));
1005 GEN_DBL_TEST (cosh (0.4));
1006 GEN_DBL_TEST (cosh (-0.4));
1007 GEN_DBL_TEST (cosh (0.7));
1008 GEN_DBL_TEST (cosh (-0.7));
1009 GEN_DBL_TEST (cosh (0.8));
1010 GEN_DBL_TEST (cosh (-0.8));
1011 GEN_DBL_TEST (cosh (3.0));
1012 GEN_DBL_TEST (cosh (-3.0));
1013 GEN_DBL_TEST (cosh (4.0));
1014 GEN_DBL_TEST (cosh (-4.0));
1015 GEN_DBL_TEST (cosh (6.0));
1016 GEN_DBL_TEST (cosh (-6.0));
1017 GEN_DBL_TEST (cosh (7.0));
1018 GEN_DBL_TEST (cosh (-7.0));
1019
1020 /* sinh tests */
1021 GEN_DBL_TEST (sinh (0.0));
1022 GEN_DBL_TEST (sinh (-0.0));
1023 GEN_DBL_TEST (sinh (1.0));
1024 GEN_DBL_TEST (sinh (-1.0));
1025 GEN_DBL_TEST (sinh (INFINITY));
1026 GEN_DBL_TEST (sinh (-INFINITY));
1027 GEN_DBL_TEST (sinh (NAN));
1028 GEN_DBL_TEST (sinh (M_PI));
1029 GEN_DBL_TEST (sinh (-M_PI));
1030 GEN_DBL_TEST (sinh (2.0 * M_PI));
1031 GEN_DBL_TEST (sinh (-2.0 * M_PI));
1032 GEN_DBL_TEST (sinh (M_PI / 2.0));
1033 GEN_DBL_TEST (sinh (-M_PI / 2.0));
1034 GEN_DBL_TEST (sinh (M_PI / 3.0));
1035 GEN_DBL_TEST (sinh (-M_PI / 3.0));
1036 GEN_DBL_TEST (sinh (M_PI / 4.0));
1037 GEN_DBL_TEST (sinh (-M_PI / 4.0));
1038 GEN_DBL_TEST (sinh (M_PI / 6.0));
1039 GEN_DBL_TEST (sinh (-M_PI / 6.0));
1040 GEN_DBL_TEST (sinh (M_PI * 2.0 / 3.0));
1041 GEN_DBL_TEST (sinh (-M_PI * 2.0 / 3.0));
1042 GEN_DBL_TEST (sinh (M_PI * 5.0 / 6.0));
1043 GEN_DBL_TEST (sinh (-M_PI * 5.0 / 6.0));
1044 GEN_DBL_TEST (sinh (6.9e-18));
1045 GEN_DBL_TEST (sinh (-6.9e-18));
1046 GEN_DBL_TEST (sinh (7.0e-18));
1047 GEN_DBL_TEST (sinh (-7.0e-18));
1048 GEN_DBL_TEST (sinh (7.4e-9));
1049 GEN_DBL_TEST (sinh (-7.4e-9));
1050 GEN_DBL_TEST (sinh (7.5e-9));
1051 GEN_DBL_TEST (sinh (-7.5e-9));
1052 GEN_DBL_TEST (sinh (0.2));
1053 GEN_DBL_TEST (sinh (-0.2));
1054 GEN_DBL_TEST (sinh (0.4));
1055 GEN_DBL_TEST (sinh (-0.4));
1056 GEN_DBL_TEST (sinh (0.7));
1057 GEN_DBL_TEST (sinh (-0.7));
1058 GEN_DBL_TEST (sinh (0.8));
1059 GEN_DBL_TEST (sinh (-0.8));
1060 GEN_DBL_TEST (sinh (3.0));
1061 GEN_DBL_TEST (sinh (-3.0));
1062 GEN_DBL_TEST (sinh (4.0));
1063 GEN_DBL_TEST (sinh (-4.0));
1064 GEN_DBL_TEST (sinh (6.0));
1065 GEN_DBL_TEST (sinh (-6.0));
1066 GEN_DBL_TEST (sinh (7.0));
1067 GEN_DBL_TEST (sinh (-7.0));
1068
1069 /* tanh tests */
1070 GEN_DBL_TEST (tanh (0.0));
1071 GEN_DBL_TEST (tanh (-0.0));
1072 GEN_DBL_TEST (tanh (1.0));
1073 GEN_DBL_TEST (tanh (-1.0));
1074 GEN_DBL_TEST (tanh (INFINITY));
1075 GEN_DBL_TEST (tanh (-INFINITY));
1076 GEN_DBL_TEST (tanh (NAN));
1077 GEN_DBL_TEST (tanh (M_PI));
1078 GEN_DBL_TEST (tanh (-M_PI));
1079 GEN_DBL_TEST (tanh (2.0 * M_PI));
1080 GEN_DBL_TEST (tanh (-2.0 * M_PI));
1081 GEN_DBL_TEST (tanh (M_PI / 2.0));
1082 GEN_DBL_TEST (tanh (-M_PI / 2.0));
1083 GEN_DBL_TEST (tanh (M_PI / 3.0));
1084 GEN_DBL_TEST (tanh (-M_PI / 3.0));
1085 GEN_DBL_TEST (tanh (M_PI / 4.0));
1086 GEN_DBL_TEST (tanh (-M_PI / 4.0));
1087 GEN_DBL_TEST (tanh (M_PI / 6.0));
1088 GEN_DBL_TEST (tanh (-M_PI / 6.0));
1089 GEN_DBL_TEST (tanh (M_PI * 2.0 / 3.0));
1090 GEN_DBL_TEST (tanh (-M_PI * 2.0 / 3.0));
1091 GEN_DBL_TEST (tanh (M_PI * 5.0 / 6.0));
1092 GEN_DBL_TEST (tanh (-M_PI * 5.0 / 6.0));
1093 GEN_DBL_TEST (tanh (6.9e-18));
1094 GEN_DBL_TEST (tanh (-6.9e-18));
1095 GEN_DBL_TEST (tanh (7.0e-18));
1096 GEN_DBL_TEST (tanh (-7.0e-18));
1097 GEN_DBL_TEST (tanh (7.4e-9));
1098 GEN_DBL_TEST (tanh (-7.4e-9));
1099 GEN_DBL_TEST (tanh (7.5e-9));
1100 GEN_DBL_TEST (tanh (-7.5e-9));
1101 GEN_DBL_TEST (tanh (0.2));
1102 GEN_DBL_TEST (tanh (-0.2));
1103 GEN_DBL_TEST (tanh (0.4));
1104 GEN_DBL_TEST (tanh (-0.4));
1105 GEN_DBL_TEST (tanh (0.7));
1106 GEN_DBL_TEST (tanh (-0.7));
1107 GEN_DBL_TEST (tanh (0.8));
1108 GEN_DBL_TEST (tanh (-0.8));
1109 GEN_DBL_TEST (tanh (3.0));
1110 GEN_DBL_TEST (tanh (-3.0));
1111 GEN_DBL_TEST (tanh (4.0));
1112 GEN_DBL_TEST (tanh (-4.0));
1113 GEN_DBL_TEST (tanh (6.0));
1114 GEN_DBL_TEST (tanh (-6.0));
1115 GEN_DBL_TEST (tanh (7.0));
1116 GEN_DBL_TEST (tanh (-7.0));
1117 } /* main */
1118