1 /* Copyright (C) 1997-2013 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Andreas Jaeger <aj@suse.de>, 1997.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 /* Part of testsuite for libm.
21 This file is processed by a perl script. The resulting file has to
22 be included by a master file that defines:
25 FUNC(function): converts general function name (like cos) to
26 name with correct suffix (e.g. cosl or cosf)
27 MATHCONST(x): like FUNC but for constants (e.g convert 0.0 to 0.0L)
28 FLOAT: floating point type to test
29 - TEST_MSG: informal message to be displayed
30 CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat):
31 chooses one of the parameters as delta for testing
33 PRINTF_EXPR Floating point conversion specification to print a variable
34 of type FLOAT with printf. PRINTF_EXPR just contains
35 the specifier, not the percent and width arguments,
37 PRINTF_XEXPR Like PRINTF_EXPR, but print in hexadecimal format.
38 PRINTF_NEXPR Like PRINTF_EXPR, but print nice. */
40 /* This testsuite has currently tests for:
41 acos, acosh, asin, asinh, atan, atan2, atanh,
42 cbrt, ceil, copysign, cos, cosh, erf, erfc, exp, exp10, exp2, expm1,
43 fabs, fdim, finite, floor, fma, fmax, fmin, fmod, fpclassify,
45 ilogb, isfinite, isinf, isnan, isnormal,
46 isless, islessequal, isgreater, isgreaterequal, islessgreater, isunordered,
48 ldexp, lgamma, log, log10, log1p, log2, logb,
49 modf, nearbyint, nextafter, nexttoward,
50 pow, remainder, remquo, rint, lrint, llrint,
51 round, lround, llround,
52 scalb, scalbn, scalbln, signbit, sin, sincos, sinh, sqrt, tan, tanh, tgamma, trunc,
53 y0, y1, yn, significand
55 and for the following complex math functions:
56 cabs, cacos, cacosh, carg, casin, casinh, catan, catanh,
57 ccos, ccosh, cexp, cimag, clog, clog10, conj, cpow, cproj, creal,
58 csin, csinh, csqrt, ctan, ctanh.
60 At the moment the following functions and macros aren't tested:
61 drem (alias for remainder),
64 pow10 (alias for exp10).
66 Parameter handling is primitive in the moment:
67 --verbose=[0..3] for different levels of output:
69 1: basic report on failed tests (default)
70 2: full report on all tests
71 -v for full output (equals --verbose=3)
72 -u for generation of an ULPs file
77 This suite tests some aspects of the correct implementation of
78 mathematical functions in libm. Some simple, specific parameters
79 are tested for correctness but there's no exhaustive
80 testing. Handling of specific inputs (e.g. infinity, not-a-number)
81 is also tested. Correct handling of exceptions is checked
82 against. These implemented tests should check all cases that are
85 Exception testing: At the moment only divide-by-zero, invalid,
86 overflow and underflow exceptions are tested. Inexact exceptions
87 aren't checked at the moment.
89 NaN values: There exist signalling and quiet NaNs. This implementation
90 only uses quiet NaN as parameter but does not differentiate
91 between the two kinds of NaNs as result. Where the sign of a NaN is
92 significant, this is not tested.
94 Inline functions: Inlining functions should give an improvement in
95 speed - but not in precission. The inlined functions return
96 reasonable values for a reasonable range of input values. The
97 result is not necessarily correct for all values and exceptions are
98 not correctly raised in all cases. Problematic input and return
99 values are infinity, not-a-number and minus zero. This suite
100 therefore does not check these specific inputs and the exception
101 handling for inlined mathematical functions - just the "reasonable"
104 Beware: The tests might fail for any of the following reasons:
106 - Functions are wrong
107 - Floating Point Unit not working properly
108 - Compiler has errors
110 With e.g. gcc 2.7.2.2 the test for cexp fails because of a compiler error.
113 To Do: All parameter should be numbers that can be represented as
114 exact floating point values. Currently some values cannot be
115 represented exactly and therefore the result is not the expected
116 result. For this we will use 36 digits so that numbers can be
117 represented exactly. */
123 #include "libm-test-ulps.h"
135 #include <tininess.h>
137 /* Allow platforms without all rounding modes to test properly,
138 assuming they provide an __FE_UNDEFINED in <bits/fenv.h> which
139 causes fesetround() to return failure. */
141 # define FE_TONEAREST __FE_UNDEFINED
143 #ifndef FE_TOWARDZERO
144 # define FE_TOWARDZERO __FE_UNDEFINED
147 # define FE_UPWARD __FE_UNDEFINED
150 # define FE_DOWNWARD __FE_UNDEFINED
153 /* Possible exceptions */
154 #define NO_EXCEPTION 0x0
155 #define INVALID_EXCEPTION 0x1
156 #define DIVIDE_BY_ZERO_EXCEPTION 0x2
157 #define OVERFLOW_EXCEPTION 0x4
158 #define UNDERFLOW_EXCEPTION 0x8
159 /* The next flags signals that those exceptions are allowed but not required. */
160 #define INVALID_EXCEPTION_OK 0x10
161 #define DIVIDE_BY_ZERO_EXCEPTION_OK 0x20
162 #define OVERFLOW_EXCEPTION_OK 0x40
163 #define UNDERFLOW_EXCEPTION_OK 0x80
164 #define EXCEPTIONS_OK INVALID_EXCEPTION_OK+DIVIDE_BY_ZERO_EXCEPTION_OK
165 /* Some special test flags, passed together with exceptions. */
166 #define IGNORE_ZERO_INF_SIGN 0x100
168 /* Values underflowing only for float. */
170 # define UNDERFLOW_EXCEPTION_FLOAT UNDERFLOW_EXCEPTION
171 # define UNDERFLOW_EXCEPTION_OK_FLOAT UNDERFLOW_EXCEPTION_OK
173 # define UNDERFLOW_EXCEPTION_FLOAT 0
174 # define UNDERFLOW_EXCEPTION_OK_FLOAT 0
176 /* Values underflowing only for double or types with a larger least
177 positive normal value. */
178 #if defined TEST_FLOAT || defined TEST_DOUBLE \
179 || (defined TEST_LDOUBLE && LDBL_MIN_EXP >= DBL_MIN_EXP)
180 # define UNDERFLOW_EXCEPTION_DOUBLE UNDERFLOW_EXCEPTION
182 # define UNDERFLOW_EXCEPTION_DOUBLE 0
184 /* Values underflowing only for IBM long double or types with a larger least
185 positive normal value. */
186 #if defined TEST_FLOAT || (defined TEST_LDOUBLE && LDBL_MIN_EXP > DBL_MIN_EXP)
187 # define UNDERFLOW_EXCEPTION_LDOUBLE_IBM UNDERFLOW_EXCEPTION
189 # define UNDERFLOW_EXCEPTION_LDOUBLE_IBM 0
191 /* Values underflowing on architectures detecting tininess before
192 rounding, but not on those detecting tininess after rounding. */
193 #define UNDERFLOW_EXCEPTION_BEFORE_ROUNDING (TININESS_AFTER_ROUNDING \
195 : UNDERFLOW_EXCEPTION)
197 /* Various constants (we must supply them precalculated for accuracy). */
198 #define M_PI_6l .52359877559829887307710723054658383L
199 #define M_E2l 7.389056098930650227230427460575008L
200 #define M_E3l 20.085536923187667740928529654581719L
201 #define M_2_SQRT_PIl 3.5449077018110320545963349666822903L /* 2 sqrt (M_PIl) */
202 #define M_SQRT_PIl 1.7724538509055160272981674833411451L /* sqrt (M_PIl) */
203 #define M_LOG_SQRT_PIl 0.57236494292470008707171367567652933L /* log(sqrt(M_PIl)) */
204 #define M_LOG_2_SQRT_PIl 1.265512123484645396488945797134706L /* log(2*sqrt(M_PIl)) */
205 #define M_PI_34l (M_PIl - M_PI_4l) /* 3*pi/4 */
206 #define M_PI_34_LOG10El (M_PIl - M_PI_4l) * M_LOG10El
207 #define M_PI2_LOG10El M_PI_2l * M_LOG10El
208 #define M_PI4_LOG10El M_PI_4l * M_LOG10El
209 #define M_PI_LOG10El M_PIl * M_LOG10El
210 #define M_SQRT_2_2 0.70710678118654752440084436210484903L /* sqrt (2) / 2 */
212 static FILE *ulps_file; /* File to document difference. */
213 static int output_ulps; /* Should ulps printed? */
215 static int noErrors; /* number of errors */
216 static int noTests; /* number of tests (without testing exceptions) */
217 static int noExcTests; /* number of tests for exception flags */
218 static int noXFails; /* number of expected failures. */
219 static int noXPasses; /* number of unexpected passes. */
222 static int output_max_error; /* Should the maximal errors printed? */
223 static int output_points; /* Should the single function results printed? */
224 static int ignore_max_ulp; /* Should we ignore max_ulp? */
226 static FLOAT minus_zero, plus_zero;
227 static FLOAT plus_infty, minus_infty, qnan_value, max_value, min_value;
228 static FLOAT min_subnorm_value;
230 static FLOAT max_error, real_max_error, imag_max_error;
233 #define BUILD_COMPLEX(real, imag) \
234 ({ __complex__ FLOAT __retval; \
235 __real__ __retval = (real); \
236 __imag__ __retval = (imag); \
239 #define BUILD_COMPLEX_INT(real, imag) \
240 ({ __complex__ int __retval; \
241 __real__ __retval = (real); \
242 __imag__ __retval = (imag); \
246 #define MANT_DIG CHOOSE ((LDBL_MANT_DIG-1), (DBL_MANT_DIG-1), (FLT_MANT_DIG-1), \
247 (LDBL_MANT_DIG-1), (DBL_MANT_DIG-1), (FLT_MANT_DIG-1))
250 init_max_error (void)
255 feclearexcept (FE_ALL_EXCEPT);
259 set_max_error (FLOAT current, FLOAT *curr_max_error)
261 if (current > *curr_max_error)
262 *curr_max_error = current;
266 /* Should the message print to screen? This depends on the verbose flag,
267 and the test status. */
269 print_screen (int ok, int xfail)
273 || (verbose == 1 && ok == xfail)))
279 /* Should the message print to screen? This depends on the verbose flag,
280 and the test status. */
282 print_screen_max_error (int ok, int xfail)
286 || ((verbose == 1) && (ok == xfail))))
291 /* Update statistic counters. */
293 update_stats (int ok, int xfail)
298 else if (!ok && xfail)
300 else if (!ok && !xfail)
305 print_ulps (const char *test_name, FLOAT ulp)
309 fprintf (ulps_file, "Test \"%s\":\n", test_name);
310 fprintf (ulps_file, "%s: %.0" PRINTF_NEXPR "\n",
311 CHOOSE("ldouble", "double", "float",
312 "ildouble", "idouble", "ifloat"),
318 print_function_ulps (const char *function_name, FLOAT ulp)
322 fprintf (ulps_file, "Function: \"%s\":\n", function_name);
323 fprintf (ulps_file, "%s: %.0" PRINTF_NEXPR "\n",
324 CHOOSE("ldouble", "double", "float",
325 "ildouble", "idouble", "ifloat"),
332 print_complex_function_ulps (const char *function_name, FLOAT real_ulp,
339 fprintf (ulps_file, "Function: Real part of \"%s\":\n", function_name);
340 fprintf (ulps_file, "%s: %.0" PRINTF_NEXPR "\n",
341 CHOOSE("ldouble", "double", "float",
342 "ildouble", "idouble", "ifloat"),
343 FUNC(ceil) (real_ulp));
347 fprintf (ulps_file, "Function: Imaginary part of \"%s\":\n", function_name);
348 fprintf (ulps_file, "%s: %.0" PRINTF_NEXPR "\n",
349 CHOOSE("ldouble", "double", "float",
350 "ildouble", "idouble", "ifloat"),
351 FUNC(ceil) (imag_ulp));
360 /* Test if Floating-Point stack hasn't changed */
362 fpstack_test (const char *test_name)
364 #if defined (__i386__) || defined (__x86_64__)
365 static int old_stack;
368 asm ("fnstsw" : "=a" (sw));
374 printf ("FP-Stack wrong after test %s (%d, should be %d)\n",
375 test_name, sw, old_stack);
384 print_max_error (const char *func_name, FLOAT allowed, int xfail)
388 if (max_error == 0.0 || (max_error <= allowed && !ignore_max_ulp))
394 print_function_ulps (func_name, max_error);
397 if (print_screen_max_error (ok, xfail))
399 printf ("Maximal error of `%s'\n", func_name);
400 printf (" is : %.0" PRINTF_NEXPR " ulp\n", FUNC(ceil) (max_error));
401 printf (" accepted: %.0" PRINTF_NEXPR " ulp\n", FUNC(ceil) (allowed));
404 update_stats (ok, xfail);
409 print_complex_max_error (const char *func_name, __complex__ FLOAT allowed,
410 __complex__ int xfail)
414 if ((real_max_error == 0 && imag_max_error == 0)
415 || (real_max_error <= __real__ allowed
416 && imag_max_error <= __imag__ allowed
423 print_complex_function_ulps (func_name, real_max_error, imag_max_error);
426 if (print_screen_max_error (ok, xfail))
428 printf ("Maximal error of real part of: %s\n", func_name);
429 printf (" is : %.0" PRINTF_NEXPR " ulp\n",
430 FUNC(ceil) (real_max_error));
431 printf (" accepted: %.0" PRINTF_NEXPR " ulp\n",
432 FUNC(ceil) (__real__ allowed));
433 printf ("Maximal error of imaginary part of: %s\n", func_name);
434 printf (" is : %.0" PRINTF_NEXPR " ulp\n",
435 FUNC(ceil) (imag_max_error));
436 printf (" accepted: %.0" PRINTF_NEXPR " ulp\n",
437 FUNC(ceil) (__imag__ allowed));
440 update_stats (ok, xfail);
444 /* Test whether a given exception was raised. */
446 test_single_exception (const char *test_name,
450 const char *flag_name)
454 if (exception & exc_flag)
456 if (fetestexcept (fe_flag))
458 if (print_screen (1, 0))
459 printf ("Pass: %s: Exception \"%s\" set\n", test_name, flag_name);
464 if (print_screen (0, 0))
465 printf ("Failure: %s: Exception \"%s\" not set\n",
466 test_name, flag_name);
471 if (fetestexcept (fe_flag))
474 if (print_screen (0, 0))
475 printf ("Failure: %s: Exception \"%s\" set\n",
476 test_name, flag_name);
480 if (print_screen (1, 0))
481 printf ("%s: Exception \"%s\" not set\n", test_name,
492 /* Test whether exceptions given by EXCEPTION are raised. Ignore thereby
493 allowed but not required exceptions.
496 test_exceptions (const char *test_name, int exception)
500 if ((exception & DIVIDE_BY_ZERO_EXCEPTION_OK) == 0)
501 test_single_exception (test_name, exception,
502 DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
506 if ((exception & INVALID_EXCEPTION_OK) == 0)
507 test_single_exception (test_name, exception, INVALID_EXCEPTION, FE_INVALID,
508 "Invalid operation");
511 if ((exception & OVERFLOW_EXCEPTION_OK) == 0)
512 test_single_exception (test_name, exception, OVERFLOW_EXCEPTION,
513 FE_OVERFLOW, "Overflow");
516 if ((exception & UNDERFLOW_EXCEPTION_OK) == 0)
517 test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION,
518 FE_UNDERFLOW, "Underflow");
520 feclearexcept (FE_ALL_EXCEPT);
525 check_float_internal (const char *test_name, FLOAT computed, FLOAT expected,
526 FLOAT max_ulp, int xfail, int exceptions,
527 FLOAT *curr_max_error)
534 test_exceptions (test_name, exceptions);
535 if (isnan (computed) && isnan (expected))
537 else if (isinf (computed) && isinf (expected))
539 /* Test for sign of infinities. */
540 if ((exceptions & IGNORE_ZERO_INF_SIGN) == 0
541 && signbit (computed) != signbit (expected))
544 printf ("infinity has wrong sign.\n");
549 /* Don't calc ulp for NaNs or infinities. */
550 else if (isinf (computed) || isnan (computed) || isinf (expected) || isnan (expected))
554 diff = FUNC(fabs) (computed - expected);
555 switch (fpclassify (expected))
558 /* ilogb (0) isn't allowed. */
559 ulp = diff / FUNC(ldexp) (1.0, - MANT_DIG);
562 ulp = diff / FUNC(ldexp) (1.0, FUNC(ilogb) (expected) - MANT_DIG);
565 /* 1ulp for a subnormal value, shifted by MANT_DIG, is the
566 least normal value. */
567 ulp = (FUNC(ldexp) (diff, MANT_DIG) / min_value);
570 /* It should never happen. */
574 set_max_error (ulp, curr_max_error);
576 if ((exceptions & IGNORE_ZERO_INF_SIGN) == 0
577 && computed == 0.0 && expected == 0.0
578 && signbit(computed) != signbit (expected))
580 else if (ulp <= 0.5 || (ulp <= max_ulp && !ignore_max_ulp))
585 print_ulps (test_name, ulp);
589 if (print_screen (ok, xfail))
592 printf ("Failure: ");
593 printf ("Test: %s\n", test_name);
594 printf ("Result:\n");
595 printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
597 printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
601 printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
603 printf (" ulp : % .4" PRINTF_NEXPR "\n", ulp);
604 printf (" max.ulp : % .4" PRINTF_NEXPR "\n", max_ulp);
607 update_stats (ok, xfail);
609 fpstack_test (test_name);
614 check_float (const char *test_name, FLOAT computed, FLOAT expected,
615 FLOAT max_ulp, int xfail, int exceptions)
617 check_float_internal (test_name, computed, expected, max_ulp, xfail,
618 exceptions, &max_error);
623 check_complex (const char *test_name, __complex__ FLOAT computed,
624 __complex__ FLOAT expected,
625 __complex__ FLOAT max_ulp, __complex__ int xfail,
628 FLOAT part_comp, part_exp, part_max_ulp;
632 if (asprintf (&str, "Real part of: %s", test_name) == -1)
635 part_comp = __real__ computed;
636 part_exp = __real__ expected;
637 part_max_ulp = __real__ max_ulp;
638 part_xfail = __real__ xfail;
640 check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail,
641 exception, &real_max_error);
644 if (asprintf (&str, "Imaginary part of: %s", test_name) == -1)
647 part_comp = __imag__ computed;
648 part_exp = __imag__ expected;
649 part_max_ulp = __imag__ max_ulp;
650 part_xfail = __imag__ xfail;
652 /* Don't check again for exceptions, just pass through the
653 zero/inf sign test. */
654 check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail,
655 exception & IGNORE_ZERO_INF_SIGN,
661 /* Check that computed and expected values are equal (int values). */
663 check_int (const char *test_name, int computed, int expected, int max_ulp,
664 int xfail, int exceptions)
666 int diff = computed - expected;
669 test_exceptions (test_name, exceptions);
671 if (abs (diff) <= max_ulp)
675 print_ulps (test_name, diff);
677 if (print_screen (ok, xfail))
680 printf ("Failure: ");
681 printf ("Test: %s\n", test_name);
682 printf ("Result:\n");
683 printf (" is: %d\n", computed);
684 printf (" should be: %d\n", expected);
687 update_stats (ok, xfail);
688 fpstack_test (test_name);
692 /* Check that computed and expected values are equal (long int values). */
694 check_long (const char *test_name, long int computed, long int expected,
695 long int max_ulp, int xfail, int exceptions)
697 long int diff = computed - expected;
700 test_exceptions (test_name, exceptions);
702 if (labs (diff) <= max_ulp)
706 print_ulps (test_name, diff);
708 if (print_screen (ok, xfail))
711 printf ("Failure: ");
712 printf ("Test: %s\n", test_name);
713 printf ("Result:\n");
714 printf (" is: %ld\n", computed);
715 printf (" should be: %ld\n", expected);
718 update_stats (ok, xfail);
719 fpstack_test (test_name);
723 /* Check that computed value is true/false. */
725 check_bool (const char *test_name, int computed, int expected,
726 long int max_ulp, int xfail, int exceptions)
730 test_exceptions (test_name, exceptions);
732 if ((computed == 0) == (expected == 0))
735 if (print_screen (ok, xfail))
738 printf ("Failure: ");
739 printf ("Test: %s\n", test_name);
740 printf ("Result:\n");
741 printf (" is: %d\n", computed);
742 printf (" should be: %d\n", expected);
745 update_stats (ok, xfail);
746 fpstack_test (test_name);
750 /* check that computed and expected values are equal (long int values) */
752 check_longlong (const char *test_name, long long int computed,
753 long long int expected,
754 long long int max_ulp, int xfail,
757 long long int diff = computed - expected;
760 test_exceptions (test_name, exceptions);
762 if (llabs (diff) <= max_ulp)
766 print_ulps (test_name, diff);
768 if (print_screen (ok, xfail))
772 printf ("Test: %s\n", test_name);
773 printf ("Result:\n");
774 printf (" is: %lld\n", computed);
775 printf (" should be: %lld\n", expected);
778 update_stats (ok, xfail);
779 fpstack_test (test_name);
784 /* This is to prevent messages from the SVID libm emulation. */
786 matherr (struct exception *x __attribute__ ((unused)))
792 /****************************************************************************
793 Tests for single functions of libm.
794 Please keep them alphabetically sorted!
795 ****************************************************************************/
803 /* Function not implemented. */
808 TEST_f_f (acos, plus_infty, qnan_value, INVALID_EXCEPTION);
809 TEST_f_f (acos, minus_infty, qnan_value, INVALID_EXCEPTION);
810 TEST_f_f (acos, qnan_value, qnan_value);
813 TEST_f_f (acos, 1.125L, qnan_value, INVALID_EXCEPTION);
814 TEST_f_f (acos, -1.125L, qnan_value, INVALID_EXCEPTION);
815 TEST_f_f (acos, max_value, qnan_value, INVALID_EXCEPTION);
816 TEST_f_f (acos, -max_value, qnan_value, INVALID_EXCEPTION);
818 TEST_f_f (acos, 0, M_PI_2l);
819 TEST_f_f (acos, minus_zero, M_PI_2l);
820 TEST_f_f (acos, 1, 0);
821 TEST_f_f (acos, -1, M_PIl);
822 TEST_f_f (acos, 0.5, M_PI_6l*2.0);
823 TEST_f_f (acos, -0.5, M_PI_6l*4.0);
824 TEST_f_f (acos, 0.75L, 0.722734247813415611178377352641333362L);
825 TEST_f_f (acos, 2e-17L, 1.57079632679489659923132169163975144L);
826 TEST_f_f (acos, 0.0625L, 1.50825556499840522843072005474337068L);
827 TEST_f_f (acos, 0x0.ffffffp0L, 3.4526698471620358760324948263873649728491e-4L);
828 TEST_f_f (acos, -0x0.ffffffp0L, 3.1412473866050770348750401337968641476999L);
830 TEST_f_f (acos, 0x0.ffffffff8p0L, 1.5258789062648029736620564947844627548516e-5L);
831 TEST_f_f (acos, -0x0.ffffffff8p0L, 3.1415773948007305904329067627145550395696L);
832 TEST_f_f (acos, 0x0.ffffffffffffp0L, 8.4293697021788088529885473244391795127130e-8L);
833 TEST_f_f (acos, -0x0.ffffffffffffp0L, 3.1415925692960962166745548533940296398054L);
835 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
836 TEST_f_f (acos, 0x0.ffffffffffffffffp0L, 3.2927225399135962333718255320079907245059e-10L);
837 TEST_f_f (acos, -0x0.ffffffffffffffffp0L, 3.1415926532605209844712837599423203309964L);
844 acos_test_tonearest (void)
850 /* Function not implemented. */
853 START (acos_tonearest);
855 save_round_mode = fegetround ();
857 if (!fesetround (FE_TONEAREST))
859 TEST_f_f (acos, 0, M_PI_2l);
860 TEST_f_f (acos, minus_zero, M_PI_2l);
861 TEST_f_f (acos, 1, 0);
862 TEST_f_f (acos, -1, M_PIl);
863 TEST_f_f (acos, 0.5, M_PI_6l*2.0);
864 TEST_f_f (acos, -0.5, M_PI_6l*4.0);
867 fesetround (save_round_mode);
869 END (acos_tonearest);
874 acos_test_towardzero (void)
880 /* Function not implemented. */
883 START (acos_towardzero);
885 save_round_mode = fegetround ();
887 if (!fesetround (FE_TOWARDZERO))
889 TEST_f_f (acos, 0, M_PI_2l);
890 TEST_f_f (acos, minus_zero, M_PI_2l);
891 TEST_f_f (acos, 1, 0);
892 TEST_f_f (acos, -1, M_PIl);
893 TEST_f_f (acos, 0.5, M_PI_6l*2.0);
894 TEST_f_f (acos, -0.5, M_PI_6l*4.0);
897 fesetround (save_round_mode);
899 END (acos_towardzero);
904 acos_test_downward (void)
910 /* Function not implemented. */
913 START (acos_downward);
915 save_round_mode = fegetround ();
917 if (!fesetround (FE_DOWNWARD))
919 TEST_f_f (acos, 0, M_PI_2l);
920 TEST_f_f (acos, minus_zero, M_PI_2l);
921 TEST_f_f (acos, 1, 0);
922 TEST_f_f (acos, -1, M_PIl);
923 TEST_f_f (acos, 0.5, M_PI_6l*2.0);
924 TEST_f_f (acos, -0.5, M_PI_6l*4.0);
927 fesetround (save_round_mode);
934 acos_test_upward (void)
940 /* Function not implemented. */
945 save_round_mode = fegetround ();
947 if (!fesetround (FE_UPWARD))
949 TEST_f_f (acos, 0, M_PI_2l);
950 TEST_f_f (acos, minus_zero, M_PI_2l);
951 TEST_f_f (acos, 1, 0);
952 TEST_f_f (acos, -1, M_PIl);
953 TEST_f_f (acos, 0.5, M_PI_6l*2.0);
954 TEST_f_f (acos, -0.5, M_PI_6l*4.0);
957 fesetround (save_round_mode);
968 /* Function not implemented. */
973 TEST_f_f (acosh, plus_infty, plus_infty);
974 TEST_f_f (acosh, minus_infty, qnan_value, INVALID_EXCEPTION);
975 TEST_f_f (acosh, qnan_value, qnan_value);
978 TEST_f_f (acosh, -1.125L, qnan_value, INVALID_EXCEPTION);
979 TEST_f_f (acosh, -max_value, qnan_value, INVALID_EXCEPTION);
981 TEST_f_f (acosh, 1, 0);
982 TEST_f_f (acosh, 7, 2.63391579384963341725009269461593689L);
993 /* Function not implemented. */
998 TEST_f_f (asin, plus_infty, qnan_value, INVALID_EXCEPTION);
999 TEST_f_f (asin, minus_infty, qnan_value, INVALID_EXCEPTION);
1000 TEST_f_f (asin, qnan_value, qnan_value);
1002 /* asin x == qNaN plus invalid exception for |x| > 1. */
1003 TEST_f_f (asin, 1.125L, qnan_value, INVALID_EXCEPTION);
1004 TEST_f_f (asin, -1.125L, qnan_value, INVALID_EXCEPTION);
1005 TEST_f_f (asin, max_value, qnan_value, INVALID_EXCEPTION);
1006 TEST_f_f (asin, -max_value, qnan_value, INVALID_EXCEPTION);
1008 TEST_f_f (asin, 0, 0);
1009 TEST_f_f (asin, minus_zero, minus_zero);
1010 TEST_f_f (asin, 0.5, M_PI_6l);
1011 TEST_f_f (asin, -0.5, -M_PI_6l);
1012 TEST_f_f (asin, 1.0, M_PI_2l);
1013 TEST_f_f (asin, -1.0, -M_PI_2l);
1014 TEST_f_f (asin, 0.75L, 0.848062078981481008052944338998418080L);
1015 TEST_f_f (asin, 0x0.ffffffp0L, 1.5704510598101804156437184421571127056013L);
1016 TEST_f_f (asin, -0x0.ffffffp0L, -1.5704510598101804156437184421571127056013L);
1018 TEST_f_f (asin, 0x0.ffffffff8p0L, 1.5707810680058339712015850710748035974710L);
1019 TEST_f_f (asin, -0x0.ffffffff8p0L, -1.5707810680058339712015850710748035974710L);
1020 TEST_f_f (asin, 0x0.ffffffffffffp0L, 1.5707962425011995974432331617542781977068L);
1021 TEST_f_f (asin, -0x0.ffffffffffffp0L, -1.5707962425011995974432331617542781977068L);
1023 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
1024 TEST_f_f (asin, 0x0.ffffffffffffffffp0L, 1.5707963264656243652399620683025688888978L);
1025 TEST_f_f (asin, -0x0.ffffffffffffffffp0L, -1.5707963264656243652399620683025688888978L);
1033 asin_test_tonearest (void)
1035 int save_round_mode;
1038 if (errno == ENOSYS)
1039 /* Function not implemented. */
1042 START (asin_tonearest);
1044 save_round_mode = fegetround ();
1046 if (!fesetround (FE_TONEAREST))
1048 TEST_f_f (asin, 0, 0);
1049 TEST_f_f (asin, minus_zero, minus_zero);
1050 TEST_f_f (asin, 0.5, M_PI_6l);
1051 TEST_f_f (asin, -0.5, -M_PI_6l);
1052 TEST_f_f (asin, 1.0, M_PI_2l);
1053 TEST_f_f (asin, -1.0, -M_PI_2l);
1056 fesetround (save_round_mode);
1058 END (asin_tonearest);
1063 asin_test_towardzero (void)
1065 int save_round_mode;
1068 if (errno == ENOSYS)
1069 /* Function not implemented. */
1072 START (asin_towardzero);
1074 save_round_mode = fegetround ();
1076 if (!fesetround (FE_TOWARDZERO))
1078 TEST_f_f (asin, 0, 0);
1079 TEST_f_f (asin, minus_zero, minus_zero);
1080 TEST_f_f (asin, 0.5, M_PI_6l);
1081 TEST_f_f (asin, -0.5, -M_PI_6l);
1082 TEST_f_f (asin, 1.0, M_PI_2l);
1083 TEST_f_f (asin, -1.0, -M_PI_2l);
1086 fesetround (save_round_mode);
1088 END (asin_towardzero);
1093 asin_test_downward (void)
1095 int save_round_mode;
1098 if (errno == ENOSYS)
1099 /* Function not implemented. */
1102 START (asin_downward);
1104 save_round_mode = fegetround ();
1106 if (!fesetround (FE_DOWNWARD))
1108 TEST_f_f (asin, 0, 0);
1109 TEST_f_f (asin, minus_zero, minus_zero);
1110 TEST_f_f (asin, 0.5, M_PI_6l);
1111 TEST_f_f (asin, -0.5, -M_PI_6l);
1112 TEST_f_f (asin, 1.0, M_PI_2l);
1113 TEST_f_f (asin, -1.0, -M_PI_2l);
1116 fesetround (save_round_mode);
1118 END (asin_downward);
1123 asin_test_upward (void)
1125 int save_round_mode;
1128 if (errno == ENOSYS)
1129 /* Function not implemented. */
1132 START (asin_upward);
1134 save_round_mode = fegetround ();
1136 if (!fesetround (FE_UPWARD))
1138 TEST_f_f (asin, 0, 0);
1139 TEST_f_f (asin, minus_zero, minus_zero);
1140 TEST_f_f (asin, 0.5, M_PI_6l);
1141 TEST_f_f (asin, -0.5, -M_PI_6l);
1142 TEST_f_f (asin, 1.0, M_PI_2l);
1143 TEST_f_f (asin, -1.0, -M_PI_2l);
1146 fesetround (save_round_mode);
1156 if (errno == ENOSYS)
1157 /* Function not implemented. */
1162 TEST_f_f (asinh, 0, 0);
1163 TEST_f_f (asinh, minus_zero, minus_zero);
1165 TEST_f_f (asinh, plus_infty, plus_infty);
1166 TEST_f_f (asinh, minus_infty, minus_infty);
1168 TEST_f_f (asinh, qnan_value, qnan_value);
1169 TEST_f_f (asinh, 0.75L, 0.693147180559945309417232121458176568L);
1179 if (errno == ENOSYS)
1180 /* Function not implemented. */
1185 TEST_f_f (atan, 0, 0);
1186 TEST_f_f (atan, minus_zero, minus_zero);
1188 TEST_f_f (atan, plus_infty, M_PI_2l);
1189 TEST_f_f (atan, minus_infty, -M_PI_2l);
1190 TEST_f_f (atan, qnan_value, qnan_value);
1191 TEST_f_f (atan, max_value, M_PI_2l);
1192 TEST_f_f (atan, -max_value, -M_PI_2l);
1194 TEST_f_f (atan, 1, M_PI_4l);
1195 TEST_f_f (atan, -1, -M_PI_4l);
1197 TEST_f_f (atan, 0.75L, 0.643501108793284386802809228717322638L);
1199 TEST_f_f (atan, 0x1p-100L, 0x1p-100L);
1201 TEST_f_f (atan, 0x1p-600L, 0x1p-600L);
1203 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
1204 TEST_f_f (atan, 0x1p-10000L, 0x1p-10000L);
1217 if (errno == ENOSYS)
1218 /* Function not implemented. */
1224 TEST_f_f (atanh, 0, 0);
1225 TEST_f_f (atanh, minus_zero, minus_zero);
1227 TEST_f_f (atanh, 1, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
1228 TEST_f_f (atanh, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
1229 TEST_f_f (atanh, qnan_value, qnan_value);
1231 /* atanh (x) == qNaN plus invalid exception if |x| > 1. */
1232 TEST_f_f (atanh, 1.125L, qnan_value, INVALID_EXCEPTION);
1233 TEST_f_f (atanh, -1.125L, qnan_value, INVALID_EXCEPTION);
1234 TEST_f_f (atanh, max_value, qnan_value, INVALID_EXCEPTION);
1235 TEST_f_f (atanh, -max_value, qnan_value, INVALID_EXCEPTION);
1237 TEST_f_f (atanh, 0.75L, 0.972955074527656652552676371721589865L);
1246 FUNC(atan2) (-0, 1);
1247 if (errno == ENOSYS)
1248 /* Function not implemented. */
1253 /* atan2 (0,x) == 0 for x > 0. */
1254 TEST_ff_f (atan2, 0, 1, 0);
1256 /* atan2 (-0,x) == -0 for x > 0. */
1257 TEST_ff_f (atan2, minus_zero, 1, minus_zero);
1259 TEST_ff_f (atan2, 0, 0, 0);
1260 TEST_ff_f (atan2, minus_zero, 0, minus_zero);
1262 /* atan2 (+0,x) == +pi for x < 0. */
1263 TEST_ff_f (atan2, 0, -1, M_PIl);
1265 /* atan2 (-0,x) == -pi for x < 0. */
1266 TEST_ff_f (atan2, minus_zero, -1, -M_PIl);
1268 TEST_ff_f (atan2, 0, minus_zero, M_PIl);
1269 TEST_ff_f (atan2, minus_zero, minus_zero, -M_PIl);
1271 /* atan2 (y,+0) == pi/2 for y > 0. */
1272 TEST_ff_f (atan2, 1, 0, M_PI_2l);
1274 /* atan2 (y,-0) == pi/2 for y > 0. */
1275 TEST_ff_f (atan2, 1, minus_zero, M_PI_2l);
1277 /* atan2 (y,+0) == -pi/2 for y < 0. */
1278 TEST_ff_f (atan2, -1, 0, -M_PI_2l);
1280 /* atan2 (y,-0) == -pi/2 for y < 0. */
1281 TEST_ff_f (atan2, -1, minus_zero, -M_PI_2l);
1283 /* atan2 (y,inf) == +0 for finite y > 0. */
1284 TEST_ff_f (atan2, 1, plus_infty, 0);
1286 /* atan2 (y,inf) == -0 for finite y < 0. */
1287 TEST_ff_f (atan2, -1, plus_infty, minus_zero);
1289 /* atan2(+inf, x) == pi/2 for finite x. */
1290 TEST_ff_f (atan2, plus_infty, -1, M_PI_2l);
1292 /* atan2(-inf, x) == -pi/2 for finite x. */
1293 TEST_ff_f (atan2, minus_infty, 1, -M_PI_2l);
1295 /* atan2 (y,-inf) == +pi for finite y > 0. */
1296 TEST_ff_f (atan2, 1, minus_infty, M_PIl);
1298 /* atan2 (y,-inf) == -pi for finite y < 0. */
1299 TEST_ff_f (atan2, -1, minus_infty, -M_PIl);
1301 TEST_ff_f (atan2, plus_infty, plus_infty, M_PI_4l);
1302 TEST_ff_f (atan2, minus_infty, plus_infty, -M_PI_4l);
1303 TEST_ff_f (atan2, plus_infty, minus_infty, M_PI_34l);
1304 TEST_ff_f (atan2, minus_infty, minus_infty, -M_PI_34l);
1305 TEST_ff_f (atan2, qnan_value, qnan_value, qnan_value);
1307 TEST_ff_f (atan2, max_value, max_value, M_PI_4l);
1309 TEST_ff_f (atan2, max_value, min_value, M_PI_2l);
1310 TEST_ff_f (atan2, -max_value, -min_value, -M_PI_2l);
1312 TEST_ff_f (atan2, 0.75L, 1, 0.643501108793284386802809228717322638L);
1313 TEST_ff_f (atan2, -0.75L, 1.0L, -0.643501108793284386802809228717322638L);
1314 TEST_ff_f (atan2, 0.75L, -1.0L, 2.49809154479650885165983415456218025L);
1315 TEST_ff_f (atan2, -0.75L, -1.0L, -2.49809154479650885165983415456218025L);
1316 TEST_ff_f (atan2, 0.390625L, .00029L, 1.57005392693128974780151246612928941L);
1317 TEST_ff_f (atan2, 1.390625L, 0.9296875L, 0.981498387184244311516296577615519772L);
1319 TEST_ff_f (atan2, -0.00756827042671106339L, -.001792735857538728036L, -1.80338464113663849327153994379639112L);
1320 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
1321 TEST_ff_f (atan2, 0x1.00000000000001p0L, 0x1.00000000000001p0L, M_PI_4l);
1331 FUNC(cabs) (BUILD_COMPLEX (0.7L, 12.4L));
1332 if (errno == ENOSYS)
1333 /* Function not implemented. */
1338 /* cabs (x + iy) is specified as hypot (x,y) */
1340 /* cabs (+inf + i x) == +inf. */
1341 TEST_c_f (cabs, plus_infty, 1.0, plus_infty);
1342 /* cabs (-inf + i x) == +inf. */
1343 TEST_c_f (cabs, minus_infty, 1.0, plus_infty);
1345 TEST_c_f (cabs, minus_infty, qnan_value, plus_infty);
1346 TEST_c_f (cabs, minus_infty, qnan_value, plus_infty);
1348 TEST_c_f (cabs, qnan_value, qnan_value, qnan_value);
1350 /* cabs (x,y) == cabs (y,x). */
1351 TEST_c_f (cabs, 0.75L, 12.390625L, 12.4133028598606664302388810868156657L);
1352 /* cabs (x,y) == cabs (-x,y). */
1353 TEST_c_f (cabs, -12.390625L, 0.75L, 12.4133028598606664302388810868156657L);
1354 /* cabs (x,y) == cabs (-y,x). */
1355 TEST_c_f (cabs, -0.75L, 12.390625L, 12.4133028598606664302388810868156657L);
1356 /* cabs (x,y) == cabs (-x,-y). */
1357 TEST_c_f (cabs, -12.390625L, -0.75L, 12.4133028598606664302388810868156657L);
1358 /* cabs (x,y) == cabs (-y,-x). */
1359 TEST_c_f (cabs, -0.75L, -12.390625L, 12.4133028598606664302388810868156657L);
1360 /* cabs (x,0) == fabs (x). */
1361 TEST_c_f (cabs, -0.75L, 0, 0.75L);
1362 TEST_c_f (cabs, 0.75L, 0, 0.75L);
1363 TEST_c_f (cabs, -1.0L, 0, 1.0L);
1364 TEST_c_f (cabs, 1.0L, 0, 1.0L);
1365 TEST_c_f (cabs, -5.7e7L, 0, 5.7e7L);
1366 TEST_c_f (cabs, 5.7e7L, 0, 5.7e7L);
1368 TEST_c_f (cabs, 0.75L, 1.25L, 1.45773797371132511771853821938639577L);
1378 FUNC(cacos) (BUILD_COMPLEX (0.7L, 1.2L));
1379 if (errno == ENOSYS)
1380 /* Function not implemented. */
1386 TEST_c_c (cacos, 0, 0, M_PI_2l, minus_zero);
1387 TEST_c_c (cacos, minus_zero, 0, M_PI_2l, minus_zero);
1388 TEST_c_c (cacos, minus_zero, minus_zero, M_PI_2l, 0.0);
1389 TEST_c_c (cacos, 0, minus_zero, M_PI_2l, 0.0);
1391 TEST_c_c (cacos, minus_infty, plus_infty, M_PI_34l, minus_infty);
1392 TEST_c_c (cacos, minus_infty, minus_infty, M_PI_34l, plus_infty);
1394 TEST_c_c (cacos, plus_infty, plus_infty, M_PI_4l, minus_infty);
1395 TEST_c_c (cacos, plus_infty, minus_infty, M_PI_4l, plus_infty);
1397 TEST_c_c (cacos, -10.0, plus_infty, M_PI_2l, minus_infty);
1398 TEST_c_c (cacos, -10.0, minus_infty, M_PI_2l, plus_infty);
1399 TEST_c_c (cacos, 0, plus_infty, M_PI_2l, minus_infty);
1400 TEST_c_c (cacos, 0, minus_infty, M_PI_2l, plus_infty);
1401 TEST_c_c (cacos, 0.1L, plus_infty, M_PI_2l, minus_infty);
1402 TEST_c_c (cacos, 0.1L, minus_infty, M_PI_2l, plus_infty);
1404 TEST_c_c (cacos, minus_infty, 0, M_PIl, minus_infty);
1405 TEST_c_c (cacos, minus_infty, minus_zero, M_PIl, plus_infty);
1406 TEST_c_c (cacos, minus_infty, 100, M_PIl, minus_infty);
1407 TEST_c_c (cacos, minus_infty, -100, M_PIl, plus_infty);
1409 TEST_c_c (cacos, plus_infty, 0, 0.0, minus_infty);
1410 TEST_c_c (cacos, plus_infty, minus_zero, 0.0, plus_infty);
1411 TEST_c_c (cacos, plus_infty, 0.5, 0.0, minus_infty);
1412 TEST_c_c (cacos, plus_infty, -0.5, 0.0, plus_infty);
1414 TEST_c_c (cacos, plus_infty, qnan_value, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN);
1415 TEST_c_c (cacos, minus_infty, qnan_value, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN);
1417 TEST_c_c (cacos, 0, qnan_value, M_PI_2l, qnan_value);
1418 TEST_c_c (cacos, minus_zero, qnan_value, M_PI_2l, qnan_value);
1420 TEST_c_c (cacos, qnan_value, plus_infty, qnan_value, minus_infty);
1421 TEST_c_c (cacos, qnan_value, minus_infty, qnan_value, plus_infty);
1423 TEST_c_c (cacos, 10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1424 TEST_c_c (cacos, -10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1426 TEST_c_c (cacos, qnan_value, 0.75, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1427 TEST_c_c (cacos, qnan_value, -0.75, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1429 TEST_c_c (cacos, qnan_value, qnan_value, qnan_value, qnan_value);
1431 TEST_c_c (cacos, plus_zero, -1.5L, M_PI_2l, 1.194763217287109304111930828519090523536L);
1432 TEST_c_c (cacos, minus_zero, -1.5L, M_PI_2l, 1.194763217287109304111930828519090523536L);
1433 TEST_c_c (cacos, plus_zero, -1.0L, M_PI_2l, 0.8813735870195430252326093249797923090282L);
1434 TEST_c_c (cacos, minus_zero, -1.0L, M_PI_2l, 0.8813735870195430252326093249797923090282L);
1435 TEST_c_c (cacos, plus_zero, -0.5L, M_PI_2l, 0.4812118250596034474977589134243684231352L);
1436 TEST_c_c (cacos, minus_zero, -0.5L, M_PI_2l, 0.4812118250596034474977589134243684231352L);
1437 TEST_c_c (cacos, plus_zero, 0.5L, M_PI_2l, -0.4812118250596034474977589134243684231352L);
1438 TEST_c_c (cacos, minus_zero, 0.5L, M_PI_2l, -0.4812118250596034474977589134243684231352L);
1439 TEST_c_c (cacos, plus_zero, 1.0L, M_PI_2l, -0.8813735870195430252326093249797923090282L);
1440 TEST_c_c (cacos, minus_zero, 1.0L, M_PI_2l, -0.8813735870195430252326093249797923090282L);
1441 TEST_c_c (cacos, plus_zero, 1.5L, M_PI_2l, -1.194763217287109304111930828519090523536L);
1442 TEST_c_c (cacos, minus_zero, 1.5L, M_PI_2l, -1.194763217287109304111930828519090523536L);
1444 TEST_c_c (cacos, -1.5L, plus_zero, M_PIl, -0.9624236501192068949955178268487368462704L);
1445 TEST_c_c (cacos, -1.5L, minus_zero, M_PIl, 0.9624236501192068949955178268487368462704L);
1446 TEST_c_c (cacos, -1.0L, plus_zero, M_PIl, minus_zero);
1447 TEST_c_c (cacos, -1.0L, minus_zero, M_PIl, plus_zero);
1448 TEST_c_c (cacos, -0.5L, plus_zero, 2.094395102393195492308428922186335256131L, minus_zero);
1449 TEST_c_c (cacos, -0.5L, minus_zero, 2.094395102393195492308428922186335256131L, plus_zero);
1450 TEST_c_c (cacos, 0.5L, plus_zero, 1.047197551196597746154214461093167628066L, minus_zero);
1451 TEST_c_c (cacos, 0.5L, minus_zero, 1.047197551196597746154214461093167628066L, plus_zero);
1452 TEST_c_c (cacos, 1.0L, plus_zero, plus_zero, minus_zero);
1453 TEST_c_c (cacos, 1.0L, minus_zero, plus_zero, plus_zero);
1454 TEST_c_c (cacos, 1.5L, plus_zero, plus_zero, -0.9624236501192068949955178268487368462704L);
1455 TEST_c_c (cacos, 1.5L, minus_zero, plus_zero, 0.9624236501192068949955178268487368462704L);
1457 TEST_c_c (cacos, 0x1p50L, 1.0L, 8.881784197001252323389053344727730248720e-16L, -3.535050620855721078027883819436720218708e1L);
1458 TEST_c_c (cacos, 0x1p50L, -1.0L, 8.881784197001252323389053344727730248720e-16L, 3.535050620855721078027883819436720218708e1L);
1459 TEST_c_c (cacos, -0x1p50L, 1.0L, 3.141592653589792350284223683154270545292L, -3.535050620855721078027883819436720218708e1L);
1460 TEST_c_c (cacos, -0x1p50L, -1.0L, 3.141592653589792350284223683154270545292L, 3.535050620855721078027883819436720218708e1L);
1461 TEST_c_c (cacos, 1.0L, 0x1p50L, 1.570796326794895731052901991514519103193L, -3.535050620855721078027883819436759661753e1L);
1462 TEST_c_c (cacos, -1.0L, 0x1p50L, 1.570796326794897507409741391764983781004L, -3.535050620855721078027883819436759661753e1L);
1463 TEST_c_c (cacos, 1.0L, -0x1p50L, 1.570796326794895731052901991514519103193L, 3.535050620855721078027883819436759661753e1L);
1464 TEST_c_c (cacos, -1.0L, -0x1p50L, 1.570796326794897507409741391764983781004L, 3.535050620855721078027883819436759661753e1L);
1466 TEST_c_c (cacos, 0x1p500L, 1.0L, 3.054936363499604682051979393213617699789e-151L, -3.472667374605326000180332928505464606058e2L);
1467 TEST_c_c (cacos, 0x1p500L, -1.0L, 3.054936363499604682051979393213617699789e-151L, 3.472667374605326000180332928505464606058e2L);
1468 TEST_c_c (cacos, -0x1p500L, 1.0L, 3.141592653589793238462643383279502884197L, -3.472667374605326000180332928505464606058e2L);
1469 TEST_c_c (cacos, -0x1p500L, -1.0L, 3.141592653589793238462643383279502884197L, 3.472667374605326000180332928505464606058e2L);
1470 TEST_c_c (cacos, 1.0L, 0x1p500L, 1.570796326794896619231321691639751442099L, -3.472667374605326000180332928505464606058e2L);
1471 TEST_c_c (cacos, -1.0L, 0x1p500L, 1.570796326794896619231321691639751442099L, -3.472667374605326000180332928505464606058e2L);
1472 TEST_c_c (cacos, 1.0L, -0x1p500L, 1.570796326794896619231321691639751442099L, 3.472667374605326000180332928505464606058e2L);
1473 TEST_c_c (cacos, -1.0L, -0x1p500L, 1.570796326794896619231321691639751442099L, 3.472667374605326000180332928505464606058e2L);
1475 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
1476 TEST_c_c (cacos, 0x1p5000L, 1.0L, 7.079811261048172892385615158694057552948e-1506L, -3.466429049980286492395577839412341016946e3L);
1477 TEST_c_c (cacos, 0x1p5000L, -1.0L, 7.079811261048172892385615158694057552948e-1506L, 3.466429049980286492395577839412341016946e3L);
1478 TEST_c_c (cacos, -0x1p5000L, 1.0L, 3.141592653589793238462643383279502884197L, -3.466429049980286492395577839412341016946e3L);
1479 TEST_c_c (cacos, -0x1p5000L, -1.0L, 3.141592653589793238462643383279502884197L, 3.466429049980286492395577839412341016946e3L);
1480 TEST_c_c (cacos, 1.0L, 0x1p5000L, 1.570796326794896619231321691639751442099L, -3.466429049980286492395577839412341016946e3L);
1481 TEST_c_c (cacos, -1.0L, 0x1p5000L, 1.570796326794896619231321691639751442099L, -3.466429049980286492395577839412341016946e3L);
1482 TEST_c_c (cacos, 1.0L, -0x1p5000L, 1.570796326794896619231321691639751442099L, 3.466429049980286492395577839412341016946e3L);
1483 TEST_c_c (cacos, -1.0L, -0x1p5000L, 1.570796326794896619231321691639751442099L, 3.466429049980286492395577839412341016946e3L);
1486 TEST_c_c (cacos, 0x1.fp127L, 0x1.fp127L, 7.853981633974483096156608458198757210493e-1L, -8.973081118419833726837456344608533993585e1L);
1488 TEST_c_c (cacos, 0x1.fp1023L, 0x1.fp1023L, 7.853981633974483096156608458198757210493e-1L, -7.107906849659093345062145442726115449315e2L);
1490 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
1491 TEST_c_c (cacos, 0x1.fp16383L, 0x1.fp16383L, 7.853981633974483096156608458198757210493e-1L, -1.135753137836666928715489992987020363057e4L);
1494 TEST_c_c (cacos, 0x1.fp-129L, 1.5L, 1.570796326794896619231321691639751442097L, -1.194763217287109304111930828519090523536L);
1495 TEST_c_c (cacos, 0x1.fp-129L, -1.5L, 1.570796326794896619231321691639751442097L, 1.194763217287109304111930828519090523536L);
1496 TEST_c_c (cacos, -0x1.fp-129L, 1.5L, 1.570796326794896619231321691639751442100L, -1.194763217287109304111930828519090523536L);
1497 TEST_c_c (cacos, -0x1.fp-129L, -1.5L, 1.570796326794896619231321691639751442100L, 1.194763217287109304111930828519090523536L);
1498 TEST_c_c (cacos, 1.5L, 0x1.fp-129L, 2.546345110742945032959687790021055102355e-39L, -9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION_FLOAT);
1499 TEST_c_c (cacos, -1.5L, 0x1.fp-129L, 3.141592653589793238462643383279502884195L, -9.624236501192068949955178268487368462704e-1L);
1500 TEST_c_c (cacos, 1.5L, -0x1.fp-129L, 2.546345110742945032959687790021055102355e-39L, 9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION_FLOAT);
1501 TEST_c_c (cacos, -1.5L, -0x1.fp-129L, 3.141592653589793238462643383279502884195L, 9.624236501192068949955178268487368462704e-1L);
1503 TEST_c_c (cacos, 0x1.fp-1025L, 1.5L, 1.570796326794896619231321691639751442099L, -1.194763217287109304111930828519090523536L);
1504 TEST_c_c (cacos, 0x1.fp-1025L, -1.5L, 1.570796326794896619231321691639751442099L, 1.194763217287109304111930828519090523536L);
1505 TEST_c_c (cacos, -0x1.fp-1025L, 1.5L, 1.570796326794896619231321691639751442099L, -1.194763217287109304111930828519090523536L);
1506 TEST_c_c (cacos, -0x1.fp-1025L, -1.5L, 1.570796326794896619231321691639751442099L, 1.194763217287109304111930828519090523536L);
1507 TEST_c_c (cacos, 1.5L, 0x1.fp-1025L, 4.819934639999230680322935210539402497827e-309L, -9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION_DOUBLE);
1508 TEST_c_c (cacos, -1.5L, 0x1.fp-1025L, 3.141592653589793238462643383279502884197L, -9.624236501192068949955178268487368462704e-1L);
1509 TEST_c_c (cacos, 1.5L, -0x1.fp-1025L, 4.819934639999230680322935210539402497827e-309L, 9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION_DOUBLE);
1510 TEST_c_c (cacos, -1.5L, -0x1.fp-1025L, 3.141592653589793238462643383279502884197L, 9.624236501192068949955178268487368462704e-1L);
1512 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
1513 TEST_c_c (cacos, 0x1.fp-16385L, 1.5L, 1.570796326794896619231321691639751442099L, -1.194763217287109304111930828519090523536L);
1514 TEST_c_c (cacos, 0x1.fp-16385L, -1.5L, 1.570796326794896619231321691639751442099L, 1.194763217287109304111930828519090523536L);
1515 TEST_c_c (cacos, -0x1.fp-16385L, 1.5L, 1.570796326794896619231321691639751442099L, -1.194763217287109304111930828519090523536L);
1516 TEST_c_c (cacos, -0x1.fp-16385L, -1.5L, 1.570796326794896619231321691639751442099L, 1.194763217287109304111930828519090523536L);
1517 TEST_c_c (cacos, 1.5L, 0x1.fp-16385L, 7.282957076134209141226696333885150260319e-4933L, -9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION);
1518 TEST_c_c (cacos, -1.5L, 0x1.fp-16385L, 3.141592653589793238462643383279502884197L, -9.624236501192068949955178268487368462704e-1L);
1519 TEST_c_c (cacos, 1.5L, -0x1.fp-16385L, 7.282957076134209141226696333885150260319e-4933L, 9.624236501192068949955178268487368462704e-1L, UNDERFLOW_EXCEPTION);
1520 TEST_c_c (cacos, -1.5L, -0x1.fp-16385L, 3.141592653589793238462643383279502884197L, 9.624236501192068949955178268487368462704e-1L);
1523 TEST_c_c (cacos, 0.75L, 1.25L, 1.11752014915610270578240049553777969L, -1.13239363160530819522266333696834467L);
1524 TEST_c_c (cacos, -2, -3, 2.1414491111159960199416055713254211L, 1.9833870299165354323470769028940395L);
1526 END (cacos, complex);
1533 FUNC(cacosh) (BUILD_COMPLEX (0.7L, 1.2L));
1534 if (errno == ENOSYS)
1535 /* Function not implemented. */
1541 TEST_c_c (cacosh, 0, 0, 0.0, M_PI_2l);
1542 TEST_c_c (cacosh, minus_zero, 0, 0.0, M_PI_2l);
1543 TEST_c_c (cacosh, 0, minus_zero, 0.0, -M_PI_2l);
1544 TEST_c_c (cacosh, minus_zero, minus_zero, 0.0, -M_PI_2l);
1545 TEST_c_c (cacosh, minus_infty, plus_infty, plus_infty, M_PI_34l);
1546 TEST_c_c (cacosh, minus_infty, minus_infty, plus_infty, -M_PI_34l);
1548 TEST_c_c (cacosh, plus_infty, plus_infty, plus_infty, M_PI_4l);
1549 TEST_c_c (cacosh, plus_infty, minus_infty, plus_infty, -M_PI_4l);
1551 TEST_c_c (cacosh, -10.0, plus_infty, plus_infty, M_PI_2l);
1552 TEST_c_c (cacosh, -10.0, minus_infty, plus_infty, -M_PI_2l);
1553 TEST_c_c (cacosh, 0, plus_infty, plus_infty, M_PI_2l);
1554 TEST_c_c (cacosh, 0, minus_infty, plus_infty, -M_PI_2l);
1555 TEST_c_c (cacosh, 0.1L, plus_infty, plus_infty, M_PI_2l);
1556 TEST_c_c (cacosh, 0.1L, minus_infty, plus_infty, -M_PI_2l);
1558 TEST_c_c (cacosh, minus_infty, 0, plus_infty, M_PIl);
1559 TEST_c_c (cacosh, minus_infty, minus_zero, plus_infty, -M_PIl);
1560 TEST_c_c (cacosh, minus_infty, 100, plus_infty, M_PIl);
1561 TEST_c_c (cacosh, minus_infty, -100, plus_infty, -M_PIl);
1563 TEST_c_c (cacosh, plus_infty, 0, plus_infty, 0.0);
1564 TEST_c_c (cacosh, plus_infty, minus_zero, plus_infty, minus_zero);
1565 TEST_c_c (cacosh, plus_infty, 0.5, plus_infty, 0.0);
1566 TEST_c_c (cacosh, plus_infty, -0.5, plus_infty, minus_zero);
1568 TEST_c_c (cacosh, plus_infty, qnan_value, plus_infty, qnan_value);
1569 TEST_c_c (cacosh, minus_infty, qnan_value, plus_infty, qnan_value);
1571 TEST_c_c (cacosh, 0, qnan_value, qnan_value, qnan_value);
1572 TEST_c_c (cacosh, minus_zero, qnan_value, qnan_value, qnan_value);
1574 TEST_c_c (cacosh, qnan_value, plus_infty, plus_infty, qnan_value);
1575 TEST_c_c (cacosh, qnan_value, minus_infty, plus_infty, qnan_value);
1577 TEST_c_c (cacosh, 10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1578 TEST_c_c (cacosh, -10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1580 TEST_c_c (cacosh, qnan_value, 0.75, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1581 TEST_c_c (cacosh, qnan_value, -0.75, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1583 TEST_c_c (cacosh, qnan_value, qnan_value, qnan_value, qnan_value);
1585 TEST_c_c (cacosh, plus_zero, -1.5L, 1.194763217287109304111930828519090523536L, -M_PI_2l);
1586 TEST_c_c (cacosh, minus_zero, -1.5L, 1.194763217287109304111930828519090523536L, -M_PI_2l);
1587 TEST_c_c (cacosh, plus_zero, -1.0L, 0.8813735870195430252326093249797923090282L, -M_PI_2l);
1588 TEST_c_c (cacosh, minus_zero, -1.0L, 0.8813735870195430252326093249797923090282L, -M_PI_2l);
1589 TEST_c_c (cacosh, plus_zero, -0.5L, 0.4812118250596034474977589134243684231352L, -M_PI_2l);
1590 TEST_c_c (cacosh, minus_zero, -0.5L, 0.4812118250596034474977589134243684231352L, -M_PI_2l);
1591 TEST_c_c (cacosh, plus_zero, 0.5L, 0.4812118250596034474977589134243684231352L, M_PI_2l);
1592 TEST_c_c (cacosh, minus_zero, 0.5L, 0.4812118250596034474977589134243684231352L, M_PI_2l);
1593 TEST_c_c (cacosh, plus_zero, 1.0L, 0.8813735870195430252326093249797923090282L, M_PI_2l);
1594 TEST_c_c (cacosh, minus_zero, 1.0L, 0.8813735870195430252326093249797923090282L, M_PI_2l);
1595 TEST_c_c (cacosh, plus_zero, 1.5L, 1.194763217287109304111930828519090523536L, M_PI_2l);
1596 TEST_c_c (cacosh, minus_zero, 1.5L, 1.194763217287109304111930828519090523536L, M_PI_2l);
1598 TEST_c_c (cacosh, -1.5L, plus_zero, 0.9624236501192068949955178268487368462704L, M_PIl);
1599 TEST_c_c (cacosh, -1.5L, minus_zero, 0.9624236501192068949955178268487368462704L, -M_PIl);
1600 TEST_c_c (cacosh, -1.0L, plus_zero, plus_zero, M_PIl);
1601 TEST_c_c (cacosh, -1.0L, minus_zero, plus_zero, -M_PIl);
1602 TEST_c_c (cacosh, -0.5L, plus_zero, plus_zero, 2.094395102393195492308428922186335256131L);
1603 TEST_c_c (cacosh, -0.5L, minus_zero, plus_zero, -2.094395102393195492308428922186335256131L);
1604 TEST_c_c (cacosh, 0.5L, plus_zero, plus_zero, 1.047197551196597746154214461093167628066L);
1605 TEST_c_c (cacosh, 0.5L, minus_zero, plus_zero, -1.047197551196597746154214461093167628066L);
1606 TEST_c_c (cacosh, 1.0L, plus_zero, plus_zero, plus_zero);
1607 TEST_c_c (cacosh, 1.0L, minus_zero, plus_zero, minus_zero);
1608 TEST_c_c (cacosh, 1.5L, plus_zero, 0.9624236501192068949955178268487368462704L, plus_zero);
1609 TEST_c_c (cacosh, 1.5L, minus_zero, 0.9624236501192068949955178268487368462704L, minus_zero);
1611 TEST_c_c (cacosh, 0.75L, 1.25L, 1.13239363160530819522266333696834467L, 1.11752014915610270578240049553777969L);
1612 TEST_c_c (cacosh, -2, -3, 1.9833870299165354323470769028940395L, -2.1414491111159960199416055713254211L);
1614 END (cacosh, complex);
1623 /* carg (x + iy) is specified as atan2 (y, x) */
1625 /* carg (x + i 0) == 0 for x > 0. */
1626 TEST_c_f (carg, 2.0, 0, 0);
1627 /* carg (x - i 0) == -0 for x > 0. */
1628 TEST_c_f (carg, 2.0, minus_zero, minus_zero);
1630 TEST_c_f (carg, 0, 0, 0);
1631 TEST_c_f (carg, 0, minus_zero, minus_zero);
1633 /* carg (x + i 0) == +pi for x < 0. */
1634 TEST_c_f (carg, -2.0, 0, M_PIl);
1636 /* carg (x - i 0) == -pi for x < 0. */
1637 TEST_c_f (carg, -2.0, minus_zero, -M_PIl);
1639 TEST_c_f (carg, minus_zero, 0, M_PIl);
1640 TEST_c_f (carg, minus_zero, minus_zero, -M_PIl);
1642 /* carg (+0 + i y) == pi/2 for y > 0. */
1643 TEST_c_f (carg, 0, 2.0, M_PI_2l);
1645 /* carg (-0 + i y) == pi/2 for y > 0. */
1646 TEST_c_f (carg, minus_zero, 2.0, M_PI_2l);
1648 /* carg (+0 + i y) == -pi/2 for y < 0. */
1649 TEST_c_f (carg, 0, -2.0, -M_PI_2l);
1651 /* carg (-0 + i y) == -pi/2 for y < 0. */
1652 TEST_c_f (carg, minus_zero, -2.0, -M_PI_2l);
1654 /* carg (inf + i y) == +0 for finite y > 0. */
1655 TEST_c_f (carg, plus_infty, 2.0, 0);
1657 /* carg (inf + i y) == -0 for finite y < 0. */
1658 TEST_c_f (carg, plus_infty, -2.0, minus_zero);
1660 /* carg(x + i inf) == pi/2 for finite x. */
1661 TEST_c_f (carg, 10.0, plus_infty, M_PI_2l);
1663 /* carg(x - i inf) == -pi/2 for finite x. */
1664 TEST_c_f (carg, 10.0, minus_infty, -M_PI_2l);
1666 /* carg (-inf + i y) == +pi for finite y > 0. */
1667 TEST_c_f (carg, minus_infty, 10.0, M_PIl);
1669 /* carg (-inf + i y) == -pi for finite y < 0. */
1670 TEST_c_f (carg, minus_infty, -10.0, -M_PIl);
1672 TEST_c_f (carg, plus_infty, plus_infty, M_PI_4l);
1674 TEST_c_f (carg, plus_infty, minus_infty, -M_PI_4l);
1676 TEST_c_f (carg, minus_infty, plus_infty, 3 * M_PI_4l);
1678 TEST_c_f (carg, minus_infty, minus_infty, -3 * M_PI_4l);
1680 TEST_c_f (carg, qnan_value, qnan_value, qnan_value);
1689 FUNC(casin) (BUILD_COMPLEX (0.7L, 1.2L));
1690 if (errno == ENOSYS)
1691 /* Function not implemented. */
1696 TEST_c_c (casin, 0, 0, 0.0, 0.0);
1697 TEST_c_c (casin, minus_zero, 0, minus_zero, 0.0);
1698 TEST_c_c (casin, 0, minus_zero, 0.0, minus_zero);
1699 TEST_c_c (casin, minus_zero, minus_zero, minus_zero, minus_zero);
1701 TEST_c_c (casin, plus_infty, plus_infty, M_PI_4l, plus_infty);
1702 TEST_c_c (casin, plus_infty, minus_infty, M_PI_4l, minus_infty);
1703 TEST_c_c (casin, minus_infty, plus_infty, -M_PI_4l, plus_infty);
1704 TEST_c_c (casin, minus_infty, minus_infty, -M_PI_4l, minus_infty);
1706 TEST_c_c (casin, -10.0, plus_infty, minus_zero, plus_infty);
1707 TEST_c_c (casin, -10.0, minus_infty, minus_zero, minus_infty);
1708 TEST_c_c (casin, 0, plus_infty, 0.0, plus_infty);
1709 TEST_c_c (casin, 0, minus_infty, 0.0, minus_infty);
1710 TEST_c_c (casin, minus_zero, plus_infty, minus_zero, plus_infty);
1711 TEST_c_c (casin, minus_zero, minus_infty, minus_zero, minus_infty);
1712 TEST_c_c (casin, 0.1L, plus_infty, 0.0, plus_infty);
1713 TEST_c_c (casin, 0.1L, minus_infty, 0.0, minus_infty);
1715 TEST_c_c (casin, minus_infty, 0, -M_PI_2l, plus_infty);
1716 TEST_c_c (casin, minus_infty, minus_zero, -M_PI_2l, minus_infty);
1717 TEST_c_c (casin, minus_infty, 100, -M_PI_2l, plus_infty);
1718 TEST_c_c (casin, minus_infty, -100, -M_PI_2l, minus_infty);
1720 TEST_c_c (casin, plus_infty, 0, M_PI_2l, plus_infty);
1721 TEST_c_c (casin, plus_infty, minus_zero, M_PI_2l, minus_infty);
1722 TEST_c_c (casin, plus_infty, 0.5, M_PI_2l, plus_infty);
1723 TEST_c_c (casin, plus_infty, -0.5, M_PI_2l, minus_infty);
1725 TEST_c_c (casin, qnan_value, plus_infty, qnan_value, plus_infty);
1726 TEST_c_c (casin, qnan_value, minus_infty, qnan_value, minus_infty);
1728 TEST_c_c (casin, 0.0, qnan_value, 0.0, qnan_value);
1729 TEST_c_c (casin, minus_zero, qnan_value, minus_zero, qnan_value);
1731 TEST_c_c (casin, plus_infty, qnan_value, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN);
1732 TEST_c_c (casin, minus_infty, qnan_value, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN);
1734 TEST_c_c (casin, qnan_value, 10.5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1735 TEST_c_c (casin, qnan_value, -10.5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1737 TEST_c_c (casin, 0.75, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1738 TEST_c_c (casin, -0.75, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1740 TEST_c_c (casin, qnan_value, qnan_value, qnan_value, qnan_value);
1742 TEST_c_c (casin, plus_zero, -1.5L, plus_zero, -1.194763217287109304111930828519090523536L);
1743 TEST_c_c (casin, minus_zero, -1.5L, minus_zero, -1.194763217287109304111930828519090523536L);
1744 TEST_c_c (casin, plus_zero, -1.0L, plus_zero, -0.8813735870195430252326093249797923090282L);
1745 TEST_c_c (casin, minus_zero, -1.0L, minus_zero, -0.8813735870195430252326093249797923090282L);
1746 TEST_c_c (casin, plus_zero, -0.5L, plus_zero, -0.4812118250596034474977589134243684231352L);
1747 TEST_c_c (casin, minus_zero, -0.5L, minus_zero, -0.4812118250596034474977589134243684231352L);
1748 TEST_c_c (casin, plus_zero, 0.5L, plus_zero, 0.4812118250596034474977589134243684231352L);
1749 TEST_c_c (casin, minus_zero, 0.5L, minus_zero, 0.4812118250596034474977589134243684231352L);
1750 TEST_c_c (casin, plus_zero, 1.0L, plus_zero, 0.8813735870195430252326093249797923090282L);
1751 TEST_c_c (casin, minus_zero, 1.0L, minus_zero, 0.8813735870195430252326093249797923090282L);
1752 TEST_c_c (casin, plus_zero, 1.5L, plus_zero, 1.194763217287109304111930828519090523536L);
1753 TEST_c_c (casin, minus_zero, 1.5L, minus_zero, 1.194763217287109304111930828519090523536L);
1755 TEST_c_c (casin, -1.5L, plus_zero, -M_PI_2l, 0.9624236501192068949955178268487368462704L);
1756 TEST_c_c (casin, -1.5L, minus_zero, -M_PI_2l, -0.9624236501192068949955178268487368462704L);
1757 TEST_c_c (casin, -1.0L, plus_zero, -M_PI_2l, plus_zero);
1758 TEST_c_c (casin, -1.0L, minus_zero, -M_PI_2l, minus_zero);
1759 TEST_c_c (casin, -0.5L, plus_zero, -0.5235987755982988730771072305465838140329L, plus_zero);
1760 TEST_c_c (casin, -0.5L, minus_zero, -0.5235987755982988730771072305465838140329L, minus_zero);
1761 TEST_c_c (casin, 0.5L, plus_zero, 0.5235987755982988730771072305465838140329L, plus_zero);
1762 TEST_c_c (casin, 0.5L, minus_zero, 0.5235987755982988730771072305465838140329L, minus_zero);
1763 TEST_c_c (casin, 1.0L, plus_zero, M_PI_2l, plus_zero);
1764 TEST_c_c (casin, 1.0L, minus_zero, M_PI_2l, minus_zero);
1765 TEST_c_c (casin, 1.5L, plus_zero, M_PI_2l, 0.9624236501192068949955178268487368462704L);
1766 TEST_c_c (casin, 1.5L, minus_zero, M_PI_2l, -0.9624236501192068949955178268487368462704L);
1768 TEST_c_c (casin, 0x1p50L, 1.0L, 1.570796326794895731052901991514519103193L, 3.535050620855721078027883819436720218708e1L);
1769 TEST_c_c (casin, 0x1p50L, -1.0L, 1.570796326794895731052901991514519103193L, -3.535050620855721078027883819436720218708e1L);
1770 TEST_c_c (casin, -0x1p50L, 1.0L, -1.570796326794895731052901991514519103193L, 3.535050620855721078027883819436720218708e1L);
1771 TEST_c_c (casin, -0x1p50L, -1.0L, -1.570796326794895731052901991514519103193L, -3.535050620855721078027883819436720218708e1L);
1772 TEST_c_c (casin, 1.0L, 0x1p50L, 8.881784197001252323389053344720723756399e-16L, 3.535050620855721078027883819436759661753e1L);
1773 TEST_c_c (casin, -1.0L, 0x1p50L, -8.881784197001252323389053344720723756399e-16L, 3.535050620855721078027883819436759661753e1L);
1774 TEST_c_c (casin, 1.0L, -0x1p50L, 8.881784197001252323389053344720723756399e-16L, -3.535050620855721078027883819436759661753e1L);
1775 TEST_c_c (casin, -1.0L, -0x1p50L, -8.881784197001252323389053344720723756399e-16L, -3.535050620855721078027883819436759661753e1L);
1777 TEST_c_c (casin, 0x1p500L, 1.0L, 1.570796326794896619231321691639751442099L, 3.472667374605326000180332928505464606058e2L);
1778 TEST_c_c (casin, 0x1p500L, -1.0L, 1.570796326794896619231321691639751442099L, -3.472667374605326000180332928505464606058e2L);
1779 TEST_c_c (casin, -0x1p500L, 1.0L, -1.570796326794896619231321691639751442099L, 3.472667374605326000180332928505464606058e2L);
1780 TEST_c_c (casin, -0x1p500L, -1.0L, -1.570796326794896619231321691639751442099L, -3.472667374605326000180332928505464606058e2L);
1781 TEST_c_c (casin, 1.0L, 0x1p500L, 3.054936363499604682051979393213617699789e-151L, 3.472667374605326000180332928505464606058e2L);
1782 TEST_c_c (casin, -1.0L, 0x1p500L, -3.054936363499604682051979393213617699789e-151L, 3.472667374605326000180332928505464606058e2L);
1783 TEST_c_c (casin, 1.0L, -0x1p500L, 3.054936363499604682051979393213617699789e-151L, -3.472667374605326000180332928505464606058e2L);
1784 TEST_c_c (casin, -1.0L, -0x1p500L, -3.054936363499604682051979393213617699789e-151L, -3.472667374605326000180332928505464606058e2L);
1786 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
1787 TEST_c_c (casin, 0x1p5000L, 1.0L, 1.570796326794896619231321691639751442099L, 3.466429049980286492395577839412341016946e3L);
1788 TEST_c_c (casin, 0x1p5000L, -1.0L, 1.570796326794896619231321691639751442099L, -3.466429049980286492395577839412341016946e3L);
1789 TEST_c_c (casin, -0x1p5000L, 1.0L, -1.570796326794896619231321691639751442099L, 3.466429049980286492395577839412341016946e3L);
1790 TEST_c_c (casin, -0x1p5000L, -1.0L, -1.570796326794896619231321691639751442099L, -3.466429049980286492395577839412341016946e3L);
1791 TEST_c_c (casin, 1.0L, 0x1p5000L, 7.079811261048172892385615158694057552948e-1506L, 3.466429049980286492395577839412341016946e3L);
1792 TEST_c_c (casin, -1.0L, 0x1p5000L, -7.079811261048172892385615158694057552948e-1506L, 3.466429049980286492395577839412341016946e3L);
1793 TEST_c_c (casin, 1.0L, -0x1p5000L, 7.079811261048172892385615158694057552948e-1506L, -3.466429049980286492395577839412341016946e3L);
1794 TEST_c_c (casin, -1.0L, -0x1p5000L, -7.079811261048172892385615158694057552948e-1506L, -3.466429049980286492395577839412341016946e3L);
1797 TEST_c_c (casin, 0x1.fp127L, 0x1.fp127L, 7.853981633974483096156608458198757210493e-1L, 8.973081118419833726837456344608533993585e1L);
1799 TEST_c_c (casin, 0x1.fp1023L, 0x1.fp1023L, 7.853981633974483096156608458198757210493e-1L, 7.107906849659093345062145442726115449315e2L);
1801 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
1802 TEST_c_c (casin, 0x1.fp16383L, 0x1.fp16383L, 7.853981633974483096156608458198757210493e-1L, 1.135753137836666928715489992987020363057e4L);
1805 TEST_c_c (casin, 0x1.fp-129L, 1.5L, 1.579176199917649005841160751101628985741e-39L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_FLOAT);
1806 TEST_c_c (casin, 0x1.fp-129L, -1.5L, 1.579176199917649005841160751101628985741e-39L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_FLOAT);
1807 TEST_c_c (casin, -0x1.fp-129L, 1.5L, -1.579176199917649005841160751101628985741e-39L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_FLOAT);
1808 TEST_c_c (casin, -0x1.fp-129L, -1.5L, -1.579176199917649005841160751101628985741e-39L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_FLOAT);
1809 TEST_c_c (casin, 1.5L, 0x1.fp-129L, 1.570796326794896619231321691639751442096L, 9.624236501192068949955178268487368462704e-1L);
1810 TEST_c_c (casin, -1.5L, 0x1.fp-129L, -1.570796326794896619231321691639751442096L, 9.624236501192068949955178268487368462704e-1L);
1811 TEST_c_c (casin, 1.5L, -0x1.fp-129L, 1.570796326794896619231321691639751442096L, -9.624236501192068949955178268487368462704e-1L);
1812 TEST_c_c (casin, -1.5L, -0x1.fp-129L, -1.570796326794896619231321691639751442096L, -9.624236501192068949955178268487368462704e-1L);
1814 TEST_c_c (casin, 0x1.fp-1025L, 1.5L, 2.989196569048182929051881765490354365918e-309L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_DOUBLE);
1815 TEST_c_c (casin, 0x1.fp-1025L, -1.5L, 2.989196569048182929051881765490354365918e-309L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_DOUBLE);
1816 TEST_c_c (casin, -0x1.fp-1025L, 1.5L, -2.989196569048182929051881765490354365918e-309L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_DOUBLE);
1817 TEST_c_c (casin, -0x1.fp-1025L, -1.5L, -2.989196569048182929051881765490354365918e-309L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION_DOUBLE);
1818 TEST_c_c (casin, 1.5L, 0x1.fp-1025L, 1.570796326794896619231321691639751442099L, 9.624236501192068949955178268487368462704e-1L);
1819 TEST_c_c (casin, -1.5L, 0x1.fp-1025L, -1.570796326794896619231321691639751442099L, 9.624236501192068949955178268487368462704e-1L);
1820 TEST_c_c (casin, 1.5L, -0x1.fp-1025L, 1.570796326794896619231321691639751442099L, -9.624236501192068949955178268487368462704e-1L);
1821 TEST_c_c (casin, -1.5L, -0x1.fp-1025L, -1.570796326794896619231321691639751442099L, -9.624236501192068949955178268487368462704e-1L);
1823 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
1824 TEST_c_c (casin, 0x1.fp-16385L, 1.5L, 4.516698239814521372306784062043266700598e-4933L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION);
1825 TEST_c_c (casin, 0x1.fp-16385L, -1.5L, 4.516698239814521372306784062043266700598e-4933L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION);
1826 TEST_c_c (casin, -0x1.fp-16385L, 1.5L, -4.516698239814521372306784062043266700598e-4933L, 1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION);
1827 TEST_c_c (casin, -0x1.fp-16385L, -1.5L, -4.516698239814521372306784062043266700598e-4933L, -1.194763217287109304111930828519090523536L, UNDERFLOW_EXCEPTION);
1828 TEST_c_c (casin, 1.5L, 0x1.fp-16385L, 1.570796326794896619231321691639751442099L, 9.624236501192068949955178268487368462704e-1L);
1829 TEST_c_c (casin, -1.5L, 0x1.fp-16385L, -1.570796326794896619231321691639751442099L, 9.624236501192068949955178268487368462704e-1L);
1830 TEST_c_c (casin, 1.5L, -0x1.fp-16385L, 1.570796326794896619231321691639751442099L, -9.624236501192068949955178268487368462704e-1L);
1831 TEST_c_c (casin, -1.5L, -0x1.fp-16385L, -1.570796326794896619231321691639751442099L, -9.624236501192068949955178268487368462704e-1L);
1834 TEST_c_c (casin, 0.75L, 1.25L, 0.453276177638793913448921196101971749L, 1.13239363160530819522266333696834467L);
1835 TEST_c_c (casin, -2, -3, -0.57065278432109940071028387968566963L, -1.9833870299165354323470769028940395L);
1837 END (casin, complex);
1845 FUNC(casinh) (BUILD_COMPLEX (0.7L, 1.2L));
1846 if (errno == ENOSYS)
1847 /* Function not implemented. */
1852 TEST_c_c (casinh, 0, 0, 0.0, 0.0);
1853 TEST_c_c (casinh, minus_zero, 0, minus_zero, 0);
1854 TEST_c_c (casinh, 0, minus_zero, 0.0, minus_zero);
1855 TEST_c_c (casinh, minus_zero, minus_zero, minus_zero, minus_zero);
1857 TEST_c_c (casinh, plus_infty, plus_infty, plus_infty, M_PI_4l);
1858 TEST_c_c (casinh, plus_infty, minus_infty, plus_infty, -M_PI_4l);
1859 TEST_c_c (casinh, minus_infty, plus_infty, minus_infty, M_PI_4l);
1860 TEST_c_c (casinh, minus_infty, minus_infty, minus_infty, -M_PI_4l);
1862 TEST_c_c (casinh, -10.0, plus_infty, minus_infty, M_PI_2l);
1863 TEST_c_c (casinh, -10.0, minus_infty, minus_infty, -M_PI_2l);
1864 TEST_c_c (casinh, 0, plus_infty, plus_infty, M_PI_2l);
1865 TEST_c_c (casinh, 0, minus_infty, plus_infty, -M_PI_2l);
1866 TEST_c_c (casinh, minus_zero, plus_infty, minus_infty, M_PI_2l);
1867 TEST_c_c (casinh, minus_zero, minus_infty, minus_infty, -M_PI_2l);
1868 TEST_c_c (casinh, 0.1L, plus_infty, plus_infty, M_PI_2l);
1869 TEST_c_c (casinh, 0.1L, minus_infty, plus_infty, -M_PI_2l);
1871 TEST_c_c (casinh, minus_infty, 0, minus_infty, 0.0);
1872 TEST_c_c (casinh, minus_infty, minus_zero, minus_infty, minus_zero);
1873 TEST_c_c (casinh, minus_infty, 100, minus_infty, 0.0);
1874 TEST_c_c (casinh, minus_infty, -100, minus_infty, minus_zero);
1876 TEST_c_c (casinh, plus_infty, 0, plus_infty, 0.0);
1877 TEST_c_c (casinh, plus_infty, minus_zero, plus_infty, minus_zero);
1878 TEST_c_c (casinh, plus_infty, 0.5, plus_infty, 0.0);
1879 TEST_c_c (casinh, plus_infty, -0.5, plus_infty, minus_zero);
1881 TEST_c_c (casinh, plus_infty, qnan_value, plus_infty, qnan_value);
1882 TEST_c_c (casinh, minus_infty, qnan_value, minus_infty, qnan_value);
1884 TEST_c_c (casinh, qnan_value, 0, qnan_value, 0.0);
1885 TEST_c_c (casinh, qnan_value, minus_zero, qnan_value, minus_zero);
1887 TEST_c_c (casinh, qnan_value, plus_infty, plus_infty, qnan_value, IGNORE_ZERO_INF_SIGN);
1888 TEST_c_c (casinh, qnan_value, minus_infty, plus_infty, qnan_value, IGNORE_ZERO_INF_SIGN);
1890 TEST_c_c (casinh, 10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1891 TEST_c_c (casinh, -10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1893 TEST_c_c (casinh, qnan_value, 0.75, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1894 TEST_c_c (casinh, -0.75, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
1896 TEST_c_c (casinh, qnan_value, qnan_value, qnan_value, qnan_value);
1898 TEST_c_c (casinh, plus_zero, -1.5L, 0.9624236501192068949955178268487368462704L, -M_PI_2l);
1899 TEST_c_c (casinh, minus_zero, -1.5L, -0.9624236501192068949955178268487368462704L, -M_PI_2l);
1900 TEST_c_c (casinh, plus_zero, -1.0L, plus_zero, -M_PI_2l);
1901 TEST_c_c (casinh, minus_zero, -1.0L, minus_zero, -M_PI_2l);
1902 TEST_c_c (casinh, plus_zero, -0.5L, plus_zero, -0.5235987755982988730771072305465838140329L);
1903 TEST_c_c (casinh, minus_zero, -0.5L, minus_zero, -0.5235987755982988730771072305465838140329L);
1904 TEST_c_c (casinh, plus_zero, 0.5L, plus_zero, 0.5235987755982988730771072305465838140329L);
1905 TEST_c_c (casinh, minus_zero, 0.5L, minus_zero, 0.5235987755982988730771072305465838140329L);
1906 TEST_c_c (casinh, plus_zero, 1.0L, plus_zero, M_PI_2l);
1907 TEST_c_c (casinh, minus_zero, 1.0L, minus_zero, M_PI_2l);
1908 TEST_c_c (casinh, plus_zero, 1.5L, 0.9624236501192068949955178268487368462704L, M_PI_2l);
1909 TEST_c_c (casinh, minus_zero, 1.5L, -0.9624236501192068949955178268487368462704L, M_PI_2l);
1911 TEST_c_c (casinh, -1.5L, plus_zero, -1.194763217287109304111930828519090523536L, plus_zero);
1912 TEST_c_c (casinh, -1.5L, minus_zero, -1.194763217287109304111930828519090523536L, minus_zero);
1913 TEST_c_c (casinh, -1.0L, plus_zero, -0.8813735870195430252326093249797923090282L, plus_zero);
1914 TEST_c_c (casinh, -1.0L, minus_zero, -0.8813735870195430252326093249797923090282L, minus_zero);
1915 TEST_c_c (casinh, -0.5L, plus_zero, -0.4812118250596034474977589134243684231352L, plus_zero);
1916 TEST_c_c (casinh, -0.5L, minus_zero, -0.4812118250596034474977589134243684231352L, minus_zero);
1917 TEST_c_c (casinh, 0.5L, plus_zero, 0.4812118250596034474977589134243684231352L, plus_zero);
1918 TEST_c_c (casinh, 0.5L, minus_zero, 0.4812118250596034474977589134243684231352L, minus_zero);
1919 TEST_c_c (casinh, 1.0L, plus_zero, 0.8813735870195430252326093249797923090282L, plus_zero);
1920 TEST_c_c (casinh, 1.0L, minus_zero, 0.8813735870195430252326093249797923090282L, minus_zero);
1921 TEST_c_c (casinh, 1.5L, plus_zero, 1.194763217287109304111930828519090523536L, plus_zero);
1922 TEST_c_c (casinh, 1.5L, minus_zero, 1.194763217287109304111930828519090523536L, minus_zero);
1924 TEST_c_c (casinh, 0x1p50L, 1.0L, 3.535050620855721078027883819436759661753e1L, 8.881784197001252323389053344720723756399e-16L);
1925 TEST_c_c (casinh, 0x1p50L, -1.0L, 3.535050620855721078027883819436759661753e1L, -8.881784197001252323389053344720723756399e-16L);
1926 TEST_c_c (casinh, -0x1p50L, 1.0L, -3.535050620855721078027883819436759661753e1L, 8.881784197001252323389053344720723756399e-16L);
1927 TEST_c_c (casinh, -0x1p50L, -1.0L, -3.535050620855721078027883819436759661753e1L, -8.881784197001252323389053344720723756399e-16L);
1928 TEST_c_c (casinh, 1.0L, 0x1p50L, 3.535050620855721078027883819436720218708e1L, 1.570796326794895731052901991514519103193L);
1929 TEST_c_c (casinh, -1.0L, 0x1p50L, -3.535050620855721078027883819436720218708e1L, 1.570796326794895731052901991514519103193L);
1930 TEST_c_c (casinh, 1.0L, -0x1p50L, 3.535050620855721078027883819436720218708e1L, -1.570796326794895731052901991514519103193L);
1931 TEST_c_c (casinh, -1.0L, -0x1p50L, -3.535050620855721078027883819436720218708e1L, -1.570796326794895731052901991514519103193L);
1933 TEST_c_c (casinh, 0x1p500L, 1.0L, 3.472667374605326000180332928505464606058e2L, 3.054936363499604682051979393213617699789e-151L);
1934 TEST_c_c (casinh, 0x1p500L, -1.0L, 3.472667374605326000180332928505464606058e2L, -3.054936363499604682051979393213617699789e-151L);
1935 TEST_c_c (casinh, -0x1p500L, 1.0L, -3.472667374605326000180332928505464606058e2L, 3.054936363499604682051979393213617699789e-151L);
1936 TEST_c_c (casinh, -0x1p500L, -1.0L, -3.472667374605326000180332928505464606058e2L, -3.054936363499604682051979393213617699789e-151L);
1937 TEST_c_c (casinh, 1.0L, 0x1p500L, 3.472667374605326000180332928505464606058e2L, 1.570796326794896619231321691639751442099L);
1938 TEST_c_c (casinh, -1.0L, 0x1p500L, -3.472667374605326000180332928505464606058e2L, 1.570796326794896619231321691639751442099L);
1939 TEST_c_c (casinh, 1.0L, -0x1p500L, 3.472667374605326000180332928505464606058e2L, -1.570796326794896619231321691639751442099L);
1940 TEST_c_c (casinh, -1.0L, -0x1p500L, -3.472667374605326000180332928505464606058e2L, -1.570796326794896619231321691639751442099L);
1942 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
1943 TEST_c_c (casinh, 0x1p5000L, 1.0L, 3.466429049980286492395577839412341016946e3L, 7.079811261048172892385615158694057552948e-1506L);
1944 TEST_c_c (casinh, 0x1p5000L, -1.0L, 3.466429049980286492395577839412341016946e3L, -7.079811261048172892385615158694057552948e-1506L);
1945 TEST_c_c (casinh, -0x1p5000L, 1.0L, -3.466429049980286492395577839412341016946e3L, 7.079811261048172892385615158694057552948e-1506L);
1946 TEST_c_c (casinh, -0x1p5000L, -1.0L, -3.466429049980286492395577839412341016946e3L, -7.079811261048172892385615158694057552948e-1506L);
1947 TEST_c_c (casinh, 1.0L, 0x1p5000L, 3.466429049980286492395577839412341016946e3L, 1.570796326794896619231321691639751442099L);
1948 TEST_c_c (casinh, -1.0L, 0x1p5000L, -3.466429049980286492395577839412341016946e3L, 1.570796326794896619231321691639751442099L);
1949 TEST_c_c (casinh, 1.0L, -0x1p5000L, 3.466429049980286492395577839412341016946e3L, -1.570796326794896619231321691639751442099L);
1950 TEST_c_c (casinh, -1.0L, -0x1p5000L, -3.466429049980286492395577839412341016946e3L, -1.570796326794896619231321691639751442099L);
1953 TEST_c_c (casinh, 0x1.fp127L, 0x1.fp127L, 8.973081118419833726837456344608533993585e1L, 7.853981633974483096156608458198757210493e-1L);
1955 TEST_c_c (casinh, 0x1.fp1023L, 0x1.fp1023L, 7.107906849659093345062145442726115449315e2L, 7.853981633974483096156608458198757210493e-1L);
1957 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
1958 TEST_c_c (casinh, 0x1.fp16383L, 0x1.fp16383L, 1.135753137836666928715489992987020363057e4L, 7.853981633974483096156608458198757210493e-1L);
1961 TEST_c_c (casinh, 0x1.fp-129L, 1.5L, 9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442096L);
1962 TEST_c_c (casinh, 0x1.fp-129L, -1.5L, 9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442096L);
1963 TEST_c_c (casinh, -0x1.fp-129L, 1.5L, -9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442096L);
1964 TEST_c_c (casinh, -0x1.fp-129L, -1.5L, -9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442096L);
1965 TEST_c_c (casinh, 1.5L, 0x1.fp-129L, 1.194763217287109304111930828519090523536L, 1.579176199917649005841160751101628985741e-39L, UNDERFLOW_EXCEPTION_FLOAT);
1966 TEST_c_c (casinh, -1.5L, 0x1.fp-129L, -1.194763217287109304111930828519090523536L, 1.579176199917649005841160751101628985741e-39L, UNDERFLOW_EXCEPTION_FLOAT);
1967 TEST_c_c (casinh, 1.5L, -0x1.fp-129L, 1.194763217287109304111930828519090523536L, -1.579176199917649005841160751101628985741e-39L, UNDERFLOW_EXCEPTION_FLOAT);
1968 TEST_c_c (casinh, -1.5L, -0x1.fp-129L, -1.194763217287109304111930828519090523536L, -1.579176199917649005841160751101628985741e-39L, UNDERFLOW_EXCEPTION_FLOAT);
1970 TEST_c_c (casinh, 0x1.fp-1025L, 1.5L, 9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442099L);
1971 TEST_c_c (casinh, 0x1.fp-1025L, -1.5L, 9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442099L);
1972 TEST_c_c (casinh, -0x1.fp-1025L, 1.5L, -9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442099L);
1973 TEST_c_c (casinh, -0x1.fp-1025L, -1.5L, -9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442099L);
1974 TEST_c_c (casinh, 1.5L, 0x1.fp-1025L, 1.194763217287109304111930828519090523536L, 2.989196569048182929051881765490354365918e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
1975 TEST_c_c (casinh, -1.5L, 0x1.fp-1025L, -1.194763217287109304111930828519090523536L, 2.989196569048182929051881765490354365918e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
1976 TEST_c_c (casinh, 1.5L, -0x1.fp-1025L, 1.194763217287109304111930828519090523536L, -2.989196569048182929051881765490354365918e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
1977 TEST_c_c (casinh, -1.5L, -0x1.fp-1025L, -1.194763217287109304111930828519090523536L, -2.989196569048182929051881765490354365918e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
1979 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
1980 TEST_c_c (casinh, 0x1.fp-16385L, 1.5L, 9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442099L);
1981 TEST_c_c (casinh, 0x1.fp-16385L, -1.5L, 9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442099L);
1982 TEST_c_c (casinh, -0x1.fp-16385L, 1.5L, -9.624236501192068949955178268487368462704e-1L, 1.570796326794896619231321691639751442099L);
1983 TEST_c_c (casinh, -0x1.fp-16385L, -1.5L, -9.624236501192068949955178268487368462704e-1L, -1.570796326794896619231321691639751442099L);
1984 TEST_c_c (casinh, 1.5L, 0x1.fp-16385L, 1.194763217287109304111930828519090523536L, 4.516698239814521372306784062043266700598e-4933L, UNDERFLOW_EXCEPTION);
1985 TEST_c_c (casinh, -1.5L, 0x1.fp-16385L, -1.194763217287109304111930828519090523536L, 4.516698239814521372306784062043266700598e-4933L, UNDERFLOW_EXCEPTION);
1986 TEST_c_c (casinh, 1.5L, -0x1.fp-16385L, 1.194763217287109304111930828519090523536L, -4.516698239814521372306784062043266700598e-4933L, UNDERFLOW_EXCEPTION);
1987 TEST_c_c (casinh, -1.5L, -0x1.fp-16385L, -1.194763217287109304111930828519090523536L, -4.516698239814521372306784062043266700598e-4933L, UNDERFLOW_EXCEPTION);
1990 TEST_c_c (casinh, 0.75L, 1.25L, 1.03171853444778027336364058631006594L, 0.911738290968487636358489564316731207L);
1991 TEST_c_c (casinh, -2, -3, -1.9686379257930962917886650952454982L, -0.96465850440760279204541105949953237L);
1993 END (casinh, complex);
2001 FUNC(catan) (BUILD_COMPLEX (0.7L, 1.2L));
2002 if (errno == ENOSYS)
2003 /* Function not implemented. */
2008 TEST_c_c (catan, 0, 0, 0, 0);
2009 TEST_c_c (catan, minus_zero, 0, minus_zero, 0);
2010 TEST_c_c (catan, 0, minus_zero, 0, minus_zero);
2011 TEST_c_c (catan, minus_zero, minus_zero, minus_zero, minus_zero);
2013 TEST_c_c (catan, plus_infty, plus_infty, M_PI_2l, 0);
2014 TEST_c_c (catan, plus_infty, minus_infty, M_PI_2l, minus_zero);
2015 TEST_c_c (catan, minus_infty, plus_infty, -M_PI_2l, 0);
2016 TEST_c_c (catan, minus_infty, minus_infty, -M_PI_2l, minus_zero);
2019 TEST_c_c (catan, plus_infty, -10.0, M_PI_2l, minus_zero);
2020 TEST_c_c (catan, minus_infty, -10.0, -M_PI_2l, minus_zero);
2021 TEST_c_c (catan, plus_infty, minus_zero, M_PI_2l, minus_zero);
2022 TEST_c_c (catan, minus_infty, minus_zero, -M_PI_2l, minus_zero);
2023 TEST_c_c (catan, plus_infty, 0.0, M_PI_2l, 0);
2024 TEST_c_c (catan, minus_infty, 0.0, -M_PI_2l, 0);
2025 TEST_c_c (catan, plus_infty, 0.1L, M_PI_2l, 0);
2026 TEST_c_c (catan, minus_infty, 0.1L, -M_PI_2l, 0);
2028 TEST_c_c (catan, 0.0, minus_infty, M_PI_2l, minus_zero);
2029 TEST_c_c (catan, minus_zero, minus_infty, -M_PI_2l, minus_zero);
2030 TEST_c_c (catan, 100.0, minus_infty, M_PI_2l, minus_zero);
2031 TEST_c_c (catan, -100.0, minus_infty, -M_PI_2l, minus_zero);
2033 TEST_c_c (catan, 0.0, plus_infty, M_PI_2l, 0);
2034 TEST_c_c (catan, minus_zero, plus_infty, -M_PI_2l, 0);
2035 TEST_c_c (catan, 0.5, plus_infty, M_PI_2l, 0);
2036 TEST_c_c (catan, -0.5, plus_infty, -M_PI_2l, 0);
2038 TEST_c_c (catan, qnan_value, 0.0, qnan_value, 0);
2039 TEST_c_c (catan, qnan_value, minus_zero, qnan_value, minus_zero);
2041 TEST_c_c (catan, qnan_value, plus_infty, qnan_value, 0);
2042 TEST_c_c (catan, qnan_value, minus_infty, qnan_value, minus_zero);
2044 TEST_c_c (catan, 0.0, qnan_value, qnan_value, qnan_value);
2045 TEST_c_c (catan, minus_zero, qnan_value, qnan_value, qnan_value);
2047 TEST_c_c (catan, plus_infty, qnan_value, M_PI_2l, 0, IGNORE_ZERO_INF_SIGN);
2048 TEST_c_c (catan, minus_infty, qnan_value, -M_PI_2l, 0, IGNORE_ZERO_INF_SIGN);
2050 TEST_c_c (catan, qnan_value, 10.5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2051 TEST_c_c (catan, qnan_value, -10.5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2053 TEST_c_c (catan, 0.75, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2054 TEST_c_c (catan, -0.75, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2056 TEST_c_c (catan, qnan_value, qnan_value, qnan_value, qnan_value);
2058 TEST_c_c (catan, 0.75L, 1.25L, 1.10714871779409050301706546017853704L, 0.549306144334054845697622618461262852L);
2059 TEST_c_c (catan, -2, -3, -1.4099210495965755225306193844604208L, -0.22907268296853876629588180294200276L);
2061 END (catan, complex);
2068 FUNC(catanh) (BUILD_COMPLEX (0.7L, 1.2L));
2069 if (errno == ENOSYS)
2070 /* Function not implemented. */
2075 TEST_c_c (catanh, 0, 0, 0.0, 0.0);
2076 TEST_c_c (catanh, minus_zero, 0, minus_zero, 0.0);
2077 TEST_c_c (catanh, 0, minus_zero, 0.0, minus_zero);
2078 TEST_c_c (catanh, minus_zero, minus_zero, minus_zero, minus_zero);
2080 TEST_c_c (catanh, plus_infty, plus_infty, 0.0, M_PI_2l);
2081 TEST_c_c (catanh, plus_infty, minus_infty, 0.0, -M_PI_2l);
2082 TEST_c_c (catanh, minus_infty, plus_infty, minus_zero, M_PI_2l);
2083 TEST_c_c (catanh, minus_infty, minus_infty, minus_zero, -M_PI_2l);
2085 TEST_c_c (catanh, -10.0, plus_infty, minus_zero, M_PI_2l);
2086 TEST_c_c (catanh, -10.0, minus_infty, minus_zero, -M_PI_2l);
2087 TEST_c_c (catanh, minus_zero, plus_infty, minus_zero, M_PI_2l);
2088 TEST_c_c (catanh, minus_zero, minus_infty, minus_zero, -M_PI_2l);
2089 TEST_c_c (catanh, 0, plus_infty, 0.0, M_PI_2l);
2090 TEST_c_c (catanh, 0, minus_infty, 0.0, -M_PI_2l);
2091 TEST_c_c (catanh, 0.1L, plus_infty, 0.0, M_PI_2l);
2092 TEST_c_c (catanh, 0.1L, minus_infty, 0.0, -M_PI_2l);
2094 TEST_c_c (catanh, minus_infty, 0, minus_zero, M_PI_2l);
2095 TEST_c_c (catanh, minus_infty, minus_zero, minus_zero, -M_PI_2l);
2096 TEST_c_c (catanh, minus_infty, 100, minus_zero, M_PI_2l);
2097 TEST_c_c (catanh, minus_infty, -100, minus_zero, -M_PI_2l);
2099 TEST_c_c (catanh, plus_infty, 0, 0.0, M_PI_2l);
2100 TEST_c_c (catanh, plus_infty, minus_zero, 0.0, -M_PI_2l);
2101 TEST_c_c (catanh, plus_infty, 0.5, 0.0, M_PI_2l);
2102 TEST_c_c (catanh, plus_infty, -0.5, 0.0, -M_PI_2l);
2104 TEST_c_c (catanh, 0, qnan_value, 0.0, qnan_value);
2105 TEST_c_c (catanh, minus_zero, qnan_value, minus_zero, qnan_value);
2107 TEST_c_c (catanh, plus_infty, qnan_value, 0.0, qnan_value);
2108 TEST_c_c (catanh, minus_infty, qnan_value, minus_zero, qnan_value);
2110 TEST_c_c (catanh, qnan_value, 0, qnan_value, qnan_value);
2111 TEST_c_c (catanh, qnan_value, minus_zero, qnan_value, qnan_value);
2113 TEST_c_c (catanh, qnan_value, plus_infty, 0.0, M_PI_2l, IGNORE_ZERO_INF_SIGN);
2114 TEST_c_c (catanh, qnan_value, minus_infty, 0.0, -M_PI_2l, IGNORE_ZERO_INF_SIGN);
2116 TEST_c_c (catanh, 10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2117 TEST_c_c (catanh, -10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2119 TEST_c_c (catanh, qnan_value, 0.75, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2120 TEST_c_c (catanh, qnan_value, -0.75, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2122 TEST_c_c (catanh, qnan_value, qnan_value, qnan_value, qnan_value);
2124 TEST_c_c (catanh, 0.75L, 1.25L, 0.261492138795671927078652057366532140L, 0.996825126463918666098902241310446708L);
2125 TEST_c_c (catanh, -2, -3, -0.14694666622552975204743278515471595L, -1.3389725222944935611241935759091443L);
2127 END (catanh, complex);
2135 if (errno == ENOSYS)
2136 /* Function not implemented. */
2141 TEST_f_f (cbrt, 0.0, 0.0);
2142 TEST_f_f (cbrt, minus_zero, minus_zero);
2144 TEST_f_f (cbrt, plus_infty, plus_infty);
2145 TEST_f_f (cbrt, minus_infty, minus_infty);
2146 TEST_f_f (cbrt, qnan_value, qnan_value);
2148 TEST_f_f (cbrt, -0.001L, -0.1L);
2149 TEST_f_f (cbrt, 8, 2);
2150 TEST_f_f (cbrt, -27.0, -3.0);
2151 TEST_f_f (cbrt, 0.9921875L, 0.997389022060725270579075195353955217L);
2152 TEST_f_f (cbrt, 0.75L, 0.908560296416069829445605878163630251L);
2162 FUNC(ccos) (BUILD_COMPLEX (0, 0));
2163 if (errno == ENOSYS)
2164 /* Function not implemented. */
2169 TEST_c_c (ccos, 0.0, 0.0, 1.0, minus_zero);
2170 TEST_c_c (ccos, minus_zero, 0.0, 1.0, 0.0);
2171 TEST_c_c (ccos, 0.0, minus_zero, 1.0, 0.0);
2172 TEST_c_c (ccos, minus_zero, minus_zero, 1.0, minus_zero);
2174 TEST_c_c (ccos, plus_infty, 0.0, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2175 TEST_c_c (ccos, plus_infty, minus_zero, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2176 TEST_c_c (ccos, minus_infty, 0.0, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2177 TEST_c_c (ccos, minus_infty, minus_zero, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2179 TEST_c_c (ccos, 0.0, plus_infty, plus_infty, minus_zero);
2180 TEST_c_c (ccos, 0.0, minus_infty, plus_infty, 0.0);
2181 TEST_c_c (ccos, minus_zero, plus_infty, plus_infty, 0.0);
2182 TEST_c_c (ccos, minus_zero, minus_infty, plus_infty, minus_zero);
2184 TEST_c_c (ccos, plus_infty, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
2185 TEST_c_c (ccos, minus_infty, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
2186 TEST_c_c (ccos, plus_infty, minus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
2187 TEST_c_c (ccos, minus_infty, minus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
2189 TEST_c_c (ccos, 4.625, plus_infty, minus_infty, plus_infty);
2190 TEST_c_c (ccos, 4.625, minus_infty, minus_infty, minus_infty);
2191 TEST_c_c (ccos, -4.625, plus_infty, minus_infty, minus_infty);
2192 TEST_c_c (ccos, -4.625, minus_infty, minus_infty, plus_infty);
2194 TEST_c_c (ccos, plus_infty, 6.75, qnan_value, qnan_value, INVALID_EXCEPTION);
2195 TEST_c_c (ccos, plus_infty, -6.75, qnan_value, qnan_value, INVALID_EXCEPTION);
2196 TEST_c_c (ccos, minus_infty, 6.75, qnan_value, qnan_value, INVALID_EXCEPTION);
2197 TEST_c_c (ccos, minus_infty, -6.75, qnan_value, qnan_value, INVALID_EXCEPTION);
2199 TEST_c_c (ccos, qnan_value, 0.0, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
2200 TEST_c_c (ccos, qnan_value, minus_zero, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
2202 TEST_c_c (ccos, qnan_value, plus_infty, plus_infty, qnan_value);
2203 TEST_c_c (ccos, qnan_value, minus_infty, plus_infty, qnan_value);
2205 TEST_c_c (ccos, qnan_value, 9.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2206 TEST_c_c (ccos, qnan_value, -9.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2208 TEST_c_c (ccos, 0.0, qnan_value, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
2209 TEST_c_c (ccos, minus_zero, qnan_value, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
2211 TEST_c_c (ccos, 10.0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2212 TEST_c_c (ccos, -10.0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2214 TEST_c_c (ccos, plus_infty, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2215 TEST_c_c (ccos, minus_infty, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2217 TEST_c_c (ccos, qnan_value, qnan_value, qnan_value, qnan_value);
2219 TEST_c_c (ccos, 0.75L, 1.25L, 1.38173873063425888530729933139078645L, -1.09193013555397466170919531722024128L);
2220 TEST_c_c (ccos, -2, -3, -4.18962569096880723013255501961597373L, -9.10922789375533659797919726277886212L);
2222 TEST_c_c (ccos, 0.75, 89.5, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
2223 TEST_c_c (ccos, 0.75, -89.5, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
2224 TEST_c_c (ccos, -0.75, 89.5, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
2225 TEST_c_c (ccos, -0.75, -89.5, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
2228 TEST_c_c (ccos, 0.75, 710.5, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
2229 TEST_c_c (ccos, 0.75, -710.5, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
2230 TEST_c_c (ccos, -0.75, 710.5, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
2231 TEST_c_c (ccos, -0.75, -710.5, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
2234 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2235 TEST_c_c (ccos, 0.75, 11357.25, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
2236 TEST_c_c (ccos, 0.75, -11357.25, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
2237 TEST_c_c (ccos, -0.75, 11357.25, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
2238 TEST_c_c (ccos, -0.75, -11357.25, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
2242 TEST_c_c (ccos, 0x1p-149, 180, plus_infty, -1.043535896672617552965983803453927655332e33L, OVERFLOW_EXCEPTION);
2245 #if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
2246 TEST_c_c (ccos, 0x1p-1074, 1440, plus_infty, -5.981479269486130556466515778180916082415e301L, OVERFLOW_EXCEPTION);
2249 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2250 TEST_c_c (ccos, 0x1p-16434L, 22730, plus_infty, -1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
2253 END (ccos, complex);
2261 FUNC(ccosh) (BUILD_COMPLEX (0.7L, 1.2L));
2262 if (errno == ENOSYS)
2263 /* Function not implemented. */
2268 TEST_c_c (ccosh, 0.0, 0.0, 1.0, 0.0);
2269 TEST_c_c (ccosh, minus_zero, 0.0, 1.0, minus_zero);
2270 TEST_c_c (ccosh, 0.0, minus_zero, 1.0, minus_zero);
2271 TEST_c_c (ccosh, minus_zero, minus_zero, 1.0, 0.0);
2273 TEST_c_c (ccosh, 0.0, plus_infty, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2274 TEST_c_c (ccosh, minus_zero, plus_infty, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2275 TEST_c_c (ccosh, 0.0, minus_infty, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2276 TEST_c_c (ccosh, minus_zero, minus_infty, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2278 TEST_c_c (ccosh, plus_infty, 0.0, plus_infty, 0.0);
2279 TEST_c_c (ccosh, minus_infty, 0.0, plus_infty, minus_zero);
2280 TEST_c_c (ccosh, plus_infty, minus_zero, plus_infty, minus_zero);
2281 TEST_c_c (ccosh, minus_infty, minus_zero, plus_infty, 0.0);
2283 TEST_c_c (ccosh, plus_infty, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
2284 TEST_c_c (ccosh, minus_infty, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
2285 TEST_c_c (ccosh, plus_infty, minus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
2286 TEST_c_c (ccosh, minus_infty, minus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
2288 TEST_c_c (ccosh, plus_infty, 4.625, minus_infty, minus_infty);
2289 TEST_c_c (ccosh, minus_infty, 4.625, minus_infty, plus_infty);
2290 TEST_c_c (ccosh, plus_infty, -4.625, minus_infty, plus_infty);
2291 TEST_c_c (ccosh, minus_infty, -4.625, minus_infty, minus_infty);
2293 TEST_c_c (ccosh, 6.75, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2294 TEST_c_c (ccosh, -6.75, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2295 TEST_c_c (ccosh, 6.75, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2296 TEST_c_c (ccosh, -6.75, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2298 TEST_c_c (ccosh, 0.0, qnan_value, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
2299 TEST_c_c (ccosh, minus_zero, qnan_value, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
2301 TEST_c_c (ccosh, plus_infty, qnan_value, plus_infty, qnan_value);
2302 TEST_c_c (ccosh, minus_infty, qnan_value, plus_infty, qnan_value);
2304 TEST_c_c (ccosh, 9.0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2305 TEST_c_c (ccosh, -9.0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2307 TEST_c_c (ccosh, qnan_value, 0.0, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
2308 TEST_c_c (ccosh, qnan_value, minus_zero, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
2310 TEST_c_c (ccosh, qnan_value, 10.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2311 TEST_c_c (ccosh, qnan_value, -10.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2313 TEST_c_c (ccosh, qnan_value, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2314 TEST_c_c (ccosh, qnan_value, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2316 TEST_c_c (ccosh, qnan_value, qnan_value, qnan_value, qnan_value);
2318 TEST_c_c (ccosh, 0.75L, 1.25L, 0.408242591877968807788852146397499084L, 0.780365930845853240391326216300863152L);
2320 TEST_c_c (ccosh, -2, -3, -3.72454550491532256547397070325597253L, 0.511822569987384608834463849801875634L);
2322 TEST_c_c (ccosh, 89.5, 0.75, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
2323 TEST_c_c (ccosh, -89.5, 0.75, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
2324 TEST_c_c (ccosh, 89.5, -0.75, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
2325 TEST_c_c (ccosh, -89.5, -0.75, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
2328 TEST_c_c (ccosh, 710.5, 0.75, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
2329 TEST_c_c (ccosh, -710.5, 0.75, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
2330 TEST_c_c (ccosh, 710.5, -0.75, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
2331 TEST_c_c (ccosh, -710.5, -0.75, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
2334 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2335 TEST_c_c (ccosh, 11357.25, 0.75, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
2336 TEST_c_c (ccosh, -11357.25, 0.75, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
2337 TEST_c_c (ccosh, 11357.25, -0.75, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
2338 TEST_c_c (ccosh, -11357.25, -0.75, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
2342 TEST_c_c (ccosh, 180, 0x1p-149, plus_infty, 1.043535896672617552965983803453927655332e33L, OVERFLOW_EXCEPTION);
2345 #if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
2346 TEST_c_c (ccosh, 1440, 0x1p-1074, plus_infty, 5.981479269486130556466515778180916082415e301L, OVERFLOW_EXCEPTION);
2349 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2350 TEST_c_c (ccosh, 22730, 0x1p-16434L, plus_infty, 1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
2353 END (ccosh, complex);
2362 TEST_f_f (ceil, 0.0, 0.0);
2363 TEST_f_f (ceil, minus_zero, minus_zero);
2364 TEST_f_f (ceil, plus_infty, plus_infty);
2365 TEST_f_f (ceil, minus_infty, minus_infty);
2366 TEST_f_f (ceil, qnan_value, qnan_value);
2368 TEST_f_f (ceil, M_PIl, 4.0);
2369 TEST_f_f (ceil, -M_PIl, -3.0);
2370 TEST_f_f (ceil, 0.1, 1.0);
2371 TEST_f_f (ceil, 0.25, 1.0);
2372 TEST_f_f (ceil, 0.625, 1.0);
2373 TEST_f_f (ceil, -0.1, minus_zero);
2374 TEST_f_f (ceil, -0.25, minus_zero);
2375 TEST_f_f (ceil, -0.625, minus_zero);
2378 /* The result can only be represented in long double. */
2379 TEST_f_f (ceil, 4503599627370495.5L, 4503599627370496.0L);
2380 TEST_f_f (ceil, 4503599627370496.25L, 4503599627370497.0L);
2381 TEST_f_f (ceil, 4503599627370496.5L, 4503599627370497.0L);
2382 TEST_f_f (ceil, 4503599627370496.75L, 4503599627370497.0L);
2383 TEST_f_f (ceil, 4503599627370497.5L, 4503599627370498.0L);
2385 TEST_f_f (ceil, -4503599627370495.5L, -4503599627370495.0L);
2386 TEST_f_f (ceil, -4503599627370496.25L, -4503599627370496.0L);
2387 TEST_f_f (ceil, -4503599627370496.5L, -4503599627370496.0L);
2388 TEST_f_f (ceil, -4503599627370496.75L, -4503599627370496.0L);
2389 TEST_f_f (ceil, -4503599627370497.5L, -4503599627370497.0L);
2391 # if LDBL_MANT_DIG > 100
2392 TEST_f_f (ceil, 4503599627370494.5000000000001L, 4503599627370495.0L);
2393 TEST_f_f (ceil, 4503599627370495.5000000000001L, 4503599627370496.0L);
2394 TEST_f_f (ceil, 4503599627370496.5000000000001L, 4503599627370497.0L);
2395 TEST_f_f (ceil, -4503599627370494.5000000000001L, -4503599627370494.0L);
2396 TEST_f_f (ceil, -4503599627370495.5000000000001L, -4503599627370495.0L);
2397 TEST_f_f (ceil, -4503599627370496.5000000000001L, -4503599627370496.0L);
2400 TEST_f_f (ceil, 9007199254740991.5L, 9007199254740992.0L);
2401 TEST_f_f (ceil, 9007199254740992.25L, 9007199254740993.0L);
2402 TEST_f_f (ceil, 9007199254740992.5L, 9007199254740993.0L);
2403 TEST_f_f (ceil, 9007199254740992.75L, 9007199254740993.0L);
2404 TEST_f_f (ceil, 9007199254740993.5L, 9007199254740994.0L);
2406 TEST_f_f (ceil, -9007199254740991.5L, -9007199254740991.0L);
2407 TEST_f_f (ceil, -9007199254740992.25L, -9007199254740992.0L);
2408 TEST_f_f (ceil, -9007199254740992.5L, -9007199254740992.0L);
2409 TEST_f_f (ceil, -9007199254740992.75L, -9007199254740992.0L);
2410 TEST_f_f (ceil, -9007199254740993.5L, -9007199254740993.0L);
2412 # if LDBL_MANT_DIG > 100
2413 TEST_f_f (ceil, 9007199254740991.0000000000001L, 9007199254740992.0L);
2414 TEST_f_f (ceil, 9007199254740992.0000000000001L, 9007199254740993.0L);
2415 TEST_f_f (ceil, 9007199254740993.0000000000001L, 9007199254740994.0L);
2416 TEST_f_f (ceil, 9007199254740991.5000000000001L, 9007199254740992.0L);
2417 TEST_f_f (ceil, 9007199254740992.5000000000001L, 9007199254740993.0L);
2418 TEST_f_f (ceil, 9007199254740993.5000000000001L, 9007199254740994.0L);
2420 TEST_f_f (ceil, -9007199254740991.0000000000001L, -9007199254740991.0L);
2421 TEST_f_f (ceil, -9007199254740992.0000000000001L, -9007199254740992.0L);
2422 TEST_f_f (ceil, -9007199254740993.0000000000001L, -9007199254740993.0L);
2423 TEST_f_f (ceil, -9007199254740991.5000000000001L, -9007199254740991.0L);
2424 TEST_f_f (ceil, -9007199254740992.5000000000001L, -9007199254740992.0L);
2425 TEST_f_f (ceil, -9007199254740993.5000000000001L, -9007199254740993.0L);
2428 TEST_f_f (ceil, 72057594037927935.5L, 72057594037927936.0L);
2429 TEST_f_f (ceil, 72057594037927936.25L, 72057594037927937.0L);
2430 TEST_f_f (ceil, 72057594037927936.5L, 72057594037927937.0L);
2431 TEST_f_f (ceil, 72057594037927936.75L, 72057594037927937.0L);
2432 TEST_f_f (ceil, 72057594037927937.5L, 72057594037927938.0L);
2434 TEST_f_f (ceil, -72057594037927935.5L, -72057594037927935.0L);
2435 TEST_f_f (ceil, -72057594037927936.25L, -72057594037927936.0L);
2436 TEST_f_f (ceil, -72057594037927936.5L, -72057594037927936.0L);
2437 TEST_f_f (ceil, -72057594037927936.75L, -72057594037927936.0L);
2438 TEST_f_f (ceil, -72057594037927937.5L, -72057594037927937.0L);
2440 TEST_f_f (ceil, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L);
2441 TEST_f_f (ceil, 10141204801825835211973625643008.25L, 10141204801825835211973625643009.0L);
2442 TEST_f_f (ceil, 10141204801825835211973625643008.5L, 10141204801825835211973625643009.0L);
2443 TEST_f_f (ceil, 10141204801825835211973625643008.75L, 10141204801825835211973625643009.0L);
2444 TEST_f_f (ceil, 10141204801825835211973625643009.5L, 10141204801825835211973625643010.0L);
2455 FUNC(cexp) (BUILD_COMPLEX (0, 0));
2456 if (errno == ENOSYS)
2457 /* Function not implemented. */
2462 TEST_c_c (cexp, plus_zero, plus_zero, 1, 0.0);
2463 TEST_c_c (cexp, minus_zero, plus_zero, 1, 0.0);
2464 TEST_c_c (cexp, plus_zero, minus_zero, 1, minus_zero);
2465 TEST_c_c (cexp, minus_zero, minus_zero, 1, minus_zero);
2467 TEST_c_c (cexp, plus_infty, plus_zero, plus_infty, 0.0);
2468 TEST_c_c (cexp, plus_infty, minus_zero, plus_infty, minus_zero);
2470 TEST_c_c (cexp, minus_infty, plus_zero, 0.0, 0.0);
2471 TEST_c_c (cexp, minus_infty, minus_zero, 0.0, minus_zero);
2473 TEST_c_c (cexp, 0.0, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2474 TEST_c_c (cexp, minus_zero, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2476 TEST_c_c (cexp, 0.0, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2477 TEST_c_c (cexp, minus_zero, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2479 TEST_c_c (cexp, 100.0, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2480 TEST_c_c (cexp, -100.0, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2482 TEST_c_c (cexp, 100.0, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2483 TEST_c_c (cexp, -100.0, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
2485 TEST_c_c (cexp, minus_infty, 2.0, minus_zero, 0.0);
2486 TEST_c_c (cexp, minus_infty, 4.0, minus_zero, minus_zero);
2487 TEST_c_c (cexp, plus_infty, 2.0, minus_infty, plus_infty);
2488 TEST_c_c (cexp, plus_infty, 4.0, minus_infty, minus_infty);
2490 TEST_c_c (cexp, plus_infty, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2491 TEST_c_c (cexp, plus_infty, minus_infty, plus_infty, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
2493 TEST_c_c (cexp, minus_infty, plus_infty, 0.0, 0.0, IGNORE_ZERO_INF_SIGN);
2494 TEST_c_c (cexp, minus_infty, minus_infty, 0.0, minus_zero, IGNORE_ZERO_INF_SIGN);
2496 TEST_c_c (cexp, minus_infty, qnan_value, 0, 0, IGNORE_ZERO_INF_SIGN);
2498 TEST_c_c (cexp, plus_infty, qnan_value, plus_infty, qnan_value);
2500 TEST_c_c (cexp, qnan_value, 0.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2501 TEST_c_c (cexp, qnan_value, 1.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2503 TEST_c_c (cexp, qnan_value, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2504 TEST_c_c (cexp, 0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2505 TEST_c_c (cexp, 1, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2506 TEST_c_c (cexp, qnan_value, qnan_value, qnan_value, qnan_value);
2508 TEST_c_c (cexp, 0.75L, 1.25L, 0.667537446429131586942201977015932112L, 2.00900045494094876258347228145863909L);
2509 TEST_c_c (cexp, -2.0, -3.0, -0.13398091492954261346140525546115575L, -0.019098516261135196432576240858800925L);
2511 TEST_c_c (cexp, 0, 0x1p65, 0.99888622066058013610642172179340364209972L, -0.047183876212354673805106149805700013943218L);
2512 TEST_c_c (cexp, 0, -0x1p65, 0.99888622066058013610642172179340364209972L, 0.047183876212354673805106149805700013943218L);
2513 TEST_c_c (cexp, 50, 0x1p127, 4.053997150228616856622417636046265337193e21L, 3.232070315463388524466674772633810238819e21L);
2516 TEST_c_c (cexp, 0, 1e22, 0.5232147853951389454975944733847094921409L, -0.8522008497671888017727058937530293682618L);
2517 TEST_c_c (cexp, 0, 0x1p1023, -0.826369834614147994500785680811743734805L, 0.5631277798508840134529434079444683477104L);
2518 TEST_c_c (cexp, 500, 0x1p1023, -1.159886268932754433233243794561351783426e217L, 7.904017694554466595359379965081774849708e216L);
2521 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2522 TEST_c_c (cexp, 0, 0x1p16383L, 0.9210843909921906206874509522505756251609L, 0.3893629985894208126948115852610595405563L);
2523 TEST_c_c (cexp, -10000, 0x1p16383L, 1.045876464564882298442774542991176546722e-4343L, 4.421154026488516836023811173959413420548e-4344L);
2526 TEST_c_c (cexp, 88.75, 0.75, 2.558360358486542817001900410314204322891e38L, 2.383359453227311447654736314679677655100e38L);
2527 TEST_c_c (cexp, -95, 0.75, 4.039714446238306526889476684000081624047e-42L, 3.763383677300535390271646960780570275931e-42L, UNDERFLOW_EXCEPTION_FLOAT);
2530 TEST_c_c (cexp, 709.8125, 0.75, 1.355121963080879535248452862759108365762e308L, 1.262426823598609432507811340856186873507e308L);
2531 TEST_c_c (cexp, -720, 0.75, 1.486960657116368433685753325516638551722e-313L, 1.385247284245720590980701226843815229385e-313L, UNDERFLOW_EXCEPTION_DOUBLE);
2534 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2535 TEST_c_c (cexp, 11356.5625, 0.75, 9.052188470850960144814815984311663764287e4931L, 8.432986734191301036267148978260970230200e4931L);
2536 TEST_c_c (cexp, -11370, 0.75, 8.631121063182211587489310508568170739592e-4939L, 8.040721827809267291427062346918413482824e-4939L, UNDERFLOW_EXCEPTION);
2540 TEST_c_c (cexp, 180, 0x1p-149, plus_infty, 2.087071793345235105931967606907855310664e33L, OVERFLOW_EXCEPTION);
2543 #if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
2544 TEST_c_c (cexp, 1440, 0x1p-1074, plus_infty, 1.196295853897226111293303155636183216483e302L, OVERFLOW_EXCEPTION);
2547 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2548 TEST_c_c (cexp, 22730, 0x1p-16434L, plus_infty, 2.435706297811211974162115164702304105374e4924L, OVERFLOW_EXCEPTION);
2551 TEST_c_c (cexp, 1e6, 0, plus_infty, 0, OVERFLOW_EXCEPTION);
2552 TEST_c_c (cexp, 1e6, min_value, plus_infty, plus_infty, OVERFLOW_EXCEPTION);
2553 TEST_c_c (cexp, 1e6, -min_value, plus_infty, minus_infty, OVERFLOW_EXCEPTION);
2555 END (cexp, complex);
2563 TEST_c_f (cimag, 1.0, 0.0, 0.0);
2564 TEST_c_f (cimag, 1.0, minus_zero, minus_zero);
2565 TEST_c_f (cimag, 1.0, qnan_value, qnan_value);
2566 TEST_c_f (cimag, qnan_value, qnan_value, qnan_value);
2567 TEST_c_f (cimag, 1.0, plus_infty, plus_infty);
2568 TEST_c_f (cimag, 1.0, minus_infty, minus_infty);
2569 TEST_c_f (cimag, 2.0, 3.0, 3.0);
2578 FUNC(clog) (BUILD_COMPLEX (-2, -3));
2579 if (errno == ENOSYS)
2580 /* Function not implemented. */
2585 TEST_c_c (clog, minus_zero, 0, minus_infty, M_PIl, DIVIDE_BY_ZERO_EXCEPTION);
2586 TEST_c_c (clog, minus_zero, minus_zero, minus_infty, -M_PIl, DIVIDE_BY_ZERO_EXCEPTION);
2588 TEST_c_c (clog, 0, 0, minus_infty, 0.0, DIVIDE_BY_ZERO_EXCEPTION);
2589 TEST_c_c (clog, 0, minus_zero, minus_infty, minus_zero, DIVIDE_BY_ZERO_EXCEPTION);
2591 TEST_c_c (clog, minus_infty, plus_infty, plus_infty, M_PI_34l);
2592 TEST_c_c (clog, minus_infty, minus_infty, plus_infty, -M_PI_34l);
2594 TEST_c_c (clog, plus_infty, plus_infty, plus_infty, M_PI_4l);
2595 TEST_c_c (clog, plus_infty, minus_infty, plus_infty, -M_PI_4l);
2597 TEST_c_c (clog, 0, plus_infty, plus_infty, M_PI_2l);
2598 TEST_c_c (clog, 3, plus_infty, plus_infty, M_PI_2l);
2599 TEST_c_c (clog, minus_zero, plus_infty, plus_infty, M_PI_2l);
2600 TEST_c_c (clog, -3, plus_infty, plus_infty, M_PI_2l);
2601 TEST_c_c (clog, 0, minus_infty, plus_infty, -M_PI_2l);
2602 TEST_c_c (clog, 3, minus_infty, plus_infty, -M_PI_2l);
2603 TEST_c_c (clog, minus_zero, minus_infty, plus_infty, -M_PI_2l);
2604 TEST_c_c (clog, -3, minus_infty, plus_infty, -M_PI_2l);
2606 TEST_c_c (clog, minus_infty, 0, plus_infty, M_PIl);
2607 TEST_c_c (clog, minus_infty, 1, plus_infty, M_PIl);
2608 TEST_c_c (clog, minus_infty, minus_zero, plus_infty, -M_PIl);
2609 TEST_c_c (clog, minus_infty, -1, plus_infty, -M_PIl);
2611 TEST_c_c (clog, plus_infty, 0, plus_infty, 0.0);
2612 TEST_c_c (clog, plus_infty, 1, plus_infty, 0.0);
2613 TEST_c_c (clog, plus_infty, minus_zero, plus_infty, minus_zero);
2614 TEST_c_c (clog, plus_infty, -1, plus_infty, minus_zero);
2616 TEST_c_c (clog, plus_infty, qnan_value, plus_infty, qnan_value);
2617 TEST_c_c (clog, minus_infty, qnan_value, plus_infty, qnan_value);
2619 TEST_c_c (clog, qnan_value, plus_infty, plus_infty, qnan_value);
2620 TEST_c_c (clog, qnan_value, minus_infty, plus_infty, qnan_value);
2622 TEST_c_c (clog, 0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2623 TEST_c_c (clog, 3, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2624 TEST_c_c (clog, minus_zero, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2625 TEST_c_c (clog, -3, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2627 TEST_c_c (clog, qnan_value, 0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2628 TEST_c_c (clog, qnan_value, 5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2629 TEST_c_c (clog, qnan_value, minus_zero, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2630 TEST_c_c (clog, qnan_value, -5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2632 TEST_c_c (clog, qnan_value, qnan_value, qnan_value, qnan_value);
2634 TEST_c_c (clog, 0.75L, 1.25L, 0.376885901188190075998919126749298416L, 1.03037682652431246378774332703115153L);
2635 TEST_c_c (clog, -2, -3, 1.2824746787307683680267437207826593L, -2.1587989303424641704769327722648368L);
2637 TEST_c_c (clog, 0x1.fffffep+127L, 0x1.fffffep+127L, 89.06941264234832570836679262104313101776L, M_PI_4l);
2638 TEST_c_c (clog, 0x1.fffffep+127L, 1.0L, 88.72283905206835305365817656031404273372L, 2.938736052218037251011746307725933020145e-39L, UNDERFLOW_EXCEPTION_FLOAT);
2639 TEST_c_c (clog, 0x1p-149L, 0x1p-149L, -102.9323563131518784484589700365392203592L, M_PI_4l);
2640 TEST_c_c (clog, 0x1p-147L, 0x1p-147L, -101.5460619520319878296245057936228672231L, M_PI_4l);
2643 TEST_c_c (clog, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 710.1292864836639693869320059713862337880L, M_PI_4l);
2644 TEST_c_c (clog, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 709.8942846690411016323109979483151967689L, 0.4636476090008061606231772164674799632783L);
2645 TEST_c_c (clog, 0x1p-1074L, 0x1p-1074L, -744.0934983311012896593986823853525458290L, M_PI_4l);
2646 TEST_c_c (clog, 0x1p-1073L, 0x1p-1073L, -743.4003511505413443499814502638943692610L, M_PI_4l);
2649 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2650 TEST_c_c (clog, 0x1.fp+16383L, 0x1.fp+16383L, 11356.83823118610934184548269774874545400L, M_PI_4l);
2651 TEST_c_c (clog, 0x1.fp+16383L, 0x1p+16383L, 11356.60974243783798653123798337822335902L, 0.4764674194737066993385333770295162295856L);
2652 TEST_c_c (clog, 0x1p-16440L, 0x1p-16441L, -11395.22807662984378194141292922726786191L, 0.4636476090008061162142562314612144020285L);
2655 TEST_c_c (clog, 0x1p-149L, 0x1.fp+127L, 88.69109041335841930424871526389807508374L, M_PI_2l);
2656 TEST_c_c (clog, -0x1p-149L, 0x1.fp+127L, 88.69109041335841930424871526389807508374L, M_PI_2l);
2657 TEST_c_c (clog, 0x1p-149L, -0x1.fp+127L, 88.69109041335841930424871526389807508374L, -M_PI_2l);
2658 TEST_c_c (clog, -0x1p-149L, -0x1.fp+127L, 88.69109041335841930424871526389807508374L, -M_PI_2l);
2659 TEST_c_c (clog, -0x1.fp+127L, 0x1p-149L, 88.69109041335841930424871526389807508374L, M_PIl);
2660 TEST_c_c (clog, -0x1.fp+127L, -0x1p-149L, 88.69109041335841930424871526389807508374L, -M_PIl);
2662 TEST_c_c (clog, 0x1.fp+127L, 0x1p-149L, 88.69109041335841930424871526389807508374L, plus_zero, UNDERFLOW_EXCEPTION);
2663 TEST_c_c (clog, 0x1.fp+127L, -0x1p-149L, 88.69109041335841930424871526389807508374L, minus_zero, UNDERFLOW_EXCEPTION);
2667 TEST_c_c (clog, 0x1p-1074L, 0x1.fp+1023L, 709.7509641950694165420886960904242800794L, M_PI_2l);
2668 TEST_c_c (clog, -0x1p-1074L, 0x1.fp+1023L, 709.7509641950694165420886960904242800794L, M_PI_2l);
2669 TEST_c_c (clog, 0x1p-1074L, -0x1.fp+1023L, 709.7509641950694165420886960904242800794L, -M_PI_2l);
2670 TEST_c_c (clog, -0x1p-1074L, -0x1.fp+1023L, 709.7509641950694165420886960904242800794L, -M_PI_2l);
2671 TEST_c_c (clog, -0x1.fp+1023L, 0x1p-1074L, 709.7509641950694165420886960904242800794L, M_PIl);
2672 TEST_c_c (clog, -0x1.fp+1023L, -0x1p-1074L, 709.7509641950694165420886960904242800794L, -M_PIl);
2674 #if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
2675 TEST_c_c (clog, 0x1.fp+1023L, 0x1p-1074L, 709.7509641950694165420886960904242800794L, plus_zero, UNDERFLOW_EXCEPTION);
2676 TEST_c_c (clog, 0x1.fp+1023L, -0x1p-1074L, 709.7509641950694165420886960904242800794L, minus_zero, UNDERFLOW_EXCEPTION);
2679 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2680 TEST_c_c (clog, 0x1p-16445L, 0x1.fp+16383L, 11356.49165759582936919077408168801636572L, M_PI_2l);
2681 TEST_c_c (clog, -0x1p-16445L, 0x1.fp+16383L, 11356.49165759582936919077408168801636572L, M_PI_2l);
2682 TEST_c_c (clog, 0x1p-16445L, -0x1.fp+16383L, 11356.49165759582936919077408168801636572L, -M_PI_2l);
2683 TEST_c_c (clog, -0x1p-16445L, -0x1.fp+16383L, 11356.49165759582936919077408168801636572L, -M_PI_2l);
2684 TEST_c_c (clog, -0x1.fp+16383L, 0x1p-16445L, 11356.49165759582936919077408168801636572L, M_PIl);
2685 TEST_c_c (clog, -0x1.fp+16383L, -0x1p-16445L, 11356.49165759582936919077408168801636572L, -M_PIl);
2686 TEST_c_c (clog, 0x1.fp+16383L, 0x1p-16445L, 11356.49165759582936919077408168801636572L, plus_zero, UNDERFLOW_EXCEPTION);
2687 TEST_c_c (clog, 0x1.fp+16383L, -0x1p-16445L, 11356.49165759582936919077408168801636572L, minus_zero, UNDERFLOW_EXCEPTION);
2688 # if LDBL_MANT_DIG >= 113
2689 TEST_c_c (clog, 0x1p-16494L, 0x1.fp+16383L, 11356.49165759582936919077408168801636572L, M_PI_2l);
2690 TEST_c_c (clog, -0x1p-16494L, 0x1.fp+16383L, 11356.49165759582936919077408168801636572L, M_PI_2l);
2691 TEST_c_c (clog, 0x1p-16494L, -0x1.fp+16383L, 11356.49165759582936919077408168801636572L, -M_PI_2l);
2692 TEST_c_c (clog, -0x1p-16494L, -0x1.fp+16383L, 11356.49165759582936919077408168801636572L, -M_PI_2l);
2693 TEST_c_c (clog, -0x1.fp+16383L, 0x1p-16494L, 11356.49165759582936919077408168801636572L, M_PIl);
2694 TEST_c_c (clog, -0x1.fp+16383L, -0x1p-16494L, 11356.49165759582936919077408168801636572L, -M_PIl);
2695 TEST_c_c (clog, 0x1.fp+16383L, 0x1p-16494L, 11356.49165759582936919077408168801636572L, plus_zero, UNDERFLOW_EXCEPTION);
2696 TEST_c_c (clog, 0x1.fp+16383L, -0x1p-16494L, 11356.49165759582936919077408168801636572L, minus_zero, UNDERFLOW_EXCEPTION);
2700 TEST_c_c (clog, 1.0L, 0x1.234566p-10L, 6.172834701221959432440126967147726538097e-7L, 1.111110564353742042376451655136933182201e-3L);
2701 TEST_c_c (clog, -1.0L, 0x1.234566p-20L, 5.886877547844618300918562490463748605537e-13L, 3.141591568520436206990380699322226378452L);
2702 TEST_c_c (clog, 0x1.234566p-30L, 1.0L, 5.614163921211322622623353961365728040115e-19L, 1.570796325735258575254858696548386439740L);
2703 TEST_c_c (clog, -0x1.234566p-40L, -1.0L, 5.354083939753840089583620652120903838944e-25L, -1.570796326795931422008642456283782656359L);
2704 TEST_c_c (clog, 0x1.234566p-50L, 1.0L, 5.106052341226425256332038420428899201070e-31L, 1.570796326794895608681734464330528755366L);
2705 TEST_c_c (clog, 0x1.234566p-60L, 1.0L, 4.869510976053643471080816669875627875933e-37L, 1.570796326794896618244456860363082279319L);
2706 TEST_c_c (clog, 0x1p-62L, 1.0L, 2.350988701644575015937473074444491355582e-38L, 1.570796326794896619014481257142650555297L);
2707 TEST_c_c (clog, 0x1p-63L, 1.0L, 5.877471754111437539843682686111228389059e-39L, 1.570796326794896619122901474391200998698L, UNDERFLOW_EXCEPTION_FLOAT);
2708 TEST_c_c (clog, 0x1p-64L, 1.0L, 1.469367938527859384960920671527807097271e-39L, 1.570796326794896619177111583015476220398L, UNDERFLOW_EXCEPTION_FLOAT);
2710 TEST_c_c (clog, 0x1p-510L, 1.0L, 4.450147717014402766180465434664808128438e-308L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
2711 TEST_c_c (clog, 0x1p-511L, 1.0L, 1.112536929253600691545116358666202032110e-308L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
2712 TEST_c_c (clog, 0x1p-512L, 1.0L, 2.781342323134001728862790896665505080274e-309L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
2714 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2715 TEST_c_c (clog, 0x1p-8190L, 1.0L, 6.724206286224187012525355634643505205196e-4932L, 1.570796326794896619231321691639751442099L);
2716 TEST_c_c (clog, 0x1p-8191L, 1.0L, 1.681051571556046753131338908660876301299e-4932L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
2717 TEST_c_c (clog, 0x1p-8192L, 1.0L, 4.202628928890116882828347271652190753248e-4933L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
2720 TEST_c_c (clog, 0x1.000566p0L, 0x1.234p-10L, 8.298731898331237038231468223024422855654e-5L, 1.110938609507128729312743251313024793990e-3L);
2721 TEST_c_c (clog, 0x1.000566p0L, 0x1.234p-100L, 8.237022655933121125560939513260027133767e-5L, 8.974094312218060110948251664314290484113e-31L);
2723 TEST_c_c (clog, -0x1.0000000123456p0L, 0x1.2345678p-30L, 2.649094282537168795982991778475646793277e-10L, 3.141592652530155111500161671113150737892L);
2724 TEST_c_c (clog, -0x1.0000000123456p0L, 0x1.2345678p-1000L, 2.649094276923003995420209214900915462737e-10L, 3.141592653589793238462643383279502884197L);
2726 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
2727 TEST_c_c (clog, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-60L, 9.868649107778739757272772275265050767867e-19L, 9.868649106423871142816660980898339912137e-19L);
2728 TEST_c_c (clog, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-1000L, 9.868649107778739752403260515979017248596e-19L, 1.061846605795612822522063052130030717368e-301L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
2731 TEST_c_c (clog, 0x0.ffffffp0L, 0x0.ffffffp-100L, -5.960464655174753498633255797994360530379e-8L, 7.888609052210118054117285652827862296732e-31L);
2733 TEST_c_c (clog, 0x0.fffffffffffff8p0L, 0x0.fffffffffffff8p-1000L, -1.110223024625156602053389888482372171810e-16L, 9.332636185032188789900895447238171696171e-302L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
2735 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
2736 TEST_c_c (clog, 0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp-15000L, -5.421010862427522170184200798202494495630e-20L, 3.548665303440282824232502561095699343814e-4516L);
2739 TEST_c_c (clog, 0x1a6p-10L, 0x3a5p-10L, -1.4305135209763571252847059962654228661815e-06L, 1.1460277178115757370775644871674016684074L);
2740 TEST_c_c (clog, 0xf2p-10L, 0x3e3p-10L, 6.1988446308070710970664736815277450078106e-06L, 1.3322126499153926210226335249558203898460L);
2741 TEST_c_c (clog, 0x4d4ep-15L, 0x6605p-15L, -1.6298145321400412054744424587143483169412e-08L, 0.9223574537155056772124552172295398141249L);
2742 TEST_c_c (clog, 0x2818p-15L, 0x798fp-15L, 1.5366822245016167178749091974664853785194e-08L, 1.2522014929038946066987318471922169174157L);
2743 TEST_c_c (clog, 0x9b57bp-20L, 0xcb7b4p-20L, -3.9563019528687610863490232935890272740908e-11L, 0.9187593477446338910857133065497364950682L);
2744 TEST_c_c (clog, 0x2731p-20L, 0xfffd0p-20L, 4.4110493034041283943115971658295280288115e-11L, 1.5612279663766352262688735061954290528838L);
2745 TEST_c_c (clog, 0x2ede88p-23L, 0x771c3fp-23L, -4.4764192352906350039050902870893173560494e-13L, 1.1959106857549200806818600493552847793381L);
2746 TEST_c_c (clog, 0x11682p-23L, 0x7ffed1p-23L, 1.1723955140027907954461000991619077811832e-12L, 1.5622968405332756349813737986164832897108L);
2747 TEST_c_c (clog, 0xa1f2c1p-24L, 0xc643aep-24L, -1.0480505352462576151523512837107080269981e-13L, 0.8858771987699967480545613322309315260313L);
2748 TEST_c_c (clog, 0x659feap-24L, 0xeaf6f9p-24L, 3.7303493627403868207597214252239749960738e-14L, 1.1625816408046866464773042283673653469061L);
2750 TEST_c_c (clog, 0x4447d7175p-35L, 0x6c445e00ap-35L, -1.4823076576950255933915367361099865652625e-20L, 1.0081311552703893116404606212158840190615L);
2751 TEST_c_c (clog, 0x2dd46725bp-35L, 0x7783a1284p-35L, 4.4469229730850767799109418892826021157328e-20L, 1.2046235979300843056806465045930070146351L);
2752 TEST_c_c (clog, 0x164c74eea876p-45L, 0x16f393482f77p-45L, -3.0292258760486853327810377824479932031744e-26L, 0.7998237934177411746093524982030330293980L);
2753 TEST_c_c (clog, 0xfe961079616p-45L, 0x1bc37e09e6d1p-45L, 5.3718272201930019901317065495843842735179e-26L, 1.0503831592447830576186444373011142397404L);
2754 TEST_c_c (clog, 0xa4722f19346cp-51L, 0x7f9631c5e7f07p-51L, -6.2122796286154679676173624516405339768606e-30L, 1.4904138780720095276446375492434049214172L);
2755 TEST_c_c (clog, 0x10673dd0f2481p-51L, 0x7ef1d17cefbd2p-51L, 3.2047474274603604594851472963586149973093e-29L, 1.4422922682185099608731642353544207976604L);
2756 TEST_c_c (clog, 0x8ecbf810c4ae6p-52L, 0xd479468b09a37p-52L, -9.7375017988218644730510244778042114638107e-30L, 0.9790637929494922564724108399524154766631L);
2757 TEST_c_c (clog, 0x5b06b680ea2ccp-52L, 0xef452b965da9fp-52L, 8.3076914081087805757422664530653247447136e-30L, 1.2072712126771536614482822173033535043206L);
2758 TEST_c_c (clog, 0x659b70ab7971bp-53L, 0x1f5d111e08abecp-53L, -2.5083311595699359750201056724289010648701e-30L, 1.3710185432462268491534742969536240564640L);
2759 TEST_c_c (clog, 0x15cfbd1990d1ffp-53L, 0x176a3973e09a9ap-53L, 1.0168910106364605304135563536838075568606e-30L, 0.8208373755522359859870890246475340086663L);
2760 TEST_c_c (clog, 0x1367a310575591p-54L, 0x3cfcc0a0541f60p-54L, 5.0844550531823026520677817684239496041087e-32L, 1.2627468605458094918919206628466016525397L);
2761 TEST_c_c (clog, 0x55cb6d0c83af5p-55L, 0x7fe33c0c7c4e90p-55L, -5.2000108498455368032511404449795741611813e-32L, 1.5288921536982513453421343495466824420259L);
2763 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
2764 TEST_c_c (clog, 0x298c62cb546588a7p-63L, 0x7911b1dfcc4ecdaep-63L, -1.1931267660846218205882675852805793644095e-36L, 1.2402109774337032400594953899784058127412L);
2765 TEST_c_c (clog, 0x4d9c37e2b5cb4533p-63L, 0x65c98be2385a042ep-63L, 6.4064442119814669184296141278612389400075e-37L, 0.9193591364645830864185131402313014890145L);
2766 TEST_c_c (clog, 0x602fd5037c4792efp-64L, 0xed3e2086dcca80b8p-64L, -2.3362950222592964220878638677292132852104e-37L, 1.1856121127236268105413184264288408265852L);
2767 TEST_c_c (clog, 0x6b10b4f3520217b6p-64L, 0xe8893cbb449253a1p-64L, 2.4244570985709679851855191080208817099132e-37L, 1.1393074519572050614551047548718495655972L);
2768 TEST_c_c (clog, 0x81b7efa81fc35ad1p-65L, 0x1ef4b835f1c79d812p-65L, -9.9182335850630508484862145328126979066934e-39L, 1.3146479888794807046338799047003947008804L);
2770 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
2771 TEST_c_c (clog, 0x3f96469050f650869c2p-75L, 0x6f16b2c9c8b05988335p-75L, -1.0509738482436128031927971874674370984602e-45L, 1.0509191467640012308402149909370784281448L);
2772 TEST_c_c (clog, 0x3157fc1d73233e580c8p-75L, 0x761b52ccd435d7c7f5fp-75L, 1.3487497719126364307640897239165442763573e-43L, 1.1750493008528425228929764149024375035382L);
2773 TEST_c_c (clog, 0x155f8afc4c48685bf63610p-85L, 0x17d0cf2652cdbeb1294e19p-85L, -4.7775669192897997174762089350332738583822e-50L, 0.8393953487996880419413728440067635213372L);
2774 TEST_c_c (clog, 0x13836d58a13448d750b4b9p-85L, 0x195ca7bc3ab4f9161edbe6p-85L, 2.8398125044729578740243199963484494962411e-50L, 0.9149964976334130461795060758257083099706L);
2775 TEST_c_c (clog, 0x1df515eb171a808b9e400266p-95L, 0x7c71eb0cd4688dfe98581c77p-95L, -3.5048022044913950094635368750889659723004e-57L, 1.3345633256521815205858155673950177421079L);
2776 TEST_c_c (clog, 0xe33f66c9542ca25cc43c867p-95L, 0x7f35a68ebd3704a43c465864p-95L, 4.1101771307217268747345114262406964584250e-56L, 1.4596065864518742494094402406719567059585L);
2777 TEST_c_c (clog, 0x6771f22c64ed551b857c128b4cp-105L, 0x1f570e7a13cc3cf2f44fd793ea1p-105L, -1.4281333889622737316199756373421183559948e-62L, 1.3673546561165378090903506783353927980633L);
2778 TEST_c_c (clog, 0x15d8ab6ed05ca514086ac3a1e84p-105L, 0x1761e480aa094c0b10b34b09ce9p-105L, 1.0027319539522347477331743836657426754857e-62L, 0.8193464073721167323313606647411269414759L);
2779 TEST_c_c (clog, 0x187190c1a334497bdbde5a95f48p-106L, 0x3b25f08062d0a095c4cfbbc338dp-106L, -1.7471844652198029695350765775994001163767e-63L, 1.1789110097072986038243729592318526094314L);
2780 TEST_c_c (clog, 0x6241ef0da53f539f02fad67dabp-106L, 0x3fb46641182f7efd9caa769dac0p-106L, 4.3299788920664682288477984749202524623248e-63L, 1.4746938237585656250866370987773473745867L);
2782 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 113
2783 TEST_c_c (clog, 0x3e1d0a105ac4ebeacd9c6952d34cp-112L, 0xf859b3d1b06d005dcbb5516d5479p-112L, -1.1683999374665377365054966073875064467108e-66L, 1.3257197596350832748781065387304444940172L);
2784 TEST_c_c (clog, 0x47017a2e36807acb1e5214b209dep-112L, 0xf5f4a550c9d75e3bb1839d865f0dp-112L, 1.5077923002544367932999503838191154621839e-65L, 1.2897445708311412721399861948957141824914L);
2785 TEST_c_c (clog, 0x148f818cb7a9258fca942ade2a0cap-113L, 0x18854a34780b8333ec53310ad7001p-113L, -7.1865869169568789348552370692485515571497e-67L, 0.8730167479365994646287897223471819363668L);
2786 TEST_c_c (clog, 0xfd95243681c055c2632286921092p-113L, 0x1bccabcd29ca2152860ec29e34ef7p-113L, 6.6255694866654064502633121109394710807528e-66L, 1.0526409614996288387567810726095850312049L);
2787 TEST_c_c (clog, 0xdb85c467ee2aadd5f425fe0f4b8dp-114L, 0x3e83162a0f95f1dcbf97dddf410eap-114L, 4.6017338806965821566734340588575402712716e-67L, 1.3547418904611758959096647942223384691728L);
2788 TEST_c_c (clog, 0x1415bcaf2105940d49a636e98ae59p-115L, 0x7e6a150adfcd1b0921d44b31f40f4p-115L, 2.5993421227864195179698176012564317527271e-67L, 1.4132318089683022770487383611430906982461L);
2791 END (clog, complex);
2799 FUNC(clog10) (BUILD_COMPLEX (0.7L, 1.2L));
2800 if (errno == ENOSYS)
2801 /* Function not implemented. */
2806 TEST_c_c (clog10, minus_zero, 0, minus_infty, M_PIl, DIVIDE_BY_ZERO_EXCEPTION);
2807 TEST_c_c (clog10, minus_zero, minus_zero, minus_infty, -M_PIl, DIVIDE_BY_ZERO_EXCEPTION);
2809 TEST_c_c (clog10, 0, 0, minus_infty, 0.0, DIVIDE_BY_ZERO_EXCEPTION);
2810 TEST_c_c (clog10, 0, minus_zero, minus_infty, minus_zero, DIVIDE_BY_ZERO_EXCEPTION);
2812 TEST_c_c (clog10, minus_infty, plus_infty, plus_infty, M_PI_34_LOG10El);
2814 TEST_c_c (clog10, plus_infty, plus_infty, plus_infty, M_PI4_LOG10El);
2815 TEST_c_c (clog10, plus_infty, minus_infty, plus_infty, -M_PI4_LOG10El);
2817 TEST_c_c (clog10, 0, plus_infty, plus_infty, M_PI2_LOG10El);
2818 TEST_c_c (clog10, 3, plus_infty, plus_infty, M_PI2_LOG10El);
2819 TEST_c_c (clog10, minus_zero, plus_infty, plus_infty, M_PI2_LOG10El);
2820 TEST_c_c (clog10, -3, plus_infty, plus_infty, M_PI2_LOG10El);
2821 TEST_c_c (clog10, 0, minus_infty, plus_infty, -M_PI2_LOG10El);
2822 TEST_c_c (clog10, 3, minus_infty, plus_infty, -M_PI2_LOG10El);
2823 TEST_c_c (clog10, minus_zero, minus_infty, plus_infty, -M_PI2_LOG10El);
2824 TEST_c_c (clog10, -3, minus_infty, plus_infty, -M_PI2_LOG10El);
2826 TEST_c_c (clog10, minus_infty, 0, plus_infty, M_PI_LOG10El);
2827 TEST_c_c (clog10, minus_infty, 1, plus_infty, M_PI_LOG10El);
2828 TEST_c_c (clog10, minus_infty, minus_zero, plus_infty, -M_PI_LOG10El);
2829 TEST_c_c (clog10, minus_infty, -1, plus_infty, -M_PI_LOG10El);
2831 TEST_c_c (clog10, plus_infty, 0, plus_infty, 0.0);
2832 TEST_c_c (clog10, plus_infty, 1, plus_infty, 0.0);
2833 TEST_c_c (clog10, plus_infty, minus_zero, plus_infty, minus_zero);
2834 TEST_c_c (clog10, plus_infty, -1, plus_infty, minus_zero);
2836 TEST_c_c (clog10, plus_infty, qnan_value, plus_infty, qnan_value);
2837 TEST_c_c (clog10, minus_infty, qnan_value, plus_infty, qnan_value);
2839 TEST_c_c (clog10, qnan_value, plus_infty, plus_infty, qnan_value);
2840 TEST_c_c (clog10, qnan_value, minus_infty, plus_infty, qnan_value);
2842 TEST_c_c (clog10, 0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2843 TEST_c_c (clog10, 3, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2844 TEST_c_c (clog10, minus_zero, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2845 TEST_c_c (clog10, -3, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2847 TEST_c_c (clog10, qnan_value, 0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2848 TEST_c_c (clog10, qnan_value, 5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2849 TEST_c_c (clog10, qnan_value, minus_zero, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2850 TEST_c_c (clog10, qnan_value, -5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
2852 TEST_c_c (clog10, qnan_value, qnan_value, qnan_value, qnan_value);
2854 TEST_c_c (clog10, 0.75L, 1.25L, 0.163679467193165171449476605077428975L, 0.447486970040493067069984724340855636L);
2855 TEST_c_c (clog10, -2, -3, 0.556971676153418384603252578971164214L, -0.937554462986374708541507952140189646L);
2857 TEST_c_c (clog10, 0x1.fffffep+127L, 0x1.fffffep+127L, 38.68235441693561449174780668781319348761L, M_PI4_LOG10El);
2858 TEST_c_c (clog10, 0x1.fffffep+127L, 1.0L, 38.53183941910362389414093724045094697423L, 1.276276851248440096917018665609900318458e-39L, UNDERFLOW_EXCEPTION_FLOAT);
2859 TEST_c_c (clog10, 0x1p-149L, 0x1p-149L, -44.70295435610120748924022586658721447508L, M_PI4_LOG10El);
2860 TEST_c_c (clog10, 0x1p-147L, 0x1p-147L, -44.10089436477324509881274807713822842154L, M_PI4_LOG10El);
2863 TEST_c_c (clog10, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 308.4052305577487344482591243175787477115L, M_PI4_LOG10El);
2864 TEST_c_c (clog10, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 308.3031705664207720674749211936626341569L, 0.2013595981366865903254995612594728746470L);
2865 TEST_c_c (clog10, 0x1p-1074L, 0x1p-1074L, -323.1557003452838130619487034867432642357L, M_PI4_LOG10El);
2866 TEST_c_c (clog10, 0x1p-1073L, 0x1p-1073L, -322.8546703496198318667349645920187712089L, M_PI4_LOG10El);
2869 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2870 TEST_c_c (clog10, 0x1.fp+16383L, 0x1.fp+16383L, 4932.212175672014259683102930239951947672L, M_PI4_LOG10El);
2871 TEST_c_c (clog10, 0x1.fp+16383L, 0x1p+16383L, 4932.112944269463028900262609694408579449L, 0.2069271710841128115912940666587802677383L);
2872 TEST_c_c (clog10, 0x1p-16440L, 0x1p-16441L, -4948.884673709346821106688037612752099609L, 0.2013595981366865710389502301937289472543L);
2875 TEST_c_c (clog10, 0x1p-149L, 0x1.fp+127L, 38.51805116050395969095658815123105801479L, 0.6821881769209206737428918127156778851051L);
2876 TEST_c_c (clog10, -0x1p-149L, 0x1.fp+127L, 38.51805116050395969095658815123105801479L, 0.6821881769209206737428918127156778851051L);
2877 TEST_c_c (clog10, 0x1p-149L, -0x1.fp+127L, 38.51805116050395969095658815123105801479L, -0.6821881769209206737428918127156778851051L);
2878 TEST_c_c (clog10, -0x1p-149L, -0x1.fp+127L, 38.51805116050395969095658815123105801479L, -0.6821881769209206737428918127156778851051L);
2879 TEST_c_c (clog10, -0x1.fp+127L, 0x1p-149L, 38.51805116050395969095658815123105801479L, 1.364376353841841347485783625431355770210L);
2880 TEST_c_c (clog10, -0x1.fp+127L, -0x1p-149L, 38.51805116050395969095658815123105801479L, -1.364376353841841347485783625431355770210L);
2882 TEST_c_c (clog10, 0x1.fp+127L, 0x1p-149L, 38.51805116050395969095658815123105801479L, plus_zero, UNDERFLOW_EXCEPTION);
2883 TEST_c_c (clog10, 0x1.fp+127L, -0x1p-149L, 38.51805116050395969095658815123105801479L, minus_zero, UNDERFLOW_EXCEPTION);
2887 TEST_c_c (clog10, 0x1p-1074L, 0x1.fp+1023L, 308.2409272754311106024666378243768099991L, 0.6821881769209206737428918127156778851051L);
2888 TEST_c_c (clog10, -0x1p-1074L, 0x1.fp+1023L, 308.2409272754311106024666378243768099991L, 0.6821881769209206737428918127156778851051L);
2889 TEST_c_c (clog10, 0x1p-1074L, -0x1.fp+1023L, 308.2409272754311106024666378243768099991L, -0.6821881769209206737428918127156778851051L);
2890 TEST_c_c (clog10, -0x1p-1074L, -0x1.fp+1023L, 308.2409272754311106024666378243768099991L, -0.6821881769209206737428918127156778851051L);
2891 TEST_c_c (clog10, -0x1.fp+1023L, 0x1p-1074L, 308.2409272754311106024666378243768099991L, 1.364376353841841347485783625431355770210L);
2892 TEST_c_c (clog10, -0x1.fp+1023L, -0x1p-1074L, 308.2409272754311106024666378243768099991L, -1.364376353841841347485783625431355770210L);
2894 #if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
2895 TEST_c_c (clog10, 0x1.fp+1023L, 0x1p-1074L, 308.2409272754311106024666378243768099991L, plus_zero, UNDERFLOW_EXCEPTION);
2896 TEST_c_c (clog10, 0x1.fp+1023L, -0x1p-1074L, 308.2409272754311106024666378243768099991L, minus_zero, UNDERFLOW_EXCEPTION);
2899 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2900 TEST_c_c (clog10, 0x1p-16445L, 0x1.fp+16383L, 4932.061660674182269085496060792589701158L, 0.6821881769209206737428918127156778851051L);
2901 TEST_c_c (clog10, -0x1p-16445L, 0x1.fp+16383L, 4932.061660674182269085496060792589701158L, 0.6821881769209206737428918127156778851051L);
2902 TEST_c_c (clog10, 0x1p-16445L, -0x1.fp+16383L, 4932.061660674182269085496060792589701158L, -0.6821881769209206737428918127156778851051L);
2903 TEST_c_c (clog10, -0x1p-16445L, -0x1.fp+16383L, 4932.061660674182269085496060792589701158L, -0.6821881769209206737428918127156778851051L);
2904 TEST_c_c (clog10, -0x1.fp+16383L, 0x1p-16445L, 4932.061660674182269085496060792589701158L, 1.364376353841841347485783625431355770210L);
2905 TEST_c_c (clog10, -0x1.fp+16383L, -0x1p-16445L, 4932.061660674182269085496060792589701158L, -1.364376353841841347485783625431355770210L);
2906 TEST_c_c (clog10, 0x1.fp+16383L, 0x1p-16445L, 4932.061660674182269085496060792589701158L, plus_zero, UNDERFLOW_EXCEPTION);
2907 TEST_c_c (clog10, 0x1.fp+16383L, -0x1p-16445L, 4932.061660674182269085496060792589701158L, minus_zero, UNDERFLOW_EXCEPTION);
2908 # if LDBL_MANT_DIG >= 113
2909 TEST_c_c (clog10, 0x1p-16494L, 0x1.fp+16383L, 4932.061660674182269085496060792589701158L, 0.6821881769209206737428918127156778851051L);
2910 TEST_c_c (clog10, -0x1p-16494L, 0x1.fp+16383L, 4932.061660674182269085496060792589701158L, 0.6821881769209206737428918127156778851051L);
2911 TEST_c_c (clog10, 0x1p-16494L, -0x1.fp+16383L, 4932.061660674182269085496060792589701158L, -0.6821881769209206737428918127156778851051L);
2912 TEST_c_c (clog10, -0x1p-16494L, -0x1.fp+16383L, 4932.061660674182269085496060792589701158L, -0.6821881769209206737428918127156778851051L);
2913 TEST_c_c (clog10, -0x1.fp+16383L, 0x1p-16494L, 4932.061660674182269085496060792589701158L, 1.364376353841841347485783625431355770210L);
2914 TEST_c_c (clog10, -0x1.fp+16383L, -0x1p-16494L, 4932.061660674182269085496060792589701158L, -1.364376353841841347485783625431355770210L);
2915 TEST_c_c (clog10, 0x1.fp+16383L, 0x1p-16494L, 4932.061660674182269085496060792589701158L, plus_zero, UNDERFLOW_EXCEPTION);
2916 TEST_c_c (clog10, 0x1.fp+16383L, -0x1p-16494L, 4932.061660674182269085496060792589701158L, minus_zero, UNDERFLOW_EXCEPTION);
2920 TEST_c_c (clog10, 1.0L, 0x1.234566p-10L, 2.680828048441605163181684680300513080769e-7L, 4.825491868832381486767558728169977751564e-4L);
2921 TEST_c_c (clog10, -1.0L, 0x1.234566p-20L, 2.556638434669064077889576526006849923281e-13L, 1.364375882602207106407956770293808181427L);
2922 TEST_c_c (clog10, 0x1.234566p-30L, 1.0L, 2.438200411482400072282924063740535840474e-19L, 6.821881764607257184291586401763604544928e-1L);
2923 TEST_c_c (clog10, -0x1.234566p-40L, -1.0L, 2.325249110681915353442924915876654139373e-25L, -6.821881769213700828789403802671540158935e-1L);
2924 TEST_c_c (clog10, 0x1.234566p-50L, 1.0L, 2.217530356103816369479108963807448194409e-31L, 6.821881769209202348667823902864283966959e-1L);
2925 TEST_c_c (clog10, 0x1.234566p-60L, 1.0L, 2.114801746467415208319767917450504756866e-37L, 6.821881769209206733143018621078368211515e-1L);
2926 TEST_c_c (clog10, 0x1p-61L, 1.0L, 4.084085680564517578238994467153626207224e-38L, 6.821881769209206735545466044044889962925e-1L);
2927 TEST_c_c (clog10, 0x1p-62L, 1.0L, 1.021021420141129394559748616788406551878e-38L, 6.821881769209206736487192085600834406988e-1L, UNDERFLOW_EXCEPTION_FLOAT);
2928 TEST_c_c (clog10, 0x1p-63L, 1.0L, 2.552553550352823486399371541971016379740e-39L, 6.821881769209206736958055106378806629019e-1L, UNDERFLOW_EXCEPTION_FLOAT);
2930 TEST_c_c (clog10, 0x1p-509L, 1.0L, 7.730698388614835910296270976605350994446e-308L, 6.821881769209206737428918127156778851051e-1L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
2931 TEST_c_c (clog10, 0x1p-510L, 1.0L, 1.932674597153708977574067744151337748612e-308L, 6.821881769209206737428918127156778851051e-1L, UNDERFLOW_EXCEPTION_DOUBLE);
2932 TEST_c_c (clog10, 0x1p-511L, 1.0L, 4.831686492884272443935169360378344371529e-309L, 6.821881769209206737428918127156778851051e-1L, UNDERFLOW_EXCEPTION_DOUBLE);
2934 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
2935 TEST_c_c (clog10, 0x1p-8189L, 1.0L, 1.168114274114528946314738738025008370069e-4931L, 6.821881769209206737428918127156778851051e-1L);
2936 TEST_c_c (clog10, 0x1p-8190L, 1.0L, 2.920285685286322365786846845062520925172e-4932L, 6.821881769209206737428918127156778851051e-1L, UNDERFLOW_EXCEPTION);
2937 TEST_c_c (clog10, 0x1p-8191L, 1.0L, 7.300714213215805914467117112656302312931e-4933L, 6.821881769209206737428918127156778851051e-1L, UNDERFLOW_EXCEPTION);
2940 TEST_c_c (clog10, 0x1.000566p0L, 0x1.234p-10L, 3.604093470239754109961125085078190708674e-5L, 4.824745078422174667425851670822596859720e-4L);
2941 TEST_c_c (clog10, 0x1.000566p0L, 0x1.234p-100L, 3.577293486783822178310971763308187385546e-5L, 3.897399639875661463735636919790792140598e-31L);
2943 TEST_c_c (clog10, -0x1.0000000123456p0L, 0x1.2345678p-30L, 1.150487028947346337782682105935961875822e-10L, 1.364376353381646356131680448946397884147L);
2944 TEST_c_c (clog10, -0x1.0000000123456p0L, 0x1.2345678p-1000L, 1.150487026509145544402795327729455391948e-10L, 1.364376353841841347485783625431355770210L);
2946 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
2947 TEST_c_c (clog10, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-60L, 4.285899851347756188767674032946882584784e-19L, 4.285899850759344225805480528847018395861e-19L);
2948 TEST_c_c (clog10, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-1000L, 4.285899851347756186652871946325962330640e-19L, 4.611541215247321502041995872887317363241e-302L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
2951 TEST_c_c (clog10, 0x0.ffffffp0L, 0x0.ffffffp-100L, -2.588596909321764128428416045209904492216e-8L, 3.425979381266895667295625489912064603415e-31L);
2953 TEST_c_c (clog10, 0x0.fffffffffffff8p0L, 0x0.fffffffffffff8p-1000L, -4.821637332766435821255375046554377090472e-17L, 4.053112396770095089737411317782466262176e-302L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
2955 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
2956 TEST_c_c (clog10, 0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp-15000L, -2.354315103889861110220423157644627849164e-20L, 1.541165759405643564697852372112893034397e-4516L);
2959 TEST_c_c (clog10, 0x1a6p-10L, 0x3a5p-10L, -6.2126412844802358329771948751248003038444e-07L, 0.4977135139537443711784513409096950995985L);
2960 TEST_c_c (clog10, 0xf2p-10L, 0x3e3p-10L, 2.6921240173351112953324592659528481616879e-06L, 0.5785726025799636431142862788413361783862L);
2961 TEST_c_c (clog10, 0x4d4ep-15L, 0x6605p-15L, -7.0781945783414996953799915941870192015212e-09L, 0.4005747524909781155537088181659175147564L);
2962 TEST_c_c (clog10, 0x2818p-15L, 0x798fp-15L, 6.6737261053986614395049481326819059203910e-09L, 0.5438241985991753781478398141908629586460L);
2963 TEST_c_c (clog10, 0x9b57bp-20L, 0xcb7b4p-20L, -1.7182001068739620267773842120965071561416e-11L, 0.3990121149225253562859800593935899629087L);
2964 TEST_c_c (clog10, 0x2731p-20L, 0xfffd0p-20L, 1.9156943718715958194239364991329064049438e-11L, 0.6780326907904082601285090019969008967595L);
2965 TEST_c_c (clog10, 0x2ede88p-23L, 0x771c3fp-23L, -1.9440841725722970687903291200493082253766e-13L, 0.5193774116724956222518530053006822210323L);
2966 TEST_c_c (clog10, 0x11682p-23L, 0x7ffed1p-23L, 5.0916490233953865181284669870035717560498e-13L, 0.6784968969384861816694467029319146542069L);
2967 TEST_c_c (clog10, 0xa1f2c1p-24L, 0xc643aep-24L, -4.5516256421319921959681423447271490869664e-14L, 0.3847315790697197749315054516562206543710L);
2968 TEST_c_c (clog10, 0x659feap-24L, 0xeaf6f9p-24L, 1.6200701438094619117335617123525612051457e-14L, 0.5049027913635038013499728086604870749732L);
2970 TEST_c_c (clog10, 0x4447d7175p-35L, 0x6c445e00ap-35L, -6.4375803621988389731799033530075237868110e-21L, 0.4378257977686804492768642780897650927167L);
2971 TEST_c_c (clog10, 0x2dd46725bp-35L, 0x7783a1284p-35L, 1.9312741086596516918394613098872836703188e-20L, 0.5231613813514771042838490538484014771862L);
2972 TEST_c_c (clog10, 0x164c74eea876p-45L, 0x16f393482f77p-45L, -1.3155760824064879362415202279780039150764e-26L, 0.3473590599762514228227328130640352044313L);
2973 TEST_c_c (clog10, 0xfe961079616p-45L, 0x1bc37e09e6d1p-45L, 2.3329549194675052736016290082882121135546e-26L, 0.4561756099441139182878993697611751382976L);
2974 TEST_c_c (clog10, 0xa4722f19346cp-51L, 0x7f9631c5e7f07p-51L, -2.6979587627476803379953050733225113494503e-30L, 0.6472785229986997177606324374555347813105L);
2975 TEST_c_c (clog10, 0x10673dd0f2481p-51L, 0x7ef1d17cefbd2p-51L, 1.3918041236396763648388478552321724382899e-29L, 0.6263795733790237053262025311642907438291L);
2976 TEST_c_c (clog10, 0x8ecbf810c4ae6p-52L, 0xd479468b09a37p-52L, -4.2289432987513243393180377141513840878196e-30L, 0.4252020027092323591068799049905597805296L);
2977 TEST_c_c (clog10, 0x5b06b680ea2ccp-52L, 0xef452b965da9fp-52L, 3.6079845358966994996207055940336690133424e-30L, 0.5243112258263349992771652393178033846555L);
2978 TEST_c_c (clog10, 0x659b70ab7971bp-53L, 0x1f5d111e08abecp-53L, -1.0893543813872082317104059174982092534059e-30L, 0.5954257879188711495921161433751775633232L);
2979 TEST_c_c (clog10, 0x15cfbd1990d1ffp-53L, 0x176a3973e09a9ap-53L, 4.4163015461643576961232672330852798804976e-31L, 0.3564851427422832755956993418877523303529L);
2980 TEST_c_c (clog10, 0x1367a310575591p-54L, 0x3cfcc0a0541f60p-54L, 2.2081507730821788480616336165447731164865e-32L, 0.5484039935757001196548030312819898864760L);
2981 TEST_c_c (clog10, 0x55cb6d0c83af5p-55L, 0x7fe33c0c7c4e90p-55L, -2.2583360179249556400630343805573865814771e-32L, 0.6639894257763289307423302343317622430835L);
2983 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
2984 TEST_c_c (clog10, 0x298c62cb546588a7p-63L, 0x7911b1dfcc4ecdaep-63L, -5.1816837072162316773907242302011632570857e-37L, 0.5386167838952956925896424154370364458140L);
2985 TEST_c_c (clog10, 0x4d9c37e2b5cb4533p-63L, 0x65c98be2385a042ep-63L, 2.7822833698845776001753149807484078521508e-37L, 0.3992725998539071066769046272515417679815L);
2986 TEST_c_c (clog10, 0x602fd5037c4792efp-64L, 0xed3e2086dcca80b8p-64L, -1.0146400362652473358437501879334790111898e-37L, 0.5149047982335273098246594109614460842099L);
2987 TEST_c_c (clog10, 0x6b10b4f3520217b6p-64L, 0xe8893cbb449253a1p-64L, 1.0529283395205396881397407610630442563938e-37L, 0.4947949395762683446121140513971996916447L);
2988 TEST_c_c (clog10, 0x81b7efa81fc35ad1p-65L, 0x1ef4b835f1c79d812p-65L, -4.3074341162203896332989394770760901408798e-39L, 0.5709443672155660428417571212549720987784L);
2990 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
2991 TEST_c_c (clog10, 0x3f96469050f650869c2p-75L, 0x6f16b2c9c8b05988335p-75L, -4.5643214291682663316715446865040356750881e-46L, 0.4564083863660793840592614609053162690362L);
2992 TEST_c_c (clog10, 0x3157fc1d73233e580c8p-75L, 0x761b52ccd435d7c7f5fp-75L, 5.8575458340992751256451490143468457830297e-44L, 0.5103174273246635294300470585396890237265L);
2993 TEST_c_c (clog10, 0x155f8afc4c48685bf63610p-85L, 0x17d0cf2652cdbeb1294e19p-85L, -2.0748709499710785084693619097712106753591e-50L, 0.3645447681189598740620098186365764884771L);
2994 TEST_c_c (clog10, 0x13836d58a13448d750b4b9p-85L, 0x195ca7bc3ab4f9161edbe6p-85L, 1.2333149003324592532859843519619084433953e-50L, 0.3973779298829931059309198145608711073016L);
2995 TEST_c_c (clog10, 0x1df515eb171a808b9e400266p-95L, 0x7c71eb0cd4688dfe98581c77p-95L, -1.5221162575729652613635150540947625639689e-57L, 0.5795934880811949230121092882659698986043L);
2996 TEST_c_c (clog10, 0xe33f66c9542ca25cc43c867p-95L, 0x7f35a68ebd3704a43c465864p-95L, 1.7850272475173865337808494725293124613817e-56L, 0.6338990862456906754888183278564382516852L);
2997 TEST_c_c (clog10, 0x6771f22c64ed551b857c128b4cp-105L, 0x1f570e7a13cc3cf2f44fd793ea1p-105L, -6.2023045024810589256360494043570293518879e-63L, 0.5938345819561308555003145899438513900776L);
2998 TEST_c_c (clog10, 0x15d8ab6ed05ca514086ac3a1e84p-105L, 0x1761e480aa094c0b10b34b09ce9p-105L, 4.3548095442952115860848857519953610343042e-63L, 0.3558376234889641500775150477035448866763L);
2999 TEST_c_c (clog10, 0x187190c1a334497bdbde5a95f48p-106L, 0x3b25f08062d0a095c4cfbbc338dp-106L, -7.5879257211204444302994221436282805900756e-64L, 0.5119945461708707332160859198685423099187L);
3000 TEST_c_c (clog10, 0x6241ef0da53f539f02fad67dabp-106L, 0x3fb46641182f7efd9caa769dac0p-106L, 1.8804859395820231849002915747252695375405e-63L, 0.6404513901551516189871978418046651877394L);
3002 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 113
3003 TEST_c_c (clog10, 0x3e1d0a105ac4ebeacd9c6952d34cp-112L, 0xf859b3d1b06d005dcbb5516d5479p-112L, -5.0742964549782184008668435276046798273476e-67L, 0.5757527761596220360985719127090110408283L);
3004 TEST_c_c (clog10, 0x47017a2e36807acb1e5214b209dep-112L, 0xf5f4a550c9d75e3bb1839d865f0dp-112L, 6.5482587585671294601662599808612773010057e-66L, 0.5601289501766423782280643144987875760229L);
3005 TEST_c_c (clog10, 0x148f818cb7a9258fca942ade2a0cap-113L, 0x18854a34780b8333ec53310ad7001p-113L, -3.1210950417524756037077807411854181477733e-67L, 0.3791463562379872585396164879981280044658L);
3006 TEST_c_c (clog10, 0xfd95243681c055c2632286921092p-113L, 0x1bccabcd29ca2152860ec29e34ef7p-113L, 2.8774482675253468630312378575186855052697e-66L, 0.4571561610046221605554903008571429975493L);
3007 TEST_c_c (clog10, 0xdb85c467ee2aadd5f425fe0f4b8dp-114L, 0x3e83162a0f95f1dcbf97dddf410eap-114L, 1.9985076315737626043096596036300177494613e-67L, 0.5883569274304683249184005177865521205198L);
3008 TEST_c_c (clog10, 0x1415bcaf2105940d49a636e98ae59p-115L, 0x7e6a150adfcd1b0921d44b31f40f4p-115L, 1.1288799405048268615023706955013387413519e-67L, 0.6137587762850841972073301550420510507903L);
3011 END (clog10, complex);
3019 TEST_c_c (conj, 0.0, 0.0, 0.0, minus_zero);
3020 TEST_c_c (conj, 0.0, minus_zero, 0.0, 0.0);
3021 TEST_c_c (conj, qnan_value, qnan_value, qnan_value, qnan_value);
3022 TEST_c_c (conj, plus_infty, minus_infty, plus_infty, plus_infty);
3023 TEST_c_c (conj, plus_infty, plus_infty, plus_infty, minus_infty);
3024 TEST_c_c (conj, 1.0, 2.0, 1.0, -2.0);
3025 TEST_c_c (conj, 3.0, -4.0, 3.0, 4.0);
3027 END (conj, complex);
3032 copysign_test (void)
3036 TEST_ff_f (copysign, 0, 4, 0);
3037 TEST_ff_f (copysign, 0, -4, minus_zero);
3038 TEST_ff_f (copysign, minus_zero, 4, 0);
3039 TEST_ff_f (copysign, minus_zero, -4, minus_zero);
3041 TEST_ff_f (copysign, plus_infty, 0, plus_infty);
3042 TEST_ff_f (copysign, plus_infty, minus_zero, minus_infty);
3043 TEST_ff_f (copysign, minus_infty, 0, plus_infty);
3044 TEST_ff_f (copysign, minus_infty, minus_zero, minus_infty);
3046 TEST_ff_f (copysign, 0, plus_infty, 0);
3047 TEST_ff_f (copysign, 0, minus_zero, minus_zero);
3048 TEST_ff_f (copysign, minus_zero, plus_infty, 0);
3049 TEST_ff_f (copysign, minus_zero, minus_zero, minus_zero);
3051 /* XXX More correctly we would have to check the sign of the NaN. */
3052 TEST_ff_f (copysign, qnan_value, 0, qnan_value);
3053 TEST_ff_f (copysign, qnan_value, minus_zero, qnan_value);
3054 TEST_ff_f (copysign, -qnan_value, 0, qnan_value);
3055 TEST_ff_f (copysign, -qnan_value, minus_zero, qnan_value);
3066 if (errno == ENOSYS)
3067 /* Function not implemented. */
3072 TEST_f_f (cos, 0, 1);
3073 TEST_f_f (cos, minus_zero, 1);
3075 TEST_f_f (cos, plus_infty, qnan_value, INVALID_EXCEPTION);
3076 check_int ("errno for cos(+inf) == EDOM", errno, EDOM, 0, 0, 0);
3078 TEST_f_f (cos, minus_infty, qnan_value, INVALID_EXCEPTION);
3079 check_int ("errno for cos(-inf) == EDOM", errno, EDOM, 0, 0, 0);
3081 TEST_f_f (cos, qnan_value, qnan_value);
3082 check_int ("errno for cos(qNaN) unchanged", errno, 0, 0, 0, 0);
3084 TEST_f_f (cos, M_PI_6l * 2.0, 0.5);
3085 TEST_f_f (cos, M_PI_6l * 4.0, -0.5);
3086 TEST_f_f (cos, M_PI_2l, 0);
3088 TEST_f_f (cos, 0.75L, 0.731688868873820886311838753000084544L);
3090 TEST_f_f (cos, 0x1p65, 0.99888622066058013610642172179340364209972L);
3091 TEST_f_f (cos, -0x1p65, 0.99888622066058013610642172179340364209972L);
3094 TEST_f_f (cos, 0.80190127184058835, 0.69534156199418473);
3097 TEST_f_f (cos, 0x1.442f74p+15, 2.4407839902314016628485779006274989801517e-06L);
3100 TEST_f_f (cos, 1e22, 0.5232147853951389454975944733847094921409L);
3101 TEST_f_f (cos, 0x1p1023, -0.826369834614147994500785680811743734805L);
3104 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
3105 TEST_f_f (cos, 0x1p16383L, 0.9210843909921906206874509522505756251609L);
3108 TEST_f_f (cos, 0x1p+120, -9.25879022854837867303861764107414946730833e-01L);
3109 TEST_f_f (cos, 0x1p+127, 7.81914638714960072263910298466369236613162e-01L);
3110 TEST_f_f (cos, 0x1.fffff8p+127, 9.98819362551949040703862043664101081064641e-01L);
3111 TEST_f_f (cos, 0x1.fffffep+127, 8.53021039830304158051791467692161107353094e-01L);
3112 TEST_f_f (cos, 0x1p+50, 8.68095904660550604334592502063501320395739e-01L);
3113 TEST_f_f (cos, 0x1p+28, -1.65568979490578758865468278195361551113358e-01L);
3120 cos_test_tonearest (void)
3122 int save_round_mode;
3125 if (errno == ENOSYS)
3126 /* Function not implemented. */
3129 START (cos_tonearest);
3131 save_round_mode = fegetround ();
3133 if (!fesetround (FE_TONEAREST))
3135 TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
3136 TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
3137 TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
3138 TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
3139 TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
3140 TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
3141 TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
3142 TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
3143 TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
3144 TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
3147 fesetround (save_round_mode);
3149 END (cos_tonearest);
3154 cos_test_towardzero (void)
3156 int save_round_mode;
3159 if (errno == ENOSYS)
3160 /* Function not implemented. */
3163 START (cos_towardzero);
3165 save_round_mode = fegetround ();
3167 if (!fesetround (FE_TOWARDZERO))
3169 TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
3170 TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
3171 TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
3172 TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
3173 TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
3174 TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
3175 TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
3176 TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
3177 TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
3178 TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
3181 fesetround (save_round_mode);
3183 END (cos_towardzero);
3188 cos_test_downward (void)
3190 int save_round_mode;
3193 if (errno == ENOSYS)
3194 /* Function not implemented. */
3197 START (cos_downward);
3199 save_round_mode = fegetround ();
3201 if (!fesetround (FE_DOWNWARD))
3203 TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
3204 TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
3205 TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
3206 TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
3207 TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
3208 TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
3209 TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
3210 TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
3211 TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
3212 TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
3215 fesetround (save_round_mode);
3222 cos_test_upward (void)
3224 int save_round_mode;
3227 if (errno == ENOSYS)
3228 /* Function not implemented. */
3233 save_round_mode = fegetround ();
3235 if (!fesetround (FE_UPWARD))
3237 TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
3238 TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
3239 TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
3240 TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
3241 TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
3242 TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
3243 TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
3244 TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
3245 TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
3246 TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
3249 fesetround (save_round_mode);
3260 if (errno == ENOSYS)
3261 /* Function not implemented. */
3265 TEST_f_f (cosh, 0, 1);
3266 TEST_f_f (cosh, minus_zero, 1);
3269 TEST_f_f (cosh, plus_infty, plus_infty);
3270 TEST_f_f (cosh, minus_infty, plus_infty);
3272 TEST_f_f (cosh, qnan_value, qnan_value);
3274 TEST_f_f (cosh, 0.75L, 1.29468328467684468784170818539018176L);
3277 TEST_f_f (cosh, 709.8893558127259666434838436543941497802734375L, 9.9999998999995070652573675944761818416035e+307L);
3278 TEST_f_f (cosh, -709.8893558127259666434838436543941497802734375L, 9.9999998999995070652573675944761818416035e+307L);
3286 cosh_test_tonearest (void)
3288 int save_round_mode;
3291 if (errno == ENOSYS)
3292 /* Function not implemented. */
3295 START (cosh_tonearest);
3297 save_round_mode = fegetround ();
3299 if (!fesetround (FE_TONEAREST))
3301 TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
3302 TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
3303 TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
3306 fesetround (save_round_mode);
3308 END (cosh_tonearest);
3313 cosh_test_towardzero (void)
3315 int save_round_mode;
3318 if (errno == ENOSYS)
3319 /* Function not implemented. */
3322 START (cosh_towardzero);
3324 save_round_mode = fegetround ();
3326 if (!fesetround (FE_TOWARDZERO))
3328 TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
3329 TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
3330 TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
3333 fesetround (save_round_mode);
3335 END (cosh_towardzero);
3340 cosh_test_downward (void)
3342 int save_round_mode;
3345 if (errno == ENOSYS)
3346 /* Function not implemented. */
3349 START (cosh_downward);
3351 save_round_mode = fegetround ();
3353 if (!fesetround (FE_DOWNWARD))
3355 TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
3356 TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
3357 TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
3360 fesetround (save_round_mode);
3362 END (cosh_downward);
3367 cosh_test_upward (void)
3369 int save_round_mode;
3372 if (errno == ENOSYS)
3373 /* Function not implemented. */
3376 START (cosh_upward);
3378 save_round_mode = fegetround ();
3380 if (!fesetround (FE_UPWARD))
3382 TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
3383 TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
3384 TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
3387 fesetround (save_round_mode);
3397 FUNC(cpow) (BUILD_COMPLEX (1, 0), BUILD_COMPLEX (0, 0));
3398 if (errno == ENOSYS)
3399 /* Function not implemented. */
3404 TEST_cc_c (cpow, 1, 0, 0, 0, 1.0, 0.0);
3405 TEST_cc_c (cpow, 2, 0, 10, 0, 1024.0, 0.0);
3407 TEST_cc_c (cpow, M_El, 0, 0, 2 * M_PIl, 1.0, 0.0);
3408 TEST_cc_c (cpow, 2, 3, 4, 0, -119.0, -120.0);
3410 TEST_cc_c (cpow, qnan_value, qnan_value, qnan_value, qnan_value, qnan_value, qnan_value);
3412 TEST_cc_c (cpow, 0.75L, 1.25L, 0.75L, 1.25L, 0.117506293914473555420279832210420483L, 0.346552747708338676483025352060418001L);
3413 TEST_cc_c (cpow, 0.75L, 1.25L, 1.0L, 1.0L, 0.0846958290317209430433805274189191353L, 0.513285749182902449043287190519090481L);
3414 TEST_cc_c (cpow, 0.75L, 1.25L, 1.0L, 0.0L, 0.75L, 1.25L);
3415 TEST_cc_c (cpow, 0.75L, 1.25L, 0.0L, 1.0L, 0.331825439177608832276067945276730566L, 0.131338600281188544930936345230903032L);
3417 END (cpow, complex);
3425 TEST_c_c (cproj, 0.0, 0.0, 0.0, 0.0);
3426 TEST_c_c (cproj, minus_zero, minus_zero, minus_zero, minus_zero);
3427 TEST_c_c (cproj, 0.0, minus_zero, 0.0, minus_zero);
3428 TEST_c_c (cproj, minus_zero, 0.0, minus_zero, 0.0);
3430 TEST_c_c (cproj, qnan_value, qnan_value, qnan_value, qnan_value);
3432 TEST_c_c (cproj, plus_infty, plus_infty, plus_infty, 0.0);
3433 TEST_c_c (cproj, plus_infty, minus_infty, plus_infty, minus_zero);
3434 TEST_c_c (cproj, minus_infty, plus_infty, plus_infty, 0.0);
3435 TEST_c_c (cproj, minus_infty, minus_infty, plus_infty, minus_zero);
3437 TEST_c_c (cproj, 1.0, 0.0, 1.0, 0.0);
3438 TEST_c_c (cproj, 2.0, 3.0, 2.0, 3.0);
3440 END (cproj, complex);
3448 TEST_c_f (creal, 0.0, 1.0, 0.0);
3449 TEST_c_f (creal, minus_zero, 1.0, minus_zero);
3450 TEST_c_f (creal, qnan_value, 1.0, qnan_value);
3451 TEST_c_f (creal, qnan_value, qnan_value, qnan_value);
3452 TEST_c_f (creal, plus_infty, 1.0, plus_infty);
3453 TEST_c_f (creal, minus_infty, 1.0, minus_infty);
3454 TEST_c_f (creal, 2.0, 3.0, 2.0);
3463 FUNC(csin) (BUILD_COMPLEX (0.7L, 1.2L));
3464 if (errno == ENOSYS)
3465 /* Function not implemented. */
3470 TEST_c_c (csin, 0.0, 0.0, 0.0, 0.0);
3471 TEST_c_c (csin, minus_zero, 0.0, minus_zero, 0.0);
3472 TEST_c_c (csin, 0.0, minus_zero, 0, minus_zero);
3473 TEST_c_c (csin, minus_zero, minus_zero, minus_zero, minus_zero);
3475 TEST_c_c (csin, 0.0, plus_infty, 0.0, plus_infty);
3476 TEST_c_c (csin, minus_zero, plus_infty, minus_zero, plus_infty);
3477 TEST_c_c (csin, 0.0, minus_infty, 0.0, minus_infty);
3478 TEST_c_c (csin, minus_zero, minus_infty, minus_zero, minus_infty);
3480 TEST_c_c (csin, plus_infty, 0.0, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3481 TEST_c_c (csin, minus_infty, 0.0, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3482 TEST_c_c (csin, plus_infty, minus_zero, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3483 TEST_c_c (csin, minus_infty, minus_zero, qnan_value, 0.0, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3485 TEST_c_c (csin, plus_infty, plus_infty, qnan_value, plus_infty, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3486 TEST_c_c (csin, minus_infty, plus_infty, qnan_value, plus_infty, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3487 TEST_c_c (csin, plus_infty, minus_infty, qnan_value, plus_infty, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3488 TEST_c_c (csin, minus_infty, minus_infty, qnan_value, plus_infty, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3490 TEST_c_c (csin, plus_infty, 6.75, qnan_value, qnan_value, INVALID_EXCEPTION);
3491 TEST_c_c (csin, plus_infty, -6.75, qnan_value, qnan_value, INVALID_EXCEPTION);
3492 TEST_c_c (csin, minus_infty, 6.75, qnan_value, qnan_value, INVALID_EXCEPTION);
3493 TEST_c_c (csin, minus_infty, -6.75, qnan_value, qnan_value, INVALID_EXCEPTION);
3495 TEST_c_c (csin, 4.625, plus_infty, minus_infty, minus_infty);
3496 TEST_c_c (csin, 4.625, minus_infty, minus_infty, plus_infty);
3497 TEST_c_c (csin, -4.625, plus_infty, plus_infty, minus_infty);
3498 TEST_c_c (csin, -4.625, minus_infty, plus_infty, plus_infty);
3500 TEST_c_c (csin, qnan_value, 0.0, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
3501 TEST_c_c (csin, qnan_value, minus_zero, qnan_value, 0.0, IGNORE_ZERO_INF_SIGN);
3503 TEST_c_c (csin, qnan_value, plus_infty, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN);
3504 TEST_c_c (csin, qnan_value, minus_infty, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN);
3506 TEST_c_c (csin, qnan_value, 9.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3507 TEST_c_c (csin, qnan_value, -9.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3509 TEST_c_c (csin, 0.0, qnan_value, 0.0, qnan_value);
3510 TEST_c_c (csin, minus_zero, qnan_value, minus_zero, qnan_value);
3512 TEST_c_c (csin, 10.0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3513 TEST_c_c (csin, qnan_value, -10.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3515 TEST_c_c (csin, plus_infty, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3516 TEST_c_c (csin, minus_infty, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3518 TEST_c_c (csin, qnan_value, qnan_value, qnan_value, qnan_value);
3520 TEST_c_c (csin, 0.75L, 1.25L, 1.28722291002649188575873510790565441L, 1.17210635989270256101081285116138863L);
3521 TEST_c_c (csin, -2, -3, -9.15449914691142957346729954460983256L, 4.16890695996656435075481305885375484L);
3523 TEST_c_c (csin, 0.75, 89.5, 2.522786001038096774676288412995370563339e38L, 2.708024460708609732016532185663087200560e38L);
3524 TEST_c_c (csin, 0.75, -89.5, 2.522786001038096774676288412995370563339e38L, -2.708024460708609732016532185663087200560e38L);
3525 TEST_c_c (csin, -0.75, 89.5, -2.522786001038096774676288412995370563339e38L, 2.708024460708609732016532185663087200560e38L);
3526 TEST_c_c (csin, -0.75, -89.5, -2.522786001038096774676288412995370563339e38L, -2.708024460708609732016532185663087200560e38L);
3529 TEST_c_c (csin, 0.75, 710.5, 1.255317763348154410745082950806112487736e308L, 1.347490911916428129246890157395342279438e308L);
3530 TEST_c_c (csin, 0.75, -710.5, 1.255317763348154410745082950806112487736e308L, -1.347490911916428129246890157395342279438e308L);
3531 TEST_c_c (csin, -0.75, 710.5, -1.255317763348154410745082950806112487736e308L, 1.347490911916428129246890157395342279438e308L);
3532 TEST_c_c (csin, -0.75, -710.5, -1.255317763348154410745082950806112487736e308L, -1.347490911916428129246890157395342279438e308L);
3535 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
3536 TEST_c_c (csin, 0.75, 11357.25, 8.385498349388321535962327491346664141020e4931L, 9.001213196851067077465606717616495588201e4931L);
3537 TEST_c_c (csin, 0.75, -11357.25, 8.385498349388321535962327491346664141020e4931L, -9.001213196851067077465606717616495588201e4931L);
3538 TEST_c_c (csin, -0.75, 11357.25, -8.385498349388321535962327491346664141020e4931L, 9.001213196851067077465606717616495588201e4931L);
3539 TEST_c_c (csin, -0.75, -11357.25, -8.385498349388321535962327491346664141020e4931L, -9.001213196851067077465606717616495588201e4931L);
3543 TEST_c_c (csin, 0x1p-149, 180, 1.043535896672617552965983803453927655332e33L, plus_infty, OVERFLOW_EXCEPTION);
3546 #if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
3547 TEST_c_c (csin, 0x1p-1074, 1440, 5.981479269486130556466515778180916082415e301L, plus_infty, OVERFLOW_EXCEPTION);
3550 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
3551 TEST_c_c (csin, 0x1p-16434L, 22730, 1.217853148905605987081057582351152052687e4924L, plus_infty, OVERFLOW_EXCEPTION);
3554 END (csin, complex);
3562 FUNC(csinh) (BUILD_COMPLEX (0.7L, 1.2L));
3563 if (errno == ENOSYS)
3564 /* Function not implemented. */
3569 TEST_c_c (csinh, 0.0, 0.0, 0.0, 0.0);
3570 TEST_c_c (csinh, minus_zero, 0.0, minus_zero, 0.0);
3571 TEST_c_c (csinh, 0.0, minus_zero, 0.0, minus_zero);
3572 TEST_c_c (csinh, minus_zero, minus_zero, minus_zero, minus_zero);
3574 TEST_c_c (csinh, 0.0, plus_infty, 0.0, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3575 TEST_c_c (csinh, minus_zero, plus_infty, 0.0, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3576 TEST_c_c (csinh, 0.0, minus_infty, 0.0, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3577 TEST_c_c (csinh, minus_zero, minus_infty, 0.0, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3579 TEST_c_c (csinh, plus_infty, 0.0, plus_infty, 0.0);
3580 TEST_c_c (csinh, minus_infty, 0.0, minus_infty, 0.0);
3581 TEST_c_c (csinh, plus_infty, minus_zero, plus_infty, minus_zero);
3582 TEST_c_c (csinh, minus_infty, minus_zero, minus_infty, minus_zero);
3584 TEST_c_c (csinh, plus_infty, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3585 TEST_c_c (csinh, minus_infty, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3586 TEST_c_c (csinh, plus_infty, minus_infty, plus_infty, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3587 TEST_c_c (csinh, minus_infty, minus_infty, plus_infty, qnan_value, INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN);
3589 TEST_c_c (csinh, plus_infty, 4.625, minus_infty, minus_infty);
3590 TEST_c_c (csinh, minus_infty, 4.625, plus_infty, minus_infty);
3591 TEST_c_c (csinh, plus_infty, -4.625, minus_infty, plus_infty);
3592 TEST_c_c (csinh, minus_infty, -4.625, plus_infty, plus_infty);
3594 TEST_c_c (csinh, 6.75, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
3595 TEST_c_c (csinh, -6.75, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
3596 TEST_c_c (csinh, 6.75, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
3597 TEST_c_c (csinh, -6.75, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
3599 TEST_c_c (csinh, 0.0, qnan_value, 0.0, qnan_value, IGNORE_ZERO_INF_SIGN);
3600 TEST_c_c (csinh, minus_zero, qnan_value, 0.0, qnan_value, IGNORE_ZERO_INF_SIGN);
3602 TEST_c_c (csinh, plus_infty, qnan_value, plus_infty, qnan_value, IGNORE_ZERO_INF_SIGN);
3603 TEST_c_c (csinh, minus_infty, qnan_value, plus_infty, qnan_value, IGNORE_ZERO_INF_SIGN);
3605 TEST_c_c (csinh, 9.0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3606 TEST_c_c (csinh, -9.0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3608 TEST_c_c (csinh, qnan_value, 0.0, qnan_value, 0.0);
3609 TEST_c_c (csinh, qnan_value, minus_zero, qnan_value, minus_zero);
3611 TEST_c_c (csinh, qnan_value, 10.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3612 TEST_c_c (csinh, qnan_value, -10.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3614 TEST_c_c (csinh, qnan_value, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3615 TEST_c_c (csinh, qnan_value, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3617 TEST_c_c (csinh, qnan_value, qnan_value, qnan_value, qnan_value);
3619 TEST_c_c (csinh, 0.75L, 1.25L, 0.259294854551162779153349830618433028L, 1.22863452409509552219214606515777594L);
3620 TEST_c_c (csinh, -2, -3, 3.59056458998577995201256544779481679L, -0.530921086248519805267040090660676560L);
3622 TEST_c_c (csinh, 89.5, 0.75, 2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
3623 TEST_c_c (csinh, -89.5, 0.75, -2.708024460708609732016532185663087200560e38L, 2.522786001038096774676288412995370563339e38L);
3624 TEST_c_c (csinh, 89.5, -0.75, 2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
3625 TEST_c_c (csinh, -89.5, -0.75, -2.708024460708609732016532185663087200560e38L, -2.522786001038096774676288412995370563339e38L);
3628 TEST_c_c (csinh, 710.5, 0.75, 1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
3629 TEST_c_c (csinh, -710.5, 0.75, -1.347490911916428129246890157395342279438e308L, 1.255317763348154410745082950806112487736e308L);
3630 TEST_c_c (csinh, 710.5, -0.75, 1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
3631 TEST_c_c (csinh, -710.5, -0.75, -1.347490911916428129246890157395342279438e308L, -1.255317763348154410745082950806112487736e308L);
3634 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
3635 TEST_c_c (csinh, 11357.25, 0.75, 9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
3636 TEST_c_c (csinh, -11357.25, 0.75, -9.001213196851067077465606717616495588201e4931L, 8.385498349388321535962327491346664141020e4931L);
3637 TEST_c_c (csinh, 11357.25, -0.75, 9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
3638 TEST_c_c (csinh, -11357.25, -0.75, -9.001213196851067077465606717616495588201e4931L, -8.385498349388321535962327491346664141020e4931L);
3642 TEST_c_c (csinh, 180, 0x1p-149, plus_infty, 1.043535896672617552965983803453927655332e33L, OVERFLOW_EXCEPTION);
3645 #if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
3646 TEST_c_c (csinh, 1440, 0x1p-1074, plus_infty, 5.981479269486130556466515778180916082415e301L, OVERFLOW_EXCEPTION);
3649 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
3650 TEST_c_c (csinh, 22730, 0x1p-16434L, plus_infty, 1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
3653 END (csinh, complex);
3661 FUNC(csqrt) (BUILD_COMPLEX (-1, 0));
3662 if (errno == ENOSYS)
3663 /* Function not implemented. */
3668 TEST_c_c (csqrt, 0, 0, 0.0, 0.0);
3669 TEST_c_c (csqrt, 0, minus_zero, 0, minus_zero);
3670 TEST_c_c (csqrt, minus_zero, 0, 0.0, 0.0);
3671 TEST_c_c (csqrt, minus_zero, minus_zero, 0.0, minus_zero);
3673 TEST_c_c (csqrt, minus_infty, 0, 0.0, plus_infty);
3674 TEST_c_c (csqrt, minus_infty, 6, 0.0, plus_infty);
3675 TEST_c_c (csqrt, minus_infty, minus_zero, 0.0, minus_infty);
3676 TEST_c_c (csqrt, minus_infty, -6, 0.0, minus_infty);
3678 TEST_c_c (csqrt, plus_infty, 0, plus_infty, 0.0);
3679 TEST_c_c (csqrt, plus_infty, 6, plus_infty, 0.0);
3680 TEST_c_c (csqrt, plus_infty, minus_zero, plus_infty, minus_zero);
3681 TEST_c_c (csqrt, plus_infty, -6, plus_infty, minus_zero);
3683 TEST_c_c (csqrt, 0, plus_infty, plus_infty, plus_infty);
3684 TEST_c_c (csqrt, 4, plus_infty, plus_infty, plus_infty);
3685 TEST_c_c (csqrt, plus_infty, plus_infty, plus_infty, plus_infty);
3686 TEST_c_c (csqrt, minus_zero, plus_infty, plus_infty, plus_infty);
3687 TEST_c_c (csqrt, -4, plus_infty, plus_infty, plus_infty);
3688 TEST_c_c (csqrt, minus_infty, plus_infty, plus_infty, plus_infty);
3689 TEST_c_c (csqrt, 0, minus_infty, plus_infty, minus_infty);
3690 TEST_c_c (csqrt, 4, minus_infty, plus_infty, minus_infty);
3691 TEST_c_c (csqrt, plus_infty, minus_infty, plus_infty, minus_infty);
3692 TEST_c_c (csqrt, minus_zero, minus_infty, plus_infty, minus_infty);
3693 TEST_c_c (csqrt, -4, minus_infty, plus_infty, minus_infty);
3694 TEST_c_c (csqrt, minus_infty, minus_infty, plus_infty, minus_infty);
3696 TEST_c_c (csqrt, minus_infty, qnan_value, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN);
3698 TEST_c_c (csqrt, plus_infty, qnan_value, plus_infty, qnan_value);
3700 TEST_c_c (csqrt, 0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3701 TEST_c_c (csqrt, 1, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3702 TEST_c_c (csqrt, minus_zero, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3703 TEST_c_c (csqrt, -1, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3705 TEST_c_c (csqrt, qnan_value, 0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3706 TEST_c_c (csqrt, qnan_value, 8, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3707 TEST_c_c (csqrt, qnan_value, minus_zero, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3708 TEST_c_c (csqrt, qnan_value, -8, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3710 TEST_c_c (csqrt, qnan_value, qnan_value, qnan_value, qnan_value);
3712 TEST_c_c (csqrt, 16.0, -30.0, 5.0, -3.0);
3713 TEST_c_c (csqrt, -1, 0, 0.0, 1.0);
3714 TEST_c_c (csqrt, 0, 2, 1.0, 1.0);
3715 TEST_c_c (csqrt, 119, 120, 12.0, 5.0);
3716 TEST_c_c (csqrt, 0.75L, 1.25L, 1.05065169626078392338656675760808326L, 0.594868882070379067881984030639932657L);
3717 TEST_c_c (csqrt, -2, -3, 0.89597747612983812471573375529004348L, -1.6741492280355400404480393008490519L);
3718 TEST_c_c (csqrt, -2, 3, 0.89597747612983812471573375529004348L, 1.6741492280355400404480393008490519L);
3719 /* Principal square root should be returned (i.e., non-negative real
3721 TEST_c_c (csqrt, 0, -1, M_SQRT_2_2, -M_SQRT_2_2);
3723 TEST_c_c (csqrt, 0x1.fffffep+127L, 0x1.fffffep+127L, 2.026714405498316804978751017492482558075e+19L, 8.394925938143272988211878516208015586281e+18L);
3724 TEST_c_c (csqrt, 0x1.fffffep+127L, 1.0L, 1.844674352395372953599975585936590505260e+19L, 2.710505511993121390769065968615872097053e-20L);
3725 TEST_c_c (csqrt, 0x1p-149L, 0x1p-149L, 4.112805464342778798097003462770175200803e-23L, 1.703579802732953750368659735601389709551e-23L);
3726 TEST_c_c (csqrt, 0x1p-147L, 0x1p-147L, 8.225610928685557596194006925540350401606e-23L, 3.407159605465907500737319471202779419102e-23L);
3728 TEST_c_c (csqrt, plus_zero, 0x1p-149L, 2.646977960169688559588507814623881131411e-23L, 2.646977960169688559588507814623881131411e-23L);
3729 TEST_c_c (csqrt, 0x1p-50L, 0x1p-149L, 2.980232238769531250000000000000000000000e-8L, 2.350988701644575015937473074444491355637e-38L);
3731 TEST_c_c (csqrt, 0x1p+127L, 0x1p-149L, 1.304381782533278221234957180625250836888e19L, plus_zero, UNDERFLOW_EXCEPTION);
3733 TEST_c_c (csqrt, 0x1p-149L, 0x1p+127L, 9.223372036854775808000000000000000000000e18L, 9.223372036854775808000000000000000000000e18L);
3734 TEST_c_c (csqrt, 0x1.000002p-126L, 0x1.000002p-126L, 1.191195773697904627170323731331667740087e-19L, 4.934094449071842328766868579214125217132e-20L);
3735 TEST_c_c (csqrt, -0x1.000002p-126L, -0x1.000002p-126L, 4.934094449071842328766868579214125217132e-20L, -1.191195773697904627170323731331667740087e-19L);
3738 TEST_c_c (csqrt, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 1.473094556905565378990473658199034571917e+154L, 6.101757441282702188537080005372547713595e+153L);
3739 TEST_c_c (csqrt, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 1.379778091031440685006200821918878702861e+154L, 3.257214233483129514781233066898042490248e+153L);
3740 TEST_c_c (csqrt, 0x1p-1074L, 0x1p-1074L, 2.442109726130830256743814843868934877597e-162L, 1.011554969366634726113090867589031782487e-162L);
3741 TEST_c_c (csqrt, 0x1p-1073L, 0x1p-1073L, 3.453664695497464982856905711457966660085e-162L, 1.430554756764195530630723976279903095110e-162L);
3743 TEST_c_c (csqrt, plus_zero, 0x1p-1074L, 1.571727784702628688909515672805082228285e-162L, 1.571727784702628688909515672805082228285e-162L);
3744 TEST_c_c (csqrt, 0x1p-500L, 0x1p-1074L, 5.527147875260444560247265192192255725514e-76L, 4.469444793151709302716387622440056066334e-249L);
3745 #if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MAX_EXP == 1024)
3746 TEST_c_c (csqrt, 0x1p+1023L, 0x1p-1074L, 9.480751908109176726832526455652159260085e153L, plus_zero, UNDERFLOW_EXCEPTION);
3748 TEST_c_c (csqrt, 0x1p-1074L, 0x1p+1023L, 6.703903964971298549787012499102923063740e153L, 6.703903964971298549787012499102923063740e153L);
3749 TEST_c_c (csqrt, 0x1.0000000000001p-1022L, 0x1.0000000000001p-1022L, 1.638872094839911521020410942677082920935e-154L, 6.788430486774966350907249113759995429568e-155L);
3750 TEST_c_c (csqrt, -0x1.0000000000001p-1022L, -0x1.0000000000001p-1022L, 6.788430486774966350907249113759995429568e-155L, -1.638872094839911521020410942677082920935e-154L);
3753 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
3754 TEST_c_c (csqrt, 0x1.fp+16383L, 0x1.fp+16383L, 1.179514222452201722651836720466795901016e+2466L, 4.885707879516577666702435054303191575148e+2465L);
3755 TEST_c_c (csqrt, 0x1.fp+16383L, 0x1p+16383L, 1.106698967236475180613254276996359485630e+2466L, 2.687568007603946993388538156299100955642e+2465L);
3756 TEST_c_c (csqrt, 0x1p-16440L, 0x1p-16441L, 3.514690655930285351254618340783294558136e-2475L, 8.297059146828716918029689466551384219370e-2476L);
3758 TEST_c_c (csqrt, plus_zero, 0x1p-16445L, 4.269191686890197837775136325621239761720e-2476L, 4.269191686890197837775136325621239761720e-2476L);
3759 TEST_c_c (csqrt, 0x1p-5000L, 0x1p-16445L, 2.660791472672778409283210520357607795518e-753L, 6.849840675828785164910701384823702064234e-4199L);
3760 TEST_c_c (csqrt, 0x1p+16383L, 0x1p-16445L, 7.712754032630730034273323365543179095045e2465L, plus_zero, UNDERFLOW_EXCEPTION);
3761 TEST_c_c (csqrt, 0x1p-16445L, 0x1p+16383L, 5.453740678097079647314921223668914312241e2465L, 5.453740678097079647314921223668914312241e2465L);
3762 TEST_c_c (csqrt, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-16382L, 2.014551439675644900131815801350165472778e-2466L, 8.344545284118961664300307045791497724440e-2467L);
3763 TEST_c_c (csqrt, -0x1.0000000000000002p-16382L, -0x1.0000000000000002p-16382L, 8.344545284118961664300307045791497724440e-2467L, -2.014551439675644900131815801350165472778e-2466L);
3765 # if LDBL_MANT_DIG >= 113
3766 TEST_c_c (csqrt, plus_zero, 0x1p-16494L, 1.799329752913293143453817328207572571442e-2483L, 1.799329752913293143453817328207572571442e-2483L);
3767 TEST_c_c (csqrt, 0x1p-5000L, 0x1p-16494L, 2.660791472672778409283210520357607795518e-753L, 1.216776133331049643422030716668249905907e-4213L);
3768 TEST_c_c (csqrt, 0x1p+16383L, 0x1p-16494L, 7.712754032630730034273323365543179095045e2465L, plus_zero, UNDERFLOW_EXCEPTION);
3769 TEST_c_c (csqrt, 0x1p-16494L, 0x1p+16383L, 5.453740678097079647314921223668914312241e2465L, 5.453740678097079647314921223668914312241e2465L);
3770 TEST_c_c (csqrt, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-16382L, 2.014551439675644900022606748976158925145e-2466L, 8.344545284118961663847948339519226074126e-2467L);
3771 TEST_c_c (csqrt, -0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-16382L, 8.344545284118961663847948339519226074126e-2467L, -2.014551439675644900022606748976158925145e-2466L);
3775 END (csqrt, complex);
3782 FUNC(ctan) (BUILD_COMPLEX (0.7L, 1.2L));
3783 if (errno == ENOSYS)
3784 /* Function not implemented. */
3789 TEST_c_c (ctan, 0, 0, 0.0, 0.0);
3790 TEST_c_c (ctan, 0, minus_zero, 0.0, minus_zero);
3791 TEST_c_c (ctan, minus_zero, 0, minus_zero, 0.0);
3792 TEST_c_c (ctan, minus_zero, minus_zero, minus_zero, minus_zero);
3794 TEST_c_c (ctan, 0, plus_infty, 0.0, 1.0);
3795 TEST_c_c (ctan, 1, plus_infty, 0.0, 1.0);
3796 TEST_c_c (ctan, minus_zero, plus_infty, minus_zero, 1.0);
3797 TEST_c_c (ctan, -1, plus_infty, minus_zero, 1.0);
3799 TEST_c_c (ctan, 0, minus_infty, 0.0, -1.0);
3800 TEST_c_c (ctan, 1, minus_infty, 0.0, -1.0);
3801 TEST_c_c (ctan, minus_zero, minus_infty, minus_zero, -1.0);
3802 TEST_c_c (ctan, -1, minus_infty, minus_zero, -1.0);
3804 TEST_c_c (ctan, plus_infty, 0, qnan_value, qnan_value, INVALID_EXCEPTION);
3805 TEST_c_c (ctan, plus_infty, 2, qnan_value, qnan_value, INVALID_EXCEPTION);
3806 TEST_c_c (ctan, minus_infty, 0, qnan_value, qnan_value, INVALID_EXCEPTION);
3807 TEST_c_c (ctan, minus_infty, 2, qnan_value, qnan_value, INVALID_EXCEPTION);
3808 TEST_c_c (ctan, plus_infty, minus_zero, qnan_value, qnan_value, INVALID_EXCEPTION);
3809 TEST_c_c (ctan, plus_infty, -2, qnan_value, qnan_value, INVALID_EXCEPTION);
3810 TEST_c_c (ctan, minus_infty, minus_zero, qnan_value, qnan_value, INVALID_EXCEPTION);
3811 TEST_c_c (ctan, minus_infty, -2, qnan_value, qnan_value, INVALID_EXCEPTION);
3813 TEST_c_c (ctan, qnan_value, plus_infty, 0.0, 1.0, IGNORE_ZERO_INF_SIGN);
3814 TEST_c_c (ctan, qnan_value, minus_infty, 0.0, -1.0, IGNORE_ZERO_INF_SIGN);
3816 TEST_c_c (ctan, 0, qnan_value, 0.0, qnan_value);
3817 TEST_c_c (ctan, minus_zero, qnan_value, minus_zero, qnan_value);
3819 TEST_c_c (ctan, 0.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3820 TEST_c_c (ctan, -4.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3822 TEST_c_c (ctan, qnan_value, 0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3823 TEST_c_c (ctan, qnan_value, 5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3824 TEST_c_c (ctan, qnan_value, minus_zero, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3825 TEST_c_c (ctan, qnan_value, -0.25, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
3827 TEST_c_c (ctan, qnan_value, qnan_value, qnan_value, qnan_value);
3829 TEST_c_c (ctan, 0.75L, 1.25L, 0.160807785916206426725166058173438663L, 0.975363285031235646193581759755216379L);
3830 TEST_c_c (ctan, -2, -3, 0.376402564150424829275122113032269084e-2L, -1.00323862735360980144635859782192726L);
3832 TEST_c_c (ctan, 1, 45, 1.490158918874345552942703234806348520895e-39L, 1.000000000000000000000000000000000000001L, UNDERFLOW_EXCEPTION_FLOAT);
3833 TEST_c_c (ctan, 1, 47, 2.729321264492904590777293425576722354636e-41L, 1.0, UNDERFLOW_EXCEPTION_FLOAT);
3836 TEST_c_c (ctan, 1, 355, 8.140551093483276762350406321792653551513e-309L, 1.0, UNDERFLOW_EXCEPTION_DOUBLE);
3837 TEST_c_c (ctan, 1, 365, 1.677892637497921890115075995898773550884e-317L, 1.0, UNDERFLOW_EXCEPTION_DOUBLE);
3840 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
3841 TEST_c_c (ctan, 1, 5680, 4.725214596136812019616700920476949798307e-4934L, 1.0, UNDERFLOW_EXCEPTION);
3842 TEST_c_c (ctan, 1, 5690, 9.739393181626937151720816611272607059057e-4943L, 1.0, UNDERFLOW_EXCEPTION);
3845 TEST_c_c (ctan, 0x3.243f6cp-1, 0, -2.287733242885645987394874673945769518150e7L, 0.0);
3847 TEST_c_c (ctan, 0x1p127, 1, 0.2446359391192790896381501310437708987204L, 0.9101334047676183761532873794426475906201L);
3850 TEST_c_c (ctan, 0x1p1023, 1, -0.2254627924997545057926782581695274244229L, 0.8786063118883068695462540226219865087189L);
3853 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
3854 TEST_c_c (ctan, 0x1p16383L, 1, 0.1608598776370396607204448234354670036772L, 0.8133818522051542536316746743877629761488L);
3857 TEST_c_c (ctan, 50000, 50000, plus_zero, 1.0, UNDERFLOW_EXCEPTION);
3858 TEST_c_c (ctan, 50000, -50000, plus_zero, -1.0, UNDERFLOW_EXCEPTION);
3859 TEST_c_c (ctan, -50000, 50000, minus_zero, 1.0, UNDERFLOW_EXCEPTION);
3860 TEST_c_c (ctan, -50000, -50000, minus_zero, -1.0, UNDERFLOW_EXCEPTION);
3862 END (ctan, complex);
3867 ctan_test_tonearest (void)
3869 int save_round_mode;
3871 FUNC(ctan) (BUILD_COMPLEX (0.7L, 1.2L));
3872 if (errno == ENOSYS)
3873 /* Function not implemented. */
3876 START (ctan_tonearest);
3878 save_round_mode = fegetround ();
3880 if (!fesetround (FE_TONEAREST))
3882 TEST_c_c (ctan, 0x1.921fb6p+0, 0x1p-149, -2.287733242885645987394874673945769518150e7L, 7.334008549954377778731880988481078535821e-31L);
3885 TEST_c_c (ctan, 0x1.921fb54442d18p+0, 0x1p-1074, 1.633123935319536975596773704152891653086e16L, 1.317719414943508315995636961402669067843e-291L);
3888 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
3889 TEST_c_c (ctan, 0x1.921fb54442d1846ap+0L, 0x1p-16445L, -3.986797629811710706723242948653362815645e19L, 5.793882568875674066286163141055208625180e-4912L);
3893 fesetround (save_round_mode);
3895 END (ctan_tonearest, complex);
3900 ctan_test_towardzero (void)
3902 int save_round_mode;
3904 FUNC(ctan) (BUILD_COMPLEX (0.7L, 1.2L));
3905 if (errno == ENOSYS)
3906 /* Function not implemented. */
3909 START (ctan_towardzero);
3911 save_round_mode = fegetround ();
3913 if (!fesetround (FE_TOWARDZERO))
3915 TEST_c_c (ctan, 0x1.921fb6p+0, 0x1p-149, -2.287733242885645987394874673945769518150e7L, 7.334008549954377778731880988481078535821e-31L);
3918 TEST_c_c (ctan, 0x1.921fb54442d18p+0, 0x1p-1074, 1.633123935319536975596773704152891653086e16L, 1.317719414943508315995636961402669067843e-291L);
3921 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
3922 TEST_c_c (ctan, 0x1.921fb54442d1846ap+0L, 0x1p-16445L, -3.986797629811710706723242948653362815645e19L, 5.793882568875674066286163141055208625180e-4912L);
3926 fesetround (save_round_mode);
3928 END (ctan_towardzero, complex);
3933 ctan_test_downward (void)
3935 int save_round_mode;
3937 FUNC(ctan) (BUILD_COMPLEX (0.7L, 1.2L));
3938 if (errno == ENOSYS)
3939 /* Function not implemented. */
3942 START (ctan_downward);
3944 save_round_mode = fegetround ();
3946 if (!fesetround (FE_DOWNWARD))
3948 TEST_c_c (ctan, 0x1.921fb6p+0, 0x1p-149, -2.287733242885645987394874673945769518150e7L, 7.334008549954377778731880988481078535821e-31L);
3951 TEST_c_c (ctan, 0x1.921fb54442d18p+0, 0x1p-1074, 1.633123935319536975596773704152891653086e16L, 1.317719414943508315995636961402669067843e-291L);
3954 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
3955 TEST_c_c (ctan, 0x1.921fb54442d1846ap+0L, 0x1p-16445L, -3.986797629811710706723242948653362815645e19L, 5.793882568875674066286163141055208625180e-4912L);
3959 fesetround (save_round_mode);
3961 END (ctan_downward, complex);
3966 ctan_test_upward (void)
3968 int save_round_mode;
3970 FUNC(ctan) (BUILD_COMPLEX (0.7L, 1.2L));
3971 if (errno == ENOSYS)
3972 /* Function not implemented. */
3975 START (ctan_upward);
3977 save_round_mode = fegetround ();
3979 if (!fesetround (FE_UPWARD))
3981 TEST_c_c (ctan, 0x1.921fb6p+0, 0x1p-149, -2.287733242885645987394874673945769518150e7L, 7.334008549954377778731880988481078535821e-31L);
3984 TEST_c_c (ctan, 0x1.921fb54442d18p+0, 0x1p-1074, 1.633123935319536975596773704152891653086e16L, 1.317719414943508315995636961402669067843e-291L);
3987 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
3988 TEST_c_c (ctan, 0x1.921fb54442d1846ap+0L, 0x1p-16445L, -3.986797629811710706723242948653362815645e19L, 5.793882568875674066286163141055208625180e-4912L);
3992 fesetround (save_round_mode);
3994 END (ctan_upward, complex);
4002 FUNC(ctanh) (BUILD_COMPLEX (0, 0));
4003 if (errno == ENOSYS)
4004 /* Function not implemented. */
4009 TEST_c_c (ctanh, 0, 0, 0.0, 0.0);
4010 TEST_c_c (ctanh, 0, minus_zero, 0.0, minus_zero);
4011 TEST_c_c (ctanh, minus_zero, 0, minus_zero, 0.0);
4012 TEST_c_c (ctanh, minus_zero, minus_zero, minus_zero, minus_zero);
4014 TEST_c_c (ctanh, plus_infty, 0, 1.0, 0.0);
4015 TEST_c_c (ctanh, plus_infty, 1, 1.0, 0.0);
4016 TEST_c_c (ctanh, plus_infty, minus_zero, 1.0, minus_zero);
4017 TEST_c_c (ctanh, plus_infty, -1, 1.0, minus_zero);
4018 TEST_c_c (ctanh, minus_infty, 0, -1.0, 0.0);
4019 TEST_c_c (ctanh, minus_infty, 1, -1.0, 0.0);
4020 TEST_c_c (ctanh, minus_infty, minus_zero, -1.0, minus_zero);
4021 TEST_c_c (ctanh, minus_infty, -1, -1.0, minus_zero);
4023 TEST_c_c (ctanh, 0, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
4024 TEST_c_c (ctanh, 2, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
4025 TEST_c_c (ctanh, 0, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
4026 TEST_c_c (ctanh, 2, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
4027 TEST_c_c (ctanh, minus_zero, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
4028 TEST_c_c (ctanh, -2, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
4029 TEST_c_c (ctanh, minus_zero, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
4030 TEST_c_c (ctanh, -2, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
4032 TEST_c_c (ctanh, plus_infty, qnan_value, 1.0, 0.0, IGNORE_ZERO_INF_SIGN);
4033 TEST_c_c (ctanh, minus_infty, qnan_value, -1.0, 0.0, IGNORE_ZERO_INF_SIGN);
4035 TEST_c_c (ctanh, qnan_value, 0, qnan_value, 0.0);
4036 TEST_c_c (ctanh, qnan_value, minus_zero, qnan_value, minus_zero);
4038 TEST_c_c (ctanh, qnan_value, 0.5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4039 TEST_c_c (ctanh, qnan_value, -4.5, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4041 TEST_c_c (ctanh, 0, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4042 TEST_c_c (ctanh, 5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4043 TEST_c_c (ctanh, minus_zero, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4044 TEST_c_c (ctanh, -0.25, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4046 TEST_c_c (ctanh, qnan_value, qnan_value, qnan_value, qnan_value);
4048 TEST_c_c (ctanh, 0, M_PI_4l, 0.0, 1.0);
4050 TEST_c_c (ctanh, 0.75L, 1.25L, 1.37260757053378320258048606571226857L, 0.385795952609750664177596760720790220L);
4051 TEST_c_c (ctanh, -2, -3, -0.965385879022133124278480269394560686L, 0.988437503832249372031403430350121098e-2L);
4053 TEST_c_c (ctanh, 45, 1, 1.000000000000000000000000000000000000001L, 1.490158918874345552942703234806348520895e-39L, UNDERFLOW_EXCEPTION_FLOAT);
4054 TEST_c_c (ctanh, 47, 1, 1.0, 2.729321264492904590777293425576722354636e-41L, UNDERFLOW_EXCEPTION_FLOAT);
4057 TEST_c_c (ctanh, 355, 1, 1.0, 8.140551093483276762350406321792653551513e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
4058 TEST_c_c (ctanh, 365, 1, 1.0, 1.677892637497921890115075995898773550884e-317L, UNDERFLOW_EXCEPTION_DOUBLE);
4061 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
4062 TEST_c_c (ctanh, 5680, 1, 1.0, 4.725214596136812019616700920476949798307e-4934L, UNDERFLOW_EXCEPTION);
4063 TEST_c_c (ctanh, 5690, 1, 1.0, 9.739393181626937151720816611272607059057e-4943L, UNDERFLOW_EXCEPTION);
4066 TEST_c_c (ctanh, 0, 0x3.243f6cp-1, 0.0, -2.287733242885645987394874673945769518150e7L);
4068 TEST_c_c (ctanh, 1, 0x1p127, 0.9101334047676183761532873794426475906201L, 0.2446359391192790896381501310437708987204L);
4071 TEST_c_c (ctanh, 1, 0x1p1023, 0.8786063118883068695462540226219865087189L, -0.2254627924997545057926782581695274244229L);
4074 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
4075 TEST_c_c (ctanh, 1, 0x1p16383L, 0.8133818522051542536316746743877629761488L, 0.1608598776370396607204448234354670036772L);
4078 TEST_c_c (ctanh, 50000, 50000, 1.0, plus_zero, UNDERFLOW_EXCEPTION);
4079 TEST_c_c (ctanh, 50000, -50000, 1.0, minus_zero, UNDERFLOW_EXCEPTION);
4080 TEST_c_c (ctanh, -50000, 50000, -1.0, plus_zero, UNDERFLOW_EXCEPTION);
4081 TEST_c_c (ctanh, -50000, -50000, -1.0, minus_zero, UNDERFLOW_EXCEPTION);
4083 END (ctanh, complex);
4088 ctanh_test_tonearest (void)
4090 int save_round_mode;
4092 FUNC(ctanh) (BUILD_COMPLEX (0.7L, 1.2L));
4093 if (errno == ENOSYS)
4094 /* Function not implemented. */
4097 START (ctanh_tonearest);
4099 save_round_mode = fegetround ();
4101 if (!fesetround (FE_TONEAREST))
4103 TEST_c_c (ctanh, 0x1p-149, 0x1.921fb6p+0, 7.334008549954377778731880988481078535821e-31L, -2.287733242885645987394874673945769518150e7L);
4106 TEST_c_c (ctanh, 0x1p-1074, 0x1.921fb54442d18p+0, 1.317719414943508315995636961402669067843e-291L, 1.633123935319536975596773704152891653086e16L);
4109 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
4110 TEST_c_c (ctanh, 0x1p-16445L, 0x1.921fb54442d1846ap+0L, 5.793882568875674066286163141055208625180e-4912L, -3.986797629811710706723242948653362815645e19L);
4114 fesetround (save_round_mode);
4116 END (ctanh_tonearest, complex);
4121 ctanh_test_towardzero (void)
4123 int save_round_mode;
4125 FUNC(ctanh) (BUILD_COMPLEX (0.7L, 1.2L));
4126 if (errno == ENOSYS)
4127 /* Function not implemented. */
4130 START (ctanh_towardzero);
4132 save_round_mode = fegetround ();
4134 if (!fesetround (FE_TOWARDZERO))
4136 TEST_c_c (ctanh, 0x1p-149, 0x1.921fb6p+0, 7.334008549954377778731880988481078535821e-31L, -2.287733242885645987394874673945769518150e7L);
4139 TEST_c_c (ctanh, 0x1p-1074, 0x1.921fb54442d18p+0, 1.317719414943508315995636961402669067843e-291L, 1.633123935319536975596773704152891653086e16L);
4142 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
4143 TEST_c_c (ctanh, 0x1p-16445L, 0x1.921fb54442d1846ap+0L, 5.793882568875674066286163141055208625180e-4912L, -3.986797629811710706723242948653362815645e19L);
4147 fesetround (save_round_mode);
4149 END (ctanh_towardzero, complex);
4154 ctanh_test_downward (void)
4156 int save_round_mode;
4158 FUNC(ctanh) (BUILD_COMPLEX (0.7L, 1.2L));
4159 if (errno == ENOSYS)
4160 /* Function not implemented. */
4163 START (ctanh_downward);
4165 save_round_mode = fegetround ();
4167 if (!fesetround (FE_DOWNWARD))
4169 TEST_c_c (ctanh, 0x1p-149, 0x1.921fb6p+0, 7.334008549954377778731880988481078535821e-31L, -2.287733242885645987394874673945769518150e7L);
4172 TEST_c_c (ctanh, 0x1p-1074, 0x1.921fb54442d18p+0, 1.317719414943508315995636961402669067843e-291L, 1.633123935319536975596773704152891653086e16L);
4175 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
4176 TEST_c_c (ctanh, 0x1p-16445L, 0x1.921fb54442d1846ap+0L, 5.793882568875674066286163141055208625180e-4912L, -3.986797629811710706723242948653362815645e19L);
4180 fesetround (save_round_mode);
4182 END (ctanh_downward, complex);
4187 ctanh_test_upward (void)
4189 int save_round_mode;
4191 FUNC(ctanh) (BUILD_COMPLEX (0.7L, 1.2L));
4192 if (errno == ENOSYS)
4193 /* Function not implemented. */
4196 START (ctanh_upward);
4198 save_round_mode = fegetround ();
4200 if (!fesetround (FE_UPWARD))
4202 TEST_c_c (ctanh, 0x1p-149, 0x1.921fb6p+0, 7.334008549954377778731880988481078535821e-31L, -2.287733242885645987394874673945769518150e7L);
4205 TEST_c_c (ctanh, 0x1p-1074, 0x1.921fb54442d18p+0, 1.317719414943508315995636961402669067843e-291L, 1.633123935319536975596773704152891653086e16L);
4208 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
4209 TEST_c_c (ctanh, 0x1p-16445L, 0x1.921fb54442d1846ap+0L, 5.793882568875674066286163141055208625180e-4912L, -3.986797629811710706723242948653362815645e19L);
4213 fesetround (save_round_mode);
4215 END (ctanh_upward, complex);
4224 if (errno == ENOSYS)
4225 /* Function not implemented. */
4230 TEST_f_f (erf, 0, 0);
4231 TEST_f_f (erf, minus_zero, minus_zero);
4232 TEST_f_f (erf, plus_infty, 1);
4233 TEST_f_f (erf, minus_infty, -1);
4234 TEST_f_f (erf, qnan_value, qnan_value);
4236 TEST_f_f (erf, 0.125L, 0.140316204801333817393029446521623398L);
4237 TEST_f_f (erf, 0.75L, 0.711155633653515131598937834591410777L);
4238 TEST_f_f (erf, 1.25L, 0.922900128256458230136523481197281140L);
4239 TEST_f_f (erf, 2.0L, 0.995322265018952734162069256367252929L);
4240 TEST_f_f (erf, 4.125L, 0.999999994576599200434933994687765914L);
4241 TEST_f_f (erf, 27.0L, 1.0L);
4252 if (errno == ENOSYS)
4253 /* Function not implemented. */
4258 TEST_f_f (erfc, plus_infty, 0.0);
4259 TEST_f_f (erfc, minus_infty, 2.0);
4260 TEST_f_f (erfc, 0.0, 1.0);
4261 TEST_f_f (erfc, minus_zero, 1.0);
4262 TEST_f_f (erfc, qnan_value, qnan_value);
4264 TEST_f_f (erfc, 0.125L, 0.859683795198666182606970553478376602L);
4265 TEST_f_f (erfc, 0.75L, 0.288844366346484868401062165408589223L);
4266 TEST_f_f (erfc, 1.25L, 0.0770998717435417698634765188027188596L);
4267 TEST_f_f (erfc, 2.0L, 0.00467773498104726583793074363274707139L);
4268 TEST_f_f (erfc, 0x1.f7303cp+1L, 2.705500297238986897105236321218861842255e-8L);
4269 TEST_f_f (erfc, 4.125L, 0.542340079956506600531223408575531062e-8L);
4270 TEST_f_f (erfc, 0x1.ffa002p+2L, 1.233585992097580296336099501489175967033e-29L);
4271 TEST_f_f (erfc, 0x1.ffffc8p+2L, 1.122671365033056305522366683719541099329e-29L);
4273 /* The result can only be represented in long double. */
4274 # if LDBL_MIN_10_EXP < -319
4275 TEST_f_f (erfc, 27.0L, 0.523704892378925568501606768284954709e-318L);
4277 # if LDBL_MANT_DIG >= 106
4278 TEST_f_f (erfc, 0x1.ffff56789abcdef0123456789a8p+2L, 1.123161416304655390092138725253789378459e-29L);
4291 if (errno == ENOSYS)
4292 /* Function not implemented. */
4297 TEST_f_f (exp, 0, 1);
4298 TEST_f_f (exp, minus_zero, 1);
4301 TEST_f_f (exp, plus_infty, plus_infty);
4302 TEST_f_f (exp, minus_infty, 0);
4304 TEST_f_f (exp, qnan_value, qnan_value);
4305 TEST_f_f (exp, 1, M_El);
4307 TEST_f_f (exp, 2, M_E2l);
4308 TEST_f_f (exp, 3, M_E3l);
4309 TEST_f_f (exp, 0.75L, 2.11700001661267466854536981983709561L);
4310 TEST_f_f (exp, 50.0L, 5184705528587072464087.45332293348538L);
4311 TEST_f_f (exp, 88.72269439697265625L, 3.40233126623160774937554134772290447915e38L);
4312 #if defined TEST_LDOUBLE && __LDBL_MAX_EXP__ > 1024
4313 /* The result can only be represented in sane long double. */
4314 TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L);
4317 #if !(defined TEST_LDOUBLE && LDBL_MAX_EXP > 1024)
4318 TEST_f_f (exp, 710, plus_infty, OVERFLOW_EXCEPTION);
4319 TEST_f_f (exp, -1234, plus_zero, UNDERFLOW_EXCEPTION);
4321 TEST_f_f (exp, 1e5, plus_infty, OVERFLOW_EXCEPTION);
4322 TEST_f_f (exp, max_value, plus_infty, OVERFLOW_EXCEPTION);
4323 TEST_f_f (exp, -max_value, 0, UNDERFLOW_EXCEPTION);
4330 exp_test_tonearest (void)
4332 int save_round_mode;
4335 if (errno == ENOSYS)
4336 /* Function not implemented. */
4339 START (exp_tonearest);
4341 save_round_mode = fegetround ();
4343 if (!fesetround (FE_TONEAREST))
4345 TEST_f_f (exp, 1, M_El);
4346 TEST_f_f (exp, 2, M_E2l);
4347 TEST_f_f (exp, 3, M_E3l);
4350 fesetround (save_round_mode);
4352 END (exp_tonearest);
4357 exp_test_towardzero (void)
4359 int save_round_mode;
4362 if (errno == ENOSYS)
4363 /* Function not implemented. */
4366 START (exp_towardzero);
4368 save_round_mode = fegetround ();
4370 if (!fesetround (FE_TOWARDZERO))
4372 TEST_f_f (exp, 1, M_El);
4373 TEST_f_f (exp, 2, M_E2l);
4374 TEST_f_f (exp, 3, M_E3l);
4377 fesetround (save_round_mode);
4379 END (exp_towardzero);
4384 exp_test_downward (void)
4386 int save_round_mode;
4389 if (errno == ENOSYS)
4390 /* Function not implemented. */
4393 START (exp_downward);
4395 save_round_mode = fegetround ();
4397 if (!fesetround (FE_DOWNWARD))
4399 TEST_f_f (exp, 1, M_El);
4400 TEST_f_f (exp, 2, M_E2l);
4401 TEST_f_f (exp, 3, M_E3l);
4404 fesetround (save_round_mode);
4411 exp_test_upward (void)
4413 int save_round_mode;
4416 if (errno == ENOSYS)
4417 /* Function not implemented. */
4422 save_round_mode = fegetround ();
4424 if (!fesetround (FE_UPWARD))
4426 TEST_f_f (exp, 1, M_El);
4427 TEST_f_f (exp, 2, M_E2l);
4428 TEST_f_f (exp, 3, M_E3l);
4431 fesetround (save_round_mode);
4442 if (errno == ENOSYS)
4443 /* Function not implemented. */
4448 TEST_f_f (exp10, 0, 1);
4449 TEST_f_f (exp10, minus_zero, 1);
4451 TEST_f_f (exp10, plus_infty, plus_infty);
4452 TEST_f_f (exp10, minus_infty, 0);
4453 TEST_f_f (exp10, qnan_value, qnan_value);
4454 TEST_f_f (exp10, 3, 1000);
4455 TEST_f_f (exp10, -1, 0.1L);
4456 TEST_f_f (exp10, 36, 1.0e36L);
4457 TEST_f_f (exp10, -36, 1.0e-36L);
4459 TEST_f_f (exp10, 305, 1.0e305L);
4460 TEST_f_f (exp10, -305, 1.0e-305L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
4462 #if defined TEST_LDOUBLE && LDBL_MAX_10_EXP >= 4932
4463 TEST_f_f (exp10, 4932, 1.0e4932L);
4464 TEST_f_f (exp10, -4932, 1.0e-4932L, UNDERFLOW_EXCEPTION);
4466 TEST_f_f (exp10, 1e6, plus_infty, OVERFLOW_EXCEPTION);
4467 TEST_f_f (exp10, -1e6, 0, UNDERFLOW_EXCEPTION);
4468 TEST_f_f (exp10, max_value, plus_infty, OVERFLOW_EXCEPTION);
4469 TEST_f_f (exp10, -max_value, 0, UNDERFLOW_EXCEPTION);
4470 TEST_f_f (exp10, 0.75L, 5.62341325190349080394951039776481231L);
4481 if (errno == ENOSYS)
4482 /* Function not implemented. */
4487 TEST_f_f (exp2, 0, 1);
4488 TEST_f_f (exp2, minus_zero, 1);
4489 TEST_f_f (exp2, plus_infty, plus_infty);
4490 TEST_f_f (exp2, minus_infty, 0);
4491 TEST_f_f (exp2, qnan_value, qnan_value);
4493 TEST_f_f (exp2, 10, 1024);
4494 TEST_f_f (exp2, -1, 0.5);
4495 TEST_f_f (exp2, 1e6, plus_infty, OVERFLOW_EXCEPTION);
4496 TEST_f_f (exp2, -1e6, 0, UNDERFLOW_EXCEPTION);
4497 TEST_f_f (exp2, max_value, plus_infty, OVERFLOW_EXCEPTION);
4498 TEST_f_f (exp2, -max_value, 0, UNDERFLOW_EXCEPTION);
4499 TEST_f_f (exp2, 0.75L, 1.68179283050742908606225095246642979L);
4501 TEST_f_f (exp2, 100.5, 1.792728671193156477399422023278661496394e+30L);
4502 TEST_f_f (exp2, 127, 0x1p127);
4503 TEST_f_f (exp2, -149, 0x1p-149);
4506 TEST_f_f (exp2, 1000.25, 1.274245659452564874772384918171765416737e+301L);
4507 TEST_f_f (exp2, 1023, 0x1p1023);
4508 TEST_f_f (exp2, -1074, 0x1p-1074);
4511 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
4512 TEST_f_f (exp2, 16383, 0x1p16383L);
4513 TEST_f_f (exp2, -16400, 0x1p-16400L);
4525 if (errno == ENOSYS)
4526 /* Function not implemented. */
4531 TEST_f_f (expm1, 0, 0);
4532 TEST_f_f (expm1, minus_zero, minus_zero);
4535 TEST_f_f (expm1, plus_infty, plus_infty);
4536 TEST_f_f (expm1, minus_infty, -1);
4538 TEST_f_f (expm1, qnan_value, qnan_value);
4540 TEST_f_f (expm1, 1, M_El - 1.0);
4541 TEST_f_f (expm1, 0.75L, 1.11700001661267466854536981983709561L);
4543 TEST_f_f (expm1, 50.0L, 5.1847055285870724640864533229334853848275e+21L);
4546 TEST_f_f (expm1, 127.0L, 1.4302079958348104463583671072905261080748e+55L);
4547 TEST_f_f (expm1, 500.0L, 1.4035922178528374107397703328409120821806e+217L);
4550 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
4551 TEST_f_f (expm1, 11356.25L, 9.05128237311923300051376115753226014206e+4931L);
4554 TEST_f_f (expm1, -10.0, -0.9999546000702375151484644084844394493898L);
4555 TEST_f_f (expm1, -16.0, -0.9999998874648252807408854862248209398728L);
4556 TEST_f_f (expm1, -17.0, -0.9999999586006228121483334034897228104472L);
4557 TEST_f_f (expm1, -18.0, -0.9999999847700202552873715638633707664826L);
4558 TEST_f_f (expm1, -36.0, -0.9999999999999997680477169756430611687736L);
4559 TEST_f_f (expm1, -37.0, -0.9999999999999999146695237425593420572195L);
4560 TEST_f_f (expm1, -38.0, -0.9999999999999999686086720795197037129104L);
4561 TEST_f_f (expm1, -44.0, -0.9999999999999999999221886775886620348429L);
4562 TEST_f_f (expm1, -45.0, -0.9999999999999999999713748141945060635553L);
4563 TEST_f_f (expm1, -46.0, -0.9999999999999999999894693826424461876212L);
4564 TEST_f_f (expm1, -73.0, -0.9999999999999999999999999999999802074012L);
4565 TEST_f_f (expm1, -74.0, -0.9999999999999999999999999999999927187098L);
4566 TEST_f_f (expm1, -75.0, -0.9999999999999999999999999999999973213630L);
4567 TEST_f_f (expm1, -78.0, -0.9999999999999999999999999999999998666385L);
4568 TEST_f_f (expm1, -79.0, -0.9999999999999999999999999999999999509391L);
4569 TEST_f_f (expm1, -80.0, -0.9999999999999999999999999999999999819515L);
4570 TEST_f_f (expm1, -100.0, -1.0);
4571 TEST_f_f (expm1, -1000.0, -1.0);
4572 TEST_f_f (expm1, -10000.0, -1.0);
4573 TEST_f_f (expm1, -100000.0, -1.0);
4576 TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION);
4577 check_int ("errno for expm1(large) == ERANGE", errno, ERANGE, 0, 0, 0);
4578 TEST_f_f (expm1, max_value, plus_infty, OVERFLOW_EXCEPTION);
4579 TEST_f_f (expm1, -max_value, -1);
4590 TEST_f_f (fabs, 0, 0);
4591 TEST_f_f (fabs, minus_zero, 0);
4593 TEST_f_f (fabs, plus_infty, plus_infty);
4594 TEST_f_f (fabs, minus_infty, plus_infty);
4595 TEST_f_f (fabs, qnan_value, qnan_value);
4597 TEST_f_f (fabs, 38.0, 38.0);
4598 TEST_f_f (fabs, -M_El, M_El);
4609 TEST_ff_f (fdim, 0, 0, 0);
4610 TEST_ff_f (fdim, 9, 0, 9);
4611 TEST_ff_f (fdim, 0, 9, 0);
4612 TEST_ff_f (fdim, -9, 0, 0);
4613 TEST_ff_f (fdim, 0, -9, 9);
4615 TEST_ff_f (fdim, plus_infty, 9, plus_infty);
4616 TEST_ff_f (fdim, plus_infty, -9, plus_infty);
4617 TEST_ff_f (fdim, minus_infty, 9, 0);
4618 TEST_ff_f (fdim, minus_infty, -9, 0);
4619 TEST_ff_f (fdim, 9, minus_infty, plus_infty);
4620 TEST_ff_f (fdim, -9, minus_infty, plus_infty);
4621 TEST_ff_f (fdim, 9, plus_infty, 0);
4622 TEST_ff_f (fdim, -9, plus_infty, 0);
4624 TEST_ff_f (fdim, 0, qnan_value, qnan_value);
4625 TEST_ff_f (fdim, 9, qnan_value, qnan_value);
4626 TEST_ff_f (fdim, -9, qnan_value, qnan_value);
4627 TEST_ff_f (fdim, qnan_value, 9, qnan_value);
4628 TEST_ff_f (fdim, qnan_value, -9, qnan_value);
4629 TEST_ff_f (fdim, plus_infty, qnan_value, qnan_value);
4630 TEST_ff_f (fdim, minus_infty, qnan_value, qnan_value);
4631 TEST_ff_f (fdim, qnan_value, plus_infty, qnan_value);
4632 TEST_ff_f (fdim, qnan_value, minus_infty, qnan_value);
4633 TEST_ff_f (fdim, qnan_value, qnan_value, qnan_value);
4635 TEST_ff_f (fdim, plus_infty, plus_infty, 0);
4646 TEST_f_b (finite, 0, 1);
4647 TEST_f_b (finite, minus_zero, 1);
4648 TEST_f_b (finite, 10, 1);
4649 TEST_f_b (finite, min_subnorm_value, 1);
4650 TEST_f_b (finite, plus_infty, 0);
4651 TEST_f_b (finite, minus_infty, 0);
4652 TEST_f_b (finite, qnan_value, 0);
4663 TEST_f_f (floor, 0.0, 0.0);
4664 TEST_f_f (floor, minus_zero, minus_zero);
4665 TEST_f_f (floor, plus_infty, plus_infty);
4666 TEST_f_f (floor, minus_infty, minus_infty);
4667 TEST_f_f (floor, qnan_value, qnan_value);
4669 TEST_f_f (floor, M_PIl, 3.0);
4670 TEST_f_f (floor, -M_PIl, -4.0);
4672 TEST_f_f (floor, 0.1, 0.0);
4673 TEST_f_f (floor, 0.25, 0.0);
4674 TEST_f_f (floor, 0.625, 0.0);
4675 TEST_f_f (floor, -0.1, -1.0);
4676 TEST_f_f (floor, -0.25, -1.0);
4677 TEST_f_f (floor, -0.625, -1.0);
4680 /* The result can only be represented in long double. */
4681 TEST_f_f (floor, 4503599627370495.5L, 4503599627370495.0L);
4682 TEST_f_f (floor, 4503599627370496.25L, 4503599627370496.0L);
4683 TEST_f_f (floor, 4503599627370496.5L, 4503599627370496.0L);
4684 TEST_f_f (floor, 4503599627370496.75L, 4503599627370496.0L);
4685 TEST_f_f (floor, 4503599627370497.5L, 4503599627370497.0L);
4686 # if LDBL_MANT_DIG > 100
4687 TEST_f_f (floor, 4503599627370494.5000000000001L, 4503599627370494.0L);
4688 TEST_f_f (floor, 4503599627370495.5000000000001L, 4503599627370495.0L);
4689 TEST_f_f (floor, 4503599627370496.5000000000001L, 4503599627370496.0L);
4692 TEST_f_f (floor, -4503599627370495.5L, -4503599627370496.0L);
4693 TEST_f_f (floor, -4503599627370496.25L, -4503599627370497.0L);
4694 TEST_f_f (floor, -4503599627370496.5L, -4503599627370497.0L);
4695 TEST_f_f (floor, -4503599627370496.75L, -4503599627370497.0L);
4696 TEST_f_f (floor, -4503599627370497.5L, -4503599627370498.0L);
4697 # if LDBL_MANT_DIG > 100
4698 TEST_f_f (floor, -4503599627370494.5000000000001L, -4503599627370495.0L);
4699 TEST_f_f (floor, -4503599627370495.5000000000001L, -4503599627370496.0L);
4700 TEST_f_f (floor, -4503599627370496.5000000000001L, -4503599627370497.0L);
4703 TEST_f_f (floor, 9007199254740991.5L, 9007199254740991.0L);
4704 TEST_f_f (floor, 9007199254740992.25L, 9007199254740992.0L);
4705 TEST_f_f (floor, 9007199254740992.5L, 9007199254740992.0L);
4706 TEST_f_f (floor, 9007199254740992.75L, 9007199254740992.0L);
4707 TEST_f_f (floor, 9007199254740993.5L, 9007199254740993.0L);
4709 # if LDBL_MANT_DIG > 100
4710 TEST_f_f (floor, 9007199254740991.0000000000001L, 9007199254740991.0L);
4711 TEST_f_f (floor, 9007199254740992.0000000000001L, 9007199254740992.0L);
4712 TEST_f_f (floor, 9007199254740993.0000000000001L, 9007199254740993.0L);
4713 TEST_f_f (floor, 9007199254740991.5000000000001L, 9007199254740991.0L);
4714 TEST_f_f (floor, 9007199254740992.5000000000001L, 9007199254740992.0L);
4715 TEST_f_f (floor, 9007199254740993.5000000000001L, 9007199254740993.0L);
4718 TEST_f_f (floor, -9007199254740991.5L, -9007199254740992.0L);
4719 TEST_f_f (floor, -9007199254740992.25L, -9007199254740993.0L);
4720 TEST_f_f (floor, -9007199254740992.5L, -9007199254740993.0L);
4721 TEST_f_f (floor, -9007199254740992.75L, -9007199254740993.0L);
4722 TEST_f_f (floor, -9007199254740993.5L, -9007199254740994.0L);
4724 # if LDBL_MANT_DIG > 100
4725 TEST_f_f (floor, -9007199254740991.0000000000001L, -9007199254740992.0L);
4726 TEST_f_f (floor, -9007199254740992.0000000000001L, -9007199254740993.0L);
4727 TEST_f_f (floor, -9007199254740993.0000000000001L, -9007199254740994.0L);
4728 TEST_f_f (floor, -9007199254740991.5000000000001L, -9007199254740992.0L);
4729 TEST_f_f (floor, -9007199254740992.5000000000001L, -9007199254740993.0L);
4730 TEST_f_f (floor, -9007199254740993.5000000000001L, -9007199254740994.0L);
4733 TEST_f_f (floor, 72057594037927935.5L, 72057594037927935.0L);
4734 TEST_f_f (floor, 72057594037927936.25L, 72057594037927936.0L);
4735 TEST_f_f (floor, 72057594037927936.5L, 72057594037927936.0L);
4736 TEST_f_f (floor, 72057594037927936.75L, 72057594037927936.0L);
4737 TEST_f_f (floor, 72057594037927937.5L, 72057594037927937.0L);
4739 TEST_f_f (floor, -72057594037927935.5L, -72057594037927936.0L);
4740 TEST_f_f (floor, -72057594037927936.25L, -72057594037927937.0L);
4741 TEST_f_f (floor, -72057594037927936.5L, -72057594037927937.0L);
4742 TEST_f_f (floor, -72057594037927936.75L, -72057594037927937.0L);
4743 TEST_f_f (floor, -72057594037927937.5L, -72057594037927938.0L);
4745 TEST_f_f (floor, 10141204801825835211973625643007.5L, 10141204801825835211973625643007.0L);
4746 TEST_f_f (floor, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L);
4747 TEST_f_f (floor, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L);
4748 TEST_f_f (floor, 10141204801825835211973625643008.75L, 10141204801825835211973625643008.0L);
4749 TEST_f_f (floor, 10141204801825835211973625643009.5L, 10141204801825835211973625643009.0L);
4751 TEST_f_f (floor, 0xf.ffffffffffffff8p+47L, 0xf.fffffffffffep+47L);
4752 TEST_f_f (floor, -0x8.000000000000004p+48L, -0x8.000000000001p+48L);
4764 TEST_fff_f (fma, 1.0, 2.0, 3.0, 5.0);
4765 TEST_fff_f (fma, qnan_value, 2.0, 3.0, qnan_value);
4766 TEST_fff_f (fma, 1.0, qnan_value, 3.0, qnan_value);
4767 TEST_fff_f (fma, 1.0, 2.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4768 TEST_fff_f (fma, plus_infty, 0.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4769 TEST_fff_f (fma, minus_infty, 0.0, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4770 TEST_fff_f (fma, 0.0, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4771 TEST_fff_f (fma, 0.0, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION_OK);
4772 TEST_fff_f (fma, plus_infty, 0.0, 1.0, qnan_value, INVALID_EXCEPTION);
4773 TEST_fff_f (fma, minus_infty, 0.0, 1.0, qnan_value, INVALID_EXCEPTION);
4774 TEST_fff_f (fma, 0.0, plus_infty, 1.0, qnan_value, INVALID_EXCEPTION);
4775 TEST_fff_f (fma, 0.0, minus_infty, 1.0, qnan_value, INVALID_EXCEPTION);
4777 TEST_fff_f (fma, plus_infty, plus_infty, minus_infty, qnan_value, INVALID_EXCEPTION);
4778 TEST_fff_f (fma, minus_infty, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
4779 TEST_fff_f (fma, plus_infty, minus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
4780 TEST_fff_f (fma, minus_infty, minus_infty, minus_infty, qnan_value, INVALID_EXCEPTION);
4781 TEST_fff_f (fma, plus_infty, 3.5L, minus_infty, qnan_value, INVALID_EXCEPTION);
4782 TEST_fff_f (fma, minus_infty, -7.5L, minus_infty, qnan_value, INVALID_EXCEPTION);
4783 TEST_fff_f (fma, -13.5L, plus_infty, plus_infty, qnan_value, INVALID_EXCEPTION);
4784 TEST_fff_f (fma, minus_infty, 7.5L, plus_infty, qnan_value, INVALID_EXCEPTION);
4786 TEST_fff_f (fma, 1.25L, 0.75L, 0.0625L, 1.0L);
4788 FLOAT fltmax = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
4789 LDBL_MAX, DBL_MAX, FLT_MAX);
4790 TEST_fff_f (fma, -fltmax, -fltmax, minus_infty, minus_infty);
4791 TEST_fff_f (fma, fltmax / 2, fltmax / 2, minus_infty, minus_infty);
4792 TEST_fff_f (fma, -fltmax, fltmax, plus_infty, plus_infty);
4793 TEST_fff_f (fma, fltmax / 2, -fltmax / 4, plus_infty, plus_infty);
4794 TEST_fff_f (fma, plus_infty, 4, plus_infty, plus_infty);
4795 TEST_fff_f (fma, 2, minus_infty, minus_infty, minus_infty);
4796 TEST_fff_f (fma, minus_infty, minus_infty, plus_infty, plus_infty);
4797 TEST_fff_f (fma, plus_infty, minus_infty, minus_infty, minus_infty);
4799 TEST_fff_f (fma, plus_zero, plus_zero, plus_zero, plus_zero);
4800 TEST_fff_f (fma, plus_zero, plus_zero, minus_zero, plus_zero);
4801 TEST_fff_f (fma, plus_zero, minus_zero, plus_zero, plus_zero);
4802 TEST_fff_f (fma, plus_zero, minus_zero, minus_zero, minus_zero);
4803 TEST_fff_f (fma, minus_zero, plus_zero, plus_zero, plus_zero);
4804 TEST_fff_f (fma, minus_zero, plus_zero, minus_zero, minus_zero);
4805 TEST_fff_f (fma, minus_zero, minus_zero, plus_zero, plus_zero);
4806 TEST_fff_f (fma, minus_zero, minus_zero, minus_zero, plus_zero);
4807 TEST_fff_f (fma, 1.0, plus_zero, plus_zero, plus_zero);
4808 TEST_fff_f (fma, 1.0, plus_zero, minus_zero, plus_zero);
4809 TEST_fff_f (fma, 1.0, minus_zero, plus_zero, plus_zero);
4810 TEST_fff_f (fma, 1.0, minus_zero, minus_zero, minus_zero);
4811 TEST_fff_f (fma, -1.0, plus_zero, plus_zero, plus_zero);
4812 TEST_fff_f (fma, -1.0, plus_zero, minus_zero, minus_zero);
4813 TEST_fff_f (fma, -1.0, minus_zero, plus_zero, plus_zero);
4814 TEST_fff_f (fma, -1.0, minus_zero, minus_zero, plus_zero);
4815 TEST_fff_f (fma, plus_zero, 1.0, plus_zero, plus_zero);
4816 TEST_fff_f (fma, plus_zero, 1.0, minus_zero, plus_zero);
4817 TEST_fff_f (fma, plus_zero, -1.0, plus_zero, plus_zero);
4818 TEST_fff_f (fma, plus_zero, -1.0, minus_zero, minus_zero);
4819 TEST_fff_f (fma, minus_zero, 1.0, plus_zero, plus_zero);
4820 TEST_fff_f (fma, minus_zero, 1.0, minus_zero, minus_zero);
4821 TEST_fff_f (fma, minus_zero, -1.0, plus_zero, plus_zero);
4822 TEST_fff_f (fma, minus_zero, -1.0, minus_zero, plus_zero);
4824 TEST_fff_f (fma, 1.0, 1.0, -1.0, plus_zero);
4825 TEST_fff_f (fma, 1.0, -1.0, 1.0, plus_zero);
4826 TEST_fff_f (fma, -1.0, 1.0, 1.0, plus_zero);
4827 TEST_fff_f (fma, -1.0, -1.0, -1.0, plus_zero);
4829 TEST_fff_f (fma, min_value, min_value, plus_zero, plus_zero, UNDERFLOW_EXCEPTION);
4830 TEST_fff_f (fma, min_value, min_value, minus_zero, plus_zero, UNDERFLOW_EXCEPTION);
4831 TEST_fff_f (fma, min_value, -min_value, plus_zero, minus_zero, UNDERFLOW_EXCEPTION);
4832 TEST_fff_f (fma, min_value, -min_value, minus_zero, minus_zero, UNDERFLOW_EXCEPTION);
4833 TEST_fff_f (fma, -min_value, min_value, plus_zero, minus_zero, UNDERFLOW_EXCEPTION);
4834 TEST_fff_f (fma, -min_value, min_value, minus_zero, minus_zero, UNDERFLOW_EXCEPTION);
4835 TEST_fff_f (fma, -min_value, -min_value, plus_zero, plus_zero, UNDERFLOW_EXCEPTION);
4836 TEST_fff_f (fma, -min_value, -min_value, minus_zero, plus_zero, UNDERFLOW_EXCEPTION);
4838 TEST_fff_f (fma, max_value, max_value, min_value, plus_infty, OVERFLOW_EXCEPTION);
4839 TEST_fff_f (fma, max_value, max_value, -min_value, plus_infty, OVERFLOW_EXCEPTION);
4840 TEST_fff_f (fma, max_value, -max_value, min_value, minus_infty, OVERFLOW_EXCEPTION);
4841 TEST_fff_f (fma, max_value, -max_value, -min_value, minus_infty, OVERFLOW_EXCEPTION);
4842 TEST_fff_f (fma, -max_value, max_value, min_value, minus_infty, OVERFLOW_EXCEPTION);
4843 TEST_fff_f (fma, -max_value, max_value, -min_value, minus_infty, OVERFLOW_EXCEPTION);
4844 TEST_fff_f (fma, -max_value, -max_value, min_value, plus_infty, OVERFLOW_EXCEPTION);
4845 TEST_fff_f (fma, -max_value, -max_value, -min_value, plus_infty, OVERFLOW_EXCEPTION);
4847 #if defined (TEST_FLOAT) && FLT_MANT_DIG == 24
4848 TEST_fff_f (fma, 0x1.7ff8p+13, 0x1.000002p+0, 0x1.ffffp-24, 0x1.7ff802p+13);
4849 TEST_fff_f (fma, 0x1.fffp+0, 0x1.00001p+0, -0x1.fffp+0, 0x1.fffp-20);
4850 TEST_fff_f (fma, 0x1.9abcdep+127, 0x0.9abcdep-126, -0x1.f08948p+0, 0x1.bb421p-25);
4851 TEST_fff_f (fma, 0x1.9abcdep+100, 0x0.9abcdep-126, -0x1.f08948p-27, 0x1.bb421p-52);
4852 TEST_fff_f (fma, 0x1.fffffep+127, 0x1.001p+0, -0x1.fffffep+127, 0x1.fffffep+115);
4853 TEST_fff_f (fma, -0x1.fffffep+127, 0x1.fffffep+0, 0x1.fffffep+127, -0x1.fffffap+127);
4854 TEST_fff_f (fma, 0x1.fffffep+127, 2.0, -0x1.fffffep+127, 0x1.fffffep+127);
4855 TEST_fff_f (fma, 0x1.4p-126, 0x1.000004p-1, 0x1p-128, 0x1.c00004p-127, UNDERFLOW_EXCEPTION);
4856 TEST_fff_f (fma, -0x1.4p-126, 0x1.000004p-1, -0x1p-128, -0x1.c00004p-127, UNDERFLOW_EXCEPTION);
4857 TEST_fff_f (fma, 0x1.fffff8p-126, 0x1.000002p-1, 0x1p-149, 0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4858 TEST_fff_f (fma, -0x1.fffff8p-126, 0x1.000002p-1, -0x1p-149, -0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4859 TEST_fff_f (fma, 0x1p-149, 0x1p-1, 0x0.fffffep-126, 0x1p-126, UNDERFLOW_EXCEPTION);
4860 TEST_fff_f (fma, -0x1p-149, 0x1p-1, -0x0.fffffep-126, -0x1p-126, UNDERFLOW_EXCEPTION);
4861 TEST_fff_f (fma, 0x1p-149, 0x1.1p-1, 0x0.fffffep-126, 0x1p-126, UNDERFLOW_EXCEPTION);
4862 TEST_fff_f (fma, -0x1p-149, 0x1.1p-1, -0x0.fffffep-126, -0x1p-126, UNDERFLOW_EXCEPTION);
4863 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p127, 0x1p127);
4864 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p127, 0x1p127);
4865 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p127, -0x1p127);
4866 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p127, -0x1p127);
4867 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p-126, 0x1p-126);
4868 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p-126, 0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4869 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p-126, -0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4870 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p-126, -0x1p-126);
4871 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
4872 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
4873 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
4874 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
4875 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p-149, 0x1p-149, UNDERFLOW_EXCEPTION);
4876 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p-149, 0x1p-149, UNDERFLOW_EXCEPTION);
4877 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p-149, -0x1p-149, UNDERFLOW_EXCEPTION);
4878 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p-149, -0x1p-149, UNDERFLOW_EXCEPTION);
4879 TEST_fff_f (fma, 0x0.fffp0, 0x0.fffp0, -0x0.ffep0, 0x1p-24);
4880 TEST_fff_f (fma, 0x0.fffp0, -0x0.fffp0, 0x0.ffep0, -0x1p-24);
4881 TEST_fff_f (fma, -0x0.fffp0, 0x0.fffp0, 0x0.ffep0, -0x1p-24);
4882 TEST_fff_f (fma, -0x0.fffp0, -0x0.fffp0, -0x0.ffep0, 0x1p-24);
4883 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, 0x1p127, 0x1p127);
4884 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, 0x1p127, 0x1p127);
4885 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, -0x1p127, -0x1p127);
4886 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, -0x1p127, -0x1p127);
4887 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, 0x1p103, 0x1p103);
4888 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, 0x1p103, 0x1p103);
4889 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, -0x1p103, -0x1p103);
4890 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, -0x1p103, -0x1p103);
4892 #if defined (TEST_DOUBLE) && DBL_MANT_DIG == 53
4893 TEST_fff_f (fma, 0x1.7fp+13, 0x1.0000000000001p+0, 0x1.ffep-48, 0x1.7f00000000001p+13);
4894 TEST_fff_f (fma, 0x1.fffp+0, 0x1.0000000000001p+0, -0x1.fffp+0, 0x1.fffp-52);
4895 TEST_fff_f (fma, 0x1.0000002p+0, 0x1.ffffffcp-1, 0x1p-300, 1.0);
4896 TEST_fff_f (fma, 0x1.0000002p+0, 0x1.ffffffcp-1, -0x1p-300, 0x1.fffffffffffffp-1);
4897 TEST_fff_f (fma, 0x1.deadbeef2feedp+1023, 0x0.deadbeef2feedp-1022, -0x1.a05f8c01a4bfbp+1, 0x1.0989687bc9da4p-53);
4898 TEST_fff_f (fma, 0x1.deadbeef2feedp+900, 0x0.deadbeef2feedp-1022, -0x1.a05f8c01a4bfbp-122, 0x1.0989687bc9da4p-176);
4899 TEST_fff_f (fma, 0x1.fffffffffffffp+1023, 0x1.001p+0, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+1011);
4900 TEST_fff_f (fma, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+0, 0x1.fffffffffffffp+1023, -0x1.ffffffffffffdp+1023);
4901 TEST_fff_f (fma, 0x1.fffffffffffffp+1023, 2.0, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+1023);
4902 TEST_fff_f (fma, 0x1.6a09e667f3bccp-538, 0x1.6a09e667f3bccp-538, 0.0, 0.0, UNDERFLOW_EXCEPTION);
4903 TEST_fff_f (fma, 0x1.deadbeef2feedp-495, 0x1.deadbeef2feedp-495, -0x1.bf86a5786a574p-989, 0x0.0000042625a1fp-1022, UNDERFLOW_EXCEPTION);
4904 TEST_fff_f (fma, 0x1.deadbeef2feedp-503, 0x1.deadbeef2feedp-503, -0x1.bf86a5786a574p-1005, 0x0.0000000004262p-1022, UNDERFLOW_EXCEPTION);
4905 TEST_fff_f (fma, 0x1p-537, 0x1p-538, 0x1p-1074, 0x0.0000000000002p-1022, UNDERFLOW_EXCEPTION);
4906 TEST_fff_f (fma, 0x1.7fffff8p-968, 0x1p-106, 0x0.000001p-1022, 0x0.0000010000001p-1022, UNDERFLOW_EXCEPTION);
4907 TEST_fff_f (fma, 0x1.4000004p-967, 0x1p-106, 0x0.000001p-1022, 0x0.0000010000003p-1022, UNDERFLOW_EXCEPTION);
4908 TEST_fff_f (fma, 0x1.4p-967, -0x1p-106, -0x0.000001p-1022, -0x0.0000010000002p-1022, UNDERFLOW_EXCEPTION);
4909 TEST_fff_f (fma, -0x1.19cab66d73e17p-959, 0x1.c7108a8c5ff51p-107, -0x0.80b0ad65d9b64p-1022, -0x0.80b0ad65d9d59p-1022, UNDERFLOW_EXCEPTION);
4910 TEST_fff_f (fma, -0x1.d2eaed6e8e9d3p-979, -0x1.4e066c62ac9ddp-63, -0x0.9245e6b003454p-1022, -0x0.9245c09c5fb5dp-1022, UNDERFLOW_EXCEPTION);
4911 TEST_fff_f (fma, 0x1.153d650bb9f06p-907, 0x1.2d01230d48407p-125, -0x0.b278d5acfc3cp-1022, -0x0.b22757123bbe9p-1022, UNDERFLOW_EXCEPTION);
4912 TEST_fff_f (fma, -0x1.fffffffffffffp-711, 0x1.fffffffffffffp-275, 0x1.fffffe00007ffp-983, 0x1.7ffffe00007ffp-983);
4913 TEST_fff_f (fma, 0x1.4p-1022, 0x1.0000000000002p-1, 0x1p-1024, 0x1.c000000000002p-1023, UNDERFLOW_EXCEPTION);
4914 TEST_fff_f (fma, -0x1.4p-1022, 0x1.0000000000002p-1, -0x1p-1024, -0x1.c000000000002p-1023, UNDERFLOW_EXCEPTION);
4915 TEST_fff_f (fma, 0x1.ffffffffffffcp-1022, 0x1.0000000000001p-1, 0x1p-1074, 0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4916 TEST_fff_f (fma, -0x1.ffffffffffffcp-1022, 0x1.0000000000001p-1, -0x1p-1074, -0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4917 TEST_fff_f (fma, 0x1p-1074, 0x1p-1, 0x0.fffffffffffffp-1022, 0x1p-1022, UNDERFLOW_EXCEPTION);
4918 TEST_fff_f (fma, -0x1p-1074, 0x1p-1, -0x0.fffffffffffffp-1022, -0x1p-1022, UNDERFLOW_EXCEPTION);
4919 TEST_fff_f (fma, 0x1p-1074, 0x1.1p-1, 0x0.fffffffffffffp-1022, 0x1p-1022, UNDERFLOW_EXCEPTION);
4920 TEST_fff_f (fma, -0x1p-1074, 0x1.1p-1, -0x0.fffffffffffffp-1022, -0x1p-1022, UNDERFLOW_EXCEPTION);
4921 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p1023, 0x1p1023);
4922 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p1023, 0x1p1023);
4923 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p1023, -0x1p1023);
4924 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p1023, -0x1p1023);
4925 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p-1022, 0x1p-1022);
4926 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p-1022, 0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4927 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p-1022, -0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4928 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p-1022, -0x1p-1022);
4929 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
4930 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
4931 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
4932 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
4933 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p-1074, 0x1p-1074, UNDERFLOW_EXCEPTION);
4934 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p-1074, 0x1p-1074, UNDERFLOW_EXCEPTION);
4935 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p-1074, -0x1p-1074, UNDERFLOW_EXCEPTION);
4936 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p-1074, -0x1p-1074, UNDERFLOW_EXCEPTION);
4937 TEST_fff_f (fma, 0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0, -0x0.fffffffffffffp0, 0x1p-106);
4938 TEST_fff_f (fma, 0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0, 0x0.fffffffffffffp0, -0x1p-106);
4939 TEST_fff_f (fma, -0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0, 0x0.fffffffffffffp0, -0x1p-106);
4940 TEST_fff_f (fma, -0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0, -0x0.fffffffffffffp0, 0x1p-106);
4941 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, 0x1p1023, 0x1p1023);
4942 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, 0x1p1023, 0x1p1023);
4943 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, -0x1p1023, -0x1p1023);
4944 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, -0x1p1023, -0x1p1023);
4945 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, 0x1p970, 0x1p970);
4946 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, 0x1p970, 0x1p970);
4947 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, -0x1p970, -0x1p970);
4948 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, -0x1p970, -0x1p970);
4950 #if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 64
4951 TEST_fff_f (fma, -0x8.03fcp+3696L, 0xf.fffffffffffffffp-6140L, 0x8.3ffffffffffffffp-2450L, -0x8.01ecp-2440L);
4952 TEST_fff_f (fma, 0x9.fcp+2033L, -0x8.000e1f000ff800fp-3613L, -0xf.fffffffffffc0ffp-1579L, -0xd.fc119fb093ed092p-1577L);
4953 TEST_fff_f (fma, 0xc.7fc000003ffffffp-1194L, 0x8.1e0003fffffffffp+15327L, -0x8.fffep+14072L, 0xc.ae9f164020effffp+14136L);
4954 TEST_fff_f (fma, -0x8.0001fc000000003p+1798L, 0xcp-2230L, 0x8.f7e000000000007p-468L, -0xc.0002f9ffee10404p-429L);
4955 TEST_fff_f (fma, 0xc.0000000000007ffp+10130L, -0x8.000000000000001p+4430L, 0xc.07000000001ffffp+14513L, -0xb.fffffffffffd7e4p+14563L);
4956 TEST_fff_f (fma, 0xb.ffffp-4777L, 0x8.000000fffffffffp-11612L, -0x0.3800fff8p-16385L, 0x5.c7fe80c7ffeffffp-16385L, UNDERFLOW_EXCEPTION);
4957 TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000004p-1L, 0x1p-16384L, 0x1.c000000000000004p-16383L, UNDERFLOW_EXCEPTION);
4958 TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000004p-1L, -0x1p-16384L, -0x1.c000000000000004p-16383L, UNDERFLOW_EXCEPTION);
4959 TEST_fff_f (fma, 0x1.fffffffffffffff8p-16382L, 0x1.0000000000000002p-1L, 0x1p-16445L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4960 TEST_fff_f (fma, -0x1.fffffffffffffff8p-16382L, 0x1.0000000000000002p-1L, -0x1p-16445L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4961 TEST_fff_f (fma, 0x1p-16445L, 0x1p-1L, 0x0.fffffffffffffffep-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION);
4962 TEST_fff_f (fma, -0x1p-16445L, 0x1p-1L, -0x0.fffffffffffffffep-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION);
4963 TEST_fff_f (fma, 0x1p-16445L, 0x1.1p-1L, 0x0.fffffffffffffffep-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION);
4964 TEST_fff_f (fma, -0x1p-16445L, 0x1.1p-1L, -0x0.fffffffffffffffep-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION);
4965 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p16383L, 0x1p16383L);
4966 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p16383L, 0x1p16383L);
4967 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p16383L, -0x1p16383L);
4968 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p16383L, -0x1p16383L);
4969 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p-16382L, 0x1p-16382L);
4970 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4971 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
4972 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p-16382L, -0x1p-16382L);
4973 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
4974 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
4975 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
4976 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
4977 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p-16445L, 0x1p-16445L, UNDERFLOW_EXCEPTION);
4978 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p-16445L, 0x1p-16445L, UNDERFLOW_EXCEPTION);
4979 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p-16445L, -0x1p-16445L, UNDERFLOW_EXCEPTION);
4980 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p-16445L, -0x1p-16445L, UNDERFLOW_EXCEPTION);
4981 TEST_fff_f (fma, 0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp0L, -0x0.fffffffffffffffep0L, 0x1p-128L);
4982 TEST_fff_f (fma, 0x0.ffffffffffffffffp0L, -0x0.ffffffffffffffffp0L, 0x0.fffffffffffffffep0L, -0x1p-128L);
4983 TEST_fff_f (fma, -0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp0L, 0x0.fffffffffffffffep0L, -0x1p-128L);
4984 TEST_fff_f (fma, -0x0.ffffffffffffffffp0L, -0x0.ffffffffffffffffp0L, -0x0.fffffffffffffffep0L, 0x1p-128L);
4985 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, 0x1p16383L, 0x1p16383L);
4986 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, 0x1p16383L, 0x1p16383L);
4987 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, -0x1p16383L, -0x1p16383L);
4988 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, -0x1p16383L, -0x1p16383L);
4989 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, 0x1p16319L, 0x1p16319L);
4990 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, 0x1p16319L, 0x1p16319L);
4991 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, -0x1p16319L, -0x1p16319L);
4992 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, -0x1p16319L, -0x1p16319L);
4994 #if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 113
4995 TEST_fff_f (fma, 0x1.bb2de33e02ccbbfa6e245a7c1f71p-2584L, -0x1.6b500daf0580d987f1bc0cadfcddp-13777L, 0x1.613cd91d9fed34b33820e5ab9d8dp-16378L, -0x1.3a79fb50eb9ce887cffa0f09bd9fp-16360L);
4996 TEST_fff_f (fma, -0x1.f949b880cacb0f0c61540105321dp-5954L, -0x1.3876cec84b4140f3bd6198731b7ep-10525L, -0x0.a5dc1c6cfbc498c54fb0b504bf19p-16382L, -0x0.a5dc1c6cfbc498c54fb0b5038abbp-16382L, UNDERFLOW_EXCEPTION);
4997 TEST_fff_f (fma, -0x1.0000fffffffffp-16221L, 0x1.0000001fffff8007fep-239L, 0x0.ff87ffffffffffffe000003fffffp-16382L, 0x0.ff87ffffffffffffdffc003bff7fp-16382L, UNDERFLOW_EXCEPTION);
4998 TEST_fff_f (fma, -0x1.ac79c9376ef447f3827c9e9de008p-2228L, -0x1.5ba830022b6139e21fbe7270cad8p-6314L, 0x1.e8282b6a26bb6a9daf5c8e73e9f9p-8616L, 0x1.22f14a0253878a730cd1aee373adp-8541L);
4999 TEST_fff_f (fma, -0x1.c69749ec574caaa2ab8e97ddb9f3p+2652L, 0x1.f34235ff9d095449c29b4831b62dp+3311L, 0x1.fbe4302df23354dbd0c4d3cfe606p+5879L, -0x1.bb473bfdfb7a6e18886ce6e57eafp+5964L);
5000 TEST_fff_f (fma, -0x1.ca8835fc6ecfb5398625fc891be5p-1686L, 0x1.621e1972bbe2180e5be9dd7d8df5p-7671L, -0x1.7d2d21b73b52cf20dec2a83902a4p-9395L, -0x1.3d2322191c9c88bc68a62ab8042cp-9356L);
5001 TEST_fff_f (fma, -0x1.55cff679ec49c2541fab41fc843ep-11819L, 0x1.e60e9f464f9e8df0509647c7c971p+12325L, 0x1.eaa2a7649d765c2f564f7a5beca7p+454L, -0x1.447e29fa7e406a285f4e350fcf86p+507L);
5002 TEST_fff_f (fma, 0x1.f0e7b1454908576f2537d863cf9bp+11432L, 0x1.cdce52f09d4ca76e68706f34b5d5p-1417L, -0x1.2e986187c70f146235ea2066e486p+9979L, 0x1.c030dad3cc5643f3dd0f5619f661p+10016L);
5003 TEST_fff_f (fma, 0x1.f102f7da4a57a3a4aab620e29452p-3098L, -0x1.cc06a4ff40248f9e2dcc4b6afd84p-11727L, 0x1.d512a11126b5ac8ed8973b8580c8p-14849L, -0x1.be8f1cf737ab4d1c31c54f5ec23bp-14824L);
5004 TEST_fff_f (fma, -0x1.fc47ac7434b993cd8dcb2b431f25p-3816L, 0x1.fbc9750da8468852d84558e1db6dp-5773L, -0x1.00a98abf783f75c40fe5b7a37d86p-9607L, -0x1.f81917b166f45e763cfcc057e2adp-9588L);
5005 TEST_fff_f (fma, 0x1.00000000000007ffffffffffffffp-9045L, -0x1.ffffffffffff80000001ffffffffp+4773L, -0x1.f8p-4316L, -0x1.00000000000f88000000fffffdffp-4271L);
5006 TEST_fff_f (fma, 0x1.4e922764c90701d4a2f21d01893dp-8683L, -0x1.955a12e2d7c9447c27fa022fc865p+212L, -0x1.e9634462eaef96528b90b6944578p-8521L, -0x1.08e1783184a371943d3598e10865p-8470L);
5007 TEST_fff_f (fma, 0x1.801181509c03bdbef10d6165588cp-15131L, 0x1.ad86f8e57d3d40bfa8007780af63p-368L, -0x1.6e9df0dab1c9f1d7a6043c390741p-15507L, 0x1.417c9b2b15e2ad57dc9e0e920844p-15498L);
5008 TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, 0x1p-16384L, 0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION);
5009 TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, -0x1p-16384L, -0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION);
5010 TEST_fff_f (fma, 0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, 0x1p-16494L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5011 TEST_fff_f (fma, -0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, -0x1p-16494L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5012 TEST_fff_f (fma, 0x1p-16494L, 0x1p-1L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION);
5013 TEST_fff_f (fma, -0x1p-16494L, 0x1p-1L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION);
5014 TEST_fff_f (fma, 0x1p-16494L, 0x1.1p-1L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION);
5015 TEST_fff_f (fma, -0x1p-16494L, 0x1.1p-1L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION);
5016 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p16383L, 0x1p16383L);
5017 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p16383L, 0x1p16383L);
5018 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p16383L, -0x1p16383L);
5019 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p16383L, -0x1p16383L);
5020 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p-16382L, 0x1p-16382L);
5021 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5022 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5023 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p-16382L, -0x1p-16382L);
5024 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5025 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5026 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5027 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5028 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p-16494L, 0x1p-16494L, UNDERFLOW_EXCEPTION);
5029 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p-16494L, 0x1p-16494L, UNDERFLOW_EXCEPTION);
5030 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p-16494L, -0x1p-16494L, UNDERFLOW_EXCEPTION);
5031 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p-16494L, -0x1p-16494L, UNDERFLOW_EXCEPTION);
5032 TEST_fff_f (fma, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffffp0L, 0x1p-226L);
5033 TEST_fff_f (fma, 0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffffp0L, -0x1p-226L);
5034 TEST_fff_f (fma, -0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffffp0L, -0x1p-226L);
5035 TEST_fff_f (fma, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffffp0L, 0x1p-226L);
5036 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, 0x1p16383L, 0x1p16383L);
5037 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, 0x1p16383L, 0x1p16383L);
5038 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, -0x1p16383L, -0x1p16383L);
5039 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, -0x1p16383L, -0x1p16383L);
5040 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, 0x1p16319L, 0x1p16319L);
5041 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, 0x1p16319L, 0x1p16319L);
5042 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, -0x1p16319L, -0x1p16319L);
5043 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, -0x1p16319L, -0x1p16319L);
5051 fma_test_towardzero (void)
5053 int save_round_mode;
5054 START (fma_towardzero);
5056 save_round_mode = fegetround ();
5058 if (!fesetround (FE_TOWARDZERO))
5060 TEST_fff_f (fma, plus_zero, plus_zero, plus_zero, plus_zero);
5061 TEST_fff_f (fma, plus_zero, plus_zero, minus_zero, plus_zero);
5062 TEST_fff_f (fma, plus_zero, minus_zero, plus_zero, plus_zero);
5063 TEST_fff_f (fma, plus_zero, minus_zero, minus_zero, minus_zero);
5064 TEST_fff_f (fma, minus_zero, plus_zero, plus_zero, plus_zero);
5065 TEST_fff_f (fma, minus_zero, plus_zero, minus_zero, minus_zero);
5066 TEST_fff_f (fma, minus_zero, minus_zero, plus_zero, plus_zero);
5067 TEST_fff_f (fma, minus_zero, minus_zero, minus_zero, plus_zero);
5068 TEST_fff_f (fma, 1.0, plus_zero, plus_zero, plus_zero);
5069 TEST_fff_f (fma, 1.0, plus_zero, minus_zero, plus_zero);
5070 TEST_fff_f (fma, 1.0, minus_zero, plus_zero, plus_zero);
5071 TEST_fff_f (fma, 1.0, minus_zero, minus_zero, minus_zero);
5072 TEST_fff_f (fma, -1.0, plus_zero, plus_zero, plus_zero);
5073 TEST_fff_f (fma, -1.0, plus_zero, minus_zero, minus_zero);
5074 TEST_fff_f (fma, -1.0, minus_zero, plus_zero, plus_zero);
5075 TEST_fff_f (fma, -1.0, minus_zero, minus_zero, plus_zero);
5076 TEST_fff_f (fma, plus_zero, 1.0, plus_zero, plus_zero);
5077 TEST_fff_f (fma, plus_zero, 1.0, minus_zero, plus_zero);
5078 TEST_fff_f (fma, plus_zero, -1.0, plus_zero, plus_zero);
5079 TEST_fff_f (fma, plus_zero, -1.0, minus_zero, minus_zero);
5080 TEST_fff_f (fma, minus_zero, 1.0, plus_zero, plus_zero);
5081 TEST_fff_f (fma, minus_zero, 1.0, minus_zero, minus_zero);
5082 TEST_fff_f (fma, minus_zero, -1.0, plus_zero, plus_zero);
5083 TEST_fff_f (fma, minus_zero, -1.0, minus_zero, plus_zero);
5085 TEST_fff_f (fma, 1.0, 1.0, -1.0, plus_zero);
5086 TEST_fff_f (fma, 1.0, -1.0, 1.0, plus_zero);
5087 TEST_fff_f (fma, -1.0, 1.0, 1.0, plus_zero);
5088 TEST_fff_f (fma, -1.0, -1.0, -1.0, plus_zero);
5090 TEST_fff_f (fma, min_value, min_value, plus_zero, plus_zero, UNDERFLOW_EXCEPTION);
5091 TEST_fff_f (fma, min_value, min_value, minus_zero, plus_zero, UNDERFLOW_EXCEPTION);
5092 TEST_fff_f (fma, min_value, -min_value, plus_zero, minus_zero, UNDERFLOW_EXCEPTION);
5093 TEST_fff_f (fma, min_value, -min_value, minus_zero, minus_zero, UNDERFLOW_EXCEPTION);
5094 TEST_fff_f (fma, -min_value, min_value, plus_zero, minus_zero, UNDERFLOW_EXCEPTION);
5095 TEST_fff_f (fma, -min_value, min_value, minus_zero, minus_zero, UNDERFLOW_EXCEPTION);
5096 TEST_fff_f (fma, -min_value, -min_value, plus_zero, plus_zero, UNDERFLOW_EXCEPTION);
5097 TEST_fff_f (fma, -min_value, -min_value, minus_zero, plus_zero, UNDERFLOW_EXCEPTION);
5099 #if !(defined TEST_LDOUBLE && LDBL_MANT_DIG == 106) /* Bug 13304. */
5100 TEST_fff_f (fma, max_value, max_value, min_value, max_value, OVERFLOW_EXCEPTION);
5101 TEST_fff_f (fma, max_value, max_value, -min_value, max_value, OVERFLOW_EXCEPTION);
5102 TEST_fff_f (fma, max_value, -max_value, min_value, -max_value, OVERFLOW_EXCEPTION);
5103 TEST_fff_f (fma, max_value, -max_value, -min_value, -max_value, OVERFLOW_EXCEPTION);
5104 TEST_fff_f (fma, -max_value, max_value, min_value, -max_value, OVERFLOW_EXCEPTION);
5105 TEST_fff_f (fma, -max_value, max_value, -min_value, -max_value, OVERFLOW_EXCEPTION);
5106 TEST_fff_f (fma, -max_value, -max_value, min_value, max_value, OVERFLOW_EXCEPTION);
5107 TEST_fff_f (fma, -max_value, -max_value, -min_value, max_value, OVERFLOW_EXCEPTION);
5110 #if defined (TEST_FLOAT) && FLT_MANT_DIG == 24
5111 TEST_fff_f (fma, 0x1.4p-126, 0x1.000004p-1, 0x1p-128, 0x1.c00004p-127, UNDERFLOW_EXCEPTION);
5112 TEST_fff_f (fma, -0x1.4p-126, 0x1.000004p-1, -0x1p-128, -0x1.c00004p-127, UNDERFLOW_EXCEPTION);
5113 TEST_fff_f (fma, 0x1.fffff8p-126, 0x1.000002p-1, 0x1p-149, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5114 TEST_fff_f (fma, -0x1.fffff8p-126, 0x1.000002p-1, -0x1p-149, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5115 TEST_fff_f (fma, 0x1p-149, 0x1p-1, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5116 TEST_fff_f (fma, -0x1p-149, 0x1p-1, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5117 TEST_fff_f (fma, 0x1p-149, 0x1.1p-1, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5118 TEST_fff_f (fma, -0x1p-149, 0x1.1p-1, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5119 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p127, 0x1p127);
5120 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p127, 0x0.ffffffp127);
5121 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p127, -0x0.ffffffp127);
5122 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p127, -0x1p127);
5123 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p-126, 0x1p-126);
5124 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5125 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5126 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p-126, -0x1p-126);
5127 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5128 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x0.fffffep-126, 0x0.fffffcp-126, UNDERFLOW_EXCEPTION);
5129 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x0.fffffep-126, -0x0.fffffcp-126, UNDERFLOW_EXCEPTION);
5130 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5131 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p-149, 0x1p-149, UNDERFLOW_EXCEPTION);
5132 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p-149, plus_zero, UNDERFLOW_EXCEPTION);
5133 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p-149, minus_zero, UNDERFLOW_EXCEPTION);
5134 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p-149, -0x1p-149, UNDERFLOW_EXCEPTION);
5135 TEST_fff_f (fma, 0x0.fffp0, 0x0.fffp0, -0x0.ffep0, 0x1p-24);
5136 TEST_fff_f (fma, 0x0.fffp0, -0x0.fffp0, 0x0.ffep0, -0x1p-24);
5137 TEST_fff_f (fma, -0x0.fffp0, 0x0.fffp0, 0x0.ffep0, -0x1p-24);
5138 TEST_fff_f (fma, -0x0.fffp0, -0x0.fffp0, -0x0.ffep0, 0x1p-24);
5139 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, 0x1p127, 0x1p127);
5140 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, 0x1p127, 0x0.ffffffp127);
5141 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, -0x1p127, -0x0.ffffffp127);
5142 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, -0x1p127, -0x1p127);
5143 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, 0x1p103, 0x1p103);
5144 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, 0x1p103, 0x0.ffffffp103);
5145 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, -0x1p103, -0x0.ffffffp103);
5146 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, -0x1p103, -0x1p103);
5148 #if defined (TEST_DOUBLE) && DBL_MANT_DIG == 53
5149 TEST_fff_f (fma, 0x1.4p-1022, 0x1.0000000000002p-1, 0x1p-1024, 0x1.c000000000002p-1023, UNDERFLOW_EXCEPTION);
5150 TEST_fff_f (fma, -0x1.4p-1022, 0x1.0000000000002p-1, -0x1p-1024, -0x1.c000000000002p-1023, UNDERFLOW_EXCEPTION);
5151 TEST_fff_f (fma, 0x1.ffffffffffffcp-1022, 0x1.0000000000001p-1, 0x1p-1074, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5152 TEST_fff_f (fma, -0x1.ffffffffffffcp-1022, 0x1.0000000000001p-1, -0x1p-1074, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5153 TEST_fff_f (fma, 0x1p-1074, 0x1p-1, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5154 TEST_fff_f (fma, -0x1p-1074, 0x1p-1, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5155 TEST_fff_f (fma, 0x1p-1074, 0x1.1p-1, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5156 TEST_fff_f (fma, -0x1p-1074, 0x1.1p-1, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5157 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p1023, 0x1p1023);
5158 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p1023, 0x0.fffffffffffff8p1023);
5159 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p1023, -0x0.fffffffffffff8p1023);
5160 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p1023, -0x1p1023);
5161 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p-1022, 0x1p-1022);
5162 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5163 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5164 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p-1022, -0x1p-1022);
5165 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5166 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x0.fffffffffffffp-1022, 0x0.ffffffffffffep-1022, UNDERFLOW_EXCEPTION);
5167 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x0.fffffffffffffp-1022, -0x0.ffffffffffffep-1022, UNDERFLOW_EXCEPTION);
5168 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5169 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p-1074, 0x1p-1074, UNDERFLOW_EXCEPTION);
5170 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p-1074, plus_zero, UNDERFLOW_EXCEPTION);
5171 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p-1074, minus_zero, UNDERFLOW_EXCEPTION);
5172 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p-1074, -0x1p-1074, UNDERFLOW_EXCEPTION);
5173 TEST_fff_f (fma, 0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0, -0x0.fffffffffffffp0, 0x1p-106);
5174 TEST_fff_f (fma, 0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0, 0x0.fffffffffffffp0, -0x1p-106);
5175 TEST_fff_f (fma, -0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0, 0x0.fffffffffffffp0, -0x1p-106);
5176 TEST_fff_f (fma, -0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0, -0x0.fffffffffffffp0, 0x1p-106);
5177 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, 0x1p1023, 0x1p1023);
5178 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, 0x1p1023, 0x0.fffffffffffff8p1023);
5179 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, -0x1p1023, -0x0.fffffffffffff8p1023);
5180 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, -0x1p1023, -0x1p1023);
5181 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, 0x1p970, 0x1p970);
5182 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, 0x1p970, 0x0.fffffffffffff8p970);
5183 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, -0x1p970, -0x0.fffffffffffff8p970);
5184 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, -0x1p970, -0x1p970);
5186 #if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 64
5187 TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000004p-1L, 0x1p-16384L, 0x1.c000000000000004p-16383L, UNDERFLOW_EXCEPTION);
5188 TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000004p-1L, -0x1p-16384L, -0x1.c000000000000004p-16383L, UNDERFLOW_EXCEPTION);
5189 TEST_fff_f (fma, 0x1.fffffffffffffff8p-16382L, 0x1.0000000000000002p-1L, 0x1p-16445L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5190 TEST_fff_f (fma, -0x1.fffffffffffffff8p-16382L, 0x1.0000000000000002p-1L, -0x1p-16445L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5191 TEST_fff_f (fma, 0x1p-16445L, 0x1p-1L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5192 TEST_fff_f (fma, -0x1p-16445L, 0x1p-1L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5193 TEST_fff_f (fma, 0x1p-16445L, 0x1.1p-1L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5194 TEST_fff_f (fma, -0x1p-16445L, 0x1.1p-1L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5195 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p16383L, 0x1p16383L);
5196 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p16383L, 0x0.ffffffffffffffffp16383L);
5197 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p16383L, -0x0.ffffffffffffffffp16383L);
5198 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p16383L, -0x1p16383L);
5199 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p-16382L, 0x1p-16382L);
5200 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5201 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5202 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p-16382L, -0x1p-16382L);
5203 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5204 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffcp-16382L, UNDERFLOW_EXCEPTION);
5205 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffcp-16382L, UNDERFLOW_EXCEPTION);
5206 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5207 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p-16445L, 0x1p-16445L, UNDERFLOW_EXCEPTION);
5208 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p-16445L, plus_zero, UNDERFLOW_EXCEPTION);
5209 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p-16445L, minus_zero, UNDERFLOW_EXCEPTION);
5210 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p-16445L, -0x1p-16445L, UNDERFLOW_EXCEPTION);
5211 TEST_fff_f (fma, 0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp0L, -0x0.fffffffffffffffep0L, 0x1p-128L);
5212 TEST_fff_f (fma, 0x0.ffffffffffffffffp0L, -0x0.ffffffffffffffffp0L, 0x0.fffffffffffffffep0L, -0x1p-128L);
5213 TEST_fff_f (fma, -0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp0L, 0x0.fffffffffffffffep0L, -0x1p-128L);
5214 TEST_fff_f (fma, -0x0.ffffffffffffffffp0L, -0x0.ffffffffffffffffp0L, -0x0.fffffffffffffffep0L, 0x1p-128L);
5215 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, 0x1p16383L, 0x1p16383L);
5216 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, 0x1p16383L, 0x0.ffffffffffffffffp16383L);
5217 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, -0x1p16383L, -0x0.ffffffffffffffffp16383L);
5218 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, -0x1p16383L, -0x1p16383L);
5219 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, 0x1p16319L, 0x1p16319L);
5220 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, 0x1p16319L, 0x0.ffffffffffffffffp16319L);
5221 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, -0x1p16319L, -0x0.ffffffffffffffffp16319L);
5222 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, -0x1p16319L, -0x1p16319L);
5224 #if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 113
5225 TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, 0x1p-16384L, 0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION);
5226 TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, -0x1p-16384L, -0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION);
5227 TEST_fff_f (fma, 0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, 0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5228 TEST_fff_f (fma, -0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, -0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5229 TEST_fff_f (fma, 0x1p-16494L, 0x1p-1L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5230 TEST_fff_f (fma, -0x1p-16494L, 0x1p-1L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5231 TEST_fff_f (fma, 0x1p-16494L, 0x1.1p-1L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5232 TEST_fff_f (fma, -0x1p-16494L, 0x1.1p-1L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5233 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p16383L, 0x1p16383L);
5234 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p16383L, 0x0.ffffffffffffffffffffffffffff8p16383L);
5235 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p16383L, -0x0.ffffffffffffffffffffffffffff8p16383L);
5236 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p16383L, -0x1p16383L);
5237 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p-16382L, 0x1p-16382L);
5238 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5239 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5240 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p-16382L, -0x1p-16382L);
5241 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5242 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.fffffffffffffffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5243 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.fffffffffffffffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5244 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5245 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p-16494L, 0x1p-16494L, UNDERFLOW_EXCEPTION);
5246 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p-16494L, plus_zero, UNDERFLOW_EXCEPTION);
5247 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p-16494L, minus_zero, UNDERFLOW_EXCEPTION);
5248 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p-16494L, -0x1p-16494L, UNDERFLOW_EXCEPTION);
5249 TEST_fff_f (fma, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffffp0L, 0x1p-226L);
5250 TEST_fff_f (fma, 0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffffp0L, -0x1p-226L);
5251 TEST_fff_f (fma, -0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffffp0L, -0x1p-226L);
5252 TEST_fff_f (fma, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffffp0L, 0x1p-226L);
5253 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, 0x1p16383L, 0x1p16383L);
5254 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, 0x1p16383L, 0x0.ffffffffffffffffffffffffffff8p16383L);
5255 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, -0x1p16383L, -0x0.ffffffffffffffffffffffffffff8p16383L);
5256 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, -0x1p16383L, -0x1p16383L);
5257 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, 0x1p16319L, 0x1p16319L);
5258 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, 0x1p16319L, 0x0.ffffffffffffffffffffffffffff8p16319L);
5259 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, -0x1p16319L, -0x0.ffffffffffffffffffffffffffff8p16319L);
5260 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, -0x1p16319L, -0x1p16319L);
5264 fesetround (save_round_mode);
5266 END (fma_towardzero);
5271 fma_test_downward (void)
5273 int save_round_mode;
5274 START (fma_downward);
5276 save_round_mode = fegetround ();
5278 if (!fesetround (FE_DOWNWARD))
5280 TEST_fff_f (fma, plus_zero, plus_zero, plus_zero, plus_zero);
5281 TEST_fff_f (fma, plus_zero, plus_zero, minus_zero, minus_zero);
5282 TEST_fff_f (fma, plus_zero, minus_zero, plus_zero, minus_zero);
5283 TEST_fff_f (fma, plus_zero, minus_zero, minus_zero, minus_zero);
5284 TEST_fff_f (fma, minus_zero, plus_zero, plus_zero, minus_zero);
5285 TEST_fff_f (fma, minus_zero, plus_zero, minus_zero, minus_zero);
5286 TEST_fff_f (fma, minus_zero, minus_zero, plus_zero, plus_zero);
5287 TEST_fff_f (fma, minus_zero, minus_zero, minus_zero, minus_zero);
5288 TEST_fff_f (fma, 1.0, plus_zero, plus_zero, plus_zero);
5289 TEST_fff_f (fma, 1.0, plus_zero, minus_zero, minus_zero);
5290 TEST_fff_f (fma, 1.0, minus_zero, plus_zero, minus_zero);
5291 TEST_fff_f (fma, 1.0, minus_zero, minus_zero, minus_zero);
5292 TEST_fff_f (fma, -1.0, plus_zero, plus_zero, minus_zero);
5293 TEST_fff_f (fma, -1.0, plus_zero, minus_zero, minus_zero);
5294 TEST_fff_f (fma, -1.0, minus_zero, plus_zero, plus_zero);
5295 TEST_fff_f (fma, -1.0, minus_zero, minus_zero, minus_zero);
5296 TEST_fff_f (fma, plus_zero, 1.0, plus_zero, plus_zero);
5297 TEST_fff_f (fma, plus_zero, 1.0, minus_zero, minus_zero);
5298 TEST_fff_f (fma, plus_zero, -1.0, plus_zero, minus_zero);
5299 TEST_fff_f (fma, plus_zero, -1.0, minus_zero, minus_zero);
5300 TEST_fff_f (fma, minus_zero, 1.0, plus_zero, minus_zero);
5301 TEST_fff_f (fma, minus_zero, 1.0, minus_zero, minus_zero);
5302 TEST_fff_f (fma, minus_zero, -1.0, plus_zero, plus_zero);
5303 TEST_fff_f (fma, minus_zero, -1.0, minus_zero, minus_zero);
5305 TEST_fff_f (fma, 1.0, 1.0, -1.0, minus_zero);
5306 TEST_fff_f (fma, 1.0, -1.0, 1.0, minus_zero);
5307 TEST_fff_f (fma, -1.0, 1.0, 1.0, minus_zero);
5308 TEST_fff_f (fma, -1.0, -1.0, -1.0, minus_zero);
5310 TEST_fff_f (fma, min_value, min_value, plus_zero, plus_zero, UNDERFLOW_EXCEPTION);
5311 TEST_fff_f (fma, min_value, min_value, minus_zero, plus_zero, UNDERFLOW_EXCEPTION);
5312 TEST_fff_f (fma, min_value, -min_value, plus_zero, -min_subnorm_value, UNDERFLOW_EXCEPTION);
5313 TEST_fff_f (fma, min_value, -min_value, minus_zero, -min_subnorm_value, UNDERFLOW_EXCEPTION);
5314 TEST_fff_f (fma, -min_value, min_value, plus_zero, -min_subnorm_value, UNDERFLOW_EXCEPTION);
5315 TEST_fff_f (fma, -min_value, min_value, minus_zero, -min_subnorm_value, UNDERFLOW_EXCEPTION);
5316 TEST_fff_f (fma, -min_value, -min_value, plus_zero, plus_zero, UNDERFLOW_EXCEPTION);
5317 TEST_fff_f (fma, -min_value, -min_value, minus_zero, plus_zero, UNDERFLOW_EXCEPTION);
5319 #if !(defined TEST_LDOUBLE && LDBL_MANT_DIG == 106) /* Bug 13304. */
5320 TEST_fff_f (fma, max_value, max_value, min_value, max_value, OVERFLOW_EXCEPTION);
5321 TEST_fff_f (fma, max_value, max_value, -min_value, max_value, OVERFLOW_EXCEPTION);
5322 TEST_fff_f (fma, max_value, -max_value, min_value, minus_infty, OVERFLOW_EXCEPTION);
5323 TEST_fff_f (fma, max_value, -max_value, -min_value, minus_infty, OVERFLOW_EXCEPTION);
5324 TEST_fff_f (fma, -max_value, max_value, min_value, minus_infty, OVERFLOW_EXCEPTION);
5325 TEST_fff_f (fma, -max_value, max_value, -min_value, minus_infty, OVERFLOW_EXCEPTION);
5326 TEST_fff_f (fma, -max_value, -max_value, min_value, max_value, OVERFLOW_EXCEPTION);
5327 TEST_fff_f (fma, -max_value, -max_value, -min_value, max_value, OVERFLOW_EXCEPTION);
5330 #if defined (TEST_FLOAT) && FLT_MANT_DIG == 24
5331 TEST_fff_f (fma, 0x1.4p-126, 0x1.000004p-1, 0x1p-128, 0x1.c00004p-127, UNDERFLOW_EXCEPTION);
5332 TEST_fff_f (fma, -0x1.4p-126, 0x1.000004p-1, -0x1p-128, -0x1.c00008p-127, UNDERFLOW_EXCEPTION);
5333 TEST_fff_f (fma, 0x1.fffff8p-126, 0x1.000002p-1, 0x1p-149, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5334 TEST_fff_f (fma, -0x1.fffff8p-126, 0x1.000002p-1, -0x1p-149, -0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5335 TEST_fff_f (fma, 0x1p-149, 0x1p-1, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5336 TEST_fff_f (fma, -0x1p-149, 0x1p-1, -0x0.fffffep-126, -0x1p-126, UNDERFLOW_EXCEPTION);
5337 TEST_fff_f (fma, 0x1p-149, 0x1.1p-1, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5338 TEST_fff_f (fma, -0x1p-149, 0x1.1p-1, -0x0.fffffep-126, -0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5339 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p127, 0x1p127);
5340 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p127, 0x0.ffffffp127);
5341 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p127, -0x1p127);
5342 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p127, -0x1.000002p127);
5343 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p-126, 0x1p-126);
5344 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5345 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p-126, -0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5346 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p-126, -0x1.000002p-126);
5347 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5348 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x0.fffffep-126, 0x0.fffffcp-126, UNDERFLOW_EXCEPTION);
5349 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5350 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x0.fffffep-126, -0x1p-126, UNDERFLOW_EXCEPTION);
5351 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p-149, 0x1p-149, UNDERFLOW_EXCEPTION);
5352 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p-149, plus_zero, UNDERFLOW_EXCEPTION);
5353 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p-149, -0x1p-149, UNDERFLOW_EXCEPTION);
5354 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p-149, -0x1p-148, UNDERFLOW_EXCEPTION);
5355 TEST_fff_f (fma, 0x0.fffp0, 0x0.fffp0, -0x0.ffep0, 0x1p-24);
5356 TEST_fff_f (fma, 0x0.fffp0, -0x0.fffp0, 0x0.ffep0, -0x1p-24);
5357 TEST_fff_f (fma, -0x0.fffp0, 0x0.fffp0, 0x0.ffep0, -0x1p-24);
5358 TEST_fff_f (fma, -0x0.fffp0, -0x0.fffp0, -0x0.ffep0, 0x1p-24);
5359 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, 0x1p127, 0x1p127);
5360 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, 0x1p127, 0x0.ffffffp127);
5361 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, -0x1p127, -0x1p127);
5362 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, -0x1p127, -0x1.000002p127);
5363 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, 0x1p103, 0x1p103);
5364 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, 0x1p103, 0x0.ffffffp103);
5365 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, -0x1p103, -0x1p103);
5366 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, -0x1p103, -0x1.000002p103);
5368 #if defined (TEST_DOUBLE) && DBL_MANT_DIG == 53
5369 TEST_fff_f (fma, 0x1.4p-1022, 0x1.0000000000002p-1, 0x1p-1024, 0x1.c000000000002p-1023, UNDERFLOW_EXCEPTION);
5370 TEST_fff_f (fma, -0x1.4p-1022, 0x1.0000000000002p-1, -0x1p-1024, -0x1.c000000000004p-1023, UNDERFLOW_EXCEPTION);
5371 TEST_fff_f (fma, 0x1.ffffffffffffcp-1022, 0x1.0000000000001p-1, 0x1p-1074, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5372 TEST_fff_f (fma, -0x1.ffffffffffffcp-1022, 0x1.0000000000001p-1, -0x1p-1074, -0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5373 TEST_fff_f (fma, 0x1p-1074, 0x1p-1, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5374 TEST_fff_f (fma, -0x1p-1074, 0x1p-1, -0x0.fffffffffffffp-1022, -0x1p-1022, UNDERFLOW_EXCEPTION);
5375 TEST_fff_f (fma, 0x1p-1074, 0x1.1p-1, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5376 TEST_fff_f (fma, -0x1p-1074, 0x1.1p-1, -0x0.fffffffffffffp-1022, -0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5377 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p1023, 0x1p1023);
5378 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p1023, 0x0.fffffffffffff8p1023);
5379 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p1023, -0x1p1023);
5380 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p1023, -0x1.0000000000001p1023);
5381 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p-1022, 0x1p-1022);
5382 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5383 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p-1022, -0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5384 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p-1022, -0x1.0000000000001p-1022);
5385 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5386 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x0.fffffffffffffp-1022, 0x0.ffffffffffffep-1022, UNDERFLOW_EXCEPTION);
5387 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5388 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x0.fffffffffffffp-1022, -0x1p-1022, UNDERFLOW_EXCEPTION);
5389 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p-1074, 0x1p-1074, UNDERFLOW_EXCEPTION);
5390 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p-1074, plus_zero, UNDERFLOW_EXCEPTION);
5391 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p-1074, -0x1p-1074, UNDERFLOW_EXCEPTION);
5392 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p-1074, -0x1p-1073, UNDERFLOW_EXCEPTION);
5393 TEST_fff_f (fma, 0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0, -0x0.fffffffffffffp0, 0x1p-106);
5394 TEST_fff_f (fma, 0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0, 0x0.fffffffffffffp0, -0x1p-106);
5395 TEST_fff_f (fma, -0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0, 0x0.fffffffffffffp0, -0x1p-106);
5396 TEST_fff_f (fma, -0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0, -0x0.fffffffffffffp0, 0x1p-106);
5397 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, 0x1p1023, 0x1p1023);
5398 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, 0x1p1023, 0x0.fffffffffffff8p1023);
5399 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, -0x1p1023, -0x1p1023);
5400 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, -0x1p1023, -0x1.0000000000001p1023);
5401 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, 0x1p970, 0x1p970);
5402 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, 0x1p970, 0x0.fffffffffffff8p970);
5403 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, -0x1p970, -0x1p970);
5404 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, -0x1p970, -0x1.0000000000001p970);
5406 #if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 64
5407 TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000004p-1L, 0x1p-16384L, 0x1.c000000000000004p-16383L, UNDERFLOW_EXCEPTION);
5408 TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000004p-1L, -0x1p-16384L, -0x1.c000000000000008p-16383L, UNDERFLOW_EXCEPTION);
5409 TEST_fff_f (fma, 0x1.fffffffffffffff8p-16382L, 0x1.0000000000000002p-1L, 0x1p-16445L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5410 TEST_fff_f (fma, -0x1.fffffffffffffff8p-16382L, 0x1.0000000000000002p-1L, -0x1p-16445L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5411 TEST_fff_f (fma, 0x1p-16445L, 0x1p-1L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5412 TEST_fff_f (fma, -0x1p-16445L, 0x1p-1L, -0x0.fffffffffffffffep-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION);
5413 TEST_fff_f (fma, 0x1p-16445L, 0x1.1p-1L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5414 TEST_fff_f (fma, -0x1p-16445L, 0x1.1p-1L, -0x0.fffffffffffffffep-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5415 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p16383L, 0x1p16383L);
5416 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p16383L, 0x0.ffffffffffffffffp16383L);
5417 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p16383L, -0x1p16383L);
5418 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p16383L, -0x1.0000000000000002p16383L);
5419 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p-16382L, 0x1p-16382L);
5420 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5421 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5422 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p-16382L, -0x1.0000000000000002p-16382L);
5423 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5424 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffcp-16382L, UNDERFLOW_EXCEPTION);
5425 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5426 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x0.fffffffffffffffep-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION);
5427 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p-16445L, 0x1p-16445L, UNDERFLOW_EXCEPTION);
5428 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p-16445L, plus_zero, UNDERFLOW_EXCEPTION);
5429 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p-16445L, -0x1p-16445L, UNDERFLOW_EXCEPTION);
5430 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p-16445L, -0x1p-16444L, UNDERFLOW_EXCEPTION);
5431 TEST_fff_f (fma, 0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp0L, -0x0.fffffffffffffffep0L, 0x1p-128L);
5432 TEST_fff_f (fma, 0x0.ffffffffffffffffp0L, -0x0.ffffffffffffffffp0L, 0x0.fffffffffffffffep0L, -0x1p-128L);
5433 TEST_fff_f (fma, -0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp0L, 0x0.fffffffffffffffep0L, -0x1p-128L);
5434 TEST_fff_f (fma, -0x0.ffffffffffffffffp0L, -0x0.ffffffffffffffffp0L, -0x0.fffffffffffffffep0L, 0x1p-128L);
5435 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, 0x1p16383L, 0x1p16383L);
5436 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, 0x1p16383L, 0x0.ffffffffffffffffp16383L);
5437 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, -0x1p16383L, -0x1p16383L);
5438 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, -0x1p16383L, -0x1.0000000000000002p16383L);
5439 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, 0x1p16319L, 0x1p16319L);
5440 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, 0x1p16319L, 0x0.ffffffffffffffffp16319L);
5441 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, -0x1p16319L, -0x1p16319L);
5442 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, -0x1p16319L, -0x1.0000000000000002p16319L);
5444 #if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 113
5445 TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, 0x1p-16384L, 0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION);
5446 TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, -0x1p-16384L, -0x1.c000000000000000000000000004p-16383L, UNDERFLOW_EXCEPTION);
5447 TEST_fff_f (fma, 0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, 0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5448 TEST_fff_f (fma, -0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, -0x1p-16494L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5449 TEST_fff_f (fma, 0x1p-16494L, 0x1p-1L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5450 TEST_fff_f (fma, -0x1p-16494L, 0x1p-1L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION);
5451 TEST_fff_f (fma, 0x1p-16494L, 0x1.1p-1L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5452 TEST_fff_f (fma, -0x1p-16494L, 0x1.1p-1L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5453 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p16383L, 0x1p16383L);
5454 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p16383L, 0x0.ffffffffffffffffffffffffffff8p16383L);
5455 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p16383L, -0x1p16383L);
5456 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p16383L, -0x1.0000000000000000000000000001p16383L);
5457 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p-16382L, 0x1p-16382L);
5458 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5459 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5460 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p-16382L, -0x1.0000000000000000000000000001p-16382L);
5461 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5462 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.fffffffffffffffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5463 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5464 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x1p-16382L, UNDERFLOW_EXCEPTION);
5465 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p-16494L, 0x1p-16494L, UNDERFLOW_EXCEPTION);
5466 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p-16494L, plus_zero, UNDERFLOW_EXCEPTION);
5467 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p-16494L, -0x1p-16494L, UNDERFLOW_EXCEPTION);
5468 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p-16494L, -0x1p-16493L, UNDERFLOW_EXCEPTION);
5469 TEST_fff_f (fma, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffffp0L, 0x1p-226L);
5470 TEST_fff_f (fma, 0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffffp0L, -0x1p-226L);
5471 TEST_fff_f (fma, -0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffffp0L, -0x1p-226L);
5472 TEST_fff_f (fma, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffffp0L, 0x1p-226L);
5473 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, 0x1p16383L, 0x1p16383L);
5474 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, 0x1p16383L, 0x0.ffffffffffffffffffffffffffff8p16383L);
5475 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, -0x1p16383L, -0x1p16383L);
5476 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, -0x1p16383L, -0x1.0000000000000000000000000001p16383L);
5477 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, 0x1p16319L, 0x1p16319L);
5478 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, 0x1p16319L, 0x0.ffffffffffffffffffffffffffff8p16319L);
5479 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, -0x1p16319L, -0x1p16319L);
5480 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, -0x1p16319L, -0x1.0000000000000000000000000001p16319L);
5484 fesetround (save_round_mode);
5491 fma_test_upward (void)
5493 int save_round_mode;
5496 save_round_mode = fegetround ();
5498 if (!fesetround (FE_UPWARD))
5500 TEST_fff_f (fma, plus_zero, plus_zero, plus_zero, plus_zero);
5501 TEST_fff_f (fma, plus_zero, plus_zero, minus_zero, plus_zero);
5502 TEST_fff_f (fma, plus_zero, minus_zero, plus_zero, plus_zero);
5503 TEST_fff_f (fma, plus_zero, minus_zero, minus_zero, minus_zero);
5504 TEST_fff_f (fma, minus_zero, plus_zero, plus_zero, plus_zero);
5505 TEST_fff_f (fma, minus_zero, plus_zero, minus_zero, minus_zero);
5506 TEST_fff_f (fma, minus_zero, minus_zero, plus_zero, plus_zero);
5507 TEST_fff_f (fma, minus_zero, minus_zero, minus_zero, plus_zero);
5508 TEST_fff_f (fma, 1.0, plus_zero, plus_zero, plus_zero);
5509 TEST_fff_f (fma, 1.0, plus_zero, minus_zero, plus_zero);
5510 TEST_fff_f (fma, 1.0, minus_zero, plus_zero, plus_zero);
5511 TEST_fff_f (fma, 1.0, minus_zero, minus_zero, minus_zero);
5512 TEST_fff_f (fma, -1.0, plus_zero, plus_zero, plus_zero);
5513 TEST_fff_f (fma, -1.0, plus_zero, minus_zero, minus_zero);
5514 TEST_fff_f (fma, -1.0, minus_zero, plus_zero, plus_zero);
5515 TEST_fff_f (fma, -1.0, minus_zero, minus_zero, plus_zero);
5516 TEST_fff_f (fma, plus_zero, 1.0, plus_zero, plus_zero);
5517 TEST_fff_f (fma, plus_zero, 1.0, minus_zero, plus_zero);
5518 TEST_fff_f (fma, plus_zero, -1.0, plus_zero, plus_zero);
5519 TEST_fff_f (fma, plus_zero, -1.0, minus_zero, minus_zero);
5520 TEST_fff_f (fma, minus_zero, 1.0, plus_zero, plus_zero);
5521 TEST_fff_f (fma, minus_zero, 1.0, minus_zero, minus_zero);
5522 TEST_fff_f (fma, minus_zero, -1.0, plus_zero, plus_zero);
5523 TEST_fff_f (fma, minus_zero, -1.0, minus_zero, plus_zero);
5525 TEST_fff_f (fma, 1.0, 1.0, -1.0, plus_zero);
5526 TEST_fff_f (fma, 1.0, -1.0, 1.0, plus_zero);
5527 TEST_fff_f (fma, -1.0, 1.0, 1.0, plus_zero);
5528 TEST_fff_f (fma, -1.0, -1.0, -1.0, plus_zero);
5530 TEST_fff_f (fma, min_value, min_value, plus_zero, min_subnorm_value, UNDERFLOW_EXCEPTION);
5531 TEST_fff_f (fma, min_value, min_value, minus_zero, min_subnorm_value, UNDERFLOW_EXCEPTION);
5532 TEST_fff_f (fma, min_value, -min_value, plus_zero, minus_zero, UNDERFLOW_EXCEPTION);
5533 TEST_fff_f (fma, min_value, -min_value, minus_zero, minus_zero, UNDERFLOW_EXCEPTION);
5534 TEST_fff_f (fma, -min_value, min_value, plus_zero, minus_zero, UNDERFLOW_EXCEPTION);
5535 TEST_fff_f (fma, -min_value, min_value, minus_zero, minus_zero, UNDERFLOW_EXCEPTION);
5536 TEST_fff_f (fma, -min_value, -min_value, plus_zero, min_subnorm_value, UNDERFLOW_EXCEPTION);
5537 TEST_fff_f (fma, -min_value, -min_value, minus_zero, min_subnorm_value, UNDERFLOW_EXCEPTION);
5539 #if !(defined TEST_LDOUBLE && LDBL_MANT_DIG == 106) /* Bug 13304. */
5540 TEST_fff_f (fma, max_value, max_value, min_value, plus_infty, OVERFLOW_EXCEPTION);
5541 TEST_fff_f (fma, max_value, max_value, -min_value, plus_infty, OVERFLOW_EXCEPTION);
5542 TEST_fff_f (fma, max_value, -max_value, min_value, -max_value, OVERFLOW_EXCEPTION);
5543 TEST_fff_f (fma, max_value, -max_value, -min_value, -max_value, OVERFLOW_EXCEPTION);
5544 TEST_fff_f (fma, -max_value, max_value, min_value, -max_value, OVERFLOW_EXCEPTION);
5545 TEST_fff_f (fma, -max_value, max_value, -min_value, -max_value, OVERFLOW_EXCEPTION);
5546 TEST_fff_f (fma, -max_value, -max_value, min_value, plus_infty, OVERFLOW_EXCEPTION);
5547 TEST_fff_f (fma, -max_value, -max_value, -min_value, plus_infty, OVERFLOW_EXCEPTION);
5550 #if defined (TEST_FLOAT) && FLT_MANT_DIG == 24
5551 TEST_fff_f (fma, 0x1.4p-126, 0x1.000004p-1, 0x1p-128, 0x1.c00008p-127, UNDERFLOW_EXCEPTION);
5552 TEST_fff_f (fma, -0x1.4p-126, 0x1.000004p-1, -0x1p-128, -0x1.c00004p-127, UNDERFLOW_EXCEPTION);
5553 TEST_fff_f (fma, 0x1.fffff8p-126, 0x1.000002p-1, 0x1p-149, 0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5554 TEST_fff_f (fma, -0x1.fffff8p-126, 0x1.000002p-1, -0x1p-149, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5555 TEST_fff_f (fma, 0x1p-149, 0x1p-1, 0x0.fffffep-126, 0x1p-126, UNDERFLOW_EXCEPTION);
5556 TEST_fff_f (fma, -0x1p-149, 0x1p-1, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5557 TEST_fff_f (fma, 0x1p-149, 0x1.1p-1, 0x0.fffffep-126, 0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5558 TEST_fff_f (fma, -0x1p-149, 0x1.1p-1, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5559 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p127, 0x1.000002p127);
5560 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p127, 0x1p127);
5561 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p127, -0x0.ffffffp127);
5562 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p127, -0x1p127);
5563 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p-126, 0x1.000002p-126);
5564 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p-126, 0x1p-126, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5565 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5566 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p-126, -0x1p-126);
5567 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x0.fffffep-126, 0x1p-126, UNDERFLOW_EXCEPTION);
5568 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x0.fffffep-126, 0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5569 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x0.fffffep-126, -0x0.fffffcp-126, UNDERFLOW_EXCEPTION);
5570 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x0.fffffep-126, -0x0.fffffep-126, UNDERFLOW_EXCEPTION);
5571 TEST_fff_f (fma, 0x1p-149, 0x1p-149, 0x1p-149, 0x1p-148, UNDERFLOW_EXCEPTION);
5572 TEST_fff_f (fma, 0x1p-149, -0x1p-149, 0x1p-149, 0x1p-149, UNDERFLOW_EXCEPTION);
5573 TEST_fff_f (fma, 0x1p-149, 0x1p-149, -0x1p-149, minus_zero, UNDERFLOW_EXCEPTION);
5574 TEST_fff_f (fma, 0x1p-149, -0x1p-149, -0x1p-149, -0x1p-149, UNDERFLOW_EXCEPTION);
5575 TEST_fff_f (fma, 0x0.fffp0, 0x0.fffp0, -0x0.ffep0, 0x1p-24);
5576 TEST_fff_f (fma, 0x0.fffp0, -0x0.fffp0, 0x0.ffep0, -0x1p-24);
5577 TEST_fff_f (fma, -0x0.fffp0, 0x0.fffp0, 0x0.ffep0, -0x1p-24);
5578 TEST_fff_f (fma, -0x0.fffp0, -0x0.fffp0, -0x0.ffep0, 0x1p-24);
5579 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, 0x1p127, 0x1.000002p127);
5580 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, 0x1p127, 0x1p127);
5581 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, -0x1p127, -0x0.ffffffp127);
5582 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, -0x1p127, -0x1p127);
5583 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, 0x1p103, 0x1.000002p103);
5584 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, 0x1p103, 0x1p103);
5585 TEST_fff_f (fma, 0x1.000002p-126, 0x1.000002p-26, -0x1p103, -0x0.ffffffp103);
5586 TEST_fff_f (fma, 0x1.000002p-126, -0x1.000002p-26, -0x1p103, -0x1p103);
5588 #if defined (TEST_DOUBLE) && DBL_MANT_DIG == 53
5589 TEST_fff_f (fma, 0x1.4p-1022, 0x1.0000000000002p-1, 0x1p-1024, 0x1.c000000000004p-1023, UNDERFLOW_EXCEPTION);
5590 TEST_fff_f (fma, -0x1.4p-1022, 0x1.0000000000002p-1, -0x1p-1024, -0x1.c000000000002p-1023, UNDERFLOW_EXCEPTION);
5591 TEST_fff_f (fma, 0x1.ffffffffffffcp-1022, 0x1.0000000000001p-1, 0x1p-1074, 0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5592 TEST_fff_f (fma, -0x1.ffffffffffffcp-1022, 0x1.0000000000001p-1, -0x1p-1074, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5593 TEST_fff_f (fma, 0x1p-1074, 0x1p-1, 0x0.fffffffffffffp-1022, 0x1p-1022, UNDERFLOW_EXCEPTION);
5594 TEST_fff_f (fma, -0x1p-1074, 0x1p-1, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5595 TEST_fff_f (fma, 0x1p-1074, 0x1.1p-1, 0x0.fffffffffffffp-1022, 0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5596 TEST_fff_f (fma, -0x1p-1074, 0x1.1p-1, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5597 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p1023, 0x1.0000000000001p1023);
5598 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p1023, 0x1p1023);
5599 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p1023, -0x0.fffffffffffff8p1023);
5600 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p1023, -0x1p1023);
5601 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p-1022, 0x1.0000000000001p-1022);
5602 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p-1022, 0x1p-1022, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5603 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5604 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p-1022, -0x1p-1022);
5605 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x0.fffffffffffffp-1022, 0x1p-1022, UNDERFLOW_EXCEPTION);
5606 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5607 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x0.fffffffffffffp-1022, -0x0.ffffffffffffep-1022, UNDERFLOW_EXCEPTION);
5608 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, UNDERFLOW_EXCEPTION);
5609 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, 0x1p-1074, 0x1p-1073, UNDERFLOW_EXCEPTION);
5610 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, 0x1p-1074, 0x1p-1074, UNDERFLOW_EXCEPTION);
5611 TEST_fff_f (fma, 0x1p-1074, 0x1p-1074, -0x1p-1074, minus_zero, UNDERFLOW_EXCEPTION);
5612 TEST_fff_f (fma, 0x1p-1074, -0x1p-1074, -0x1p-1074, -0x1p-1074, UNDERFLOW_EXCEPTION);
5613 TEST_fff_f (fma, 0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0, -0x0.fffffffffffffp0, 0x1p-106);
5614 TEST_fff_f (fma, 0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0, 0x0.fffffffffffffp0, -0x1p-106);
5615 TEST_fff_f (fma, -0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0, 0x0.fffffffffffffp0, -0x1p-106);
5616 TEST_fff_f (fma, -0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0, -0x0.fffffffffffffp0, 0x1p-106);
5617 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, 0x1p1023, 0x1.0000000000001p1023);
5618 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, 0x1p1023, 0x1p1023);
5619 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, -0x1p1023, -0x0.fffffffffffff8p1023);
5620 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, -0x1p1023, -0x1p1023);
5621 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, 0x1p970, 0x1.0000000000001p970);
5622 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, 0x1p970, 0x1p970);
5623 TEST_fff_f (fma, 0x1.0000000000001p-1022, 0x1.0000000000001p-55, -0x1p970, -0x0.fffffffffffff8p970);
5624 TEST_fff_f (fma, 0x1.0000000000001p-1022, -0x1.0000000000001p-55, -0x1p970, -0x1p970);
5626 #if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 64
5627 TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000004p-1L, 0x1p-16384L, 0x1.c000000000000008p-16383L, UNDERFLOW_EXCEPTION);
5628 TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000004p-1L, -0x1p-16384L, -0x1.c000000000000004p-16383L, UNDERFLOW_EXCEPTION);
5629 TEST_fff_f (fma, 0x1.fffffffffffffff8p-16382L, 0x1.0000000000000002p-1L, 0x1p-16445L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5630 TEST_fff_f (fma, -0x1.fffffffffffffff8p-16382L, 0x1.0000000000000002p-1L, -0x1p-16445L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5631 TEST_fff_f (fma, 0x1p-16445L, 0x1p-1L, 0x0.fffffffffffffffep-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION);
5632 TEST_fff_f (fma, -0x1p-16445L, 0x1p-1L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5633 TEST_fff_f (fma, 0x1p-16445L, 0x1.1p-1L, 0x0.fffffffffffffffep-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5634 TEST_fff_f (fma, -0x1p-16445L, 0x1.1p-1L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5635 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p16383L, 0x1.0000000000000002p16383L);
5636 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p16383L, 0x1p16383L);
5637 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p16383L, -0x0.ffffffffffffffffp16383L);
5638 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p16383L, -0x1p16383L);
5639 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p-16382L, 0x1.0000000000000002p-16382L);
5640 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5641 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5642 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p-16382L, -0x1p-16382L);
5643 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x0.fffffffffffffffep-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION);
5644 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x0.fffffffffffffffep-16382L, 0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5645 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffcp-16382L, UNDERFLOW_EXCEPTION);
5646 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x0.fffffffffffffffep-16382L, -0x0.fffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5647 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, 0x1p-16445L, 0x1p-16444L, UNDERFLOW_EXCEPTION);
5648 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, 0x1p-16445L, 0x1p-16445L, UNDERFLOW_EXCEPTION);
5649 TEST_fff_f (fma, 0x1p-16445L, 0x1p-16445L, -0x1p-16445L, minus_zero, UNDERFLOW_EXCEPTION);
5650 TEST_fff_f (fma, 0x1p-16445L, -0x1p-16445L, -0x1p-16445L, -0x1p-16445L, UNDERFLOW_EXCEPTION);
5651 TEST_fff_f (fma, 0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp0L, -0x0.fffffffffffffffep0L, 0x1p-128L);
5652 TEST_fff_f (fma, 0x0.ffffffffffffffffp0L, -0x0.ffffffffffffffffp0L, 0x0.fffffffffffffffep0L, -0x1p-128L);
5653 TEST_fff_f (fma, -0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp0L, 0x0.fffffffffffffffep0L, -0x1p-128L);
5654 TEST_fff_f (fma, -0x0.ffffffffffffffffp0L, -0x0.ffffffffffffffffp0L, -0x0.fffffffffffffffep0L, 0x1p-128L);
5655 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, 0x1p16383L, 0x1.0000000000000002p16383L);
5656 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, 0x1p16383L, 0x1p16383L);
5657 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, -0x1p16383L, -0x0.ffffffffffffffffp16383L);
5658 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, -0x1p16383L, -0x1p16383L);
5659 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, 0x1p16319L, 0x1.0000000000000002p16319L);
5660 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, 0x1p16319L, 0x1p16319L);
5661 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, 0x1.0000000000000002p-66L, -0x1p16319L, -0x0.ffffffffffffffffp16319L);
5662 TEST_fff_f (fma, 0x1.0000000000000002p-16382L, -0x1.0000000000000002p-66L, -0x1p16319L, -0x1p16319L);
5664 #if defined (TEST_LDOUBLE) && LDBL_MANT_DIG == 113
5665 TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, 0x1p-16384L, 0x1.c000000000000000000000000004p-16383L, UNDERFLOW_EXCEPTION);
5666 TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, -0x1p-16384L, -0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION);
5667 TEST_fff_f (fma, 0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, 0x1p-16494L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5668 TEST_fff_f (fma, -0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, -0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5669 TEST_fff_f (fma, 0x1p-16494L, 0x1p-1L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION);
5670 TEST_fff_f (fma, -0x1p-16494L, 0x1p-1L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5671 TEST_fff_f (fma, 0x1p-16494L, 0x1.1p-1L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5672 TEST_fff_f (fma, -0x1p-16494L, 0x1.1p-1L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5673 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p16383L, 0x1.0000000000000000000000000001p16383L);
5674 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p16383L, 0x1p16383L);
5675 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p16383L, -0x0.ffffffffffffffffffffffffffff8p16383L);
5676 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p16383L, -0x1p16383L);
5677 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p-16382L, 0x1.0000000000000000000000000001p-16382L);
5678 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING);
5679 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5680 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p-16382L, -0x1p-16382L);
5681 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x1p-16382L, UNDERFLOW_EXCEPTION);
5682 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x0.ffffffffffffffffffffffffffffp-16382L, 0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5683 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.fffffffffffffffffffffffffffep-16382L, UNDERFLOW_EXCEPTION);
5684 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x0.ffffffffffffffffffffffffffffp-16382L, -0x0.ffffffffffffffffffffffffffffp-16382L, UNDERFLOW_EXCEPTION);
5685 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, 0x1p-16494L, 0x1p-16493L, UNDERFLOW_EXCEPTION);
5686 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, 0x1p-16494L, 0x1p-16494L, UNDERFLOW_EXCEPTION);
5687 TEST_fff_f (fma, 0x1p-16494L, 0x1p-16494L, -0x1p-16494L, minus_zero, UNDERFLOW_EXCEPTION);
5688 TEST_fff_f (fma, 0x1p-16494L, -0x1p-16494L, -0x1p-16494L, -0x1p-16494L, UNDERFLOW_EXCEPTION);
5689 TEST_fff_f (fma, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffffp0L, 0x1p-226L);
5690 TEST_fff_f (fma, 0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffffp0L, -0x1p-226L);
5691 TEST_fff_f (fma, -0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffffffffffffffffffffffffp0L, -0x1p-226L);
5692 TEST_fff_f (fma, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffffffffffffffffffffffffp0L, 0x1p-226L);
5693 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, 0x1p16383L, 0x1.0000000000000000000000000001p16383L);
5694 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, 0x1p16383L, 0x1p16383L);
5695 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, -0x1p16383L, -0x0.ffffffffffffffffffffffffffff8p16383L);
5696 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, -0x1p16383L, -0x1p16383L);
5697 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, 0x1p16319L, 0x1.0000000000000000000000000001p16319L);
5698 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, 0x1p16319L, 0x1p16319L);
5699 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, 0x1.0000000000000000000000000001p-66L, -0x1p16319L, -0x0.ffffffffffffffffffffffffffff8p16319L);
5700 TEST_fff_f (fma, 0x1.0000000000000000000000000001p-16382L, -0x1.0000000000000000000000000001p-66L, -0x1p16319L, -0x1p16319L);
5704 fesetround (save_round_mode);
5715 TEST_ff_f (fmax, 0, 0, 0);
5716 TEST_ff_f (fmax, minus_zero, minus_zero, minus_zero);
5717 TEST_ff_f (fmax, 9, 0, 9);
5718 TEST_ff_f (fmax, 0, 9, 9);
5719 TEST_ff_f (fmax, -9, 0, 0);
5720 TEST_ff_f (fmax, 0, -9, 0);
5722 TEST_ff_f (fmax, plus_infty, 9, plus_infty);
5723 TEST_ff_f (fmax, 0, plus_infty, plus_infty);
5724 TEST_ff_f (fmax, -9, plus_infty, plus_infty);
5725 TEST_ff_f (fmax, plus_infty, -9, plus_infty);
5727 TEST_ff_f (fmax, minus_infty, 9, 9);
5728 TEST_ff_f (fmax, minus_infty, -9, -9);
5729 TEST_ff_f (fmax, 9, minus_infty, 9);
5730 TEST_ff_f (fmax, -9, minus_infty, -9);
5732 TEST_ff_f (fmax, 0, qnan_value, 0);
5733 TEST_ff_f (fmax, 9, qnan_value, 9);
5734 TEST_ff_f (fmax, -9, qnan_value, -9);
5735 TEST_ff_f (fmax, qnan_value, 0, 0);
5736 TEST_ff_f (fmax, qnan_value, 9, 9);
5737 TEST_ff_f (fmax, qnan_value, -9, -9);
5738 TEST_ff_f (fmax, plus_infty, qnan_value, plus_infty);
5739 TEST_ff_f (fmax, minus_infty, qnan_value, minus_infty);
5740 TEST_ff_f (fmax, qnan_value, plus_infty, plus_infty);
5741 TEST_ff_f (fmax, qnan_value, minus_infty, minus_infty);
5742 TEST_ff_f (fmax, qnan_value, qnan_value, qnan_value);
5753 TEST_ff_f (fmin, 0, 0, 0);
5754 TEST_ff_f (fmin, minus_zero, minus_zero, minus_zero);
5755 TEST_ff_f (fmin, 9, 0, 0);
5756 TEST_ff_f (fmin, 0, 9, 0);
5757 TEST_ff_f (fmin, -9, 0, -9);
5758 TEST_ff_f (fmin, 0, -9, -9);
5760 TEST_ff_f (fmin, plus_infty, 9, 9);
5761 TEST_ff_f (fmin, 9, plus_infty, 9);
5762 TEST_ff_f (fmin, plus_infty, -9, -9);
5763 TEST_ff_f (fmin, -9, plus_infty, -9);
5764 TEST_ff_f (fmin, minus_infty, 9, minus_infty);
5765 TEST_ff_f (fmin, minus_infty, -9, minus_infty);
5766 TEST_ff_f (fmin, 9, minus_infty, minus_infty);
5767 TEST_ff_f (fmin, -9, minus_infty, minus_infty);
5769 TEST_ff_f (fmin, 0, qnan_value, 0);
5770 TEST_ff_f (fmin, 9, qnan_value, 9);
5771 TEST_ff_f (fmin, -9, qnan_value, -9);
5772 TEST_ff_f (fmin, qnan_value, 0, 0);
5773 TEST_ff_f (fmin, qnan_value, 9, 9);
5774 TEST_ff_f (fmin, qnan_value, -9, -9);
5775 TEST_ff_f (fmin, plus_infty, qnan_value, plus_infty);
5776 TEST_ff_f (fmin, minus_infty, qnan_value, minus_infty);
5777 TEST_ff_f (fmin, qnan_value, plus_infty, plus_infty);
5778 TEST_ff_f (fmin, qnan_value, minus_infty, minus_infty);
5779 TEST_ff_f (fmin, qnan_value, qnan_value, qnan_value);
5789 FUNC(fmod) (6.5, 2.3L);
5790 if (errno == ENOSYS)
5791 /* Function not implemented. */
5796 /* fmod (+0, y) == +0 for y != 0. */
5797 TEST_ff_f (fmod, 0, 3, 0);
5799 /* fmod (-0, y) == -0 for y != 0. */
5800 TEST_ff_f (fmod, minus_zero, 3, minus_zero);
5802 /* fmod (+inf, y) == qNaN plus invalid exception. */
5804 TEST_ff_f (fmod, plus_infty, 3, qnan_value, INVALID_EXCEPTION);
5805 check_int ("errno for fmod(Inf,3) unchanged", errno, EDOM, 0, 0, 0);
5806 /* fmod (-inf, y) == qNaN plus invalid exception. */
5808 TEST_ff_f (fmod, minus_infty, 3, qnan_value, INVALID_EXCEPTION);
5809 check_int ("errno for fmod(-Inf,3) unchanged", errno, EDOM, 0, 0, 0);
5810 /* fmod (x, +0) == qNaN plus invalid exception. */
5812 TEST_ff_f (fmod, 3, 0, qnan_value, INVALID_EXCEPTION);
5813 check_int ("errno for fmod(3,0) unchanged", errno, EDOM, 0, 0, 0);
5814 /* fmod (x, -0) == qNaN plus invalid exception. */
5815 TEST_ff_f (fmod, 3, minus_zero, qnan_value, INVALID_EXCEPTION);
5817 /* fmod (x, +inf) == x for x not infinite. */
5818 TEST_ff_f (fmod, 3.0, plus_infty, 3.0);
5819 /* fmod (x, -inf) == x for x not infinite. */
5820 TEST_ff_f (fmod, 3.0, minus_infty, 3.0);
5822 TEST_ff_f (fmod, qnan_value, qnan_value, qnan_value);
5824 TEST_ff_f (fmod, 6.5, 2.25L, 2.0L);
5825 TEST_ff_f (fmod, -6.5, 2.25L, -2.0L);
5826 TEST_ff_f (fmod, 6.5, -2.25L, 2.0L);
5827 TEST_ff_f (fmod, -6.5, -2.25L, -2.0L);
5829 TEST_ff_f (fmod, 0x0.fffffep-126L, 0x1p-149L, plus_zero);
5831 TEST_ff_f (fmod, 0x0.fffffffffffffp-1022L, 0x1p-1074L, plus_zero);
5833 #if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
5834 TEST_ff_f (fmod, 0x0.fffffffffffffffep-16382L, 0x1p-16445L, plus_zero);
5842 fpclassify_test (void)
5846 TEST_f_i (fpclassify, qnan_value, FP_NAN);
5847 TEST_f_i (fpclassify, plus_infty, FP_INFINITE);
5848 TEST_f_i (fpclassify, minus_infty, FP_INFINITE);
5849 TEST_f_i (fpclassify, plus_zero, FP_ZERO);
5850 TEST_f_i (fpclassify, minus_zero, FP_ZERO);
5851 TEST_f_i (fpclassify, 1000, FP_NORMAL);
5852 TEST_f_i (fpclassify, min_subnorm_value, FP_SUBNORMAL);
5865 TEST_fI_f1 (frexp, plus_infty, plus_infty, IGNORE);
5866 TEST_fI_f1 (frexp, minus_infty, minus_infty, IGNORE);
5867 TEST_fI_f1 (frexp, qnan_value, qnan_value, IGNORE);
5869 TEST_fI_f1 (frexp, 0.0, 0.0, 0.0);
5870 TEST_fI_f1 (frexp, minus_zero, minus_zero, 0.0);
5872 TEST_fI_f1 (frexp, 12.8L, 0.8L, 4);
5873 TEST_fI_f1 (frexp, -27.34L, -0.854375L, 5);
5885 if (errno == ENOSYS)
5886 /* Function not implemented. */
5891 TEST_f_f (gamma, plus_infty, plus_infty);
5892 TEST_f_f (gamma, 0, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
5893 TEST_f_f (gamma, -3, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
5894 TEST_f_f (gamma, minus_infty, plus_infty);
5895 TEST_f_f (gamma, qnan_value, qnan_value);
5897 TEST_f_f1 (gamma, 1, 0, 1);
5898 TEST_f_f1 (gamma, 3, M_LN2l, 1);
5900 TEST_f_f1 (gamma, 0.5, M_LOG_SQRT_PIl, 1);
5901 TEST_f_f1 (gamma, -0.5, M_LOG_2_SQRT_PIl, -1);
5910 FUNC(hypot) (0.7L, 12.4L);
5911 if (errno == ENOSYS)
5912 /* Function not implemented. */
5917 TEST_ff_f (hypot, plus_infty, 1, plus_infty, IGNORE_ZERO_INF_SIGN);
5918 TEST_ff_f (hypot, minus_infty, 1, plus_infty, IGNORE_ZERO_INF_SIGN);
5921 TEST_ff_f (hypot, plus_infty, qnan_value, plus_infty);
5922 TEST_ff_f (hypot, minus_infty, qnan_value, plus_infty);
5923 TEST_ff_f (hypot, qnan_value, plus_infty, plus_infty);
5924 TEST_ff_f (hypot, qnan_value, minus_infty, plus_infty);
5927 TEST_ff_f (hypot, qnan_value, qnan_value, qnan_value);
5929 /* hypot (x,y) == hypot (+-x, +-y) */
5930 TEST_ff_f (hypot, 0.7L, 12.4L, 12.419742348374220601176836866763271L);
5931 TEST_ff_f (hypot, -0.7L, 12.4L, 12.419742348374220601176836866763271L);
5932 TEST_ff_f (hypot, 0.7L, -12.4L, 12.419742348374220601176836866763271L);
5933 TEST_ff_f (hypot, -0.7L, -12.4L, 12.419742348374220601176836866763271L);
5934 TEST_ff_f (hypot, 12.4L, 0.7L, 12.419742348374220601176836866763271L);
5935 TEST_ff_f (hypot, -12.4L, 0.7L, 12.419742348374220601176836866763271L);
5936 TEST_ff_f (hypot, 12.4L, -0.7L, 12.419742348374220601176836866763271L);
5937 TEST_ff_f (hypot, -12.4L, -0.7L, 12.419742348374220601176836866763271L);
5939 /* hypot (x,0) == fabs (x) */
5940 TEST_ff_f (hypot, 0.75L, 0, 0.75L);
5941 TEST_ff_f (hypot, -0.75L, 0, 0.75L);
5942 TEST_ff_f (hypot, -5.7e7, 0, 5.7e7L);
5944 TEST_ff_f (hypot, 0.75L, 1.25L, 1.45773797371132511771853821938639577L);
5946 TEST_ff_f (hypot, 1.0L, 0x1p-61L, 1.0L);
5947 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
5948 TEST_ff_f (hypot, 0x1.23456789abcdef0123456789ab8p-500L, 0x1.23456789abcdef0123456789ab8p-500L, 4.9155782399407039128612180934736799735113e-151L);
5951 #if !(defined TEST_FLOAT && defined TEST_INLINE)
5952 TEST_ff_f (hypot, 0x3p125L, 0x4p125L, 0x5p125L);
5953 TEST_ff_f (hypot, 0x1.234566p-126L, 0x1.234566p-126L, 1.891441686191081936598531534017449451173e-38L);
5956 #if !defined TEST_FLOAT && !(defined TEST_DOUBLE && defined TEST_INLINE)
5957 TEST_ff_f (hypot, 0x3p1021L, 0x4p1021L, 0x5p1021L);
5960 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384 && !defined TEST_INLINE
5961 TEST_ff_f (hypot, 0x3p16381L, 0x4p16381L, 0x5p16381L);
5973 TEST_f_i (ilogb, 1, 0);
5974 TEST_f_i (ilogb, M_El, 1);
5975 TEST_f_i (ilogb, 1024, 10);
5976 TEST_f_i (ilogb, -2000, 10);
5978 /* ilogb (0.0) == FP_ILOGB0 plus invalid exception */
5980 TEST_f_i (ilogb, 0.0, FP_ILOGB0, INVALID_EXCEPTION);
5981 check_int ("errno for ilogb(0.0) unchanged", errno, EDOM, 0, 0, 0);
5982 /* ilogb (qNaN) == FP_ILOGBNAN plus invalid exception */
5984 TEST_f_i (ilogb, qnan_value, FP_ILOGBNAN, INVALID_EXCEPTION);
5985 check_int ("errno for ilogb(qNaN) unchanged", errno, EDOM, 0, 0, 0);
5986 /* ilogb (inf) == INT_MAX plus invalid exception */
5988 TEST_f_i (ilogb, plus_infty, INT_MAX, INVALID_EXCEPTION);
5989 check_int ("errno for ilogb(Inf) unchanged", errno, EDOM, 0, 0, 0);
5990 /* ilogb (-inf) == INT_MAX plus invalid exception */
5992 TEST_f_i (ilogb, minus_infty, INT_MAX, INVALID_EXCEPTION);
5993 check_int ("errno for ilogb(-Inf) unchanged", errno, EDOM, 0, 0, 0);
5999 isfinite_test (void)
6003 TEST_f_b (isfinite, 0, 1);
6004 TEST_f_b (isfinite, minus_zero, 1);
6005 TEST_f_b (isfinite, 10, 1);
6006 TEST_f_b (isfinite, min_subnorm_value, 1);
6007 TEST_f_b (isfinite, plus_infty, 0);
6008 TEST_f_b (isfinite, minus_infty, 0);
6009 TEST_f_b (isfinite, qnan_value, 0);
6015 isgreater_test (void)
6019 TEST_ff_i (isgreater, minus_zero, minus_zero, 0);
6020 TEST_ff_i (isgreater, minus_zero, plus_zero, 0);
6021 TEST_ff_i (isgreater, minus_zero, (FLOAT) 1, 0);
6022 TEST_ff_i (isgreater, minus_zero, qnan_value, 0);
6023 TEST_ff_i (isgreater, plus_zero, minus_zero, 0);
6024 TEST_ff_i (isgreater, plus_zero, plus_zero, 0);
6025 TEST_ff_i (isgreater, plus_zero, (FLOAT) 1, 0);
6026 TEST_ff_i (isgreater, plus_zero, qnan_value, 0);
6027 TEST_ff_i (isgreater, (FLOAT) 1, minus_zero, 1);
6028 TEST_ff_i (isgreater, (FLOAT) 1, plus_zero, 1);
6029 TEST_ff_i (isgreater, (FLOAT) 1, (FLOAT) 1, 0);
6030 TEST_ff_i (isgreater, (FLOAT) 1, qnan_value, 0);
6031 TEST_ff_i (isgreater, qnan_value, minus_zero, 0);
6032 TEST_ff_i (isgreater, qnan_value, plus_zero, 0);
6033 TEST_ff_i (isgreater, qnan_value, (FLOAT) 1, 0);
6034 TEST_ff_i (isgreater, qnan_value, qnan_value, 0);
6040 isgreaterequal_test (void)
6042 START (isgreaterequal);
6044 TEST_ff_i (isgreaterequal, minus_zero, minus_zero, 1);
6045 TEST_ff_i (isgreaterequal, minus_zero, plus_zero, 1);
6046 TEST_ff_i (isgreaterequal, minus_zero, (FLOAT) 1, 0);
6047 TEST_ff_i (isgreaterequal, minus_zero, qnan_value, 0);
6048 TEST_ff_i (isgreaterequal, plus_zero, minus_zero, 1);
6049 TEST_ff_i (isgreaterequal, plus_zero, plus_zero, 1);
6050 TEST_ff_i (isgreaterequal, plus_zero, (FLOAT) 1, 0);
6051 TEST_ff_i (isgreaterequal, plus_zero, qnan_value, 0);
6052 TEST_ff_i (isgreaterequal, (FLOAT) 1, minus_zero, 1);
6053 TEST_ff_i (isgreaterequal, (FLOAT) 1, plus_zero, 1);
6054 TEST_ff_i (isgreaterequal, (FLOAT) 1, (FLOAT) 1, 1);
6055 TEST_ff_i (isgreaterequal, (FLOAT) 1, qnan_value, 0);
6056 TEST_ff_i (isgreaterequal, qnan_value, minus_zero, 0);
6057 TEST_ff_i (isgreaterequal, qnan_value, plus_zero, 0);
6058 TEST_ff_i (isgreaterequal, qnan_value, (FLOAT) 1, 0);
6059 TEST_ff_i (isgreaterequal, qnan_value, qnan_value, 0);
6061 END (isgreaterequal);
6069 TEST_f_b (isinf, 0, 0);
6070 TEST_f_b (isinf, minus_zero, 0);
6071 TEST_f_b (isinf, 10, 0);
6072 TEST_f_b (isinf, min_subnorm_value, 0);
6073 TEST_f_b (isinf, plus_infty, 1);
6074 TEST_f_b (isinf, minus_infty, 1);
6075 TEST_f_b (isinf, qnan_value, 0);
6085 TEST_ff_i (isless, minus_zero, minus_zero, 0);
6086 TEST_ff_i (isless, minus_zero, plus_zero, 0);
6087 TEST_ff_i (isless, minus_zero, (FLOAT) 1, 1);
6088 TEST_ff_i (isless, minus_zero, qnan_value, 0);
6089 TEST_ff_i (isless, plus_zero, minus_zero, 0);
6090 TEST_ff_i (isless, plus_zero, plus_zero, 0);
6091 TEST_ff_i (isless, plus_zero, (FLOAT) 1, 1);
6092 TEST_ff_i (isless, plus_zero, qnan_value, 0);
6093 TEST_ff_i (isless, (FLOAT) 1, minus_zero, 0);
6094 TEST_ff_i (isless, (FLOAT) 1, plus_zero, 0);
6095 TEST_ff_i (isless, (FLOAT) 1, (FLOAT) 1, 0);
6096 TEST_ff_i (isless, (FLOAT) 1, qnan_value, 0);
6097 TEST_ff_i (isless, qnan_value, minus_zero, 0);
6098 TEST_ff_i (isless, qnan_value, plus_zero, 0);
6099 TEST_ff_i (isless, qnan_value, (FLOAT) 1, 0);
6100 TEST_ff_i (isless, qnan_value, qnan_value, 0);
6106 islessequal_test (void)
6108 START (islessequal);
6110 TEST_ff_i (islessequal, minus_zero, minus_zero, 1);
6111 TEST_ff_i (islessequal, minus_zero, plus_zero, 1);
6112 TEST_ff_i (islessequal, minus_zero, (FLOAT) 1, 1);
6113 TEST_ff_i (islessequal, minus_zero, qnan_value, 0);
6114 TEST_ff_i (islessequal, plus_zero, minus_zero, 1);
6115 TEST_ff_i (islessequal, plus_zero, plus_zero, 1);
6116 TEST_ff_i (islessequal, plus_zero, (FLOAT) 1, 1);
6117 TEST_ff_i (islessequal, plus_zero, qnan_value, 0);
6118 TEST_ff_i (islessequal, (FLOAT) 1, minus_zero, 0);
6119 TEST_ff_i (islessequal, (FLOAT) 1, plus_zero, 0);
6120 TEST_ff_i (islessequal, (FLOAT) 1, (FLOAT) 1, 1);
6121 TEST_ff_i (islessequal, (FLOAT) 1, qnan_value, 0);
6122 TEST_ff_i (islessequal, qnan_value, minus_zero, 0);
6123 TEST_ff_i (islessequal, qnan_value, plus_zero, 0);
6124 TEST_ff_i (islessequal, qnan_value, (FLOAT) 1, 0);
6125 TEST_ff_i (islessequal, qnan_value, qnan_value, 0);
6131 islessgreater_test (void)
6133 START (islessgreater);
6135 TEST_ff_i (islessgreater, minus_zero, minus_zero, 0);
6136 TEST_ff_i (islessgreater, minus_zero, plus_zero, 0);
6137 TEST_ff_i (islessgreater, minus_zero, (FLOAT) 1, 1);
6138 TEST_ff_i (islessgreater, minus_zero, qnan_value, 0);
6139 TEST_ff_i (islessgreater, plus_zero, minus_zero, 0);
6140 TEST_ff_i (islessgreater, plus_zero, plus_zero, 0);
6141 TEST_ff_i (islessgreater, plus_zero, (FLOAT) 1, 1);
6142 TEST_ff_i (islessgreater, plus_zero, qnan_value, 0);
6143 TEST_ff_i (islessgreater, (FLOAT) 1, minus_zero, 1);
6144 TEST_ff_i (islessgreater, (FLOAT) 1, plus_zero, 1);
6145 TEST_ff_i (islessgreater, (FLOAT) 1, (FLOAT) 1, 0);
6146 TEST_ff_i (islessgreater, (FLOAT) 1, qnan_value, 0);
6147 TEST_ff_i (islessgreater, qnan_value, minus_zero, 0);
6148 TEST_ff_i (islessgreater, qnan_value, plus_zero, 0);
6149 TEST_ff_i (islessgreater, qnan_value, (FLOAT) 1, 0);
6150 TEST_ff_i (islessgreater, qnan_value, qnan_value, 0);
6152 END (islessgreater);
6160 TEST_f_b (isnan, 0, 0);
6161 TEST_f_b (isnan, minus_zero, 0);
6162 TEST_f_b (isnan, 10, 0);
6163 TEST_f_b (isnan, min_subnorm_value, 0);
6164 TEST_f_b (isnan, plus_infty, 0);
6165 TEST_f_b (isnan, minus_infty, 0);
6166 TEST_f_b (isnan, qnan_value, 1);
6172 isnormal_test (void)
6176 TEST_f_b (isnormal, 0, 0);
6177 TEST_f_b (isnormal, minus_zero, 0);
6178 TEST_f_b (isnormal, 10, 1);
6179 TEST_f_b (isnormal, min_subnorm_value, 0);
6180 TEST_f_b (isnormal, plus_infty, 0);
6181 TEST_f_b (isnormal, minus_infty, 0);
6182 TEST_f_b (isnormal, qnan_value, 0);
6188 isunordered_test (void)
6190 START (isunordered);
6192 TEST_ff_i (isunordered, minus_zero, minus_zero, 0);
6193 TEST_ff_i (isunordered, minus_zero, plus_zero, 0);
6194 TEST_ff_i (isunordered, minus_zero, (FLOAT) 1, 0);
6195 TEST_ff_i (isunordered, minus_zero, qnan_value, 1);
6196 TEST_ff_i (isunordered, plus_zero, minus_zero, 0);
6197 TEST_ff_i (isunordered, plus_zero, plus_zero, 0);
6198 TEST_ff_i (isunordered, plus_zero, (FLOAT) 1, 0);
6199 TEST_ff_i (isunordered, plus_zero, qnan_value, 1);
6200 TEST_ff_i (isunordered, (FLOAT) 1, minus_zero, 0);
6201 TEST_ff_i (isunordered, (FLOAT) 1, plus_zero, 0);
6202 TEST_ff_i (isunordered, (FLOAT) 1, (FLOAT) 1, 0);
6203 TEST_ff_i (isunordered, (FLOAT) 1, qnan_value, 1);
6204 TEST_ff_i (isunordered, qnan_value, minus_zero, 1);
6205 TEST_ff_i (isunordered, qnan_value, plus_zero, 1);
6206 TEST_ff_i (isunordered, qnan_value, (FLOAT) 1, 1);
6207 TEST_ff_i (isunordered, qnan_value, qnan_value, 1);
6217 FUNC (sincos) (0, &s, &c);
6218 if (errno == ENOSYS)
6219 /* Required function not implemented. */
6222 if (errno == ENOSYS)
6223 /* Function not implemented. */
6228 /* j0 is the Bessel function of the first kind of order 0 */
6229 TEST_f_f (j0, qnan_value, qnan_value);
6230 TEST_f_f (j0, plus_infty, 0);
6231 TEST_f_f (j0, -1.0, 0.765197686557966551449717526102663221L);
6232 TEST_f_f (j0, 0.0, 1.0);
6233 TEST_f_f (j0, 0.125L, 0.996097563041985204620768999453174712L);
6234 TEST_f_f (j0, 0.75L, 0.864242275166648623555731103820923211L);
6235 TEST_f_f (j0, 1.0, 0.765197686557966551449717526102663221L);
6236 TEST_f_f (j0, 1.5, 0.511827671735918128749051744283411720L);
6237 TEST_f_f (j0, 2.0, 0.223890779141235668051827454649948626L);
6238 TEST_f_f (j0, 8.0, 0.171650807137553906090869407851972001L);
6239 TEST_f_f (j0, 10.0, -0.245935764451348335197760862485328754L);
6240 TEST_f_f (j0, 4.0, -3.9714980986384737228659076845169804197562E-1L);
6241 TEST_f_f (j0, -4.0, -3.9714980986384737228659076845169804197562E-1L);
6243 TEST_f_f (j0, 0x1.d7ce3ap+107L, 2.775523647291230802651040996274861694514e-17L);
6246 TEST_f_f (j0, -0x1.001000001p+593L, -3.927269966354206207832593635798954916263e-90L);
6249 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
6250 TEST_f_f (j0, 0x1p16382L, -1.2193782500509000574176799046642541129387e-2466L);
6251 TEST_f_f (j0, 0x1p16383L, 9.5859502826270374691362975419147645151233e-2467L);
6263 FUNC (sincos) (0, &s, &c);
6264 if (errno == ENOSYS)
6265 /* Required function not implemented. */
6268 if (errno == ENOSYS)
6269 /* Function not implemented. */
6272 /* j1 is the Bessel function of the first kind of order 1 */
6276 TEST_f_f (j1, qnan_value, qnan_value);
6277 TEST_f_f (j1, plus_infty, 0);
6279 TEST_f_f (j1, -1.0, -0.440050585744933515959682203718914913L);
6280 TEST_f_f (j1, 0.0, 0.0);
6281 TEST_f_f (j1, 0.125L, 0.0623780091344946810942311355879361177L);
6282 TEST_f_f (j1, 0.75L, 0.349243602174862192523281016426251335L);
6283 TEST_f_f (j1, 1.0, 0.440050585744933515959682203718914913L);
6284 TEST_f_f (j1, 1.5, 0.557936507910099641990121213156089400L);
6285 TEST_f_f (j1, 2.0, 0.576724807756873387202448242269137087L);
6286 TEST_f_f (j1, 8.0, 0.234636346853914624381276651590454612L);
6287 TEST_f_f (j1, 10.0, 0.0434727461688614366697487680258592883L);
6289 TEST_f_f (j1, 0x1.3ffp+74L, 1.818984347516051243459364437186082741567e-12L);
6292 TEST_f_f (j1, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L);
6295 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
6296 TEST_f_f (j1, 0x1p16382L, 8.0839224448726336195866026476176740513439e-2467L);
6297 TEST_f_f (j1, 0x1p16383L, -3.8895531955766020648617743624167352352217e-2467L);
6308 FUNC (sincos) (0, &s, &c);
6309 if (errno == ENOSYS)
6310 /* Required function not implemented. */
6313 if (errno == ENOSYS)
6314 /* Function not implemented. */
6317 /* jn is the Bessel function of the first kind of order n. */
6320 /* jn (0, x) == j0 (x) */
6321 TEST_ff_f (jn, 0, qnan_value, qnan_value);
6322 TEST_ff_f (jn, 0, plus_infty, 0);
6323 TEST_ff_f (jn, 0, -1.0, 0.765197686557966551449717526102663221L);
6324 TEST_ff_f (jn, 0, 0.0, 1.0);
6325 TEST_ff_f (jn, 0, 0.125L, 0.996097563041985204620768999453174712L);
6326 TEST_ff_f (jn, 0, 0.75L, 0.864242275166648623555731103820923211L);
6327 TEST_ff_f (jn, 0, 1.0, 0.765197686557966551449717526102663221L);
6328 TEST_ff_f (jn, 0, 1.5, 0.511827671735918128749051744283411720L);
6329 TEST_ff_f (jn, 0, 2.0, 0.223890779141235668051827454649948626L);
6330 TEST_ff_f (jn, 0, 8.0, 0.171650807137553906090869407851972001L);
6331 TEST_ff_f (jn, 0, 10.0, -0.245935764451348335197760862485328754L);
6332 TEST_ff_f (jn, 0, 4.0, -3.9714980986384737228659076845169804197562E-1L);
6333 TEST_ff_f (jn, 0, -4.0, -3.9714980986384737228659076845169804197562E-1L);
6335 /* jn (1, x) == j1 (x) */
6336 TEST_ff_f (jn, 1, qnan_value, qnan_value);
6337 TEST_ff_f (jn, 1, plus_infty, 0);
6338 TEST_ff_f (jn, 1, -1.0, -0.440050585744933515959682203718914913L);
6339 TEST_ff_f (jn, 1, 0.0, 0.0);
6340 TEST_ff_f (jn, 1, 0.125L, 0.0623780091344946810942311355879361177L);
6341 TEST_ff_f (jn, 1, 0.75L, 0.349243602174862192523281016426251335L);
6342 TEST_ff_f (jn, 1, 1.0, 0.440050585744933515959682203718914913L);
6343 TEST_ff_f (jn, 1, 1.5, 0.557936507910099641990121213156089400L);
6344 TEST_ff_f (jn, 1, 2.0, 0.576724807756873387202448242269137087L);
6345 TEST_ff_f (jn, 1, 8.0, 0.234636346853914624381276651590454612L);
6346 TEST_ff_f (jn, 1, 10.0, 0.0434727461688614366697487680258592883L);
6349 TEST_ff_f (jn, 3, qnan_value, qnan_value);
6350 TEST_ff_f (jn, 3, plus_infty, 0);
6352 TEST_ff_f (jn, 3, -1.0, -0.0195633539826684059189053216217515083L);
6353 TEST_ff_f (jn, 3, 0.0, 0.0);
6354 TEST_ff_f (jn, 3, 0.125L, 0.406503832554912875023029337653442868e-4L);
6355 TEST_ff_f (jn, 3, 0.75L, 0.848438342327410884392755236884386804e-2L);
6356 TEST_ff_f (jn, 3, 1.0, 0.0195633539826684059189053216217515083L);
6357 TEST_ff_f (jn, 3, 2.0, 0.128943249474402051098793332969239835L);
6358 TEST_ff_f (jn, 3, 10.0, 0.0583793793051868123429354784103409563L);
6361 TEST_ff_f (jn, 10, qnan_value, qnan_value);
6362 TEST_ff_f (jn, 10, plus_infty, 0);
6364 TEST_ff_f (jn, 10, -1.0, 0.263061512368745320699785368779050294e-9L);
6365 TEST_ff_f (jn, 10, 0.0, 0.0);
6366 TEST_ff_f (jn, 10, 0.125L, 0.250543369809369890173993791865771547e-18L);
6367 TEST_ff_f (jn, 10, 0.75L, 0.149621713117596814698712483621682835e-10L);
6368 TEST_ff_f (jn, 10, 1.0, 0.263061512368745320699785368779050294e-9L);
6369 TEST_ff_f (jn, 10, 2.0, 0.251538628271673670963516093751820639e-6L);
6370 TEST_ff_f (jn, 10, 10.0, 0.207486106633358857697278723518753428L);
6373 TEST_ff_f (jn, 2, 2.4048255576957729L, 0.43175480701968038399746111312430703L);
6374 TEST_ff_f (jn, 3, 2.4048255576957729L, 0.19899990535769083404042146764530813L);
6375 TEST_ff_f (jn, 4, 2.4048255576957729L, 0.647466661641779720084932282551219891E-1L);
6376 TEST_ff_f (jn, 5, 2.4048255576957729L, 0.163892432048058525099230549946147698E-1L);
6377 TEST_ff_f (jn, 6, 2.4048255576957729L, 0.34048184720278336646673682895929161E-2L);
6378 TEST_ff_f (jn, 7, 2.4048255576957729L, 0.60068836573295394221291569249883076E-3L);
6379 TEST_ff_f (jn, 8, 2.4048255576957729L, 0.92165786705344923232879022467054148E-4L);
6380 TEST_ff_f (jn, 9, 2.4048255576957729L, 0.12517270977961513005428966643852564E-4L);
6382 /* Bug 14155: spurious exception may occur. */
6383 TEST_ff_f (jn, 2, 0x1.ffff62p+99L, -4.43860668048170034334926693188979974489e-16L, UNDERFLOW_EXCEPTION_OK);
6394 TEST_ff_f (ldexp, 0, 0, 0);
6395 TEST_ff_f (ldexp, minus_zero, 0, minus_zero);
6397 TEST_ff_f (ldexp, plus_infty, 1, plus_infty);
6398 TEST_ff_f (ldexp, minus_infty, 1, minus_infty);
6399 TEST_ff_f (ldexp, qnan_value, 1, qnan_value);
6401 TEST_ff_f (ldexp, 0.8L, 4, 12.8L);
6402 TEST_ff_f (ldexp, -0.854375L, 5, -27.34L);
6404 /* ldexp (x, 0) == x. */
6405 TEST_ff_f (ldexp, 1.0L, 0L, 1.0L);
6416 if (errno == ENOSYS)
6417 /* Function not implemented. */
6422 TEST_f_f (lgamma, plus_infty, plus_infty);
6423 TEST_f_f (lgamma, 0, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
6424 check_int ("signgam for lgamma(0) == 1", signgam, 1, 0, 0, 0);
6425 TEST_f_f (lgamma, minus_zero, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
6426 check_int ("signgam for lgamma(-0) == -1", signgam, -1, 0, 0, 0);
6427 TEST_f_f (lgamma, qnan_value, qnan_value);
6429 /* lgamma (x) == +inf plus divide by zero exception for integer x <= 0. */
6431 TEST_f_f (lgamma, -3, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
6432 check_int ("errno for lgamma(-integer) == ERANGE", errno, ERANGE, 0, 0, 0);
6433 TEST_f_f (lgamma, minus_infty, plus_infty);
6434 TEST_f_f (lgamma, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
6435 TEST_f_f (lgamma, max_value, plus_infty, OVERFLOW_EXCEPTION);
6437 TEST_f_f1 (lgamma, 1, 0, 1);
6439 TEST_f_f1 (lgamma, 3, M_LN2l, 1);
6441 TEST_f_f1 (lgamma, 0.5, M_LOG_SQRT_PIl, 1);
6442 TEST_f_f1 (lgamma, -0.5, M_LOG_2_SQRT_PIl, -1);
6443 TEST_f_f1 (lgamma, 0.7L, 0.260867246531666514385732417016759578L, 1);
6444 TEST_f_f1 (lgamma, 1.2L, -0.853740900033158497197028392998854470e-1L, 1);
6453 /* XXX this test is incomplete. We need to have a way to specifiy
6454 the rounding method and test the critical cases. So far, only
6455 unproblematic numbers are tested. */
6456 /* TODO: missing +/-Inf as well as qNaN tests. */
6460 TEST_f_l (lrint, 0.0, 0);
6461 TEST_f_l (lrint, minus_zero, 0);
6462 TEST_f_l (lrint, 0.2L, 0);
6463 TEST_f_l (lrint, -0.2L, 0);
6465 TEST_f_l (lrint, 1.4L, 1);
6466 TEST_f_l (lrint, -1.4L, -1);
6468 TEST_f_l (lrint, 8388600.3L, 8388600);
6469 TEST_f_l (lrint, -8388600.3L, -8388600);
6471 TEST_f_l (lrint, 1071930.0008, 1071930);
6473 TEST_f_l (lrint, 1073741824.01, 1073741824);
6474 # if LONG_MAX > 281474976710656
6475 TEST_f_l (lrint, 281474976710656.025, 281474976710656);
6484 lrint_test_tonearest (void)
6486 int save_round_mode;
6487 START (lrint_tonearest);
6489 save_round_mode = fegetround ();
6491 if (!fesetround (FE_TONEAREST))
6493 TEST_f_l (lrint, 0.0, 0);
6494 TEST_f_l (lrint, minus_zero, 0);
6495 TEST_f_l (lrint, 0.2L, 0);
6496 TEST_f_l (lrint, -0.2L, 0);
6497 TEST_f_l (lrint, 0.5L, 0);
6498 TEST_f_l (lrint, -0.5L, 0);
6499 TEST_f_l (lrint, 0.8L, 1);
6500 TEST_f_l (lrint, -0.8L, -1);
6502 TEST_f_l (lrint, 1.4L, 1);
6503 TEST_f_l (lrint, -1.4L, -1);
6505 TEST_f_l (lrint, 8388600.3L, 8388600);
6506 TEST_f_l (lrint, -8388600.3L, -8388600);
6508 TEST_f_l (lrint, 1071930.0008, 1071930);
6510 TEST_f_l (lrint, 1073741824.01, 1073741824);
6511 # if LONG_MAX > 281474976710656
6512 TEST_f_l (lrint, 281474976710656.025, 281474976710656);
6517 fesetround (save_round_mode);
6519 END (lrint_tonearest);
6524 lrint_test_towardzero (void)
6526 int save_round_mode;
6527 START (lrint_towardzero);
6529 save_round_mode = fegetround ();
6531 if (!fesetround (FE_TOWARDZERO))
6533 TEST_f_l (lrint, 0.0, 0);
6534 TEST_f_l (lrint, minus_zero, 0);
6535 TEST_f_l (lrint, 0.2L, 0);
6536 TEST_f_l (lrint, -0.2L, 0);
6537 TEST_f_l (lrint, 0.5L, 0);
6538 TEST_f_l (lrint, -0.5L, 0);
6539 TEST_f_l (lrint, 0.8L, 0);
6540 TEST_f_l (lrint, -0.8L, 0);
6542 TEST_f_l (lrint, 1.4L, 1);
6543 TEST_f_l (lrint, -1.4L, -1);
6545 TEST_f_l (lrint, 8388600.3L, 8388600);
6546 TEST_f_l (lrint, -8388600.3L, -8388600);
6548 TEST_f_l (lrint, 1071930.0008, 1071930);
6550 TEST_f_l (lrint, 1073741824.01, 1073741824);
6551 # if LONG_MAX > 281474976710656
6552 TEST_f_l (lrint, 281474976710656.025, 281474976710656);
6557 fesetround (save_round_mode);
6559 END (lrint_towardzero);
6564 lrint_test_downward (void)
6566 int save_round_mode;
6567 START (lrint_downward);
6569 save_round_mode = fegetround ();
6571 if (!fesetround (FE_DOWNWARD))
6573 TEST_f_l (lrint, 0.0, 0);
6574 TEST_f_l (lrint, minus_zero, 0);
6575 TEST_f_l (lrint, 0.2L, 0);
6576 TEST_f_l (lrint, -0.2L, -1);
6577 TEST_f_l (lrint, 0.5L, 0);
6578 TEST_f_l (lrint, -0.5L, -1);
6579 TEST_f_l (lrint, 0.8L, 0);
6580 TEST_f_l (lrint, -0.8L, -1);
6582 TEST_f_l (lrint, 1.4L, 1);
6583 TEST_f_l (lrint, -1.4L, -2);
6585 TEST_f_l (lrint, 8388600.3L, 8388600);
6586 TEST_f_l (lrint, -8388600.3L, -8388601);
6588 TEST_f_l (lrint, 1071930.0008, 1071930);
6590 TEST_f_l (lrint, 1073741824.01, 1073741824);
6591 # if LONG_MAX > 281474976710656
6592 TEST_f_l (lrint, 281474976710656.025, 281474976710656);
6597 fesetround (save_round_mode);
6599 END (lrint_downward);
6604 lrint_test_upward (void)
6606 int save_round_mode;
6607 START (lrint_upward);
6609 save_round_mode = fegetround ();
6611 if (!fesetround (FE_UPWARD))
6613 TEST_f_l (lrint, 0.0, 0);
6614 TEST_f_l (lrint, minus_zero, 0);
6615 TEST_f_l (lrint, 0.2L, 1);
6616 TEST_f_l (lrint, -0.2L, 0);
6617 TEST_f_l (lrint, 0.5L, 1);
6618 TEST_f_l (lrint, -0.5L, 0);
6619 TEST_f_l (lrint, 0.8L, 1);
6620 TEST_f_l (lrint, -0.8L, 0);
6622 TEST_f_l (lrint, 1.4L, 2);
6623 TEST_f_l (lrint, -1.4L, -1);
6625 TEST_f_l (lrint, 8388600.3L, 8388601);
6626 TEST_f_l (lrint, -8388600.3L, -8388600);
6629 TEST_f_l (lrint, 1071930.0008, 1071931);
6630 TEST_f_l (lrint, 1073741824.01, 1073741825);
6631 # if LONG_MAX > 281474976710656 && defined (TEST_LDOUBLE)
6632 TEST_f_l (lrint, 281474976710656.025, 281474976710656);
6637 fesetround (save_round_mode);
6646 /* XXX this test is incomplete. We need to have a way to specifiy
6647 the rounding method and test the critical cases. So far, only
6648 unproblematic numbers are tested. */
6649 /* TODO: missing +/-Inf as well as qNaN tests. */
6653 TEST_f_L (llrint, 0.0, 0);
6654 TEST_f_L (llrint, minus_zero, 0);
6655 TEST_f_L (llrint, 0.2L, 0);
6656 TEST_f_L (llrint, -0.2L, 0);
6658 TEST_f_L (llrint, 1.4L, 1);
6659 TEST_f_L (llrint, -1.4L, -1);
6661 TEST_f_L (llrint, 8388600.3L, 8388600);
6662 TEST_f_L (llrint, -8388600.3L, -8388600);
6664 TEST_f_l (llrint, 1071930.0008, 1071930);
6666 /* Test boundary conditions. */
6668 TEST_f_L (llrint, 2097151.0,2097151LL);
6670 TEST_f_L (llrint, 8388608.0, 8388608LL);
6672 TEST_f_L (llrint, 16777216.0, 16777216LL);
6674 TEST_f_L (llrint, 2199023255552.0, 2199023255552LL);
6676 TEST_f_L (llrint, 4398046511104.0, 4398046511104LL);
6677 /* 0x1000000000000 */
6678 TEST_f_L (llrint, 281474976710656.0, 281474976710656LL);
6679 /* 0x10000000000000 */
6680 TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL);
6681 /* 0x10000080000000 */
6682 TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL);
6683 /* 0x20000000000000 */
6684 TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL);
6685 /* 0x80000000000000 */
6686 TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL);
6687 /* 0x100000000000000 */
6688 TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL);
6690 /* The input can only be represented in long double. */
6691 TEST_f_L (llrint, 4503599627370495.5L, 4503599627370496LL);
6692 TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL);
6693 TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL);
6694 TEST_f_L (llrint, 4503599627370496.75L, 4503599627370497LL);
6695 TEST_f_L (llrint, 4503599627370497.5L, 4503599627370498LL);
6697 TEST_f_L (llrint, -4503599627370495.5L, -4503599627370496LL);
6698 TEST_f_L (llrint, -4503599627370496.25L, -4503599627370496LL);
6699 TEST_f_L (llrint, -4503599627370496.5L, -4503599627370496LL);
6700 TEST_f_L (llrint, -4503599627370496.75L, -4503599627370497LL);
6701 TEST_f_L (llrint, -4503599627370497.5L, -4503599627370498LL);
6703 # if LDBL_MANT_DIG > 100
6704 TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL);
6705 TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL);
6706 TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL);
6707 TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370495LL);
6708 TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370496LL);
6709 TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370497LL);
6711 TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370495LL);
6712 TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370496LL);
6713 TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370497LL);
6714 TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370495LL);
6715 TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370496LL);
6716 TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370497LL);
6719 TEST_f_L (llrint, 9007199254740991.5L, 9007199254740992LL);
6720 TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL);
6721 TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL);
6722 TEST_f_L (llrint, 9007199254740992.75L, 9007199254740993LL);
6723 TEST_f_L (llrint, 9007199254740993.5L, 9007199254740994LL);
6725 TEST_f_L (llrint, -9007199254740991.5L, -9007199254740992LL);
6726 TEST_f_L (llrint, -9007199254740992.25L, -9007199254740992LL);
6727 TEST_f_L (llrint, -9007199254740992.5L, -9007199254740992LL);
6728 TEST_f_L (llrint, -9007199254740992.75L, -9007199254740993LL);
6729 TEST_f_L (llrint, -9007199254740993.5L, -9007199254740994LL);
6731 # if LDBL_MANT_DIG > 100
6732 TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL);
6733 TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL);
6734 TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL);
6735 TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740992LL);
6736 TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740993LL);
6737 TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740994LL);
6739 TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740991LL);
6740 TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740992LL);
6741 TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740993LL);
6742 TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740992LL);
6743 TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740993LL);
6744 TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740994LL);
6747 TEST_f_L (llrint, 72057594037927935.5L, 72057594037927936LL);
6748 TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL);
6749 TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL);
6750 TEST_f_L (llrint, 72057594037927936.75L, 72057594037927937LL);
6751 TEST_f_L (llrint, 72057594037927937.5L, 72057594037927938LL);
6753 TEST_f_L (llrint, -72057594037927935.5L, -72057594037927936LL);
6754 TEST_f_L (llrint, -72057594037927936.25L, -72057594037927936LL);
6755 TEST_f_L (llrint, -72057594037927936.5L, -72057594037927936LL);
6756 TEST_f_L (llrint, -72057594037927936.75L, -72057594037927937LL);
6757 TEST_f_L (llrint, -72057594037927937.5L, -72057594037927938LL);
6759 # if LDBL_MANT_DIG > 100
6760 TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775806LL);
6761 TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775806LL);
6762 TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL);
6763 TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL);
6764 TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL);
6765 TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775806LL);
6766 TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L);
6767 TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775806LL);
6768 TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775807LL);
6769 TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775807LL);
6770 TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL);
6771 TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL);
6779 llrint_test_tonearest (void)
6781 int save_round_mode;
6782 START (llrint_tonearest);
6784 save_round_mode = fegetround ();
6786 if (!fesetround (FE_TONEAREST))
6788 TEST_f_L (llrint, 0.0, 0);
6789 TEST_f_L (llrint, minus_zero, 0);
6790 TEST_f_L (llrint, 0.2L, 0);
6791 TEST_f_L (llrint, -0.2L, 0);
6793 TEST_f_L (llrint, 1.4L, 1);
6794 TEST_f_L (llrint, -1.4L, -1);
6796 TEST_f_L (llrint, 8388600.3L, 8388600);
6797 TEST_f_L (llrint, -8388600.3L, -8388600);
6799 TEST_f_l (llrint, 1071930.0008, 1071930);
6801 /* Test boundary conditions. */
6803 TEST_f_L (llrint, 2097151.0,2097151LL);
6805 TEST_f_L (llrint, 8388608.0, 8388608LL);
6807 TEST_f_L (llrint, 16777216.0, 16777216LL);
6809 TEST_f_L (llrint, 2199023255552.0, 2199023255552LL);
6811 TEST_f_L (llrint, 4398046511104.0, 4398046511104LL);
6812 /* 0x1000000000000 */
6813 TEST_f_L (llrint, 281474976710656.0, 281474976710656LL);
6814 /* 0x10000000000000 */
6815 TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL);
6816 /* 0x10000080000000 */
6817 TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL);
6818 /* 0x20000000000000 */
6819 TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL);
6820 /* 0x80000000000000 */
6821 TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL);
6822 /* 0x100000000000000 */
6823 TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL);
6825 /* The input can only be represented in long double. */
6826 TEST_f_L (llrint, 4503599627370495.5L, 4503599627370496LL);
6827 TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL);
6828 TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL);
6829 TEST_f_L (llrint, 4503599627370496.75L, 4503599627370497LL);
6830 TEST_f_L (llrint, 4503599627370497.5L, 4503599627370498LL);
6832 TEST_f_L (llrint, -4503599627370495.5L, -4503599627370496LL);
6833 TEST_f_L (llrint, -4503599627370496.25L, -4503599627370496LL);
6834 TEST_f_L (llrint, -4503599627370496.5L, -4503599627370496LL);
6835 TEST_f_L (llrint, -4503599627370496.75L, -4503599627370497LL);
6836 TEST_f_L (llrint, -4503599627370497.5L, -4503599627370498LL);
6838 # if LDBL_MANT_DIG > 100
6839 TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL);
6840 TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL);
6841 TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL);
6842 TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370495LL);
6843 TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370496LL);
6844 TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370497LL);
6846 TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370495LL);
6847 TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370496LL);
6848 TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370497LL);
6849 TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370495LL);
6850 TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370496LL);
6851 TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370497LL);
6854 TEST_f_L (llrint, 9007199254740991.5L, 9007199254740992LL);
6855 TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL);
6856 TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL);
6857 TEST_f_L (llrint, 9007199254740992.75L, 9007199254740993LL);
6858 TEST_f_L (llrint, 9007199254740993.5L, 9007199254740994LL);
6860 TEST_f_L (llrint, -9007199254740991.5L, -9007199254740992LL);
6861 TEST_f_L (llrint, -9007199254740992.25L, -9007199254740992LL);
6862 TEST_f_L (llrint, -9007199254740992.5L, -9007199254740992LL);
6863 TEST_f_L (llrint, -9007199254740992.75L, -9007199254740993LL);
6864 TEST_f_L (llrint, -9007199254740993.5L, -9007199254740994LL);
6866 # if LDBL_MANT_DIG > 100
6867 TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL);
6868 TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL);
6869 TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL);
6870 TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740992LL);
6871 TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740993LL);
6872 TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740994LL);
6874 TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740991LL);
6875 TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740992LL);
6876 TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740993LL);
6877 TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740992LL);
6878 TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740993LL);
6879 TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740994LL);
6882 TEST_f_L (llrint, 72057594037927935.5L, 72057594037927936LL);
6883 TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL);
6884 TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL);
6885 TEST_f_L (llrint, 72057594037927936.75L, 72057594037927937LL);
6886 TEST_f_L (llrint, 72057594037927937.5L, 72057594037927938LL);
6888 TEST_f_L (llrint, -72057594037927935.5L, -72057594037927936LL);
6889 TEST_f_L (llrint, -72057594037927936.25L, -72057594037927936LL);
6890 TEST_f_L (llrint, -72057594037927936.5L, -72057594037927936LL);
6891 TEST_f_L (llrint, -72057594037927936.75L, -72057594037927937LL);
6892 TEST_f_L (llrint, -72057594037927937.5L, -72057594037927938LL);
6894 # if LDBL_MANT_DIG > 100
6895 TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775806LL);
6896 TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775806LL);
6897 TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL);
6898 TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL);
6899 TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL);
6900 TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775806LL);
6901 TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L);
6902 TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775806LL);
6903 TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775807LL);
6904 TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775807LL);
6905 TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL);
6906 TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL);
6911 fesetround (save_round_mode);
6913 END (llrint_tonearest);
6917 llrint_test_towardzero (void)
6919 int save_round_mode;
6920 START (llrint_towardzero);
6922 save_round_mode = fegetround ();
6924 if (!fesetround (FE_TOWARDZERO))
6926 TEST_f_L (llrint, 0.0, 0);
6927 TEST_f_L (llrint, minus_zero, 0);
6928 TEST_f_L (llrint, 0.2L, 0);
6929 TEST_f_L (llrint, -0.2L, 0);
6931 TEST_f_L (llrint, 1.4L, 1);
6932 TEST_f_L (llrint, -1.4L, -1);
6934 TEST_f_L (llrint, 8388600.3L, 8388600);
6935 TEST_f_L (llrint, -8388600.3L, -8388600);
6937 TEST_f_l (llrint, 1071930.0008, 1071930);
6939 /* Test boundary conditions. */
6941 TEST_f_L (llrint, 2097151.0,2097151LL);
6943 TEST_f_L (llrint, 8388608.0, 8388608LL);
6945 TEST_f_L (llrint, 16777216.0, 16777216LL);
6947 TEST_f_L (llrint, 2199023255552.0, 2199023255552LL);
6949 TEST_f_L (llrint, 4398046511104.0, 4398046511104LL);
6950 /* 0x1000000000000 */
6951 TEST_f_L (llrint, 281474976710656.0, 281474976710656LL);
6952 /* 0x10000000000000 */
6953 TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL);
6954 /* 0x10000080000000 */
6955 TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL);
6956 /* 0x20000000000000 */
6957 TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL);
6958 /* 0x80000000000000 */
6959 TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL);
6960 /* 0x100000000000000 */
6961 TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL);
6963 /* The input can only be represented in long double. */
6964 TEST_f_L (llrint, 4503599627370495.5L, 4503599627370495LL);
6965 TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL);
6966 TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL);
6967 TEST_f_L (llrint, 4503599627370496.75L, 4503599627370496LL);
6968 TEST_f_L (llrint, 4503599627370497.5L, 4503599627370497LL);
6970 TEST_f_L (llrint, -4503599627370495.5L, -4503599627370495LL);
6971 TEST_f_L (llrint, -4503599627370496.25L, -4503599627370496LL);
6972 TEST_f_L (llrint, -4503599627370496.5L, -4503599627370496LL);
6973 TEST_f_L (llrint, -4503599627370496.75L, -4503599627370496LL);
6974 TEST_f_L (llrint, -4503599627370497.5L, -4503599627370497LL);
6976 # if LDBL_MANT_DIG > 100
6977 TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL);
6978 TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL);
6979 TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL);
6980 TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370494LL);
6981 TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370495LL);
6982 TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370496LL);
6984 TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370495LL);
6985 TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370496LL);
6986 TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370497LL);
6987 TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370494LL);
6988 TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370495LL);
6989 TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370496LL);
6992 TEST_f_L (llrint, 9007199254740991.5L, 9007199254740991LL);
6993 TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL);
6994 TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL);
6995 TEST_f_L (llrint, 9007199254740992.75L, 9007199254740992LL);
6996 TEST_f_L (llrint, 9007199254740993.5L, 9007199254740993LL);
6998 TEST_f_L (llrint, -9007199254740991.5L, -9007199254740991LL);
6999 TEST_f_L (llrint, -9007199254740992.25L, -9007199254740992LL);
7000 TEST_f_L (llrint, -9007199254740992.5L, -9007199254740992LL);
7001 TEST_f_L (llrint, -9007199254740992.75L, -9007199254740992LL);
7002 TEST_f_L (llrint, -9007199254740993.5L, -9007199254740993LL);
7004 # if LDBL_MANT_DIG > 100
7005 TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL);
7006 TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL);
7007 TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL);
7008 TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740991LL);
7009 TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740992LL);
7010 TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740993LL);
7012 TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740991LL);
7013 TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740992LL);
7014 TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740993LL);
7015 TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740991LL);
7016 TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740992LL);
7017 TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740993LL);
7020 TEST_f_L (llrint, 72057594037927935.5L, 72057594037927935LL);
7021 TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL);
7022 TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL);
7023 TEST_f_L (llrint, 72057594037927936.75L, 72057594037927936LL);
7024 TEST_f_L (llrint, 72057594037927937.5L, 72057594037927937LL);
7026 TEST_f_L (llrint, -72057594037927935.5L, -72057594037927935LL);
7027 TEST_f_L (llrint, -72057594037927936.25L, -72057594037927936LL);
7028 TEST_f_L (llrint, -72057594037927936.5L, -72057594037927936LL);
7029 TEST_f_L (llrint, -72057594037927936.75L, -72057594037927936LL);
7030 TEST_f_L (llrint, -72057594037927937.5L, -72057594037927937LL);
7032 # if LDBL_MANT_DIG > 100
7033 TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775805LL);
7034 TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775805LL);
7035 TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL);
7036 TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL);
7037 TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL);
7038 TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775806LL);
7039 TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L);
7040 TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775806LL);
7041 TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775806LL);
7042 TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775806LL);
7043 TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL);
7044 TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL);
7049 fesetround (save_round_mode);
7051 END (llrint_towardzero);
7055 llrint_test_downward (void)
7057 int save_round_mode;
7058 START (llrint_downward);
7060 save_round_mode = fegetround ();
7062 if (!fesetround (FE_DOWNWARD))
7064 TEST_f_L (llrint, 0.0, 0);
7065 TEST_f_L (llrint, minus_zero, 0);
7066 TEST_f_L (llrint, 0.2L, 0);
7067 TEST_f_L (llrint, -0.2L, -1);
7069 TEST_f_L (llrint, 1.4L, 1);
7070 TEST_f_L (llrint, -1.4L, -2);
7072 TEST_f_L (llrint, 8388600.3L, 8388600);
7073 TEST_f_L (llrint, -8388600.3L, -8388601);
7075 TEST_f_l (llrint, 1071930.0008, 1071930);
7077 /* Test boundary conditions. */
7079 TEST_f_L (llrint, 2097151.0,2097151LL);
7081 TEST_f_L (llrint, 8388608.0, 8388608LL);
7083 TEST_f_L (llrint, 16777216.0, 16777216LL);
7085 TEST_f_L (llrint, 2199023255552.0, 2199023255552LL);
7087 TEST_f_L (llrint, 4398046511104.0, 4398046511104LL);
7088 /* 0x1000000000000 */
7089 TEST_f_L (llrint, 281474976710656.0, 281474976710656LL);
7090 /* 0x10000000000000 */
7091 TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL);
7092 /* 0x10000080000000 */
7093 TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL);
7094 /* 0x20000000000000 */
7095 TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL);
7096 /* 0x80000000000000 */
7097 TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL);
7098 /* 0x100000000000000 */
7099 TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL);
7101 /* The input can only be represented in long double. */
7102 TEST_f_L (llrint, 4503599627370495.5L, 4503599627370495LL);
7103 TEST_f_L (llrint, 4503599627370496.25L, 4503599627370496LL);
7104 TEST_f_L (llrint, 4503599627370496.5L, 4503599627370496LL);
7105 TEST_f_L (llrint, 4503599627370496.75L, 4503599627370496LL);
7106 TEST_f_L (llrint, 4503599627370497.5L, 4503599627370497LL);
7108 TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370495LL);
7109 TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370496LL);
7110 TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370497LL);
7111 TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370494LL);
7112 TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370495LL);
7113 TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370496LL);
7115 TEST_f_L (llrint, -4503599627370495.5L, -4503599627370496LL);
7116 TEST_f_L (llrint, -4503599627370496.25L, -4503599627370497LL);
7117 TEST_f_L (llrint, -4503599627370496.5L, -4503599627370497LL);
7118 TEST_f_L (llrint, -4503599627370496.75L, -4503599627370497LL);
7119 TEST_f_L (llrint, -4503599627370497.5L, -4503599627370498LL);
7121 TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370496LL);
7122 TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370497LL);
7123 TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370498LL);
7124 TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370495LL);
7125 TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370496LL);
7126 TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370497LL);
7128 TEST_f_L (llrint, 9007199254740991.5L, 9007199254740991LL);
7129 TEST_f_L (llrint, 9007199254740992.25L, 9007199254740992LL);
7130 TEST_f_L (llrint, 9007199254740992.5L, 9007199254740992LL);
7131 TEST_f_L (llrint, 9007199254740992.75L, 9007199254740992LL);
7132 TEST_f_L (llrint, 9007199254740993.5L, 9007199254740993LL);
7134 TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740991LL);
7135 TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740992LL);
7136 TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740993LL);
7137 TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740991LL);
7138 TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740992LL);
7139 TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740993LL);
7141 TEST_f_L (llrint, -9007199254740991.5L, -9007199254740992LL);
7142 TEST_f_L (llrint, -9007199254740992.25L, -9007199254740993LL);
7143 TEST_f_L (llrint, -9007199254740992.5L, -9007199254740993LL);
7144 TEST_f_L (llrint, -9007199254740992.75L, -9007199254740993LL);
7145 TEST_f_L (llrint, -9007199254740993.5L, -9007199254740994LL);
7147 TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740992LL);
7148 TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740993LL);
7149 TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740994LL);
7150 TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740992LL);
7151 TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740993LL);
7152 TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740994LL);
7154 TEST_f_L (llrint, 72057594037927935.5L, 72057594037927935LL);
7155 TEST_f_L (llrint, 72057594037927936.25L, 72057594037927936LL);
7156 TEST_f_L (llrint, 72057594037927936.5L, 72057594037927936LL);
7157 TEST_f_L (llrint, 72057594037927936.75L, 72057594037927936LL);
7158 TEST_f_L (llrint, 72057594037927937.5L, 72057594037927937LL);
7160 TEST_f_L (llrint, -72057594037927935.5L, -72057594037927936LL);
7161 TEST_f_L (llrint, -72057594037927936.25L, -72057594037927937LL);
7162 TEST_f_L (llrint, -72057594037927936.5L, -72057594037927937LL);
7163 TEST_f_L (llrint, -72057594037927936.75L, -72057594037927937LL);
7164 TEST_f_L (llrint, -72057594037927937.5L, -72057594037927938LL);
7166 # if LDBL_MANT_DIG > 100
7167 TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775805LL);
7168 TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775806LL);
7169 TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL);
7170 TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL);
7171 TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775806LL);
7172 TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775807LL);
7173 TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775806L);
7174 TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775807LL);
7175 TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775806LL);
7176 TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775807LL);
7177 TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL);
7178 TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL);
7183 fesetround (save_round_mode);
7185 END (llrint_downward);
7189 llrint_test_upward (void)
7191 int save_round_mode;
7192 START (llrint_upward);
7194 save_round_mode = fegetround ();
7196 if (!fesetround (FE_UPWARD))
7198 TEST_f_L (llrint, 0.0, 0);
7199 TEST_f_L (llrint, minus_zero, 0);
7200 TEST_f_L (llrint, 0.2L, 1);
7201 TEST_f_L (llrint, -0.2L, 0);
7203 TEST_f_L (llrint, 1.4L, 2);
7204 TEST_f_L (llrint, -1.4L, -1);
7206 TEST_f_L (llrint, 8388600.3L, 8388601);
7207 TEST_f_L (llrint, -8388600.3L, -8388600);
7209 TEST_f_l (llrint, 1071930.0008, 1071931);
7211 /* Test boundary conditions. */
7213 TEST_f_L (llrint, 2097151.0,2097151LL);
7215 TEST_f_L (llrint, 8388608.0, 8388608LL);
7217 TEST_f_L (llrint, 16777216.0, 16777216LL);
7219 TEST_f_L (llrint, 2199023255552.0, 2199023255552LL);
7221 TEST_f_L (llrint, 4398046511104.0, 4398046511104LL);
7222 /* 0x1000000000000 */
7223 TEST_f_L (llrint, 281474976710656.0, 281474976710656LL);
7224 /* 0x10000000000000 */
7225 TEST_f_L (llrint, 4503599627370496.0, 4503599627370496LL);
7226 /* 0x10000080000000 */
7227 TEST_f_L (llrint, 4503601774854144.0, 4503601774854144LL);
7228 /* 0x20000000000000 */
7229 TEST_f_L (llrint, 9007199254740992.0, 9007199254740992LL);
7230 /* 0x80000000000000 */
7231 TEST_f_L (llrint, 36028797018963968.0, 36028797018963968LL);
7232 /* 0x100000000000000 */
7233 TEST_f_L (llrint, 72057594037927936.0, 72057594037927936LL);
7235 /* The input can only be represented in long double. */
7236 TEST_f_L (llrint, 4503599627370495.5L, 4503599627370496LL);
7237 TEST_f_L (llrint, 4503599627370496.25L, 4503599627370497LL);
7238 TEST_f_L (llrint, 4503599627370496.5L, 4503599627370497LL);
7239 TEST_f_L (llrint, 4503599627370496.75L, 4503599627370497LL);
7240 TEST_f_L (llrint, 4503599627370497.5L, 4503599627370498LL);
7242 TEST_f_L (llrint, 4503599627370495.4999999999999L, 4503599627370496LL);
7243 TEST_f_L (llrint, 4503599627370496.4999999999999L, 4503599627370497LL);
7244 TEST_f_L (llrint, 4503599627370497.4999999999999L, 4503599627370498LL);
7245 TEST_f_L (llrint, 4503599627370494.5000000000001L, 4503599627370495LL);
7246 TEST_f_L (llrint, 4503599627370495.5000000000001L, 4503599627370496LL);
7247 TEST_f_L (llrint, 4503599627370496.5000000000001L, 4503599627370497LL);
7249 TEST_f_L (llrint, -4503599627370495.5L, -4503599627370495LL);
7250 TEST_f_L (llrint, -4503599627370496.25L, -4503599627370496LL);
7251 TEST_f_L (llrint, -4503599627370496.5L, -4503599627370496LL);
7252 TEST_f_L (llrint, -4503599627370496.75L, -4503599627370496LL);
7253 TEST_f_L (llrint, -4503599627370497.5L, -4503599627370497LL);
7255 TEST_f_L (llrint, -4503599627370495.4999999999999L, -4503599627370495LL);
7256 TEST_f_L (llrint, -4503599627370496.4999999999999L, -4503599627370496LL);
7257 TEST_f_L (llrint, -4503599627370497.4999999999999L, -4503599627370497LL);
7258 TEST_f_L (llrint, -4503599627370494.5000000000001L, -4503599627370494LL);
7259 TEST_f_L (llrint, -4503599627370495.5000000000001L, -4503599627370495LL);
7260 TEST_f_L (llrint, -4503599627370496.5000000000001L, -4503599627370496LL);
7262 TEST_f_L (llrint, 9007199254740991.5L, 9007199254740992LL);
7263 TEST_f_L (llrint, 9007199254740992.25L, 9007199254740993LL);
7264 TEST_f_L (llrint, 9007199254740992.5L, 9007199254740993LL);
7265 TEST_f_L (llrint, 9007199254740992.75L, 9007199254740993LL);
7266 TEST_f_L (llrint, 9007199254740993.5L, 9007199254740994LL);
7268 TEST_f_L (llrint, 9007199254740991.4999999999999L, 9007199254740992LL);
7269 TEST_f_L (llrint, 9007199254740992.4999999999999L, 9007199254740993LL);
7270 TEST_f_L (llrint, 9007199254740993.4999999999999L, 9007199254740994LL);
7271 TEST_f_L (llrint, 9007199254740991.5000000000001L, 9007199254740992LL);
7272 TEST_f_L (llrint, 9007199254740992.5000000000001L, 9007199254740993LL);
7273 TEST_f_L (llrint, 9007199254740993.5000000000001L, 9007199254740994LL);
7275 TEST_f_L (llrint, -9007199254740991.5L, -9007199254740991LL);
7276 TEST_f_L (llrint, -9007199254740992.25L, -9007199254740992LL);
7277 TEST_f_L (llrint, -9007199254740992.5L, -9007199254740992LL);
7278 TEST_f_L (llrint, -9007199254740992.75L, -9007199254740992LL);
7279 TEST_f_L (llrint, -9007199254740993.5L, -9007199254740993LL);
7281 TEST_f_L (llrint, -9007199254740991.4999999999999L, -9007199254740991LL);
7282 TEST_f_L (llrint, -9007199254740992.4999999999999L, -9007199254740992LL);
7283 TEST_f_L (llrint, -9007199254740993.4999999999999L, -9007199254740993LL);
7284 TEST_f_L (llrint, -9007199254740991.5000000000001L, -9007199254740991LL);
7285 TEST_f_L (llrint, -9007199254740992.5000000000001L, -9007199254740992LL);
7286 TEST_f_L (llrint, -9007199254740993.5000000000001L, -9007199254740993LL);
7288 TEST_f_L (llrint, 72057594037927935.5L, 72057594037927936LL);
7289 TEST_f_L (llrint, 72057594037927936.25L, 72057594037927937LL);
7290 TEST_f_L (llrint, 72057594037927936.5L, 72057594037927937LL);
7291 TEST_f_L (llrint, 72057594037927936.75L, 72057594037927937LL);
7292 TEST_f_L (llrint, 72057594037927937.5L, 72057594037927938LL);
7294 TEST_f_L (llrint, -72057594037927935.5L, -72057594037927935LL);
7295 TEST_f_L (llrint, -72057594037927936.25L, -72057594037927936LL);
7296 TEST_f_L (llrint, -72057594037927936.5L, -72057594037927936LL);
7297 TEST_f_L (llrint, -72057594037927936.75L, -72057594037927936LL);
7298 TEST_f_L (llrint, -72057594037927937.5L, -72057594037927937LL);
7300 # if LDBL_MANT_DIG > 100
7301 TEST_f_L (llrint, 9223372036854775805.5L, 9223372036854775806LL);
7302 TEST_f_L (llrint, -9223372036854775805.5L, -9223372036854775805LL);
7303 TEST_f_L (llrint, 9223372036854775806.0L, 9223372036854775806LL);
7304 TEST_f_L (llrint, -9223372036854775806.0L, -9223372036854775806LL);
7305 TEST_f_L (llrint, 9223372036854775806.25L, 9223372036854775807LL);
7306 TEST_f_L (llrint, -9223372036854775806.25L, -9223372036854775806LL);
7307 TEST_f_L (llrint, 9223372036854775806.5L, 9223372036854775807L);
7308 TEST_f_L (llrint, -9223372036854775806.5L, -9223372036854775806LL);
7309 TEST_f_L (llrint, 9223372036854775806.75L, 9223372036854775807LL);
7310 TEST_f_L (llrint, -9223372036854775806.75L, -9223372036854775806LL);
7311 TEST_f_L (llrint, 9223372036854775807.0L, 9223372036854775807LL);
7312 TEST_f_L (llrint, -9223372036854775807.0L, -9223372036854775807LL);
7317 fesetround (save_round_mode);
7319 END (llrint_upward);
7328 if (errno == ENOSYS)
7329 /* Function not implemented. */
7333 TEST_f_f (log, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7334 TEST_f_f (log, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7336 TEST_f_f (log, 1, 0);
7338 TEST_f_f (log, -1, qnan_value, INVALID_EXCEPTION);
7339 TEST_f_f (log, -max_value, qnan_value, INVALID_EXCEPTION);
7340 TEST_f_f (log, minus_infty, qnan_value, INVALID_EXCEPTION);
7341 TEST_f_f (log, plus_infty, plus_infty);
7342 TEST_f_f (log, qnan_value, qnan_value);
7344 TEST_f_f (log, M_El, 1);
7345 TEST_f_f (log, 1.0 / M_El, -1);
7346 TEST_f_f (log, 2, M_LN2l);
7347 TEST_f_f (log, 10, M_LN10l);
7348 TEST_f_f (log, 0.75L, -0.287682072451780927439219005993827432L);
7359 if (errno == ENOSYS)
7360 /* Function not implemented. */
7365 TEST_f_f (log10, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7366 TEST_f_f (log10, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7368 TEST_f_f (log10, 1, 0);
7370 /* log10 (x) == qNaN plus invalid exception if x < 0. */
7371 TEST_f_f (log10, -1, qnan_value, INVALID_EXCEPTION);
7372 TEST_f_f (log10, -max_value, qnan_value, INVALID_EXCEPTION);
7373 TEST_f_f (log10, minus_infty, qnan_value, INVALID_EXCEPTION);
7375 TEST_f_f (log10, plus_infty, plus_infty);
7376 TEST_f_f (log10, qnan_value, qnan_value);
7378 TEST_f_f (log10, 0.1L, -1);
7379 TEST_f_f (log10, 10.0, 1);
7380 TEST_f_f (log10, 100.0, 2);
7381 TEST_f_f (log10, 10000.0, 4);
7382 TEST_f_f (log10, M_El, M_LOG10El);
7383 TEST_f_f (log10, 0.75L, -0.124938736608299953132449886193870744L);
7394 if (errno == ENOSYS)
7395 /* Function not implemented. */
7400 TEST_f_f (log1p, 0, 0);
7401 TEST_f_f (log1p, minus_zero, minus_zero);
7403 TEST_f_f (log1p, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7404 TEST_f_f (log1p, -2, qnan_value, INVALID_EXCEPTION);
7405 TEST_f_f (log1p, -max_value, qnan_value, INVALID_EXCEPTION);
7406 TEST_f_f (log1p, minus_infty, qnan_value, INVALID_EXCEPTION);
7408 TEST_f_f (log1p, plus_infty, plus_infty);
7409 TEST_f_f (log1p, qnan_value, qnan_value);
7411 TEST_f_f (log1p, M_El - 1.0, 1);
7413 TEST_f_f (log1p, -0.25L, -0.287682072451780927439219005993827432L);
7414 TEST_f_f (log1p, -0.875, -2.07944154167983592825169636437452970L);
7425 if (errno == ENOSYS)
7426 /* Function not implemented. */
7431 TEST_f_f (log2, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7432 TEST_f_f (log2, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7434 TEST_f_f (log2, 1, 0);
7436 TEST_f_f (log2, -1, qnan_value, INVALID_EXCEPTION);
7437 TEST_f_f (log2, -max_value, qnan_value, INVALID_EXCEPTION);
7438 TEST_f_f (log2, minus_infty, qnan_value, INVALID_EXCEPTION);
7440 TEST_f_f (log2, plus_infty, plus_infty);
7441 TEST_f_f (log2, qnan_value, qnan_value);
7443 TEST_f_f (log2, M_El, M_LOG2El);
7444 TEST_f_f (log2, 2.0, 1);
7445 TEST_f_f (log2, 16.0, 4);
7446 TEST_f_f (log2, 256.0, 8);
7447 TEST_f_f (log2, 0.75L, -.415037499278843818546261056052183492L);
7458 TEST_f_f (logb, plus_infty, plus_infty);
7459 TEST_f_f (logb, minus_infty, plus_infty);
7461 TEST_f_f (logb, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7463 TEST_f_f (logb, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
7464 TEST_f_f (logb, qnan_value, qnan_value);
7466 TEST_f_f (logb, 1, 0);
7467 TEST_f_f (logb, M_El, 1);
7468 TEST_f_f (logb, 1024, 10);
7469 TEST_f_f (logb, -2000, 10);
7471 TEST_f_f (logb, 0x0.1p-127, -131);
7472 TEST_f_f (logb, 0x0.01p-127, -135);
7473 TEST_f_f (logb, 0x0.011p-127, -135);
7475 TEST_f_f (logb, 0x0.8p-1022, -1023);
7476 TEST_f_f (logb, 0x0.1p-1022, -1026);
7477 TEST_f_f (logb, 0x0.00111p-1022, -1034);
7478 TEST_f_f (logb, 0x0.00001p-1022, -1042);
7479 TEST_f_f (logb, 0x0.000011p-1022, -1042);
7480 TEST_f_f (logb, 0x0.0000000000001p-1022, -1074);
7482 #if defined TEST_LDOUBLE && LDBL_MIN_EXP - LDBL_MANT_DIG <= -16400
7483 TEST_f_f (logb, 0x1p-16400L, -16400);
7484 TEST_f_f (logb, 0x.00000000001p-16382L, -16426);
7491 logb_test_downward (void)
7493 int save_round_mode;
7497 if (errno == ENOSYS)
7498 /* Function not implemented. */
7501 START (logb_downward);
7503 save_round_mode = fegetround ();
7505 if (!fesetround (FE_DOWNWARD))
7508 /* IEEE 754-2008 says (section 5.3.3) that "logB(1) is +0.". Libm
7509 should not return -0 from logb in any rounding mode. PowerPC32 has
7510 failed with this test for power4 logb (and logbl on all PowerPC
7511 platforms) in the past due to instruction selection. GCC PR 52775
7512 provides the availability of the fcfid insn in 32-bit mode which
7513 eliminates the use of fsub in this instance and prevents the negative
7517 TEST_f_f (logb, 1.000e+0, plus_zero);
7520 fesetround (save_round_mode);
7522 END (logb_downward);
7528 /* TODO: missing +/-Inf as well as qNaN tests. */
7532 TEST_f_l (lround, 0, 0);
7533 TEST_f_l (lround, minus_zero, 0);
7534 TEST_f_l (lround, 0.2L, 0.0);
7535 TEST_f_l (lround, -0.2L, 0);
7536 TEST_f_l (lround, 0.5, 1);
7537 TEST_f_l (lround, -0.5, -1);
7538 TEST_f_l (lround, 0.8L, 1);
7539 TEST_f_l (lround, -0.8L, -1);
7540 TEST_f_l (lround, 1.5, 2);
7541 TEST_f_l (lround, -1.5, -2);
7542 TEST_f_l (lround, 22514.5, 22515);
7543 TEST_f_l (lround, -22514.5, -22515);
7544 TEST_f_l (lround, 1071930.0008, 1071930);
7546 TEST_f_l (lround, 1073741824.01, 1073741824);
7547 # if LONG_MAX > 281474976710656
7548 TEST_f_l (lround, 281474976710656.025, 281474976710656);
7549 TEST_f_l (lround, 18014398509481974, 18014398509481974);
7551 TEST_f_l (lround, 2097152.5, 2097153);
7552 TEST_f_l (lround, -2097152.5, -2097153);
7553 /* nextafter(0.5,-1) */
7554 TEST_f_l (lround, 0x1.fffffffffffffp-2, 0);
7555 /* nextafter(-0.5,1) */
7556 TEST_f_l (lround, -0x1.fffffffffffffp-2, 0);
7558 /* nextafter(0.5,-1) */
7559 TEST_f_l (lround, 0x1.fffffp-2, 0);
7560 /* nextafter(-0.5,1) */
7561 TEST_f_l (lround, -0x1.fffffp-2, 0);
7562 TEST_f_l (lround, 0x1.fffffep+23, 16777215);
7563 TEST_f_l (lround, -0x1.fffffep+23, -16777215);
7572 /* TODO: missing +/-Inf as well as qNaN tests. */
7576 TEST_f_L (llround, 0, 0);
7577 TEST_f_L (llround, minus_zero, 0);
7578 TEST_f_L (llround, 0.2L, 0.0);
7579 TEST_f_L (llround, -0.2L, 0);
7580 TEST_f_L (llround, 0.5, 1);
7581 TEST_f_L (llround, -0.5, -1);
7582 TEST_f_L (llround, 0.8L, 1);
7583 TEST_f_L (llround, -0.8L, -1);
7584 TEST_f_L (llround, 1.5, 2);
7585 TEST_f_L (llround, -1.5, -2);
7586 TEST_f_L (llround, 22514.5, 22515);
7587 TEST_f_L (llround, -22514.5, -22515);
7588 TEST_f_l (llround, 1071930.0008, 1071930);
7590 TEST_f_L (llround, 2097152.5, 2097153);
7591 TEST_f_L (llround, -2097152.5, -2097153);
7592 TEST_f_L (llround, 34359738368.5, 34359738369ll);
7593 TEST_f_L (llround, -34359738368.5, -34359738369ll);
7594 TEST_f_L (llround, -3.65309740835E17, -365309740835000000LL);
7597 /* Test boundary conditions. */
7599 TEST_f_L (llround, 2097151.0, 2097151LL);
7601 TEST_f_L (llround, 8388608.0, 8388608LL);
7603 TEST_f_L (llround, 16777216.0, 16777216LL);
7605 TEST_f_L (llround, 2199023255552.0, 2199023255552LL);
7607 TEST_f_L (llround, 4398046511104.0, 4398046511104LL);
7608 /* 0x1000000000000 */
7609 TEST_f_L (llround, 281474976710656.0, 281474976710656LL);
7610 /* 0x10000000000000 */
7611 TEST_f_L (llround, 4503599627370496.0, 4503599627370496LL);
7612 /* 0x10000080000000 */
7613 TEST_f_L (llround, 4503601774854144.0, 4503601774854144LL);
7614 /* 0x20000000000000 */
7615 TEST_f_L (llround, 9007199254740992.0, 9007199254740992LL);
7616 /* 0x80000000000000 */
7617 TEST_f_L (llround, 36028797018963968.0, 36028797018963968LL);
7618 /* 0x100000000000000 */
7619 TEST_f_L (llround, 72057594037927936.0, 72057594037927936LL);
7623 TEST_f_L (llround, 4294967295.5, 4294967296LL);
7625 TEST_f_L (llround, 8589934591.5, 8589934592LL);
7627 /* nextafter(0.5,-1) */
7628 TEST_f_L (llround, 0x1.fffffffffffffp-2, 0);
7629 /* nextafter(-0.5,1) */
7630 TEST_f_L (llround, -0x1.fffffffffffffp-2, 0);
7631 /* On PowerPC an exponent of '52' is the largest incrementally
7632 * representable sequence of whole-numbers in the 'double' range. We test
7633 * lround to make sure that a guard bit set during the lround operation
7634 * hasn't forced an erroneous shift giving us an incorrect result. The odd
7635 * numbers between +-(2^52+1 and 2^53-1) are affected since they have the
7636 * rightmost bit set. */
7638 TEST_f_L (llround, 0x1.0000000000001p+52,4503599627370497LL);
7639 TEST_f_L (llround, -0x1.0000000000001p+52,-4503599627370497LL);
7640 /* +-(2^53-1): Input is the last (positive and negative) incrementally
7641 * representable whole-number in the 'double' range that might round
7643 TEST_f_L (llround, 0x1.fffffffffffffp+52, 9007199254740991LL);
7644 TEST_f_L (llround, -0x1.fffffffffffffp+52, -9007199254740991LL);
7646 /* nextafter(0.5,-1) */
7647 TEST_f_L (llround, 0x1.fffffep-2, 0);
7648 /* nextafter(-0.5,1) */
7649 TEST_f_L (llround, -0x1.fffffep-2, 0);
7650 /* As above, on PowerPC an exponent of '23' is the largest incrementally
7651 * representable sequence of whole-numbers in the 'float' range.
7652 * Likewise, numbers between +-(2^23+1 and 2^24-1) are affected. */
7653 TEST_f_L (llround, 0x1.000002p+23,8388609);
7654 TEST_f_L (llround, -0x1.000002p+23,-8388609);
7655 TEST_f_L (llround, 0x1.fffffep+23, 16777215);
7656 TEST_f_L (llround, -0x1.fffffep+23, -16777215);
7661 /* The input can only be represented in long double. */
7662 TEST_f_L (llround, 4503599627370495.5L, 4503599627370496LL);
7663 TEST_f_L (llround, 4503599627370496.25L, 4503599627370496LL);
7664 TEST_f_L (llround, 4503599627370496.5L, 4503599627370497LL);
7665 TEST_f_L (llround, 4503599627370496.75L, 4503599627370497LL);
7666 TEST_f_L (llround, 4503599627370497.5L, 4503599627370498LL);
7668 # if LDBL_MANT_DIG > 100
7669 TEST_f_L (llround, 4503599627370495.4999999999999L, 4503599627370495LL);
7670 TEST_f_L (llround, 4503599627370496.4999999999999L, 4503599627370496LL);
7671 TEST_f_L (llround, 4503599627370497.4999999999999L, 4503599627370497LL);
7672 TEST_f_L (llround, 4503599627370494.5000000000001L, 4503599627370495LL);
7673 TEST_f_L (llround, 4503599627370495.5000000000001L, 4503599627370496LL);
7674 TEST_f_L (llround, 4503599627370496.5000000000001L, 4503599627370497LL);
7676 TEST_f_L (llround, -4503599627370495.4999999999999L, -4503599627370495LL);
7677 TEST_f_L (llround, -4503599627370496.4999999999999L, -4503599627370496LL);
7678 TEST_f_L (llround, -4503599627370497.4999999999999L, -4503599627370497LL);
7679 TEST_f_L (llround, -4503599627370494.5000000000001L, -4503599627370495LL);
7680 TEST_f_L (llround, -4503599627370495.5000000000001L, -4503599627370496LL);
7681 TEST_f_L (llround, -4503599627370496.5000000000001L, -4503599627370497LL);
7684 TEST_f_L (llround, -4503599627370495.5L, -4503599627370496LL);
7685 TEST_f_L (llround, -4503599627370496.25L, -4503599627370496LL);
7686 TEST_f_L (llround, -4503599627370496.5L, -4503599627370497LL);
7687 TEST_f_L (llround, -4503599627370496.75L, -4503599627370497LL);
7688 TEST_f_L (llround, -4503599627370497.5L, -4503599627370498LL);
7690 TEST_f_L (llround, 9007199254740991.5L, 9007199254740992LL);
7691 TEST_f_L (llround, 9007199254740992.25L, 9007199254740992LL);
7692 TEST_f_L (llround, 9007199254740992.5L, 9007199254740993LL);
7693 TEST_f_L (llround, 9007199254740992.75L, 9007199254740993LL);
7694 TEST_f_L (llround, 9007199254740993.5L, 9007199254740994LL);
7696 # if LDBL_MANT_DIG > 100
7697 TEST_f_L (llround, 9007199254740991.4999999999999L, 9007199254740991LL);
7698 TEST_f_L (llround, 9007199254740992.4999999999999L, 9007199254740992LL);
7699 TEST_f_L (llround, 9007199254740993.4999999999999L, 9007199254740993LL);
7700 TEST_f_L (llround, 9007199254740991.5000000000001L, 9007199254740992LL);
7701 TEST_f_L (llround, 9007199254740992.5000000000001L, 9007199254740993LL);
7702 TEST_f_L (llround, 9007199254740993.5000000000001L, 9007199254740994LL);
7704 TEST_f_L (llround, -9007199254740991.4999999999999L, -9007199254740991LL);
7705 TEST_f_L (llround, -9007199254740992.4999999999999L, -9007199254740992LL);
7706 TEST_f_L (llround, -9007199254740993.4999999999999L, -9007199254740993LL);
7707 TEST_f_L (llround, -9007199254740991.5000000000001L, -9007199254740992LL);
7708 TEST_f_L (llround, -9007199254740992.5000000000001L, -9007199254740993LL);
7709 TEST_f_L (llround, -9007199254740993.5000000000001L, -9007199254740994LL);
7712 TEST_f_L (llround, -9007199254740991.5L, -9007199254740992LL);
7713 TEST_f_L (llround, -9007199254740992.25L, -9007199254740992LL);
7714 TEST_f_L (llround, -9007199254740992.5L, -9007199254740993LL);
7715 TEST_f_L (llround, -9007199254740992.75L, -9007199254740993LL);
7716 TEST_f_L (llround, -9007199254740993.5L, -9007199254740994LL);
7718 TEST_f_L (llround, 72057594037927935.5L, 72057594037927936LL);
7719 TEST_f_L (llround, 72057594037927936.25L, 72057594037927936LL);
7720 TEST_f_L (llround, 72057594037927936.5L, 72057594037927937LL);
7721 TEST_f_L (llround, 72057594037927936.75L, 72057594037927937LL);
7722 TEST_f_L (llround, 72057594037927937.5L, 72057594037927938LL);
7724 TEST_f_L (llround, -72057594037927935.5L, -72057594037927936LL);
7725 TEST_f_L (llround, -72057594037927936.25L, -72057594037927936LL);
7726 TEST_f_L (llround, -72057594037927936.5L, -72057594037927937LL);
7727 TEST_f_L (llround, -72057594037927936.75L, -72057594037927937LL);
7728 TEST_f_L (llround, -72057594037927937.5L, -72057594037927938LL);
7730 TEST_f_L (llround, 9223372036854775806.25L, 9223372036854775806LL);
7731 TEST_f_L (llround, -9223372036854775806.25L, -9223372036854775806LL);
7732 TEST_f_L (llround, 9223372036854775806.5L, 9223372036854775807LL);
7733 TEST_f_L (llround, -9223372036854775806.5L, -9223372036854775807LL);
7734 TEST_f_L (llround, 9223372036854775807.0L, 9223372036854775807LL);
7735 TEST_f_L (llround, -9223372036854775807.0L, -9223372036854775807LL);
7748 TEST_fF_f1 (modf, plus_infty, 0, plus_infty);
7749 TEST_fF_f1 (modf, minus_infty, minus_zero, minus_infty);
7750 TEST_fF_f1 (modf, qnan_value, qnan_value, qnan_value);
7751 TEST_fF_f1 (modf, 0, 0, 0);
7752 TEST_fF_f1 (modf, 1.5, 0.5, 1);
7753 TEST_fF_f1 (modf, 2.5, 0.5, 2);
7754 TEST_fF_f1 (modf, -2.5, -0.5, -2);
7755 TEST_fF_f1 (modf, 20, 0, 20);
7756 TEST_fF_f1 (modf, 21, 0, 21);
7757 TEST_fF_f1 (modf, 89.5, 0.5, 89);
7764 nearbyint_test (void)
7768 TEST_f_f (nearbyint, 0.0, 0.0);
7769 TEST_f_f (nearbyint, minus_zero, minus_zero);
7770 TEST_f_f (nearbyint, plus_infty, plus_infty);
7771 TEST_f_f (nearbyint, minus_infty, minus_infty);
7772 TEST_f_f (nearbyint, qnan_value, qnan_value);
7774 /* Subnormal values */
7775 TEST_f_f (nearbyint, -8.98847e+307, -8.98847e+307);
7776 TEST_f_f (nearbyint, -4.45015e-308, minus_zero);
7778 /* Default rounding mode is round to nearest. */
7779 TEST_f_f (nearbyint, 0.5, 0.0);
7780 TEST_f_f (nearbyint, 1.5, 2.0);
7781 TEST_f_f (nearbyint, -0.5, minus_zero);
7782 TEST_f_f (nearbyint, -1.5, -2.0);
7784 TEST_f_f (nearbyint, 262144.75, 262145.0);
7785 TEST_f_f (nearbyint, 262142.75, 262143.0);
7786 TEST_f_f (nearbyint, 524286.75, 524287.0);
7787 TEST_f_f (nearbyint, 524288.75, 524289.0);
7789 TEST_f_f (nearbyint, 1048576.75, 1048577.0);
7790 TEST_f_f (nearbyint, 2097152.75, 2097153.0);
7791 TEST_f_f (nearbyint, 2492472.75, 2492473.0);
7792 TEST_f_f (nearbyint, 2886220.75, 2886221.0);
7793 TEST_f_f (nearbyint, 3058792.75, 3058793.0);
7794 TEST_f_f (nearbyint, -1048576.75, -1048577.0);
7795 TEST_f_f (nearbyint, -2097152.75, -2097153.0);
7796 TEST_f_f (nearbyint, -2492472.75, -2492473.0);
7797 TEST_f_f (nearbyint, -2886220.75, -2886221.0);
7798 TEST_f_f (nearbyint, -3058792.75, -3058793.0);
7800 TEST_f_f (nearbyint, 70368744177664.75, 70368744177665.0);
7801 TEST_f_f (nearbyint, 140737488355328.75, 140737488355329.0);
7802 TEST_f_f (nearbyint, 281474976710656.75, 281474976710657.0);
7803 TEST_f_f (nearbyint, 562949953421312.75, 562949953421313.0);
7804 TEST_f_f (nearbyint, 1125899906842624.75, 1125899906842625.0);
7805 TEST_f_f (nearbyint, -70368744177664.75, -70368744177665.0);
7806 TEST_f_f (nearbyint, -140737488355328.75, -140737488355329.0);
7807 TEST_f_f (nearbyint, -281474976710656.75, -281474976710657.0);
7808 TEST_f_f (nearbyint, -562949953421312.75, -562949953421313.0);
7809 TEST_f_f (nearbyint, -1125899906842624.75, -1125899906842625.0);
7816 nextafter_test (void)
7821 TEST_ff_f (nextafter, 0, 0, 0);
7822 TEST_ff_f (nextafter, minus_zero, 0, 0);
7823 TEST_ff_f (nextafter, 0, minus_zero, minus_zero);
7824 TEST_ff_f (nextafter, minus_zero, minus_zero, minus_zero);
7826 TEST_ff_f (nextafter, 9, 9, 9);
7827 TEST_ff_f (nextafter, -9, -9, -9);
7828 TEST_ff_f (nextafter, plus_infty, plus_infty, plus_infty);
7829 TEST_ff_f (nextafter, minus_infty, minus_infty, minus_infty);
7831 TEST_ff_f (nextafter, qnan_value, 1.1L, qnan_value);
7832 TEST_ff_f (nextafter, 1.1L, qnan_value, qnan_value);
7833 TEST_ff_f (nextafter, qnan_value, qnan_value, qnan_value);
7835 FLOAT fltmax = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
7836 LDBL_MAX, DBL_MAX, FLT_MAX);
7837 TEST_ff_f (nextafter, fltmax, plus_infty, plus_infty, OVERFLOW_EXCEPTION);
7838 TEST_ff_f (nextafter, -fltmax, minus_infty, minus_infty, OVERFLOW_EXCEPTION);
7841 // XXX Enable once gcc is fixed.
7842 //TEST_ff_f (nextafter, 0x0.00000040000000000000p-16385L, -0.1L, 0x0.0000003ffffffff00000p-16385L);
7845 /* XXX We need the hexadecimal FP number representation here for further
7853 nexttoward_test (void)
7856 TEST_ff_f (nexttoward, 0, 0, 0);
7857 TEST_ff_f (nexttoward, minus_zero, 0, 0);
7858 TEST_ff_f (nexttoward, 0, minus_zero, minus_zero);
7859 TEST_ff_f (nexttoward, minus_zero, minus_zero, minus_zero);
7861 TEST_ff_f (nexttoward, 9, 9, 9);
7862 TEST_ff_f (nexttoward, -9, -9, -9);
7863 TEST_ff_f (nexttoward, plus_infty, plus_infty, plus_infty);
7864 TEST_ff_f (nexttoward, minus_infty, minus_infty, minus_infty);
7866 TEST_ff_f (nexttoward, qnan_value, 1.1L, qnan_value);
7867 TEST_ff_f (nexttoward, 1.1L, qnan_value, qnan_value);
7868 TEST_ff_f (nexttoward, qnan_value, qnan_value, qnan_value);
7871 TEST_ff_f (nexttoward, 1.0, 1.1L, 0x1.000002p0);
7872 TEST_ff_f (nexttoward, 1.0, LDBL_MAX, 0x1.000002p0);
7873 TEST_ff_f (nexttoward, 1.0, 0x1.0000000000001p0, 0x1.000002p0);
7874 TEST_ff_f (nexttoward, 1.0, 0.9L, 0x0.ffffffp0);
7875 TEST_ff_f (nexttoward, 1.0, -LDBL_MAX, 0x0.ffffffp0);
7876 TEST_ff_f (nexttoward, 1.0, 0x0.fffffffffffff8p0, 0x0.ffffffp0);
7877 TEST_ff_f (nexttoward, -1.0, -1.1L, -0x1.000002p0);
7878 TEST_ff_f (nexttoward, -1.0, -LDBL_MAX, -0x1.000002p0);
7879 TEST_ff_f (nexttoward, -1.0, -0x1.0000000000001p0, -0x1.000002p0);
7880 TEST_ff_f (nexttoward, -1.0, -0.9L, -0x0.ffffffp0);
7881 TEST_ff_f (nexttoward, -1.0, LDBL_MAX, -0x0.ffffffp0);
7882 TEST_ff_f (nexttoward, -1.0, -0x0.fffffffffffff8p0, -0x0.ffffffp0);
7883 TEST_ff_f (nexttoward, -0x1.3p-145, -0xap-148L, -0x1.4p-145, UNDERFLOW_EXCEPTION);
7884 # if LDBL_MANT_DIG >= 64
7885 TEST_ff_f (nexttoward, 1.0, 0x1.000000000000002p0L, 0x1.000002p0);
7886 TEST_ff_f (nexttoward, 1.0, 0x0.ffffffffffffffffp0L, 0x0.ffffffp0);
7887 TEST_ff_f (nexttoward, -1.0, -0x1.000000000000002p0L, -0x1.000002p0);
7888 TEST_ff_f (nexttoward, -1.0, -0x0.ffffffffffffffffp0L, -0x0.ffffffp0);
7890 # if LDBL_MANT_DIG >= 106
7891 TEST_ff_f (nexttoward, 1.0, 0x1.000000000000000000000000008p0L, 0x1.000002p0);
7892 TEST_ff_f (nexttoward, 1.0, 0x0.ffffffffffffffffffffffffffcp0L, 0x0.ffffffp0);
7893 TEST_ff_f (nexttoward, -1.0, -0x1.000000000000000000000000008p0L, -0x1.000002p0);
7894 TEST_ff_f (nexttoward, -1.0, -0x0.ffffffffffffffffffffffffffcp0L, -0x0.ffffffp0);
7896 # if LDBL_MANT_DIG >= 113
7897 TEST_ff_f (nexttoward, 1.0, 0x1.0000000000000000000000000001p0L, 0x1.000002p0);
7898 TEST_ff_f (nexttoward, 1.0, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.ffffffp0);
7899 TEST_ff_f (nexttoward, -1.0, -0x1.0000000000000000000000000001p0L, -0x1.000002p0);
7900 TEST_ff_f (nexttoward, -1.0, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.ffffffp0);
7904 TEST_ff_f (nexttoward, 1.0, 1.1L, 0x1.0000000000001p0);
7905 TEST_ff_f (nexttoward, 1.0, LDBL_MAX, 0x1.0000000000001p0);
7906 TEST_ff_f (nexttoward, 1.0, 0x1.0000000000001p0, 0x1.0000000000001p0);
7907 TEST_ff_f (nexttoward, 1.0, 0.9L, 0x0.fffffffffffff8p0);
7908 TEST_ff_f (nexttoward, 1.0, -LDBL_MAX, 0x0.fffffffffffff8p0);
7909 TEST_ff_f (nexttoward, 1.0, 0x0.fffffffffffff8p0, 0x0.fffffffffffff8p0);
7910 TEST_ff_f (nexttoward, -1.0, -1.1L, -0x1.0000000000001p0);
7911 TEST_ff_f (nexttoward, -1.0, -LDBL_MAX, -0x1.0000000000001p0);
7912 TEST_ff_f (nexttoward, -1.0, -0x1.0000000000001p0, -0x1.0000000000001p0);
7913 TEST_ff_f (nexttoward, -1.0, -0.9L, -0x0.fffffffffffff8p0);
7914 TEST_ff_f (nexttoward, -1.0, LDBL_MAX, -0x0.fffffffffffff8p0);
7915 TEST_ff_f (nexttoward, -1.0, -0x0.fffffffffffff8p0, -0x0.fffffffffffff8p0);
7916 TEST_ff_f (nexttoward, -1.0, -0x8.00346dc5d6388p-3L, -0x1.0000000000001p0);
7917 TEST_ff_f (nexttoward, 0x1p-1074, 0x1p-1073L, 0x1p-1073, UNDERFLOW_EXCEPTION);
7918 # if LDBL_MANT_DIG >= 64
7919 TEST_ff_f (nexttoward, 1.0, 0x1.000000000000002p0L, 0x1.0000000000001p0);
7920 TEST_ff_f (nexttoward, 1.0, 0x0.ffffffffffffffffp0L, 0x0.fffffffffffff8p0);
7921 TEST_ff_f (nexttoward, -1.0, -0x1.000000000000002p0L, -0x1.0000000000001p0);
7922 TEST_ff_f (nexttoward, -1.0, -0x0.ffffffffffffffffp0L, -0x0.fffffffffffff8p0);
7924 # if LDBL_MANT_DIG >= 106
7925 TEST_ff_f (nexttoward, 1.0, 0x1.000000000000000000000000008p0L, 0x1.0000000000001p0);
7926 TEST_ff_f (nexttoward, 1.0, 0x0.ffffffffffffffffffffffffffcp0L, 0x0.fffffffffffff8p0);
7927 TEST_ff_f (nexttoward, -1.0, -0x1.000000000000000000000000008p0L, -0x1.0000000000001p0);
7928 TEST_ff_f (nexttoward, -1.0, -0x0.ffffffffffffffffffffffffffcp0L, -0x0.fffffffffffff8p0);
7930 # if LDBL_MANT_DIG >= 113
7931 TEST_ff_f (nexttoward, 1.0, 0x1.0000000000000000000000000001p0L, 0x1.0000000000001p0);
7932 TEST_ff_f (nexttoward, 1.0, 0x0.ffffffffffffffffffffffffffff8p0L, 0x0.fffffffffffff8p0);
7933 TEST_ff_f (nexttoward, -1.0, -0x1.0000000000000000000000000001p0L, -0x1.0000000000001p0);
7934 TEST_ff_f (nexttoward, -1.0, -0x0.ffffffffffffffffffffffffffff8p0L, -0x0.fffffffffffff8p0);
7948 if (errno == ENOSYS)
7949 /* Function not implemented. */
7954 TEST_ff_f (pow, 0, 0, 1);
7955 TEST_ff_f (pow, 0, minus_zero, 1);
7956 TEST_ff_f (pow, minus_zero, 0, 1);
7957 TEST_ff_f (pow, minus_zero, minus_zero, 1);
7959 TEST_ff_f (pow, 10, 0, 1);
7960 TEST_ff_f (pow, 10, minus_zero, 1);
7961 TEST_ff_f (pow, -10, 0, 1);
7962 TEST_ff_f (pow, -10, minus_zero, 1);
7964 TEST_ff_f (pow, qnan_value, 0, 1);
7965 TEST_ff_f (pow, qnan_value, minus_zero, 1);
7969 TEST_ff_f (pow, 1.1L, plus_infty, plus_infty);
7970 TEST_ff_f (pow, plus_infty, plus_infty, plus_infty);
7971 TEST_ff_f (pow, -1.1L, plus_infty, plus_infty);
7972 TEST_ff_f (pow, minus_infty, plus_infty, plus_infty);
7974 TEST_ff_f (pow, 0.9L, plus_infty, 0);
7975 TEST_ff_f (pow, 1e-7L, plus_infty, 0);
7976 TEST_ff_f (pow, -0.9L, plus_infty, 0);
7977 TEST_ff_f (pow, -1e-7L, plus_infty, 0);
7979 TEST_ff_f (pow, 1.1L, minus_infty, 0);
7980 TEST_ff_f (pow, plus_infty, minus_infty, 0);
7981 TEST_ff_f (pow, -1.1L, minus_infty, 0);
7982 TEST_ff_f (pow, minus_infty, minus_infty, 0);
7984 TEST_ff_f (pow, 0.9L, minus_infty, plus_infty);
7985 TEST_ff_f (pow, 1e-7L, minus_infty, plus_infty);
7986 TEST_ff_f (pow, -0.9L, minus_infty, plus_infty);
7987 TEST_ff_f (pow, -1e-7L, minus_infty, plus_infty);
7989 TEST_ff_f (pow, plus_infty, 1e-7L, plus_infty);
7990 TEST_ff_f (pow, plus_infty, 1, plus_infty);
7991 TEST_ff_f (pow, plus_infty, 1e7L, plus_infty);
7992 TEST_ff_f (pow, plus_infty, min_subnorm_value, plus_infty);
7994 TEST_ff_f (pow, plus_infty, -1e-7L, 0);
7995 TEST_ff_f (pow, plus_infty, -1, 0);
7996 TEST_ff_f (pow, plus_infty, -1e7L, 0);
7997 TEST_ff_f (pow, plus_infty, -min_subnorm_value, 0);
7999 TEST_ff_f (pow, minus_infty, 1, minus_infty);
8000 TEST_ff_f (pow, minus_infty, 11, minus_infty);
8001 TEST_ff_f (pow, minus_infty, 1001, minus_infty);
8003 TEST_ff_f (pow, minus_infty, 2, plus_infty);
8004 TEST_ff_f (pow, minus_infty, 12, plus_infty);
8005 TEST_ff_f (pow, minus_infty, 1002, plus_infty);
8006 TEST_ff_f (pow, minus_infty, 0.1L, plus_infty);
8007 TEST_ff_f (pow, minus_infty, 1.1L, plus_infty);
8008 TEST_ff_f (pow, minus_infty, 11.1L, plus_infty);
8009 TEST_ff_f (pow, minus_infty, 1001.1L, plus_infty);
8010 TEST_ff_f (pow, minus_infty, min_subnorm_value, plus_infty);
8012 TEST_ff_f (pow, minus_infty, -1, minus_zero);
8013 TEST_ff_f (pow, minus_infty, -11, minus_zero);
8014 TEST_ff_f (pow, minus_infty, -1001, minus_zero);
8016 TEST_ff_f (pow, minus_infty, -2, 0);
8017 TEST_ff_f (pow, minus_infty, -12, 0);
8018 TEST_ff_f (pow, minus_infty, -1002, 0);
8019 TEST_ff_f (pow, minus_infty, -0.1L, 0);
8020 TEST_ff_f (pow, minus_infty, -1.1L, 0);
8021 TEST_ff_f (pow, minus_infty, -11.1L, 0);
8022 TEST_ff_f (pow, minus_infty, -1001.1L, 0);
8023 TEST_ff_f (pow, minus_infty, -min_subnorm_value, 0);
8026 TEST_ff_f (pow, qnan_value, qnan_value, qnan_value);
8027 TEST_ff_f (pow, 0, qnan_value, qnan_value);
8028 TEST_ff_f (pow, 1, qnan_value, 1);
8029 TEST_ff_f (pow, -1, qnan_value, qnan_value);
8030 TEST_ff_f (pow, qnan_value, 1, qnan_value);
8031 TEST_ff_f (pow, qnan_value, -1, qnan_value);
8033 /* pow (x, qNaN) == qNaN. */
8034 TEST_ff_f (pow, 3.0, qnan_value, qnan_value);
8035 TEST_ff_f (pow, minus_zero, qnan_value, qnan_value);
8036 TEST_ff_f (pow, plus_infty, qnan_value, qnan_value);
8037 TEST_ff_f (pow, -3.0, qnan_value, qnan_value);
8038 TEST_ff_f (pow, minus_infty, qnan_value, qnan_value);
8040 TEST_ff_f (pow, qnan_value, 3.0, qnan_value);
8041 TEST_ff_f (pow, qnan_value, -3.0, qnan_value);
8042 TEST_ff_f (pow, qnan_value, plus_infty, qnan_value);
8043 TEST_ff_f (pow, qnan_value, minus_infty, qnan_value);
8044 TEST_ff_f (pow, qnan_value, 2.5, qnan_value);
8045 TEST_ff_f (pow, qnan_value, -2.5, qnan_value);
8046 TEST_ff_f (pow, qnan_value, min_subnorm_value, qnan_value);
8047 TEST_ff_f (pow, qnan_value, -min_subnorm_value, qnan_value);
8049 TEST_ff_f (pow, 1, plus_infty, 1);
8050 TEST_ff_f (pow, -1, plus_infty, 1);
8051 TEST_ff_f (pow, 1, minus_infty, 1);
8052 TEST_ff_f (pow, -1, minus_infty, 1);
8053 TEST_ff_f (pow, 1, 1, 1);
8054 TEST_ff_f (pow, 1, -1, 1);
8055 TEST_ff_f (pow, 1, 1.25, 1);
8056 TEST_ff_f (pow, 1, -1.25, 1);
8057 TEST_ff_f (pow, 1, 0x1p62L, 1);
8058 TEST_ff_f (pow, 1, 0x1p63L, 1);
8059 TEST_ff_f (pow, 1, 0x1p64L, 1);
8060 TEST_ff_f (pow, 1, 0x1p72L, 1);
8061 TEST_ff_f (pow, 1, min_subnorm_value, 1);
8062 TEST_ff_f (pow, 1, -min_subnorm_value, 1);
8064 /* pow (x, +-0) == 1. */
8065 TEST_ff_f (pow, plus_infty, 0, 1);
8066 TEST_ff_f (pow, plus_infty, minus_zero, 1);
8067 TEST_ff_f (pow, minus_infty, 0, 1);
8068 TEST_ff_f (pow, minus_infty, minus_zero, 1);
8069 TEST_ff_f (pow, 32.75L, 0, 1);
8070 TEST_ff_f (pow, 32.75L, minus_zero, 1);
8071 TEST_ff_f (pow, -32.75L, 0, 1);
8072 TEST_ff_f (pow, -32.75L, minus_zero, 1);
8073 TEST_ff_f (pow, 0x1p72L, 0, 1);
8074 TEST_ff_f (pow, 0x1p72L, minus_zero, 1);
8075 TEST_ff_f (pow, 0x1p-72L, 0, 1);
8076 TEST_ff_f (pow, 0x1p-72L, minus_zero, 1);
8078 TEST_ff_f (pow, -0.1L, 1.1L, qnan_value, INVALID_EXCEPTION);
8079 TEST_ff_f (pow, -0.1L, -1.1L, qnan_value, INVALID_EXCEPTION);
8080 TEST_ff_f (pow, -10.1L, 1.1L, qnan_value, INVALID_EXCEPTION);
8081 TEST_ff_f (pow, -10.1L, -1.1L, qnan_value, INVALID_EXCEPTION);
8082 TEST_ff_f (pow, -1.01L, min_subnorm_value, qnan_value, INVALID_EXCEPTION);
8083 TEST_ff_f (pow, -1.01L, -min_subnorm_value, qnan_value, INVALID_EXCEPTION);
8084 TEST_ff_f (pow, -1.0L, min_subnorm_value, qnan_value, INVALID_EXCEPTION);
8085 TEST_ff_f (pow, -1.0L, -min_subnorm_value, qnan_value, INVALID_EXCEPTION);
8088 TEST_ff_f (pow, 0, -1, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8089 check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8091 TEST_ff_f (pow, 0, -11, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8092 check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8094 TEST_ff_f (pow, 0, -0xffffff, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8095 check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8098 TEST_ff_f (pow, 0, -0x1.fffffffffffffp+52L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8099 check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8102 # if LDBL_MANT_DIG >= 64
8104 TEST_ff_f (pow, 0, -0x1.fffffffffffffffep+63L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8105 check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8107 # if LDBL_MANT_DIG >= 106
8109 TEST_ff_f (pow, 0, -0x1.ffffffffffffffffffffffffff8p+105L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8110 check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8112 # if LDBL_MANT_DIG >= 113
8114 TEST_ff_f (pow, 0, -0x1.ffffffffffffffffffffffffffffp+112L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8115 check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8118 TEST_ff_f (pow, minus_zero, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8119 check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8121 TEST_ff_f (pow, minus_zero, -11L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8122 check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8124 TEST_ff_f (pow, minus_zero, -0xffffff, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8125 check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8127 TEST_ff_f (pow, minus_zero, -0x1fffffe, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8128 check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
8131 TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffp+52L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8132 check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8134 TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffp+53L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8135 check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
8138 # if LDBL_MANT_DIG >= 64
8140 TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffffep+63L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8141 check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8143 TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffffep+64L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8144 check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
8146 # if LDBL_MANT_DIG >= 106
8148 TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8149 check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8151 TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8152 check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
8154 # if LDBL_MANT_DIG >= 113
8156 TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8157 check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
8159 TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8160 check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
8165 TEST_ff_f (pow, 0, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8166 check_int ("errno for pow(0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
8168 TEST_ff_f (pow, 0, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8169 check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8171 TEST_ff_f (pow, 0, -min_subnorm_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8172 check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8174 TEST_ff_f (pow, 0, -0x1p24, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8175 check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8177 TEST_ff_f (pow, 0, -0x1p127, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8178 check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8180 TEST_ff_f (pow, 0, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8181 check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8183 TEST_ff_f (pow, minus_zero, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8184 check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
8186 TEST_ff_f (pow, minus_zero, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8187 check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8189 TEST_ff_f (pow, minus_zero, -min_subnorm_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8190 check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8192 TEST_ff_f (pow, minus_zero, -0x1p24, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8193 check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8195 TEST_ff_f (pow, minus_zero, -0x1p127, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8196 check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8198 TEST_ff_f (pow, minus_zero, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
8199 check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
8201 TEST_ff_f (pow, 0x1p72L, 0x1p72L, plus_infty, OVERFLOW_EXCEPTION);
8202 TEST_ff_f (pow, 10, -0x1p72L, 0, UNDERFLOW_EXCEPTION);
8203 TEST_ff_f (pow, max_value, max_value, plus_infty, OVERFLOW_EXCEPTION);
8204 TEST_ff_f (pow, 10, -max_value, 0, UNDERFLOW_EXCEPTION);
8206 TEST_ff_f (pow, 0, 1, 0);
8207 TEST_ff_f (pow, 0, 11, 0);
8209 TEST_ff_f (pow, minus_zero, 1, minus_zero);
8210 TEST_ff_f (pow, minus_zero, 11, minus_zero);
8212 TEST_ff_f (pow, 0, 2, 0);
8213 TEST_ff_f (pow, 0, 11.1L, 0);
8215 TEST_ff_f (pow, minus_zero, 2, 0);
8216 TEST_ff_f (pow, minus_zero, 11.1L, 0);
8217 TEST_ff_f (pow, 0, plus_infty, 0);
8218 TEST_ff_f (pow, minus_zero, plus_infty, 0);
8219 TEST_ff_f (pow, 0, minus_infty, plus_infty, DIVIDE_BY_ZERO_EXCEPTION_OK);
8220 TEST_ff_f (pow, minus_zero, minus_infty, plus_infty, DIVIDE_BY_ZERO_EXCEPTION_OK);
8223 /* pow (x, +inf) == +inf for |x| > 1. */
8224 TEST_ff_f (pow, 1.5, plus_infty, plus_infty);
8226 /* pow (x, +inf) == +0 for |x| < 1. */
8227 TEST_ff_f (pow, 0.5, plus_infty, 0.0);
8229 /* pow (x, -inf) == +0 for |x| > 1. */
8230 TEST_ff_f (pow, 1.5, minus_infty, 0.0);
8232 /* pow (x, -inf) == +inf for |x| < 1. */
8233 TEST_ff_f (pow, 0.5, minus_infty, plus_infty);
8236 /* pow (+inf, y) == +inf for y > 0. */
8237 TEST_ff_f (pow, plus_infty, 2, plus_infty);
8238 TEST_ff_f (pow, plus_infty, 0xffffff, plus_infty);
8240 TEST_ff_f (pow, plus_infty, 0x1.fffffffffffffp+52L, plus_infty);
8243 # if LDBL_MANT_DIG >= 64
8244 TEST_ff_f (pow, plus_infty, 0x1.fffffffffffffffep+63L, plus_infty);
8246 # if LDBL_MANT_DIG >= 106
8247 TEST_ff_f (pow, plus_infty, 0x1.ffffffffffffffffffffffffff8p+105L, plus_infty);
8249 # if LDBL_MANT_DIG >= 113
8250 TEST_ff_f (pow, plus_infty, 0x1.ffffffffffffffffffffffffffffp+112L, plus_infty);
8253 TEST_ff_f (pow, plus_infty, 0x1p24, plus_infty);
8254 TEST_ff_f (pow, plus_infty, 0x1p127, plus_infty);
8255 TEST_ff_f (pow, plus_infty, max_value, plus_infty);
8257 /* pow (+inf, y) == +0 for y < 0. */
8258 TEST_ff_f (pow, plus_infty, -1, 0.0);
8259 TEST_ff_f (pow, plus_infty, -0xffffff, 0.0);
8261 TEST_ff_f (pow, plus_infty, -0x1.fffffffffffffp+52L, 0.0);
8264 # if LDBL_MANT_DIG >= 64
8265 TEST_ff_f (pow, plus_infty, -0x1.fffffffffffffffep+63L, 0.0);
8267 # if LDBL_MANT_DIG >= 106
8268 TEST_ff_f (pow, plus_infty, -0x1.ffffffffffffffffffffffffff8p+105L, 0.0);
8270 # if LDBL_MANT_DIG >= 113
8271 TEST_ff_f (pow, plus_infty, -0x1.ffffffffffffffffffffffffffffp+112L, 0.0);
8274 TEST_ff_f (pow, plus_infty, -0x1p24, 0.0);
8275 TEST_ff_f (pow, plus_infty, -0x1p127, 0.0);
8276 TEST_ff_f (pow, plus_infty, -max_value, 0.0);
8278 /* pow (-inf, y) == -inf for y an odd integer > 0. */
8279 TEST_ff_f (pow, minus_infty, 27, minus_infty);
8280 TEST_ff_f (pow, minus_infty, 0xffffff, minus_infty);
8281 TEST_ff_f (pow, minus_infty, 0x1fffffe, plus_infty);
8283 TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffp+52L, minus_infty);
8284 TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffp+53L, plus_infty);
8287 # if LDBL_MANT_DIG >= 64
8288 TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffffep+63L, minus_infty);
8289 TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffffep+64L, plus_infty);
8291 # if LDBL_MANT_DIG >= 106
8292 TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffff8p+105L, minus_infty);
8293 TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffff8p+106L, plus_infty);
8295 # if LDBL_MANT_DIG >= 113
8296 TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffffffp+112L, minus_infty);
8297 TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffffffp+113L, plus_infty);
8301 /* pow (-inf, y) == +inf for y > 0 and not an odd integer. */
8302 TEST_ff_f (pow, minus_infty, 28, plus_infty);
8303 TEST_ff_f (pow, minus_infty, 0x1p24, plus_infty);
8304 TEST_ff_f (pow, minus_infty, 0x1p127, plus_infty);
8305 TEST_ff_f (pow, minus_infty, max_value, plus_infty);
8307 /* pow (-inf, y) == -0 for y an odd integer < 0. */
8308 TEST_ff_f (pow, minus_infty, -3, minus_zero);
8309 TEST_ff_f (pow, minus_infty, -0xffffff, minus_zero);
8310 TEST_ff_f (pow, minus_infty, -0x1fffffe, plus_zero);
8312 TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffp+52L, minus_zero);
8313 TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffp+53L, plus_zero);
8316 # if LDBL_MANT_DIG >= 64
8317 TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffffep+63L, minus_zero);
8318 TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffffep+64L, plus_zero);
8320 # if LDBL_MANT_DIG >= 106
8321 TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
8322 TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
8324 # if LDBL_MANT_DIG >= 113
8325 TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
8326 TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
8329 /* pow (-inf, y) == +0 for y < 0 and not an odd integer. */
8330 TEST_ff_f (pow, minus_infty, -2.0, 0.0);
8331 TEST_ff_f (pow, minus_infty, -0x1p24, 0.0);
8332 TEST_ff_f (pow, minus_infty, -0x1p127, 0.0);
8333 TEST_ff_f (pow, minus_infty, -max_value, 0.0);
8335 /* pow (+0, y) == +0 for y an odd integer > 0. */
8336 TEST_ff_f (pow, 0.0, 27, 0.0);
8337 TEST_ff_f (pow, 0.0, 0xffffff, 0.0);
8339 TEST_ff_f (pow, 0.0, 0x1.fffffffffffffp+52L, 0.0);
8342 # if LDBL_MANT_DIG >= 64
8343 TEST_ff_f (pow, 0.0, 0x1.fffffffffffffffep+63L, 0.0);
8345 # if LDBL_MANT_DIG >= 106
8346 TEST_ff_f (pow, 0.0, 0x1.ffffffffffffffffffffffffff8p+105L, 0.0);
8348 # if LDBL_MANT_DIG >= 113
8349 TEST_ff_f (pow, 0.0, 0x1.ffffffffffffffffffffffffffffp+112L, 0.0);
8353 /* pow (-0, y) == -0 for y an odd integer > 0. */
8354 TEST_ff_f (pow, minus_zero, 27, minus_zero);
8355 TEST_ff_f (pow, minus_zero, 0xffffff, minus_zero);
8356 TEST_ff_f (pow, minus_zero, 0x1fffffe, plus_zero);
8358 TEST_ff_f (pow, minus_zero, 0x1.fffffffffffffp+52L, minus_zero);
8359 TEST_ff_f (pow, minus_zero, 0x1.fffffffffffffp+53L, plus_zero);
8362 # if LDBL_MANT_DIG >= 64
8363 TEST_ff_f (pow, minus_zero, 0x1.fffffffffffffffep+63L, minus_zero);
8364 TEST_ff_f (pow, minus_zero, 0x1.fffffffffffffffep+64L, plus_zero);
8366 # if LDBL_MANT_DIG >= 106
8367 TEST_ff_f (pow, minus_zero, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
8368 TEST_ff_f (pow, minus_zero, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
8370 # if LDBL_MANT_DIG >= 113
8371 TEST_ff_f (pow, minus_zero, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
8372 TEST_ff_f (pow, minus_zero, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
8376 /* pow (+0, y) == +0 for y > 0 and not an odd integer. */
8377 TEST_ff_f (pow, 0.0, 4, 0.0);
8378 TEST_ff_f (pow, 0.0, 0x1p24, 0.0);
8379 TEST_ff_f (pow, 0.0, 0x1p127, 0.0);
8380 TEST_ff_f (pow, 0.0, max_value, 0.0);
8381 TEST_ff_f (pow, 0.0, min_subnorm_value, 0.0);
8383 /* pow (-0, y) == +0 for y > 0 and not an odd integer. */
8384 TEST_ff_f (pow, minus_zero, 4, 0.0);
8385 TEST_ff_f (pow, minus_zero, 0x1p24, 0.0);
8386 TEST_ff_f (pow, minus_zero, 0x1p127, 0.0);
8387 TEST_ff_f (pow, minus_zero, max_value, 0.0);
8388 TEST_ff_f (pow, minus_zero, min_subnorm_value, 0.0);
8390 TEST_ff_f (pow, 16, 0.25L, 2);
8391 TEST_ff_f (pow, 0x1p64L, 0.125L, 256);
8392 TEST_ff_f (pow, 2, 4, 16);
8393 TEST_ff_f (pow, 256, 8, 0x1p64L);
8395 TEST_ff_f (pow, 0.75L, 1.25L, 0.697953644326574699205914060237425566L);
8397 #if defined TEST_DOUBLE || defined TEST_LDOUBLE
8398 TEST_ff_f (pow, -7.49321e+133, -9.80818e+16, 0, UNDERFLOW_EXCEPTION);
8401 TEST_ff_f (pow, -1.0, -0xffffff, -1.0);
8402 TEST_ff_f (pow, -1.0, -0x1fffffe, 1.0);
8404 TEST_ff_f (pow, -1.0, -0x1.fffffffffffffp+52L, -1.0);
8405 TEST_ff_f (pow, -1.0, -0x1.fffffffffffffp+53L, 1.0);
8408 # if LDBL_MANT_DIG >= 64
8409 TEST_ff_f (pow, -1.0, -0x1.fffffffffffffffep+63L, -1.0);
8410 TEST_ff_f (pow, -1.0, -0x1.fffffffffffffffep+64L, 1.0);
8412 # if LDBL_MANT_DIG >= 106
8413 TEST_ff_f (pow, -1.0, -0x1.ffffffffffffffffffffffffff8p+105L, -1.0);
8414 TEST_ff_f (pow, -1.0, -0x1.ffffffffffffffffffffffffff8p+106L, 1.0);
8416 # if LDBL_MANT_DIG >= 113
8417 TEST_ff_f (pow, -1.0, -0x1.ffffffffffffffffffffffffffffp+112L, -1.0);
8418 TEST_ff_f (pow, -1.0, -0x1.ffffffffffffffffffffffffffffp+113L, 1.0);
8421 TEST_ff_f (pow, -1.0, -max_value, 1.0);
8423 TEST_ff_f (pow, -1.0, 0xffffff, -1.0);
8424 TEST_ff_f (pow, -1.0, 0x1fffffe, 1.0);
8426 TEST_ff_f (pow, -1.0, 0x1.fffffffffffffp+52L, -1.0);
8427 TEST_ff_f (pow, -1.0, 0x1.fffffffffffffp+53L, 1.0);
8430 # if LDBL_MANT_DIG >= 64
8431 TEST_ff_f (pow, -1.0, 0x1.fffffffffffffffep+63L, -1.0);
8432 TEST_ff_f (pow, -1.0, 0x1.fffffffffffffffep+64L, 1.0);
8434 # if LDBL_MANT_DIG >= 106
8435 TEST_ff_f (pow, -1.0, 0x1.ffffffffffffffffffffffffff8p+105L, -1.0);
8436 TEST_ff_f (pow, -1.0, 0x1.ffffffffffffffffffffffffff8p+106L, 1.0);
8438 # if LDBL_MANT_DIG >= 113
8439 TEST_ff_f (pow, -1.0, 0x1.ffffffffffffffffffffffffffffp+112L, -1.0);
8440 TEST_ff_f (pow, -1.0, 0x1.ffffffffffffffffffffffffffffp+113L, 1.0);
8443 TEST_ff_f (pow, -1.0, max_value, 1.0);
8445 TEST_ff_f (pow, -2.0, 126, 0x1p126);
8446 TEST_ff_f (pow, -2.0, 127, -0x1p127);
8447 /* Allow inexact results for float to be considered to underflow. */
8448 TEST_ff_f (pow, -2.0, -126, 0x1p-126, UNDERFLOW_EXCEPTION_OK_FLOAT);
8449 TEST_ff_f (pow, -2.0, -127, -0x1p-127, UNDERFLOW_EXCEPTION_OK_FLOAT);
8451 TEST_ff_f (pow, -2.0, -0xffffff, minus_zero, UNDERFLOW_EXCEPTION);
8452 TEST_ff_f (pow, -2.0, -0x1fffffe, plus_zero, UNDERFLOW_EXCEPTION);
8454 TEST_ff_f (pow, -2.0, -0x1.fffffffffffffp+52L, minus_zero, UNDERFLOW_EXCEPTION);
8455 TEST_ff_f (pow, -2.0, -0x1.fffffffffffffp+53L, plus_zero, UNDERFLOW_EXCEPTION);
8458 # if LDBL_MANT_DIG >= 64
8459 TEST_ff_f (pow, -2.0, -0x1.fffffffffffffffep+63L, minus_zero, UNDERFLOW_EXCEPTION);
8460 TEST_ff_f (pow, -2.0, -0x1.fffffffffffffffep+64L, plus_zero, UNDERFLOW_EXCEPTION);
8462 # if LDBL_MANT_DIG >= 106
8463 TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, UNDERFLOW_EXCEPTION);
8464 TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, UNDERFLOW_EXCEPTION);
8466 # if LDBL_MANT_DIG >= 113
8467 TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, UNDERFLOW_EXCEPTION);
8468 TEST_ff_f (pow, -2.0, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, UNDERFLOW_EXCEPTION);
8471 TEST_ff_f (pow, -2.0, -max_value, plus_zero, UNDERFLOW_EXCEPTION);
8473 TEST_ff_f (pow, -2.0, 0xffffff, minus_infty, OVERFLOW_EXCEPTION);
8474 TEST_ff_f (pow, -2.0, 0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
8476 TEST_ff_f (pow, -2.0, 0x1.fffffffffffffp+52L, minus_infty, OVERFLOW_EXCEPTION);
8477 TEST_ff_f (pow, -2.0, 0x1.fffffffffffffp+53L, plus_infty, OVERFLOW_EXCEPTION);
8480 # if LDBL_MANT_DIG >= 64
8481 TEST_ff_f (pow, -2.0, 0x1.fffffffffffffffep+63L, minus_infty, OVERFLOW_EXCEPTION);
8482 TEST_ff_f (pow, -2.0, 0x1.fffffffffffffffep+64L, plus_infty, OVERFLOW_EXCEPTION);
8484 # if LDBL_MANT_DIG >= 106
8485 TEST_ff_f (pow, -2.0, 0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, OVERFLOW_EXCEPTION);
8486 TEST_ff_f (pow, -2.0, 0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, OVERFLOW_EXCEPTION);
8488 # if LDBL_MANT_DIG >= 113
8489 TEST_ff_f (pow, -2.0, 0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, OVERFLOW_EXCEPTION);
8490 TEST_ff_f (pow, -2.0, 0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, OVERFLOW_EXCEPTION);
8493 TEST_ff_f (pow, -2.0, max_value, plus_infty, OVERFLOW_EXCEPTION);
8495 TEST_ff_f (pow, -max_value, 0.5, qnan_value, INVALID_EXCEPTION);
8496 TEST_ff_f (pow, -max_value, 1.5, qnan_value, INVALID_EXCEPTION);
8497 TEST_ff_f (pow, -max_value, 1000.5, qnan_value, INVALID_EXCEPTION);
8498 TEST_ff_f (pow, -max_value, -2, plus_zero, UNDERFLOW_EXCEPTION);
8499 TEST_ff_f (pow, -max_value, -3, minus_zero, UNDERFLOW_EXCEPTION);
8500 TEST_ff_f (pow, -max_value, 2, plus_infty, OVERFLOW_EXCEPTION);
8501 TEST_ff_f (pow, -max_value, 3, minus_infty, OVERFLOW_EXCEPTION);
8503 TEST_ff_f (pow, -max_value, -0xffffff, minus_zero, UNDERFLOW_EXCEPTION);
8504 TEST_ff_f (pow, -max_value, -0x1fffffe, plus_zero, UNDERFLOW_EXCEPTION);
8506 TEST_ff_f (pow, -max_value, -0x1.fffffffffffffp+52L, minus_zero, UNDERFLOW_EXCEPTION);
8507 TEST_ff_f (pow, -max_value, -0x1.fffffffffffffp+53L, plus_zero, UNDERFLOW_EXCEPTION);
8510 # if LDBL_MANT_DIG >= 64
8511 TEST_ff_f (pow, -max_value, -0x1.fffffffffffffffep+63L, minus_zero, UNDERFLOW_EXCEPTION);
8512 TEST_ff_f (pow, -max_value, -0x1.fffffffffffffffep+64L, plus_zero, UNDERFLOW_EXCEPTION);
8514 # if LDBL_MANT_DIG >= 106
8515 TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, UNDERFLOW_EXCEPTION);
8516 TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, UNDERFLOW_EXCEPTION);
8518 # if LDBL_MANT_DIG >= 113
8519 TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, UNDERFLOW_EXCEPTION);
8520 TEST_ff_f (pow, -max_value, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, UNDERFLOW_EXCEPTION);
8523 TEST_ff_f (pow, -max_value, -max_value, plus_zero, UNDERFLOW_EXCEPTION);
8525 TEST_ff_f (pow, -max_value, 0xffffff, minus_infty, OVERFLOW_EXCEPTION);
8526 TEST_ff_f (pow, -max_value, 0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
8528 TEST_ff_f (pow, -max_value, 0x1.fffffffffffffp+52L, minus_infty, OVERFLOW_EXCEPTION);
8529 TEST_ff_f (pow, -max_value, 0x1.fffffffffffffp+53L, plus_infty, OVERFLOW_EXCEPTION);
8532 # if LDBL_MANT_DIG >= 64
8533 TEST_ff_f (pow, -max_value, 0x1.fffffffffffffffep+63L, minus_infty, OVERFLOW_EXCEPTION);
8534 TEST_ff_f (pow, -max_value, 0x1.fffffffffffffffep+64L, plus_infty, OVERFLOW_EXCEPTION);
8536 # if LDBL_MANT_DIG >= 106
8537 TEST_ff_f (pow, -max_value, 0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, OVERFLOW_EXCEPTION);
8538 TEST_ff_f (pow, -max_value, 0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, OVERFLOW_EXCEPTION);
8540 # if LDBL_MANT_DIG >= 113
8541 TEST_ff_f (pow, -max_value, 0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, OVERFLOW_EXCEPTION);
8542 TEST_ff_f (pow, -max_value, 0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, OVERFLOW_EXCEPTION);
8545 TEST_ff_f (pow, -max_value, max_value, plus_infty, OVERFLOW_EXCEPTION);
8547 TEST_ff_f (pow, -0.5, 126, 0x1p-126);
8548 TEST_ff_f (pow, -0.5, 127, -0x1p-127);
8549 TEST_ff_f (pow, -0.5, -126, 0x1p126);
8550 TEST_ff_f (pow, -0.5, -127, -0x1p127);
8552 TEST_ff_f (pow, -0.5, -0xffffff, minus_infty, OVERFLOW_EXCEPTION);
8553 TEST_ff_f (pow, -0.5, -0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
8555 TEST_ff_f (pow, -0.5, -0x1.fffffffffffffp+52L, minus_infty, OVERFLOW_EXCEPTION);
8556 TEST_ff_f (pow, -0.5, -0x1.fffffffffffffp+53L, plus_infty, OVERFLOW_EXCEPTION);
8559 # if LDBL_MANT_DIG >= 64
8560 TEST_ff_f (pow, -0.5, -0x1.fffffffffffffffep+63L, minus_infty, OVERFLOW_EXCEPTION);
8561 TEST_ff_f (pow, -0.5, -0x1.fffffffffffffffep+64L, plus_infty, OVERFLOW_EXCEPTION);
8563 # if LDBL_MANT_DIG >= 106
8564 TEST_ff_f (pow, -0.5, -0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, OVERFLOW_EXCEPTION);
8565 TEST_ff_f (pow, -0.5, -0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, OVERFLOW_EXCEPTION);
8567 # if LDBL_MANT_DIG >= 113
8568 TEST_ff_f (pow, -0.5, -0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, OVERFLOW_EXCEPTION);
8569 TEST_ff_f (pow, -0.5, -0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, OVERFLOW_EXCEPTION);
8572 TEST_ff_f (pow, -0.5, -max_value, plus_infty, OVERFLOW_EXCEPTION);
8574 TEST_ff_f (pow, -0.5, 0xffffff, minus_zero, UNDERFLOW_EXCEPTION);
8575 TEST_ff_f (pow, -0.5, 0x1fffffe, plus_zero, UNDERFLOW_EXCEPTION);
8577 TEST_ff_f (pow, -0.5, 0x1.fffffffffffffp+52L, minus_zero, UNDERFLOW_EXCEPTION);
8578 TEST_ff_f (pow, -0.5, 0x1.fffffffffffffp+53L, plus_zero, UNDERFLOW_EXCEPTION);
8581 # if LDBL_MANT_DIG >= 64
8582 TEST_ff_f (pow, -0.5, 0x1.fffffffffffffffep+63L, minus_zero, UNDERFLOW_EXCEPTION);
8583 TEST_ff_f (pow, -0.5, 0x1.fffffffffffffffep+64L, plus_zero, UNDERFLOW_EXCEPTION);
8585 # if LDBL_MANT_DIG >= 106
8586 TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, UNDERFLOW_EXCEPTION);
8587 TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, UNDERFLOW_EXCEPTION);
8589 # if LDBL_MANT_DIG >= 113
8590 TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, UNDERFLOW_EXCEPTION);
8591 TEST_ff_f (pow, -0.5, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, UNDERFLOW_EXCEPTION);
8594 TEST_ff_f (pow, -0.5, max_value, plus_zero, UNDERFLOW_EXCEPTION);
8596 TEST_ff_f (pow, -min_value, 0.5, qnan_value, INVALID_EXCEPTION);
8597 TEST_ff_f (pow, -min_value, 1.5, qnan_value, INVALID_EXCEPTION);
8598 TEST_ff_f (pow, -min_value, 1000.5, qnan_value, INVALID_EXCEPTION);
8599 TEST_ff_f (pow, -min_value, -2, plus_infty, OVERFLOW_EXCEPTION);
8600 TEST_ff_f (pow, -min_value, -3, minus_infty, OVERFLOW_EXCEPTION);
8601 /* Allow inexact results to be considered to underflow. */
8602 TEST_ff_f (pow, -min_value, 1, -min_value, UNDERFLOW_EXCEPTION_OK);
8603 TEST_ff_f (pow, -min_value, 2, plus_zero, UNDERFLOW_EXCEPTION);
8604 TEST_ff_f (pow, -min_value, 3, minus_zero, UNDERFLOW_EXCEPTION);
8606 TEST_ff_f (pow, -min_value, -0xffffff, minus_infty, OVERFLOW_EXCEPTION);
8607 TEST_ff_f (pow, -min_value, -0x1fffffe, plus_infty, OVERFLOW_EXCEPTION);
8609 TEST_ff_f (pow, -min_value, -0x1.fffffffffffffp+52L, minus_infty, OVERFLOW_EXCEPTION);
8610 TEST_ff_f (pow, -min_value, -0x1.fffffffffffffp+53L, plus_infty, OVERFLOW_EXCEPTION);
8613 # if LDBL_MANT_DIG >= 64
8614 TEST_ff_f (pow, -min_value, -0x1.fffffffffffffffep+63L, minus_infty, OVERFLOW_EXCEPTION);
8615 TEST_ff_f (pow, -min_value, -0x1.fffffffffffffffep+64L, plus_infty, OVERFLOW_EXCEPTION);
8617 # if LDBL_MANT_DIG >= 106
8618 TEST_ff_f (pow, -min_value, -0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, OVERFLOW_EXCEPTION);
8619 TEST_ff_f (pow, -min_value, -0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, OVERFLOW_EXCEPTION);
8621 # if LDBL_MANT_DIG >= 113
8622 TEST_ff_f (pow, -min_value, -0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, OVERFLOW_EXCEPTION);
8623 TEST_ff_f (pow, -min_value, -0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, OVERFLOW_EXCEPTION);
8626 TEST_ff_f (pow, -min_value, -max_value, plus_infty, OVERFLOW_EXCEPTION);
8628 TEST_ff_f (pow, -min_value, 0xffffff, minus_zero, UNDERFLOW_EXCEPTION);
8629 TEST_ff_f (pow, -min_value, 0x1fffffe, plus_zero, UNDERFLOW_EXCEPTION);
8631 TEST_ff_f (pow, -min_value, 0x1.fffffffffffffp+52L, minus_zero, UNDERFLOW_EXCEPTION);
8632 TEST_ff_f (pow, -min_value, 0x1.fffffffffffffp+53L, plus_zero, UNDERFLOW_EXCEPTION);
8635 # if LDBL_MANT_DIG >= 64
8636 TEST_ff_f (pow, -min_value, 0x1.fffffffffffffffep+63L, minus_zero, UNDERFLOW_EXCEPTION);
8637 TEST_ff_f (pow, -min_value, 0x1.fffffffffffffffep+64L, plus_zero, UNDERFLOW_EXCEPTION);
8639 # if LDBL_MANT_DIG >= 106
8640 TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, UNDERFLOW_EXCEPTION);
8641 TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, UNDERFLOW_EXCEPTION);
8643 # if LDBL_MANT_DIG >= 113
8644 TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, UNDERFLOW_EXCEPTION);
8645 TEST_ff_f (pow, -min_value, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, UNDERFLOW_EXCEPTION);
8648 TEST_ff_f (pow, -min_value, max_value, plus_zero, UNDERFLOW_EXCEPTION);
8650 TEST_ff_f (pow, 0x0.ffffffp0, 10, 0.999999403953712118183885036774764444747L);
8651 TEST_ff_f (pow, 0x0.ffffffp0, 100, 0.999994039553108359406305079606228341585L);
8652 TEST_ff_f (pow, 0x0.ffffffp0, 1000, 0.9999403971297699052276650144650733772182L);
8653 TEST_ff_f (pow, 0x0.ffffffp0, 0x1p24, 0.3678794302077803437135155590023422899744L);
8654 TEST_ff_f (pow, 0x0.ffffffp0, 0x1p30, 1.603807831524924233828134753069728224044e-28L);
8655 TEST_ff_f (pow, 0x0.ffffffp0, 0x1.234566p30, 2.374884712135295099971443365381007297732e-32L);
8656 TEST_ff_f (pow, 0x0.ffffffp0, -10, 1.000000596046643153205170848674671339688L);
8657 TEST_ff_f (pow, 0x0.ffffffp0, -100, 1.000005960482418779499387594989252621451L);
8658 TEST_ff_f (pow, 0x0.ffffffp0, -1000, 1.000059606422943986382898964231519867906L);
8659 TEST_ff_f (pow, 0x0.ffffffp0, -0x1p24, 2.7182819094701610539628664526874952929416L);
8660 TEST_ff_f (pow, 0x0.ffffffp0, -0x1p30, 6.2351609734265057988914412331288163636075e+27L);
8661 TEST_ff_f (pow, 0x0.ffffffp0, -0x1.234566p30, 4.2107307141696353498921307077142537353515e+31L);
8662 TEST_ff_f (pow, 0x1.000002p0, 0x1p24, 7.3890552180866447284268641248075832310141L);
8663 TEST_ff_f (pow, 0x1.000002p0, 0x1.234566p29, 4.2107033006507495188536371520637025716256e+31L);
8664 TEST_ff_f (pow, 0x1.000002p0, -0x1.234566p29, 2.3749001736727769098946062325205705312166e-32L);
8666 #if !defined TEST_FLOAT
8667 TEST_ff_f (pow, 0x0.fffffffffffff8p0L, 0x1.23456789abcdfp62L, 1.0118762747827252817436395051178295138220e-253L);
8668 TEST_ff_f (pow, 0x0.fffffffffffff8p0L, -0x1.23456789abcdfp62L, 9.8826311568054561811190162420900667121992e+252L);
8669 TEST_ff_f (pow, 0x1.0000000000001p0L, 0x1.23456789abcdfp61L, 9.8826311568044974397135026217687399395481e+252L);
8670 TEST_ff_f (pow, 0x1.0000000000001p0L, -0x1.23456789abcdfp61L, 1.0118762747828234466621210689458255908670e-253L);
8673 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64 && LDBL_MAX_EXP >= 16384
8674 TEST_ff_f (pow, 0x0.ffffffffffffffffp0L, 0x1.23456789abcdef0ep77L, 1.2079212226420368189981778807634890018840e-4048L);
8675 TEST_ff_f (pow, 0x0.ffffffffffffffffp0L, -0x1.23456789abcdef0ep77L, 8.2786855736563746280496724205839522148001e+4047L);
8676 TEST_ff_f (pow, 0x1.0000000000000002p0L, 0x1.23456789abcdef0ep76L, 8.2786855736563683535324500168799315131570e+4047L);
8677 TEST_ff_f (pow, 0x1.0000000000000002p0L, -0x1.23456789abcdef0ep76L, 1.2079212226420377344964713407722652880280e-4048L);
8680 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 113
8681 TEST_ff_f (pow, 0x0.ffffffffffffffffffffffffffff8p0L, 0x1.23456789abcdef0123456789abcdp126L, 1.2079212226420440237790185999151440179953e-4048L);
8682 TEST_ff_f (pow, 0x0.ffffffffffffffffffffffffffff8p0L, -0x1.23456789abcdef0123456789abcdp126L, 8.2786855736563252489063231915535105363602e+4047L);
8683 TEST_ff_f (pow, 0x1.0000000000000000000000000001p0L, 0x1.23456789abcdef0123456789abcdp125L, 8.2786855736563252489063231915423647547782e+4047L);
8684 TEST_ff_f (pow, 0x1.0000000000000000000000000001p0L, -0x1.23456789abcdef0123456789abcdp125L, 1.2079212226420440237790185999167702696503e-4048L);
8687 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
8688 TEST_ff_f (pow, 1e4932L, 0.75L, 1e3699L);
8689 TEST_ff_f (pow, 1e4928L, 0.75L, 1e3696L);
8690 TEST_ff_f (pow, 1e4924L, 0.75L, 1e3693L);
8691 TEST_ff_f (pow, 1e4920L, 0.75L, 1e3690L);
8692 TEST_ff_f (pow, 10.0L, 4932.0L, 1e4932L);
8693 TEST_ff_f (pow, 10.0L, 4931.0L, 1e4931L);
8694 TEST_ff_f (pow, 10.0L, 4930.0L, 1e4930L);
8695 TEST_ff_f (pow, 10.0L, 4929.0L, 1e4929L);
8696 TEST_ff_f (pow, 10.0L, -4931.0L, 1e-4931L);
8697 TEST_ff_f (pow, 10.0L, -4930.0L, 1e-4930L);
8698 TEST_ff_f (pow, 10.0L, -4929.0L, 1e-4929L);
8699 TEST_ff_f (pow, 1e27L, 182.0L, 1e4914L);
8700 TEST_ff_f (pow, 1e27L, -182.0L, 1e-4914L);
8703 TEST_ff_f (pow, min_subnorm_value, min_subnorm_value, 1.0L);
8704 TEST_ff_f (pow, min_subnorm_value, -min_subnorm_value, 1.0L);
8705 TEST_ff_f (pow, max_value, min_subnorm_value, 1.0L);
8706 TEST_ff_f (pow, max_value, -min_subnorm_value, 1.0L);
8707 TEST_ff_f (pow, 0.99L, min_subnorm_value, 1.0L);
8708 TEST_ff_f (pow, 0.99L, -min_subnorm_value, 1.0L);
8709 TEST_ff_f (pow, 1.01L, min_subnorm_value, 1.0L);
8710 TEST_ff_f (pow, 1.01L, -min_subnorm_value, 1.0L);
8712 TEST_ff_f (pow, 2.0L, -100000.0L, plus_zero, UNDERFLOW_EXCEPTION);
8719 pow_test_tonearest (void)
8721 int save_round_mode;
8724 if (errno == ENOSYS)
8725 /* Function not implemented. */
8728 START (pow_tonearest);
8730 save_round_mode = fegetround ();
8732 if (!fesetround (FE_TONEAREST))
8734 TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
8735 TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
8738 fesetround (save_round_mode);
8740 END (pow_tonearest);
8745 pow_test_towardzero (void)
8747 int save_round_mode;
8750 if (errno == ENOSYS)
8751 /* Function not implemented. */
8754 START (pow_towardzero);
8756 save_round_mode = fegetround ();
8758 if (!fesetround (FE_TOWARDZERO))
8760 TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
8761 TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
8764 fesetround (save_round_mode);
8766 END (pow_towardzero);
8771 pow_test_downward (void)
8773 int save_round_mode;
8776 if (errno == ENOSYS)
8777 /* Function not implemented. */
8780 START (pow_downward);
8782 save_round_mode = fegetround ();
8784 if (!fesetround (FE_DOWNWARD))
8786 TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
8787 TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
8790 fesetround (save_round_mode);
8797 pow_test_upward (void)
8799 int save_round_mode;
8802 if (errno == ENOSYS)
8803 /* Function not implemented. */
8808 save_round_mode = fegetround ();
8810 if (!fesetround (FE_UPWARD))
8812 TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
8813 TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
8816 fesetround (save_round_mode);
8823 remainder_test (void)
8826 FUNC(remainder) (1.625, 1.0);
8827 if (errno == ENOSYS)
8828 /* Function not implemented. */
8834 TEST_ff_f (remainder, 1, 0, qnan_value, INVALID_EXCEPTION);
8835 check_int ("errno for remainder(1, 0) = EDOM ", errno, EDOM, 0, 0, 0);
8837 TEST_ff_f (remainder, 1, minus_zero, qnan_value, INVALID_EXCEPTION);
8838 check_int ("errno for remainder(1, -0) = EDOM ", errno, EDOM, 0, 0, 0);
8840 TEST_ff_f (remainder, plus_infty, 1, qnan_value, INVALID_EXCEPTION);
8841 check_int ("errno for remainder(INF, 1) = EDOM ", errno, EDOM, 0, 0, 0);
8843 TEST_ff_f (remainder, minus_infty, 1, qnan_value, INVALID_EXCEPTION);
8844 check_int ("errno for remainder(-INF, 1) = EDOM ", errno, EDOM, 0, 0, 0);
8846 TEST_ff_f (remainder, qnan_value, qnan_value, qnan_value);
8847 check_int ("errno for remainder(qNAN, qNAN) unchanged", errno, 0, 0, 0, 0);
8849 TEST_ff_f (remainder, 0, qnan_value, qnan_value);
8850 check_int ("errno for remainder(0, qNAN) unchanged", errno, 0, 0, 0, 0);
8852 TEST_ff_f (remainder, qnan_value, 0, qnan_value);
8853 check_int ("errno for remainder(qNaN, 0) unchanged", errno, 0, 0, 0, 0);
8855 TEST_ff_f (remainder, 1.625, 1.0, -0.375);
8856 TEST_ff_f (remainder, -1.625, 1.0, 0.375);
8857 TEST_ff_f (remainder, 1.625, -1.0, -0.375);
8858 TEST_ff_f (remainder, -1.625, -1.0, 0.375);
8859 TEST_ff_f (remainder, 5.0, 2.0, 1.0);
8860 TEST_ff_f (remainder, 3.0, 2.0, -1.0);
8872 FUNC(remquo) (1.625, 1.0, &x);
8873 if (errno == ENOSYS)
8874 /* Function not implemented. */
8879 TEST_ffI_f1 (remquo, 1, 0, qnan_value, IGNORE, INVALID_EXCEPTION);
8880 TEST_ffI_f1 (remquo, 1, minus_zero, qnan_value, IGNORE, INVALID_EXCEPTION);
8881 TEST_ffI_f1 (remquo, plus_infty, 1, qnan_value, IGNORE, INVALID_EXCEPTION);
8882 TEST_ffI_f1 (remquo, minus_infty, 1, qnan_value, IGNORE, INVALID_EXCEPTION);
8883 TEST_ffI_f1 (remquo, qnan_value, qnan_value, qnan_value, IGNORE);
8885 TEST_ffI_f1 (remquo, 1.625, 1.0, -0.375, 2);
8886 TEST_ffI_f1 (remquo, -1.625, 1.0, 0.375, -2);
8887 TEST_ffI_f1 (remquo, 1.625, -1.0, -0.375, -2);
8888 TEST_ffI_f1 (remquo, -1.625, -1.0, 0.375, 2);
8890 TEST_ffI_f1 (remquo, 5, 2, 1, 2);
8891 TEST_ffI_f1 (remquo, 3, 2, -1, 2);
8899 /* TODO: missing qNaN tests. */
8903 TEST_f_f (rint, 0.0, 0.0);
8904 TEST_f_f (rint, minus_zero, minus_zero);
8905 TEST_f_f (rint, plus_infty, plus_infty);
8906 TEST_f_f (rint, minus_infty, minus_infty);
8908 /* Default rounding mode is round to even. */
8909 TEST_f_f (rint, 0.5, 0.0);
8910 TEST_f_f (rint, 1.5, 2.0);
8911 TEST_f_f (rint, 2.5, 2.0);
8912 TEST_f_f (rint, 3.5, 4.0);
8913 TEST_f_f (rint, 4.5, 4.0);
8914 TEST_f_f (rint, -0.5, -0.0);
8915 TEST_f_f (rint, -1.5, -2.0);
8916 TEST_f_f (rint, -2.5, -2.0);
8917 TEST_f_f (rint, -3.5, -4.0);
8918 TEST_f_f (rint, -4.5, -4.0);
8919 TEST_f_f (rint, 0.1, 0.0);
8920 TEST_f_f (rint, 0.25, 0.0);
8921 TEST_f_f (rint, 0.625, 1.0);
8922 TEST_f_f (rint, -0.1, -0.0);
8923 TEST_f_f (rint, -0.25, -0.0);
8924 TEST_f_f (rint, -0.625, -1.0);
8925 TEST_f_f (rint, 262144.75, 262145.0);
8926 TEST_f_f (rint, 262142.75, 262143.0);
8927 TEST_f_f (rint, 524286.75, 524287.0);
8928 TEST_f_f (rint, 524288.75, 524289.0);
8929 TEST_f_f (rint, 1048576.75, 1048577.0);
8930 TEST_f_f (rint, 2097152.75, 2097153.0);
8931 TEST_f_f (rint, -1048576.75, -1048577.0);
8932 TEST_f_f (rint, -2097152.75, -2097153.0);
8934 TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
8935 TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
8936 TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
8937 TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
8938 TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
8939 TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
8940 TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
8941 TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
8942 TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
8943 TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
8946 /* The result can only be represented in long double. */
8947 TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);
8948 TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L);
8949 TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L);
8950 TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L);
8951 TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L);
8953 # if LDBL_MANT_DIG > 100
8954 TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L);
8955 TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L);
8956 TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L);
8959 TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L);
8960 TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L);
8961 TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L);
8962 TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L);
8963 TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L);
8965 # if LDBL_MANT_DIG > 100
8966 TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L);
8967 TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L);
8968 TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L);
8970 TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L);
8971 TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L);
8972 TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L);
8973 TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L);
8974 TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L);
8975 TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L);
8977 TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L);
8978 TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L);
8979 TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L);
8980 TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L);
8981 TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L);
8982 TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L);
8985 TEST_f_f (rint, 9007199254740991.5L, 9007199254740992.0L);
8986 TEST_f_f (rint, 9007199254740992.25L, 9007199254740992.0L);
8987 TEST_f_f (rint, 9007199254740992.5L, 9007199254740992.0L);
8988 TEST_f_f (rint, 9007199254740992.75L, 9007199254740993.0L);
8989 TEST_f_f (rint, 9007199254740993.5L, 9007199254740994.0L);
8991 TEST_f_f (rint, -9007199254740991.5L, -9007199254740992.0L);
8992 TEST_f_f (rint, -9007199254740992.25L, -9007199254740992.0L);
8993 TEST_f_f (rint, -9007199254740992.5L, -9007199254740992.0L);
8994 TEST_f_f (rint, -9007199254740992.75L, -9007199254740993.0L);
8995 TEST_f_f (rint, -9007199254740993.5L, -9007199254740994.0L);
8997 TEST_f_f (rint, 72057594037927935.5L, 72057594037927936.0L);
8998 TEST_f_f (rint, 72057594037927936.25L, 72057594037927936.0L);
8999 TEST_f_f (rint, 72057594037927936.5L, 72057594037927936.0L);
9000 TEST_f_f (rint, 72057594037927936.75L, 72057594037927937.0L);
9001 TEST_f_f (rint, 72057594037927937.5L, 72057594037927938.0L);
9003 TEST_f_f (rint, -72057594037927935.5L, -72057594037927936.0L);
9004 TEST_f_f (rint, -72057594037927936.25L, -72057594037927936.0L);
9005 TEST_f_f (rint, -72057594037927936.5L, -72057594037927936.0L);
9006 TEST_f_f (rint, -72057594037927936.75L, -72057594037927937.0L);
9007 TEST_f_f (rint, -72057594037927937.5L, -72057594037927938.0L);
9009 TEST_f_f (rint, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L);
9010 TEST_f_f (rint, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L);
9011 TEST_f_f (rint, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L);
9012 TEST_f_f (rint, 10141204801825835211973625643008.75L, 10141204801825835211973625643009.0L);
9013 TEST_f_f (rint, 10141204801825835211973625643009.5L, 10141204801825835211973625643010.0L);
9020 rint_test_tonearest (void)
9022 int save_round_mode;
9023 START (rint_tonearest);
9025 save_round_mode = fegetround ();
9027 if (!fesetround (FE_TONEAREST))
9029 TEST_f_f (rint, 2.0, 2.0);
9030 TEST_f_f (rint, 1.5, 2.0);
9031 TEST_f_f (rint, 1.0, 1.0);
9032 TEST_f_f (rint, 0.5, 0.0);
9033 TEST_f_f (rint, 0.0, 0.0);
9034 TEST_f_f (rint, minus_zero, minus_zero);
9035 TEST_f_f (rint, -0.5, -0.0);
9036 TEST_f_f (rint, -1.0, -1.0);
9037 TEST_f_f (rint, -1.5, -2.0);
9038 TEST_f_f (rint, -2.0, -2.0);
9039 TEST_f_f (rint, 0.1, 0.0);
9040 TEST_f_f (rint, 0.25, 0.0);
9041 TEST_f_f (rint, 0.625, 1.0);
9042 TEST_f_f (rint, -0.1, -0.0);
9043 TEST_f_f (rint, -0.25, -0.0);
9044 TEST_f_f (rint, -0.625, -1.0);
9045 TEST_f_f (rint, 1048576.75, 1048577.0);
9046 TEST_f_f (rint, 2097152.75, 2097153.0);
9047 TEST_f_f (rint, -1048576.75, -1048577.0);
9048 TEST_f_f (rint, -2097152.75, -2097153.0);
9050 TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
9051 TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
9052 TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
9053 TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
9054 TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
9055 TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
9056 TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
9057 TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
9058 TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
9059 TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
9062 /* The result can only be represented in long double. */
9063 TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);
9064 TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L);
9065 TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L);
9066 TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L);
9067 TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L);
9068 # if LDBL_MANT_DIG > 100
9069 TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L);
9070 TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L);
9071 TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L);
9073 TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L);
9074 TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L);
9075 TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L);
9076 TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L);
9077 TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L);
9078 # if LDBL_MANT_DIG > 100
9079 TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L);
9080 TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L);
9081 TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L);
9083 TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L);
9084 TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L);
9085 TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L);
9086 TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L);
9087 TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L);
9088 TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L);
9090 TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L);
9091 TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L);
9092 TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L);
9093 TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L);
9094 TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L);
9095 TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L);
9100 fesetround (save_round_mode);
9102 END (rint_tonearest);
9106 rint_test_towardzero (void)
9108 int save_round_mode;
9109 START (rint_towardzero);
9111 save_round_mode = fegetround ();
9113 if (!fesetround (FE_TOWARDZERO))
9115 TEST_f_f (rint, 2.0, 2.0);
9116 TEST_f_f (rint, 1.5, 1.0);
9117 TEST_f_f (rint, 1.0, 1.0);
9118 TEST_f_f (rint, 0.5, 0.0);
9119 TEST_f_f (rint, 0.0, 0.0);
9120 TEST_f_f (rint, minus_zero, minus_zero);
9121 TEST_f_f (rint, -0.5, -0.0);
9122 TEST_f_f (rint, -1.0, -1.0);
9123 TEST_f_f (rint, -1.5, -1.0);
9124 TEST_f_f (rint, -2.0, -2.0);
9125 TEST_f_f (rint, 0.1, 0.0);
9126 TEST_f_f (rint, 0.25, 0.0);
9127 TEST_f_f (rint, 0.625, 0.0);
9128 TEST_f_f (rint, -0.1, -0.0);
9129 TEST_f_f (rint, -0.25, -0.0);
9130 TEST_f_f (rint, -0.625, -0.0);
9131 TEST_f_f (rint, 1048576.75, 1048576.0);
9132 TEST_f_f (rint, 2097152.75, 2097152.0);
9133 TEST_f_f (rint, -1048576.75, -1048576.0);
9134 TEST_f_f (rint, -2097152.75, -2097152.0);
9136 TEST_f_f (rint, 70368744177664.75, 70368744177664.0);
9137 TEST_f_f (rint, 140737488355328.75, 140737488355328.0);
9138 TEST_f_f (rint, 281474976710656.75, 281474976710656.0);
9139 TEST_f_f (rint, 562949953421312.75, 562949953421312.0);
9140 TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0);
9141 TEST_f_f (rint, -70368744177664.75, -70368744177664.0);
9142 TEST_f_f (rint, -140737488355328.75, -140737488355328.0);
9143 TEST_f_f (rint, -281474976710656.75, -281474976710656.0);
9144 TEST_f_f (rint, -562949953421312.75, -562949953421312.0);
9145 TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0);
9148 /* The result can only be represented in long double. */
9149 TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L);
9150 TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L);
9151 TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L);
9152 TEST_f_f (rint, 4503599627370496.75L, 4503599627370496.0L);
9153 TEST_f_f (rint, 4503599627370497.5L, 4503599627370497.0L);
9154 # if LDBL_MANT_DIG > 100
9155 TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370494.0L);
9156 TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370495.0L);
9157 TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370496.0L);
9159 TEST_f_f (rint, -4503599627370495.5L, -4503599627370495.0L);
9160 TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L);
9161 TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L);
9162 TEST_f_f (rint, -4503599627370496.75L, -4503599627370496.0L);
9163 TEST_f_f (rint, -4503599627370497.5L, -4503599627370497.0L);
9164 # if LDBL_MANT_DIG > 100
9165 TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370494.0L);
9166 TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370495.0L);
9167 TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370496.0L);
9169 TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L);
9170 TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L);
9171 TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L);
9172 TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740991.0L);
9173 TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740992.0L);
9174 TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740993.0L);
9176 TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L);
9177 TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L);
9178 TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L);
9179 TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740991.0L);
9180 TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740992.0L);
9181 TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740993.0L);
9186 fesetround (save_round_mode);
9188 END (rint_towardzero);
9192 rint_test_downward (void)
9194 int save_round_mode;
9195 START (rint_downward);
9197 save_round_mode = fegetround ();
9199 if (!fesetround (FE_DOWNWARD))
9201 TEST_f_f (rint, 2.0, 2.0);
9202 TEST_f_f (rint, 1.5, 1.0);
9203 TEST_f_f (rint, 1.0, 1.0);
9204 TEST_f_f (rint, 0.5, 0.0);
9205 TEST_f_f (rint, 0.0, 0.0);
9206 TEST_f_f (rint, minus_zero, minus_zero);
9207 TEST_f_f (rint, -0.5, -1.0);
9208 TEST_f_f (rint, -1.0, -1.0);
9209 TEST_f_f (rint, -1.5, -2.0);
9210 TEST_f_f (rint, -2.0, -2.0);
9211 TEST_f_f (rint, 0.1, 0.0);
9212 TEST_f_f (rint, 0.25, 0.0);
9213 TEST_f_f (rint, 0.625, 0.0);
9214 TEST_f_f (rint, -0.1, -1.0);
9215 TEST_f_f (rint, -0.25, -1.0);
9216 TEST_f_f (rint, -0.625, -1.0);
9217 TEST_f_f (rint, 1048576.75, 1048576.0);
9218 TEST_f_f (rint, 2097152.75, 2097152.0);
9219 TEST_f_f (rint, -1048576.75, -1048577.0);
9220 TEST_f_f (rint, -2097152.75, -2097153.0);
9222 TEST_f_f (rint, 70368744177664.75, 70368744177664.0);
9223 TEST_f_f (rint, 140737488355328.75, 140737488355328.0);
9224 TEST_f_f (rint, 281474976710656.75, 281474976710656.0);
9225 TEST_f_f (rint, 562949953421312.75, 562949953421312.0);
9226 TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0);
9227 TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
9228 TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
9229 TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
9230 TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
9231 TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
9234 /* The result can only be represented in long double. */
9235 TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L);
9236 TEST_f_f (rint, 4503599627370496.25L, 4503599627370496.0L);
9237 TEST_f_f (rint, 4503599627370496.5L, 4503599627370496.0L);
9238 TEST_f_f (rint, 4503599627370496.75L, 4503599627370496.0L);
9239 TEST_f_f (rint, 4503599627370497.5L, 4503599627370497.0L);
9240 # if LDBL_MANT_DIG > 100
9241 TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370494.0L);
9242 TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370495.0L);
9243 TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370496.0L);
9245 TEST_f_f (rint, -4503599627370495.5L, -4503599627370496.0L);
9246 TEST_f_f (rint, -4503599627370496.25L, -4503599627370497.0L);
9247 TEST_f_f (rint, -4503599627370496.5L, -4503599627370497.0L);
9248 TEST_f_f (rint, -4503599627370496.75L, -4503599627370497.0L);
9249 TEST_f_f (rint, -4503599627370497.5L, -4503599627370498.0L);
9250 # if LDBL_MANT_DIG > 100
9251 TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370495.0L);
9252 TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370496.0L);
9253 TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370497.0L);
9255 TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740991.0L);
9256 TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740992.0L);
9257 TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740993.0L);
9258 TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740991.0L);
9259 TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740992.0L);
9260 TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740993.0L);
9262 TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740992.0L);
9263 TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740993.0L);
9264 TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740994.0L);
9265 TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740992.0L);
9266 TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740993.0L);
9267 TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740994.0L);
9272 fesetround (save_round_mode);
9274 END (rint_downward);
9278 rint_test_upward (void)
9280 int save_round_mode;
9281 START (rint_upward);
9283 save_round_mode = fegetround ();
9285 if (!fesetround (FE_UPWARD))
9287 TEST_f_f (rint, 2.0, 2.0);
9288 TEST_f_f (rint, 1.5, 2.0);
9289 TEST_f_f (rint, 1.0, 1.0);
9290 TEST_f_f (rint, 0.5, 1.0);
9291 TEST_f_f (rint, 0.0, 0.0);
9292 TEST_f_f (rint, minus_zero, minus_zero);
9293 TEST_f_f (rint, -0.5, -0.0);
9294 TEST_f_f (rint, -1.0, -1.0);
9295 TEST_f_f (rint, -1.5, -1.0);
9296 TEST_f_f (rint, -2.0, -2.0);
9297 TEST_f_f (rint, 0.1, 1.0);
9298 TEST_f_f (rint, 0.25, 1.0);
9299 TEST_f_f (rint, 0.625, 1.0);
9300 TEST_f_f (rint, -0.1, -0.0);
9301 TEST_f_f (rint, -0.25, -0.0);
9302 TEST_f_f (rint, -0.625, -0.0);
9303 TEST_f_f (rint, 1048576.75, 1048577.0);
9304 TEST_f_f (rint, 2097152.75, 2097153.0);
9305 TEST_f_f (rint, -1048576.75, -1048576.0);
9306 TEST_f_f (rint, -2097152.75, -2097152.0);
9308 TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
9309 TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
9310 TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
9311 TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
9312 TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
9313 TEST_f_f (rint, -70368744177664.75, -70368744177664.0);
9314 TEST_f_f (rint, -140737488355328.75, -140737488355328.0);
9315 TEST_f_f (rint, -281474976710656.75, -281474976710656.0);
9316 TEST_f_f (rint, -562949953421312.75, -562949953421312.0);
9317 TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0);
9320 /* The result can only be represented in long double. */
9321 TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);
9322 TEST_f_f (rint, 4503599627370496.25L, 4503599627370497.0L);
9323 TEST_f_f (rint, 4503599627370496.5L, 4503599627370497.0L);
9324 TEST_f_f (rint, 4503599627370496.75L, 4503599627370497.0L);
9325 TEST_f_f (rint, 4503599627370497.5L, 4503599627370498.0L);
9326 # if LDBL_MANT_DIG > 100
9327 TEST_f_f (rint, 4503599627370494.5000000000001L, 4503599627370495.0L);
9328 TEST_f_f (rint, 4503599627370495.5000000000001L, 4503599627370496.0L);
9329 TEST_f_f (rint, 4503599627370496.5000000000001L, 4503599627370497.0L);
9331 TEST_f_f (rint, -4503599627370495.5L, -4503599627370495.0L);
9332 TEST_f_f (rint, -4503599627370496.25L, -4503599627370496.0L);
9333 TEST_f_f (rint, -4503599627370496.5L, -4503599627370496.0L);
9334 TEST_f_f (rint, -4503599627370496.75L, -4503599627370496.0L);
9335 TEST_f_f (rint, -4503599627370497.5L, -4503599627370497.0L);
9336 # if LDBL_MANT_DIG > 100
9337 TEST_f_f (rint, -4503599627370494.5000000000001L, -4503599627370494.0L);
9338 TEST_f_f (rint, -4503599627370495.5000000000001L, -4503599627370495.0L);
9339 TEST_f_f (rint, -4503599627370496.5000000000001L, -4503599627370496.0L);
9341 TEST_f_f (rint, 9007199254740991.0000000000001L, 9007199254740992.0L);
9342 TEST_f_f (rint, 9007199254740992.0000000000001L, 9007199254740993.0L);
9343 TEST_f_f (rint, 9007199254740993.0000000000001L, 9007199254740994.0L);
9344 TEST_f_f (rint, 9007199254740991.5000000000001L, 9007199254740992.0L);
9345 TEST_f_f (rint, 9007199254740992.5000000000001L, 9007199254740993.0L);
9346 TEST_f_f (rint, 9007199254740993.5000000000001L, 9007199254740994.0L);
9348 TEST_f_f (rint, -9007199254740991.0000000000001L, -9007199254740991.0L);
9349 TEST_f_f (rint, -9007199254740992.0000000000001L, -9007199254740992.0L);
9350 TEST_f_f (rint, -9007199254740993.0000000000001L, -9007199254740993.0L);
9351 TEST_f_f (rint, -9007199254740991.5000000000001L, -9007199254740991.0L);
9352 TEST_f_f (rint, -9007199254740992.5000000000001L, -9007199254740992.0L);
9353 TEST_f_f (rint, -9007199254740993.5000000000001L, -9007199254740993.0L);
9358 fesetround (save_round_mode);
9366 /* TODO: missing +/-Inf as well as qNaN tests. */
9370 TEST_f_f (round, 0, 0);
9371 TEST_f_f (round, minus_zero, minus_zero);
9372 TEST_f_f (round, 0.2L, 0.0);
9373 TEST_f_f (round, -0.2L, minus_zero);
9374 TEST_f_f (round, 0.5, 1.0);
9375 TEST_f_f (round, -0.5, -1.0);
9376 TEST_f_f (round, 0.8L, 1.0);
9377 TEST_f_f (round, -0.8L, -1.0);
9378 TEST_f_f (round, 1.5, 2.0);
9379 TEST_f_f (round, -1.5, -2.0);
9380 TEST_f_f (round, 0.1, 0.0);
9381 TEST_f_f (round, 0.25, 0.0);
9382 TEST_f_f (round, 0.625, 1.0);
9383 TEST_f_f (round, -0.1, -0.0);
9384 TEST_f_f (round, -0.25, -0.0);
9385 TEST_f_f (round, -0.625, -1.0);
9386 TEST_f_f (round, 2097152.5, 2097153);
9387 TEST_f_f (round, -2097152.5, -2097153);
9390 /* The result can only be represented in long double. */
9391 TEST_f_f (round, 4503599627370495.5L, 4503599627370496.0L);
9392 TEST_f_f (round, 4503599627370496.25L, 4503599627370496.0L);
9393 TEST_f_f (round, 4503599627370496.5L, 4503599627370497.0L);
9394 TEST_f_f (round, 4503599627370496.75L, 4503599627370497.0L);
9395 TEST_f_f (round, 4503599627370497.5L, 4503599627370498.0L);
9396 # if LDBL_MANT_DIG > 100
9397 TEST_f_f (round, 4503599627370494.5000000000001L, 4503599627370495.0L);
9398 TEST_f_f (round, 4503599627370495.5000000000001L, 4503599627370496.0L);
9399 TEST_f_f (round, 4503599627370496.5000000000001L, 4503599627370497.0L);
9402 TEST_f_f (round, -4503599627370495.5L, -4503599627370496.0L);
9403 TEST_f_f (round, -4503599627370496.25L, -4503599627370496.0L);
9404 TEST_f_f (round, -4503599627370496.5L, -4503599627370497.0L);
9405 TEST_f_f (round, -4503599627370496.75L, -4503599627370497.0L);
9406 TEST_f_f (round, -4503599627370497.5L, -4503599627370498.0L);
9407 # if LDBL_MANT_DIG > 100
9408 TEST_f_f (round, -4503599627370494.5000000000001L, -4503599627370495.0L);
9409 TEST_f_f (round, -4503599627370495.5000000000001L, -4503599627370496.0L);
9410 TEST_f_f (round, -4503599627370496.5000000000001L, -4503599627370497.0L);
9413 TEST_f_f (round, 9007199254740991.5L, 9007199254740992.0L);
9414 TEST_f_f (round, 9007199254740992.25L, 9007199254740992.0L);
9415 TEST_f_f (round, 9007199254740992.5L, 9007199254740993.0L);
9416 TEST_f_f (round, 9007199254740992.75L, 9007199254740993.0L);
9417 TEST_f_f (round, 9007199254740993.5L, 9007199254740994.0L);
9419 TEST_f_f (round, -9007199254740991.5L, -9007199254740992.0L);
9420 TEST_f_f (round, -9007199254740992.25L, -9007199254740992.0L);
9421 TEST_f_f (round, -9007199254740992.5L, -9007199254740993.0L);
9422 TEST_f_f (round, -9007199254740992.75L, -9007199254740993.0L);
9423 TEST_f_f (round, -9007199254740993.5L, -9007199254740994.0L);
9425 # if LDBL_MANT_DIG > 100
9426 TEST_f_f (round, 9007199254740991.0000000000001L, 9007199254740991.0L);
9427 TEST_f_f (round, 9007199254740992.0000000000001L, 9007199254740992.0L);
9428 TEST_f_f (round, 9007199254740993.0000000000001L, 9007199254740993.0L);
9429 TEST_f_f (round, 9007199254740991.5000000000001L, 9007199254740992.0L);
9430 TEST_f_f (round, 9007199254740992.5000000000001L, 9007199254740993.0L);
9431 TEST_f_f (round, 9007199254740993.5000000000001L, 9007199254740994.0L);
9433 TEST_f_f (round, -9007199254740991.0000000000001L, -9007199254740991.0L);
9434 TEST_f_f (round, -9007199254740992.0000000000001L, -9007199254740992.0L);
9435 TEST_f_f (round, -9007199254740993.0000000000001L, -9007199254740993.0L);
9436 TEST_f_f (round, -9007199254740991.5000000000001L, -9007199254740992.0L);
9437 TEST_f_f (round, -9007199254740992.5000000000001L, -9007199254740993.0L);
9438 TEST_f_f (round, -9007199254740993.5000000000001L, -9007199254740994.0L);
9441 TEST_f_f (round, 72057594037927935.5L, 72057594037927936.0L);
9442 TEST_f_f (round, 72057594037927936.25L, 72057594037927936.0L);
9443 TEST_f_f (round, 72057594037927936.5L, 72057594037927937.0L);
9444 TEST_f_f (round, 72057594037927936.75L, 72057594037927937.0L);
9445 TEST_f_f (round, 72057594037927937.5L, 72057594037927938.0L);
9447 TEST_f_f (round, -72057594037927935.5L, -72057594037927936.0L);
9448 TEST_f_f (round, -72057594037927936.25L, -72057594037927936.0L);
9449 TEST_f_f (round, -72057594037927936.5L, -72057594037927937.0L);
9450 TEST_f_f (round, -72057594037927936.75L, -72057594037927937.0L);
9451 TEST_f_f (round, -72057594037927937.5L, -72057594037927938.0L);
9453 TEST_f_f (round, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L);
9454 TEST_f_f (round, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L);
9455 TEST_f_f (round, 10141204801825835211973625643008.5L, 10141204801825835211973625643009.0L);
9456 TEST_f_f (round, 10141204801825835211973625643008.75L, 10141204801825835211973625643009.0L);
9457 TEST_f_f (round, 10141204801825835211973625643009.5L, 10141204801825835211973625643010.0L);
9470 TEST_ff_f (scalb, 2.0, 0.5, qnan_value, INVALID_EXCEPTION);
9471 TEST_ff_f (scalb, 3.0, -2.5, qnan_value, INVALID_EXCEPTION);
9473 TEST_ff_f (scalb, 0, qnan_value, qnan_value);
9474 TEST_ff_f (scalb, 1, qnan_value, qnan_value);
9476 TEST_ff_f (scalb, 1, 0, 1);
9477 TEST_ff_f (scalb, -1, 0, -1);
9479 TEST_ff_f (scalb, 0, plus_infty, qnan_value, INVALID_EXCEPTION);
9480 TEST_ff_f (scalb, minus_zero, plus_infty, qnan_value, INVALID_EXCEPTION);
9482 TEST_ff_f (scalb, 0, 2, 0);
9483 TEST_ff_f (scalb, minus_zero, -4, minus_zero);
9484 TEST_ff_f (scalb, 0, 0, 0);
9485 TEST_ff_f (scalb, minus_zero, 0, minus_zero);
9486 TEST_ff_f (scalb, 0, -1, 0);
9487 TEST_ff_f (scalb, minus_zero, -10, minus_zero);
9488 TEST_ff_f (scalb, 0, minus_infty, 0);
9489 TEST_ff_f (scalb, minus_zero, minus_infty, minus_zero);
9491 TEST_ff_f (scalb, plus_infty, -1, plus_infty);
9492 TEST_ff_f (scalb, minus_infty, -10, minus_infty);
9493 TEST_ff_f (scalb, plus_infty, 0, plus_infty);
9494 TEST_ff_f (scalb, minus_infty, 0, minus_infty);
9495 TEST_ff_f (scalb, plus_infty, 2, plus_infty);
9496 TEST_ff_f (scalb, minus_infty, 100, minus_infty);
9498 TEST_ff_f (scalb, 0.1L, minus_infty, 0.0);
9499 TEST_ff_f (scalb, -0.1L, minus_infty, minus_zero);
9501 TEST_ff_f (scalb, 1, plus_infty, plus_infty);
9502 TEST_ff_f (scalb, -1, plus_infty, minus_infty);
9503 TEST_ff_f (scalb, plus_infty, plus_infty, plus_infty);
9504 TEST_ff_f (scalb, minus_infty, plus_infty, minus_infty);
9506 TEST_ff_f (scalb, plus_infty, minus_infty, qnan_value, INVALID_EXCEPTION);
9507 TEST_ff_f (scalb, minus_infty, minus_infty, qnan_value, INVALID_EXCEPTION);
9509 TEST_ff_f (scalb, qnan_value, 1, qnan_value);
9510 TEST_ff_f (scalb, 1, qnan_value, qnan_value);
9511 TEST_ff_f (scalb, qnan_value, 0, qnan_value);
9512 TEST_ff_f (scalb, 0, qnan_value, qnan_value);
9513 TEST_ff_f (scalb, qnan_value, plus_infty, qnan_value);
9514 TEST_ff_f (scalb, plus_infty, qnan_value, qnan_value);
9515 TEST_ff_f (scalb, qnan_value, qnan_value, qnan_value);
9517 TEST_ff_f (scalb, 0.8L, 4, 12.8L);
9518 TEST_ff_f (scalb, -0.854375L, 5, -27.34L);
9530 TEST_fi_f (scalbn, 0, 0, 0);
9531 TEST_fi_f (scalbn, minus_zero, 0, minus_zero);
9533 TEST_fi_f (scalbn, plus_infty, 1, plus_infty);
9534 TEST_fi_f (scalbn, minus_infty, 1, minus_infty);
9535 TEST_fi_f (scalbn, qnan_value, 1, qnan_value);
9537 TEST_fi_f (scalbn, 0.8L, 4, 12.8L);
9538 TEST_fi_f (scalbn, -0.854375L, 5, -27.34L);
9540 TEST_fi_f (scalbn, 1, 0L, 1);
9542 TEST_fi_f (scalbn, 1, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
9543 TEST_fi_f (scalbn, 1, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9544 TEST_fi_f (scalbn, max_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
9545 TEST_fi_f (scalbn, max_value, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9546 TEST_fi_f (scalbn, min_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
9547 TEST_fi_f (scalbn, min_value, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9548 TEST_fi_f (scalbn, min_value / 4, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
9549 TEST_fi_f (scalbn, min_value / 4, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9561 TEST_fl_f (scalbln, 0, 0, 0);
9562 TEST_fl_f (scalbln, minus_zero, 0, minus_zero);
9564 TEST_fl_f (scalbln, plus_infty, 1, plus_infty);
9565 TEST_fl_f (scalbln, minus_infty, 1, minus_infty);
9566 TEST_fl_f (scalbln, qnan_value, 1, qnan_value);
9568 TEST_fl_f (scalbln, 0.8L, 4, 12.8L);
9569 TEST_fl_f (scalbln, -0.854375L, 5, -27.34L);
9571 TEST_fl_f (scalbln, 1, 0L, 1);
9573 TEST_fi_f (scalbln, 1, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
9574 TEST_fi_f (scalbln, 1, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9575 TEST_fi_f (scalbln, max_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
9576 TEST_fi_f (scalbln, max_value, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9577 TEST_fi_f (scalbln, min_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
9578 TEST_fi_f (scalbln, min_value, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9579 TEST_fi_f (scalbln, min_value / 4, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
9580 TEST_fi_f (scalbln, min_value / 4, INT_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9582 TEST_fi_f (scalbln, 1, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
9583 TEST_fi_f (scalbln, 1, LONG_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9584 TEST_fi_f (scalbln, max_value, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
9585 TEST_fi_f (scalbln, max_value, LONG_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9586 TEST_fi_f (scalbln, min_value, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
9587 TEST_fi_f (scalbln, min_value, LONG_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9588 TEST_fi_f (scalbln, min_value / 4, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
9589 TEST_fi_f (scalbln, min_value / 4, LONG_MIN, plus_zero, UNDERFLOW_EXCEPTION);
9591 #if LONG_MAX >= 0x100000000
9592 TEST_fi_f (scalbln, 1, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
9593 TEST_fi_f (scalbln, 1, -0x88000000L, plus_zero, UNDERFLOW_EXCEPTION);
9594 TEST_fi_f (scalbln, max_value, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
9595 TEST_fi_f (scalbln, max_value, -0x88000000L, plus_zero, UNDERFLOW_EXCEPTION);
9596 TEST_fi_f (scalbln, min_value, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
9597 TEST_fi_f (scalbln, min_value, -0x88000000L, plus_zero, UNDERFLOW_EXCEPTION);
9598 TEST_fi_f (scalbln, min_value / 4, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
9599 TEST_fi_f (scalbln, min_value / 4, -0x88000000L, plus_zero, UNDERFLOW_EXCEPTION);
9609 /* TODO: missing qNaN tests. */
9613 TEST_f_b (signbit, 0, 0);
9614 TEST_f_b (signbit, minus_zero, 1);
9615 TEST_f_b (signbit, plus_infty, 0);
9616 TEST_f_b (signbit, minus_infty, 1);
9618 /* signbit (x) != 0 for x < 0. */
9619 TEST_f_b (signbit, -1, 1);
9620 /* signbit (x) == 0 for x >= 0. */
9621 TEST_f_b (signbit, 1, 0);
9632 if (errno == ENOSYS)
9633 /* Function not implemented. */
9638 TEST_f_f (sin, 0, 0);
9639 TEST_f_f (sin, minus_zero, minus_zero);
9641 TEST_f_f (sin, plus_infty, qnan_value, INVALID_EXCEPTION);
9642 check_int ("errno for sin(+inf) == EDOM", errno, EDOM, 0, 0, 0);
9644 TEST_f_f (sin, minus_infty, qnan_value, INVALID_EXCEPTION);
9645 check_int ("errno for sin(-inf) == EDOM", errno, EDOM, 0, 0, 0);
9647 TEST_f_f (sin, qnan_value, qnan_value);
9648 check_int ("errno for sin(qNaN) unchanged", errno, 0, 0, 0, 0);
9650 TEST_f_f (sin, M_PI_6l, 0.5);
9651 TEST_f_f (sin, -M_PI_6l, -0.5);
9652 TEST_f_f (sin, M_PI_2l, 1);
9653 TEST_f_f (sin, -M_PI_2l, -1);
9654 TEST_f_f (sin, 0.75L, 0.681638760023334166733241952779893935L);
9656 TEST_f_f (sin, 0x1p65, -0.047183876212354673805106149805700013943218L);
9657 TEST_f_f (sin, -0x1p65, 0.047183876212354673805106149805700013943218L);
9659 TEST_f_f (sin, 0x1.7f4134p+103, -6.6703229329788657073304190650534846045235e-08L);
9662 TEST_f_f (sin, 0.80190127184058835, 0.71867942238767868);
9663 TEST_f_f (sin, 2.522464e-1, 2.4957989804940911e-1);
9667 TEST_f_f (sin, 1e22, -0.8522008497671888017727058937530293682618L);
9668 TEST_f_f (sin, 0x1p1023, 0.5631277798508840134529434079444683477104L);
9671 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
9672 TEST_f_f (sin, 0x1p16383L, 0.3893629985894208126948115852610595405563L);
9675 TEST_f_f (sin, 0x1p+120, 3.77820109360752022655548470056922991960587e-01L);
9676 TEST_f_f (sin, 0x1p+127, 6.23385512955870240370428801097126489001833e-01L);
9677 TEST_f_f (sin, 0x1.fffff8p+127, 4.85786063130487339701113680434728152037092e-02L);
9678 TEST_f_f (sin, 0x1.fffffep+127, -5.21876523333658540551505357019806722935726e-01L);
9679 TEST_f_f (sin, 0x1p+50, 4.96396515208940840876821859865411368093356e-01L);
9680 TEST_f_f (sin, 0x1p+28, -9.86198211836975655703110310527108292055548e-01L);
9688 sin_test_tonearest (void)
9690 int save_round_mode;
9693 if (errno == ENOSYS)
9694 /* Function not implemented. */
9697 START (sin_tonearest);
9699 save_round_mode = fegetround ();
9701 if (!fesetround (FE_TONEAREST))
9703 TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
9704 TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
9705 TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
9706 TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
9707 TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
9708 TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
9709 TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
9710 TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
9711 TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
9712 TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
9715 fesetround (save_round_mode);
9717 END (sin_tonearest);
9722 sin_test_towardzero (void)
9724 int save_round_mode;
9727 if (errno == ENOSYS)
9728 /* Function not implemented. */
9731 START (sin_towardzero);
9733 save_round_mode = fegetround ();
9735 if (!fesetround (FE_TOWARDZERO))
9737 TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
9738 TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
9739 TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
9740 TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
9741 TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
9742 TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
9743 TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
9744 TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
9745 TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
9746 TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
9749 fesetround (save_round_mode);
9751 END (sin_towardzero);
9756 sin_test_downward (void)
9758 int save_round_mode;
9761 if (errno == ENOSYS)
9762 /* Function not implemented. */
9765 START (sin_downward);
9767 save_round_mode = fegetround ();
9769 if (!fesetround (FE_DOWNWARD))
9771 TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
9772 TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
9773 TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
9774 TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
9775 TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
9776 TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
9777 TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
9778 TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
9779 TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
9780 TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
9783 fesetround (save_round_mode);
9790 sin_test_upward (void)
9792 int save_round_mode;
9795 if (errno == ENOSYS)
9796 /* Function not implemented. */
9801 save_round_mode = fegetround ();
9803 if (!fesetround (FE_UPWARD))
9805 TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
9806 TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
9807 TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
9808 TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
9809 TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
9810 TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
9811 TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
9812 TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
9813 TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
9814 TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
9817 fesetround (save_round_mode);
9826 FLOAT sin_res, cos_res;
9829 FUNC(sincos) (0, &sin_res, &cos_res);
9830 if (errno == ENOSYS)
9831 /* Function not implemented. */
9836 /* sincos is treated differently because it returns void. */
9837 TEST_extra (sincos, 0, 0, 1);
9839 TEST_extra (sincos, minus_zero, minus_zero, 1);
9840 TEST_extra (sincos, plus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
9841 TEST_extra (sincos, minus_infty, qnan_value, qnan_value, INVALID_EXCEPTION);
9842 TEST_extra (sincos, qnan_value, qnan_value, qnan_value);
9844 TEST_extra (sincos, M_PI_2l, 1, 0);
9845 TEST_extra (sincos, M_PI_6l, 0.5, 0.86602540378443864676372317075293616L);
9846 TEST_extra (sincos, M_PI_6l*2.0, 0.86602540378443864676372317075293616L, 0.5);
9847 TEST_extra (sincos, 0.75L, 0.681638760023334166733241952779893935L, 0.731688868873820886311838753000084544L);
9849 TEST_extra (sincos, 0x1p65, -0.047183876212354673805106149805700013943218L, 0.99888622066058013610642172179340364209972L);
9850 TEST_extra (sincos, -0x1p65, 0.047183876212354673805106149805700013943218L, 0.99888622066058013610642172179340364209972L);
9853 TEST_extra (sincos, 0.80190127184058835, 0.71867942238767868, 0.69534156199418473);
9857 TEST_extra (sincos, 1e22, -0.8522008497671888017727058937530293682618L, 0.5232147853951389454975944733847094921409L);
9858 TEST_extra (sincos, 0x1p1023, 0.5631277798508840134529434079444683477104L, -0.826369834614147994500785680811743734805L);
9861 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
9862 TEST_extra (sincos, 0x1p16383L, 0.3893629985894208126948115852610595405563L, 0.9210843909921906206874509522505756251609L);
9865 TEST_extra (sincos, 0x1p+120, 3.77820109360752022655548470056922991960587e-01L, -9.25879022854837867303861764107414946730833e-01L);
9866 TEST_extra (sincos, 0x1p+127, 6.23385512955870240370428801097126489001833e-01L, 7.81914638714960072263910298466369236613162e-01L);
9867 TEST_extra (sincos, 0x1.fffff8p+127, 4.85786063130487339701113680434728152037092e-02L, 9.98819362551949040703862043664101081064641e-01L);
9868 TEST_extra (sincos, 0x1.fffffep+127, -5.21876523333658540551505357019806722935726e-01L, 8.53021039830304158051791467692161107353094e-01L);
9869 TEST_extra (sincos, 0x1p+50, 4.96396515208940840876821859865411368093356e-01L, 8.68095904660550604334592502063501320395739e-01L);
9870 TEST_extra (sincos, 0x1p+28, -9.86198211836975655703110310527108292055548e-01L, -1.65568979490578758865468278195361551113358e-01L);
9880 if (errno == ENOSYS)
9881 /* Function not implemented. */
9885 TEST_f_f (sinh, 0, 0);
9886 TEST_f_f (sinh, minus_zero, minus_zero);
9889 TEST_f_f (sinh, plus_infty, plus_infty);
9890 TEST_f_f (sinh, minus_infty, minus_infty);
9892 TEST_f_f (sinh, qnan_value, qnan_value);
9894 TEST_f_f (sinh, 0.75L, 0.822316731935829980703661634446913849L);
9895 TEST_f_f (sinh, 0x8p-32L, 1.86264514923095703232705808926175479e-9L);
9902 sinh_test_tonearest (void)
9904 int save_round_mode;
9907 if (errno == ENOSYS)
9908 /* Function not implemented. */
9911 START (sinh_tonearest);
9913 save_round_mode = fegetround ();
9915 if (!fesetround (FE_TONEAREST))
9917 TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
9918 TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
9919 TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
9922 fesetround (save_round_mode);
9924 END (sinh_tonearest);
9929 sinh_test_towardzero (void)
9931 int save_round_mode;
9934 if (errno == ENOSYS)
9935 /* Function not implemented. */
9938 START (sinh_towardzero);
9940 save_round_mode = fegetround ();
9942 if (!fesetround (FE_TOWARDZERO))
9944 TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
9945 TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
9946 TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
9949 fesetround (save_round_mode);
9951 END (sinh_towardzero);
9956 sinh_test_downward (void)
9958 int save_round_mode;
9961 if (errno == ENOSYS)
9962 /* Function not implemented. */
9965 START (sinh_downward);
9967 save_round_mode = fegetround ();
9969 if (!fesetround (FE_DOWNWARD))
9971 TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
9972 TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
9973 TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
9976 fesetround (save_round_mode);
9978 END (sinh_downward);
9983 sinh_test_upward (void)
9985 int save_round_mode;
9988 if (errno == ENOSYS)
9989 /* Function not implemented. */
9992 START (sinh_upward);
9994 save_round_mode = fegetround ();
9996 if (!fesetround (FE_UPWARD))
9998 TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
9999 TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
10000 TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
10003 fesetround (save_round_mode);
10014 if (errno == ENOSYS)
10015 /* Function not implemented. */
10020 TEST_f_f (sqrt, 0, 0);
10021 TEST_f_f (sqrt, qnan_value, qnan_value);
10022 TEST_f_f (sqrt, plus_infty, plus_infty);
10024 TEST_f_f (sqrt, minus_zero, minus_zero);
10026 /* sqrt (x) == qNaN plus invalid exception for x < 0. */
10027 TEST_f_f (sqrt, -1, qnan_value, INVALID_EXCEPTION);
10028 TEST_f_f (sqrt, -max_value, qnan_value, INVALID_EXCEPTION);
10029 TEST_f_f (sqrt, minus_infty, qnan_value, INVALID_EXCEPTION);
10031 TEST_f_f (sqrt, 2209, 47);
10032 TEST_f_f (sqrt, 4, 2);
10033 TEST_f_f (sqrt, 2, M_SQRT2l);
10034 TEST_f_f (sqrt, 0.25, 0.5);
10035 TEST_f_f (sqrt, 6642.25, 81.5);
10036 TEST_f_f (sqrt, 15190.5625L, 123.25L);
10037 TEST_f_f (sqrt, 0.75L, 0.866025403784438646763723170752936183L);
10048 if (errno == ENOSYS)
10049 /* Function not implemented. */
10054 TEST_f_f (tan, 0, 0);
10055 TEST_f_f (tan, minus_zero, minus_zero);
10057 TEST_f_f (tan, plus_infty, qnan_value, INVALID_EXCEPTION);
10058 check_int ("errno for tan(Inf) == EDOM", errno, EDOM, 0, 0, 0);
10060 TEST_f_f (tan, minus_infty, qnan_value, INVALID_EXCEPTION);
10061 check_int ("errno for tan(-Inf) == EDOM", errno, EDOM, 0, 0, 0);
10063 TEST_f_f (tan, qnan_value, qnan_value);
10064 check_int ("errno for tan(qNaN) == 0", errno, 0, 0, 0, 0);
10066 TEST_f_f (tan, M_PI_4l, 1);
10067 TEST_f_f (tan, 0.75L, 0.931596459944072461165202756573936428L);
10069 TEST_f_f (tan, 0x1p65, -0.0472364872359047946798414219288370688827L);
10070 TEST_f_f (tan, -0x1p65, 0.0472364872359047946798414219288370688827L);
10072 TEST_f_f (tan, 0xc.9p-4, 0.9995162902115457818029468900654150261381L);
10073 TEST_f_f (tan, 0xc.908p-4, 0.9997603425502441410973077452249560802034L);
10074 TEST_f_f (tan, 0xc.90cp-4, 0.9998823910588060302788513970802357770031L);
10075 TEST_f_f (tan, 0xc.90ep-4, 0.9999434208994808753305784795924711152508L);
10076 TEST_f_f (tan, 0xc.90fp-4, 0.9999739372166156702433266059635165160515L);
10077 TEST_f_f (tan, 0xc.90f8p-4, 0.9999891957244072765118898375645469865764L);
10078 TEST_f_f (tan, 0xc.90fcp-4, 0.9999968250656122402859679132395522927393L);
10079 TEST_f_f (tan, 0xc.90fdp-4, 0.9999987324100083358016192309006353329444L);
10080 TEST_f_f (tan, 0xc.90fd8p-4, 0.9999996860835706212861509874451585282616L);
10081 TEST_f_f (tan, 0xc.90fdap-4, 0.9999999245021033010474530133665235922808L);
10082 TEST_f_f (tan, 0xc.ap-4, 1.0073556597407272165371804539701396631519L);
10083 TEST_f_f (tan, 0xc.98p-4, 1.0034282930863044654045449407466962736255L);
10084 TEST_f_f (tan, 0xc.94p-4, 1.0014703786820082237342656561856877993328L);
10085 TEST_f_f (tan, 0xc.92p-4, 1.0004928571392300571266638743539017593717L);
10086 TEST_f_f (tan, 0xc.91p-4, 1.0000044544650244953647966900221905361131L);
10087 TEST_f_f (tan, 0xc.90fep-4, 1.0000006397580424009014454926842136804016L);
10088 TEST_f_f (tan, 0xc.90fdcp-4, 1.0000001629206928242190327320047489394217L);
10089 TEST_f_f (tan, 0xc.90fdbp-4, 1.0000000437113909572052640953950483705005L);
10091 TEST_f_f (tan, -0xc.9p-4, -0.9995162902115457818029468900654150261381L);
10092 TEST_f_f (tan, -0xc.908p-4, -0.9997603425502441410973077452249560802034L);
10093 TEST_f_f (tan, -0xc.90cp-4, -0.9998823910588060302788513970802357770031L);
10094 TEST_f_f (tan, -0xc.90ep-4, -0.9999434208994808753305784795924711152508L);
10095 TEST_f_f (tan, -0xc.90fp-4, -0.9999739372166156702433266059635165160515L);
10096 TEST_f_f (tan, -0xc.90f8p-4, -0.9999891957244072765118898375645469865764L);
10097 TEST_f_f (tan, -0xc.90fcp-4, -0.9999968250656122402859679132395522927393L);
10098 TEST_f_f (tan, -0xc.90fdp-4, -0.9999987324100083358016192309006353329444L);
10099 TEST_f_f (tan, -0xc.90fd8p-4, -0.9999996860835706212861509874451585282616L);
10100 TEST_f_f (tan, -0xc.90fdap-4, -0.9999999245021033010474530133665235922808L);
10101 TEST_f_f (tan, -0xc.ap-4, -1.0073556597407272165371804539701396631519L);
10102 TEST_f_f (tan, -0xc.98p-4, -1.0034282930863044654045449407466962736255L);
10103 TEST_f_f (tan, -0xc.94p-4, -1.0014703786820082237342656561856877993328L);
10104 TEST_f_f (tan, -0xc.92p-4, -1.0004928571392300571266638743539017593717L);
10105 TEST_f_f (tan, -0xc.91p-4, -1.0000044544650244953647966900221905361131L);
10106 TEST_f_f (tan, -0xc.90fep-4, -1.0000006397580424009014454926842136804016L);
10107 TEST_f_f (tan, -0xc.90fdcp-4, -1.0000001629206928242190327320047489394217L);
10108 TEST_f_f (tan, -0xc.90fdbp-4, -1.0000000437113909572052640953950483705005L);
10111 TEST_f_f (tan, 1e22, -1.628778225606898878549375936939548513545L);
10112 TEST_f_f (tan, 0x1p1023, -0.6814476476066215012854144040167365190368L);
10115 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
10116 TEST_f_f (tan, 0x1p16383L, 0.422722393732022337800504160054440141575L);
10124 tan_test_tonearest (void)
10126 int save_round_mode;
10129 if (errno == ENOSYS)
10130 /* Function not implemented. */
10133 START (tan_tonearest);
10135 save_round_mode = fegetround ();
10137 if (!fesetround (FE_TONEAREST))
10139 TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
10140 TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
10141 TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
10142 TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
10143 TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
10144 TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
10145 TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
10146 TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
10147 TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
10148 TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
10151 fesetround (save_round_mode);
10153 END (tan_tonearest);
10158 tan_test_towardzero (void)
10160 int save_round_mode;
10163 if (errno == ENOSYS)
10164 /* Function not implemented. */
10167 START (tan_towardzero);
10169 save_round_mode = fegetround ();
10171 if (!fesetround (FE_TOWARDZERO))
10173 TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
10174 TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
10175 TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
10176 TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
10177 TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
10178 TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
10179 TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
10180 TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
10181 TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
10182 TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
10185 fesetround (save_round_mode);
10187 END (tan_towardzero);
10192 tan_test_downward (void)
10194 int save_round_mode;
10197 if (errno == ENOSYS)
10198 /* Function not implemented. */
10201 START (tan_downward);
10203 save_round_mode = fegetround ();
10205 if (!fesetround (FE_DOWNWARD))
10207 TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
10208 TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
10209 TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
10210 TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
10211 TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
10212 TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
10213 TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
10214 TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
10215 TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
10216 TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
10219 fesetround (save_round_mode);
10221 END (tan_downward);
10226 tan_test_upward (void)
10228 int save_round_mode;
10231 if (errno == ENOSYS)
10232 /* Function not implemented. */
10235 START (tan_upward);
10237 save_round_mode = fegetround ();
10239 if (!fesetround (FE_UPWARD))
10241 TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
10242 TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
10243 TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
10244 TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
10245 TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
10246 TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
10247 TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
10248 TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
10249 TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
10250 TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
10253 fesetround (save_round_mode);
10264 if (errno == ENOSYS)
10265 /* Function not implemented. */
10270 TEST_f_f (tanh, 0, 0);
10271 TEST_f_f (tanh, minus_zero, minus_zero);
10273 #ifndef TEST_INLINE
10274 TEST_f_f (tanh, plus_infty, 1);
10275 TEST_f_f (tanh, minus_infty, -1);
10277 TEST_f_f (tanh, qnan_value, qnan_value);
10279 TEST_f_f (tanh, 0.75L, 0.635148952387287319214434357312496495L);
10280 TEST_f_f (tanh, -0.75L, -0.635148952387287319214434357312496495L);
10282 TEST_f_f (tanh, 1.0L, 0.7615941559557648881194582826047935904L);
10283 TEST_f_f (tanh, -1.0L, -0.7615941559557648881194582826047935904L);
10286 TEST_f_f (tanh, 0x1p-57L, 6.938893903907228377647697925567626953125e-18L);
10296 if (errno == ENOSYS)
10297 /* Function not implemented. */
10302 TEST_f_f (tgamma, plus_infty, plus_infty);
10303 TEST_f_f (tgamma, max_value, plus_infty, OVERFLOW_EXCEPTION);
10304 TEST_f_f (tgamma, 0, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
10305 TEST_f_f (tgamma, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
10306 /* tgamma (x) == qNaN plus invalid exception for integer x <= 0. */
10307 TEST_f_f (tgamma, -2, qnan_value, INVALID_EXCEPTION);
10308 TEST_f_f (tgamma, -max_value, qnan_value, INVALID_EXCEPTION);
10309 TEST_f_f (tgamma, minus_infty, qnan_value, INVALID_EXCEPTION);
10310 TEST_f_f (tgamma, qnan_value, qnan_value);
10312 TEST_f_f (tgamma, 0.5, M_SQRT_PIl);
10313 TEST_f_f (tgamma, -0.5, -M_2_SQRT_PIl);
10315 TEST_f_f (tgamma, 1, 1);
10316 TEST_f_f (tgamma, 4, 6);
10318 TEST_f_f (tgamma, 0.7L, 1.29805533264755778568117117915281162L);
10319 TEST_f_f (tgamma, 1.2L, 0.918168742399760610640951655185830401L);
10330 TEST_f_f (trunc, plus_infty, plus_infty);
10331 TEST_f_f (trunc, minus_infty, minus_infty);
10332 TEST_f_f (trunc, qnan_value, qnan_value);
10334 TEST_f_f (trunc, 0, 0);
10335 TEST_f_f (trunc, minus_zero, minus_zero);
10336 TEST_f_f (trunc, 0.1, 0);
10337 TEST_f_f (trunc, 0.25, 0);
10338 TEST_f_f (trunc, 0.625, 0);
10339 TEST_f_f (trunc, -0.1, minus_zero);
10340 TEST_f_f (trunc, -0.25, minus_zero);
10341 TEST_f_f (trunc, -0.625, minus_zero);
10342 TEST_f_f (trunc, 1, 1);
10343 TEST_f_f (trunc, -1, -1);
10344 TEST_f_f (trunc, 1.625, 1);
10345 TEST_f_f (trunc, -1.625, -1);
10347 TEST_f_f (trunc, 1048580.625L, 1048580L);
10348 TEST_f_f (trunc, -1048580.625L, -1048580L);
10350 TEST_f_f (trunc, 8388610.125L, 8388610.0L);
10351 TEST_f_f (trunc, -8388610.125L, -8388610.0L);
10353 TEST_f_f (trunc, 4294967296.625L, 4294967296.0L);
10354 TEST_f_f (trunc, -4294967296.625L, -4294967296.0L);
10356 #ifdef TEST_LDOUBLE
10357 /* The result can only be represented in long double. */
10358 TEST_f_f (trunc, 4503599627370495.5L, 4503599627370495.0L);
10359 TEST_f_f (trunc, 4503599627370496.25L, 4503599627370496.0L);
10360 TEST_f_f (trunc, 4503599627370496.5L, 4503599627370496.0L);
10361 TEST_f_f (trunc, 4503599627370496.75L, 4503599627370496.0L);
10362 TEST_f_f (trunc, 4503599627370497.5L, 4503599627370497.0L);
10364 # if LDBL_MANT_DIG > 100
10365 TEST_f_f (trunc, 4503599627370494.5000000000001L, 4503599627370494.0L);
10366 TEST_f_f (trunc, 4503599627370495.5000000000001L, 4503599627370495.0L);
10367 TEST_f_f (trunc, 4503599627370496.5000000000001L, 4503599627370496.0L);
10370 TEST_f_f (trunc, -4503599627370495.5L, -4503599627370495.0L);
10371 TEST_f_f (trunc, -4503599627370496.25L, -4503599627370496.0L);
10372 TEST_f_f (trunc, -4503599627370496.5L, -4503599627370496.0L);
10373 TEST_f_f (trunc, -4503599627370496.75L, -4503599627370496.0L);
10374 TEST_f_f (trunc, -4503599627370497.5L, -4503599627370497.0L);
10376 # if LDBL_MANT_DIG > 100
10377 TEST_f_f (trunc, -4503599627370494.5000000000001L, -4503599627370494.0L);
10378 TEST_f_f (trunc, -4503599627370495.5000000000001L, -4503599627370495.0L);
10379 TEST_f_f (trunc, -4503599627370496.5000000000001L, -4503599627370496.0L);
10382 TEST_f_f (trunc, 9007199254740991.5L, 9007199254740991.0L);
10383 TEST_f_f (trunc, 9007199254740992.25L, 9007199254740992.0L);
10384 TEST_f_f (trunc, 9007199254740992.5L, 9007199254740992.0L);
10385 TEST_f_f (trunc, 9007199254740992.75L, 9007199254740992.0L);
10386 TEST_f_f (trunc, 9007199254740993.5L, 9007199254740993.0L);
10388 # if LDBL_MANT_DIG > 100
10389 TEST_f_f (trunc, 9007199254740991.0000000000001L, 9007199254740991.0L);
10390 TEST_f_f (trunc, 9007199254740992.0000000000001L, 9007199254740992.0L);
10391 TEST_f_f (trunc, 9007199254740993.0000000000001L, 9007199254740993.0L);
10392 TEST_f_f (trunc, 9007199254740991.5000000000001L, 9007199254740991.0L);
10393 TEST_f_f (trunc, 9007199254740992.5000000000001L, 9007199254740992.0L);
10394 TEST_f_f (trunc, 9007199254740993.5000000000001L, 9007199254740993.0L);
10397 TEST_f_f (trunc, -9007199254740991.5L, -9007199254740991.0L);
10398 TEST_f_f (trunc, -9007199254740992.25L, -9007199254740992.0L);
10399 TEST_f_f (trunc, -9007199254740992.5L, -9007199254740992.0L);
10400 TEST_f_f (trunc, -9007199254740992.75L, -9007199254740992.0L);
10401 TEST_f_f (trunc, -9007199254740993.5L, -9007199254740993.0L);
10403 # if LDBL_MANT_DIG > 100
10404 TEST_f_f (trunc, -9007199254740991.0000000000001L, -9007199254740991.0L);
10405 TEST_f_f (trunc, -9007199254740992.0000000000001L, -9007199254740992.0L);
10406 TEST_f_f (trunc, -9007199254740993.0000000000001L, -9007199254740993.0L);
10407 TEST_f_f (trunc, -9007199254740991.5000000000001L, -9007199254740991.0L);
10408 TEST_f_f (trunc, -9007199254740992.5000000000001L, -9007199254740992.0L);
10409 TEST_f_f (trunc, -9007199254740993.5000000000001L, -9007199254740993.0L);
10412 TEST_f_f (trunc, 72057594037927935.5L, 72057594037927935.0L);
10413 TEST_f_f (trunc, 72057594037927936.25L, 72057594037927936.0L);
10414 TEST_f_f (trunc, 72057594037927936.5L, 72057594037927936.0L);
10415 TEST_f_f (trunc, 72057594037927936.75L, 72057594037927936.0L);
10416 TEST_f_f (trunc, 72057594037927937.5L, 72057594037927937.0L);
10418 TEST_f_f (trunc, -72057594037927935.5L, -72057594037927935.0L);
10419 TEST_f_f (trunc, -72057594037927936.25L, -72057594037927936.0L);
10420 TEST_f_f (trunc, -72057594037927936.5L, -72057594037927936.0L);
10421 TEST_f_f (trunc, -72057594037927936.75L, -72057594037927936.0L);
10422 TEST_f_f (trunc, -72057594037927937.5L, -72057594037927937.0L);
10424 TEST_f_f (trunc, 10141204801825835211973625643007.5L, 10141204801825835211973625643007.0L);
10425 TEST_f_f (trunc, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L);
10426 TEST_f_f (trunc, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L);
10427 TEST_f_f (trunc, 10141204801825835211973625643008.75L, 10141204801825835211973625643008.0L);
10428 TEST_f_f (trunc, 10141204801825835211973625643009.5L, 10141204801825835211973625643009.0L);
10439 FUNC (sincos) (0, &s, &c);
10440 if (errno == ENOSYS)
10441 /* Required function not implemented. */
10444 if (errno == ENOSYS)
10445 /* Function not implemented. */
10448 /* y0 is the Bessel function of the second kind of order 0 */
10451 TEST_f_f (y0, -1.0, minus_infty, INVALID_EXCEPTION);
10452 TEST_f_f (y0, -max_value, minus_infty, INVALID_EXCEPTION);
10453 TEST_f_f (y0, 0.0, minus_infty);
10454 TEST_f_f (y0, qnan_value, qnan_value);
10455 TEST_f_f (y0, plus_infty, 0);
10457 TEST_f_f (y0, 0.125L, -1.38968062514384052915582277745018693L);
10458 TEST_f_f (y0, 0.75L, -0.137172769385772397522814379396581855L);
10459 TEST_f_f (y0, 1.0, 0.0882569642156769579829267660235151628L);
10460 TEST_f_f (y0, 1.5, 0.382448923797758843955068554978089862L);
10461 TEST_f_f (y0, 2.0, 0.510375672649745119596606592727157873L);
10462 TEST_f_f (y0, 8.0, 0.223521489387566220527323400498620359L);
10463 TEST_f_f (y0, 10.0, 0.0556711672835993914244598774101900481L);
10465 TEST_f_f (y0, 0x1.3ffp+74L, 1.818984347516051243459467456433028748678e-12L);
10468 TEST_f_f (y0, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L);
10471 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
10472 TEST_f_f (y0, 0x1p16382L, 8.0839224448726336195866026476176740513439e-2467L);
10473 TEST_f_f (y0, 0x1p16383L, -3.8895531955766020648617743624167352352217e-2467L);
10476 TEST_f_f (y0, 0x1p-10L, -4.4865150767109739412411806297168793661098L);
10477 TEST_f_f (y0, 0x1p-20L, -8.8992283012125827603076426611387876938160L);
10478 TEST_f_f (y0, 0x1p-30L, -1.3311940304267782826037118027401817264906e+1L);
10479 TEST_f_f (y0, 0x1p-40L, -1.7724652307320814696990854700366226762563e+1L);
10480 TEST_f_f (y0, 0x1p-50L, -2.2137364310373846564919987139743760738155e+1L);
10481 TEST_f_f (y0, 0x1p-60L, -2.6550076313426878432849115782108205929120e+1L);
10482 TEST_f_f (y0, 0x1p-70L, -3.0962788316479910300778244424468159753887e+1L);
10483 TEST_f_f (y0, 0x1p-80L, -3.5375500319532942168707373066828113573541e+1L);
10484 TEST_f_f (y0, 0x1p-90L, -3.9788212322585974036636501709188067393195e+1L);
10485 TEST_f_f (y0, 0x1p-100L, -4.420092432563900590456563035154802121284e+1L);
10486 TEST_f_f (y0, 0x1p-110L, -4.861363632869203777249475899390797503250e+1L);
10497 FUNC (sincos) (0, &s, &c);
10498 if (errno == ENOSYS)
10499 /* Required function not implemented. */
10502 if (errno == ENOSYS)
10503 /* Function not implemented. */
10506 /* y1 is the Bessel function of the second kind of order 1 */
10509 TEST_f_f (y1, -1.0, minus_infty, INVALID_EXCEPTION);
10510 TEST_f_f (y1, -max_value, minus_infty, INVALID_EXCEPTION);
10511 TEST_f_f (y1, 0.0, minus_infty);
10512 TEST_f_f (y1, plus_infty, 0);
10513 TEST_f_f (y1, qnan_value, qnan_value);
10515 TEST_f_f (y1, 0.125L, -5.19993611253477499595928744876579921L);
10516 TEST_f_f (y1, 0.75L, -1.03759455076928541973767132140642198L);
10517 TEST_f_f (y1, 1.0, -0.781212821300288716547150000047964821L);
10518 TEST_f_f (y1, 1.5, -0.412308626973911295952829820633445323L);
10519 TEST_f_f (y1, 2.0, -0.107032431540937546888370772277476637L);
10520 TEST_f_f (y1, 8.0, -0.158060461731247494255555266187483550L);
10521 TEST_f_f (y1, 10.0, 0.249015424206953883923283474663222803L);
10523 TEST_f_f (y1, 0x1.27e204p+99L, -8.881610148467797208469612080785210013461e-16L);
10526 TEST_f_f (y1, 0x1.001000001p+593L, 3.927269966354206207832593635798954916263e-90L);
10529 #if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
10530 TEST_f_f (y1, 0x1p16382L, 1.2193782500509000574176799046642541129387e-2466L);
10531 TEST_f_f (y1, 0x1p16383L, -9.5859502826270374691362975419147645151233e-2467L);
10534 TEST_f_f (y1, 0x1p-10L, -6.5190099301063115047395187618929589514382e+02L);
10535 TEST_f_f (y1, 0x1p-20L, -6.6754421443450423911167962313100637952285e+05L);
10536 TEST_f_f (y1, 0x1p-30L, -6.8356527557643159612937462812258975438856e+08L);
10537 TEST_f_f (y1, 0x1p-40L, -6.9997084219026594793707805777425993547887e+11L);
10538 TEST_f_f (y1, 0x1p-50L, -7.1677014240283233068755952926181262431559e+14L);
10539 TEST_f_f (y1, 0x1p-60L, -7.3397262582050030662406095795388448059822e+17L);
10540 TEST_f_f (y1, 0x1p-70L, -7.5158796884019231398303842094477769620063e+20L);
10541 TEST_f_f (y1, 0x1p-80L, -7.6962608009235692951863134304745236090943e+23L);
10542 TEST_f_f (y1, 0x1p-90L, -7.8809710601457349582707849528059121757126e+26L);
10543 TEST_f_f (y1, 0x1p-100L, -8.0701143655892325972692837916732540679297e+29L);
10544 TEST_f_f (y1, 0x1p-110L, -8.2637971103633741796037466026734121655600e+32L);
10555 FUNC (sincos) (0, &s, &c);
10556 if (errno == ENOSYS)
10557 /* Required function not implemented. */
10560 if (errno == ENOSYS)
10561 /* Function not implemented. */
10564 /* yn is the Bessel function of the second kind of order n */
10567 /* yn (0, x) == y0 (x) */
10568 TEST_ff_f (yn, 0, -1.0, minus_infty, INVALID_EXCEPTION);
10569 TEST_ff_f (yn, 0, -max_value, minus_infty, INVALID_EXCEPTION);
10570 TEST_ff_f (yn, 0, 0.0, minus_infty);
10571 TEST_ff_f (yn, 0, qnan_value, qnan_value);
10572 TEST_ff_f (yn, 0, plus_infty, 0);
10574 TEST_ff_f (yn, 0, 0.125L, -1.38968062514384052915582277745018693L);
10575 TEST_ff_f (yn, 0, 0.75L, -0.137172769385772397522814379396581855L);
10576 TEST_ff_f (yn, 0, 1.0, 0.0882569642156769579829267660235151628L);
10577 TEST_ff_f (yn, 0, 1.5, 0.382448923797758843955068554978089862L);
10578 TEST_ff_f (yn, 0, 2.0, 0.510375672649745119596606592727157873L);
10579 TEST_ff_f (yn, 0, 8.0, 0.223521489387566220527323400498620359L);
10580 TEST_ff_f (yn, 0, 10.0, 0.0556711672835993914244598774101900481L);
10582 /* yn (1, x) == y1 (x) */
10583 TEST_ff_f (yn, 1, -1.0, minus_infty, INVALID_EXCEPTION);
10584 TEST_ff_f (yn, 1, 0.0, minus_infty);
10585 TEST_ff_f (yn, 1, plus_infty, 0);
10586 TEST_ff_f (yn, 1, qnan_value, qnan_value);
10588 TEST_ff_f (yn, 1, 0.125L, -5.19993611253477499595928744876579921L);
10589 TEST_ff_f (yn, 1, 0.75L, -1.03759455076928541973767132140642198L);
10590 TEST_ff_f (yn, 1, 1.0, -0.781212821300288716547150000047964821L);
10591 TEST_ff_f (yn, 1, 1.5, -0.412308626973911295952829820633445323L);
10592 TEST_ff_f (yn, 1, 2.0, -0.107032431540937546888370772277476637L);
10593 TEST_ff_f (yn, 1, 8.0, -0.158060461731247494255555266187483550L);
10594 TEST_ff_f (yn, 1, 10.0, 0.249015424206953883923283474663222803L);
10597 TEST_ff_f (yn, 3, plus_infty, 0);
10598 TEST_ff_f (yn, 3, qnan_value, qnan_value);
10600 TEST_ff_f (yn, 3, 0.125L, -2612.69757350066712600220955744091741L);
10601 TEST_ff_f (yn, 3, 0.75L, -12.9877176234475433186319774484809207L);
10602 TEST_ff_f (yn, 3, 1.0, -5.82151760596472884776175706442981440L);
10603 TEST_ff_f (yn, 3, 2.0, -1.12778377684042778608158395773179238L);
10604 TEST_ff_f (yn, 3, 10.0, -0.251362657183837329779204747654240998L);
10607 TEST_ff_f (yn, 10, plus_infty, 0);
10608 TEST_ff_f (yn, 10, qnan_value, qnan_value);
10610 TEST_ff_f (yn, 10, 0.125L, -127057845771019398.252538486899753195L);
10611 TEST_ff_f (yn, 10, 0.75L, -2133501638.90573424452445412893839236L);
10612 TEST_ff_f (yn, 10, 1.0, -121618014.278689189288130426667971145L);
10613 TEST_ff_f (yn, 10, 2.0, -129184.542208039282635913145923304214L);
10614 TEST_ff_f (yn, 10, 10.0, -0.359814152183402722051986577343560609L);
10616 /* Check whether yn returns correct value for LDBL_MIN, DBL_MIN,
10617 and FLT_MIN. See Bug 14173. */
10618 TEST_ff_f (yn, 10, min_value, minus_infty, OVERFLOW_EXCEPTION);
10621 TEST_ff_f (yn, 10, min_value, minus_infty, OVERFLOW_EXCEPTION);
10622 check_int ("errno for yn(10,-min) == ERANGE", errno, ERANGE, 0, 0, 0);
10629 significand_test (void)
10631 /* significand returns the mantissa of the exponential representation. */
10633 /* TODO: missing +/-Inf as well as qNaN tests. */
10635 START (significand);
10637 TEST_f_f (significand, 4.0, 1.0);
10638 TEST_f_f (significand, 6.0, 1.5);
10639 TEST_f_f (significand, 8.0, 1.0);
10648 fpstack_test ("start *init*");
10651 qnan_value = FUNC (__builtin_nan) ("");
10652 minus_zero = FUNC (copysign) (0.0, -1.0);
10653 plus_infty = CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF,
10654 HUGE_VALL, HUGE_VAL, HUGE_VALF);
10655 minus_infty = CHOOSE (-HUGE_VALL, -HUGE_VAL, -HUGE_VALF,
10656 -HUGE_VALL, -HUGE_VAL, -HUGE_VALF);
10657 max_value = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
10658 LDBL_MAX, DBL_MAX, FLT_MAX);
10659 min_value = CHOOSE (LDBL_MIN, DBL_MIN, FLT_MIN,
10660 LDBL_MIN, DBL_MIN, FLT_MIN);
10661 min_subnorm_value = CHOOSE (__LDBL_DENORM_MIN__,
10662 __DBL_DENORM_MIN__,
10663 __FLT_DENORM_MIN__,
10664 __LDBL_DENORM_MIN__,
10665 __DBL_DENORM_MIN__,
10666 __FLT_DENORM_MIN__);
10669 (void) &qnan_value;
10670 (void) &minus_zero;
10671 (void) &plus_infty;
10672 (void) &minus_infty;
10675 (void) &min_subnorm_value;
10677 /* Clear all exceptions. From now on we must not get random exceptions. */
10678 feclearexcept (FE_ALL_EXCEPT);
10680 /* Test to make sure we start correctly. */
10681 fpstack_test ("end *init*");
10684 /* Definitions of arguments for argp functions. */
10685 static const struct argp_option options[] =
10687 { "verbose", 'v', "NUMBER", 0, "Level of verbosity (0..3)"},
10688 { "ulps-file", 'u', NULL, 0, "Output ulps to file ULPs"},
10689 { "no-max-error", 'f', NULL, 0,
10690 "Don't output maximal errors of functions"},
10691 { "no-points", 'p', NULL, 0,
10692 "Don't output results of functions invocations"},
10693 { "ignore-max-ulp", 'i', "yes/no", 0,
10694 "Ignore given maximal errors"},
10695 { NULL, 0, NULL, 0, NULL }
10698 /* Short description of program. */
10699 static const char doc[] = "Math test suite: " TEST_MSG ;
10701 /* Prototype for option handler. */
10702 static error_t parse_opt (int key, char *arg, struct argp_state *state);
10704 /* Data structure to communicate with argp functions. */
10705 static struct argp argp =
10707 options, parse_opt, NULL, doc,
10711 /* Handle program arguments. */
10713 parse_opt (int key, char *arg, struct argp_state *state)
10718 output_max_error = 0;
10721 if (strcmp (arg, "yes") == 0)
10722 ignore_max_ulp = 1;
10723 else if (strcmp (arg, "no") == 0)
10724 ignore_max_ulp = 0;
10734 verbose = (unsigned int) strtoul (optarg, NULL, 0);
10739 return ARGP_ERR_UNKNOWN;
10745 /* function to check our ulp calculation. */
10751 FLOAT u, diff, ulp;
10752 /* This gives one ulp. */
10753 u = FUNC(nextafter) (10, 20);
10754 check_equal (10.0, u, 1, &diff, &ulp);
10755 printf ("One ulp: % .4" PRINTF_NEXPR "\n", ulp);
10757 /* This gives one more ulp. */
10758 u = FUNC(nextafter) (u, 20);
10759 check_equal (10.0, u, 2, &diff, &ulp);
10760 printf ("two ulp: % .4" PRINTF_NEXPR "\n", ulp);
10762 /* And now calculate 100 ulp. */
10763 for (i = 2; i < 100; i++)
10764 u = FUNC(nextafter) (u, 20);
10765 check_equal (10.0, u, 100, &diff, &ulp);
10766 printf ("100 ulp: % .4" PRINTF_NEXPR "\n", ulp);
10771 main (int argc, char **argv)
10778 output_max_error = 1;
10780 /* XXX set to 0 for releases. */
10781 ignore_max_ulp = 0;
10783 /* Parse and process arguments. */
10784 argp_parse (&argp, argc, argv, 0, &remaining, NULL);
10786 if (remaining != argc)
10788 fprintf (stderr, "wrong number of arguments");
10789 argp_help (&argp, stdout, ARGP_HELP_SEE, program_invocation_short_name);
10790 exit (EXIT_FAILURE);
10795 ulps_file = fopen ("ULPs", "a");
10796 if (ulps_file == NULL)
10798 perror ("can't open file `ULPs' for writing: ");
10811 /* Keep the tests a wee bit ordered (according to ISO C99). */
10812 /* Classification macros: */
10814 fpclassify_test ();
10821 /* Trigonometric functions: */
10823 acos_test_tonearest ();
10824 acos_test_towardzero ();
10825 acos_test_downward ();
10826 acos_test_upward ();
10828 asin_test_tonearest ();
10829 asin_test_towardzero ();
10830 asin_test_downward ();
10831 asin_test_upward ();
10835 cos_test_tonearest ();
10836 cos_test_towardzero ();
10837 cos_test_downward ();
10838 cos_test_upward ();
10840 sin_test_tonearest ();
10841 sin_test_towardzero ();
10842 sin_test_downward ();
10843 sin_test_upward ();
10846 tan_test_tonearest ();
10847 tan_test_towardzero ();
10848 tan_test_downward ();
10849 tan_test_upward ();
10851 /* Hyperbolic functions: */
10856 cosh_test_tonearest ();
10857 cosh_test_towardzero ();
10858 cosh_test_downward ();
10859 cosh_test_upward ();
10861 sinh_test_tonearest ();
10862 sinh_test_towardzero ();
10863 sinh_test_downward ();
10864 sinh_test_upward ();
10867 /* Exponential and logarithmic functions: */
10869 exp_test_tonearest ();
10870 exp_test_towardzero ();
10871 exp_test_downward ();
10872 exp_test_upward ();
10883 logb_test_downward ();
10889 significand_test ();
10891 /* Power and absolute value functions: */
10896 pow_test_tonearest ();
10897 pow_test_towardzero ();
10898 pow_test_downward ();
10899 pow_test_upward ();
10902 /* Error and gamma functions: */
10909 /* Nearest integer functions: */
10914 rint_test_tonearest ();
10915 rint_test_towardzero ();
10916 rint_test_downward ();
10917 rint_test_upward ();
10919 lrint_test_tonearest ();
10920 lrint_test_towardzero ();
10921 lrint_test_downward ();
10922 lrint_test_upward ();
10924 llrint_test_tonearest ();
10925 llrint_test_towardzero ();
10926 llrint_test_downward ();
10927 llrint_test_upward ();
10933 /* Remainder functions: */
10938 /* Manipulation functions: */
10941 nexttoward_test ();
10943 /* maximum, minimum and positive difference functions */
10948 /* Multiply and add: */
10950 fma_test_towardzero ();
10951 fma_test_downward ();
10952 fma_test_upward ();
10954 /* Comparison macros: */
10956 isgreaterequal_test ();
10958 islessequal_test ();
10959 islessgreater_test ();
10960 isunordered_test ();
10962 /* Complex functions: */
10985 ctan_test_tonearest ();
10986 ctan_test_towardzero ();
10987 ctan_test_downward ();
10988 ctan_test_upward ();
10990 ctanh_test_tonearest ();
10991 ctanh_test_towardzero ();
10992 ctanh_test_downward ();
10993 ctanh_test_upward ();
10995 /* Bessel functions: */
11004 fclose (ulps_file);
11006 printf ("\nTest suite completed:\n");
11007 printf (" %d test cases plus %d tests for exception flags executed.\n",
11008 noTests, noExcTests);
11010 printf (" %d expected failures occurred.\n", noXFails);
11012 printf (" %d unexpected passes occurred.\n", noXPasses);
11015 printf (" %d errors occurred.\n", noErrors);
11018 printf (" All tests passed successfully.\n");