1 /*
2  * SPDX-License-Identifier: BSD-3-Clause
3  *
4  * Copyright © 2020 Keith Packard
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above
14  *    copyright notice, this list of conditions and the following
15  *    disclaimer in the documentation and/or other materials provided
16  *    with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  *    contributors may be used to endorse or promote products derived
20  *    from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33  * OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #define makelname(s) scat(s,l)
37 
38 volatile FLOAT_T makemathname(zero) = (FLOAT_T) 0.0;
39 volatile FLOAT_T makemathname(negzero) = (FLOAT_T) -0.0;
40 volatile FLOAT_T makemathname(one) = (FLOAT_T) 1.0;
41 volatile FLOAT_T makemathname(two) = (FLOAT_T) 2.0;
42 volatile FLOAT_T makemathname(three) = (FLOAT_T) 3.0;
43 volatile FLOAT_T makemathname(half) = (FLOAT_T) 0.5;
44 volatile FLOAT_T makemathname(big) = BIG;
45 volatile FLOAT_T makemathname(bigodd) = BIGODD;
46 volatile FLOAT_T makemathname(bigeven) = BIGEVEN;
47 volatile FLOAT_T makemathname(small) = SMALL;
48 volatile FLOAT_T makemathname(infval) = (FLOAT_T) INFINITY;
49 volatile FLOAT_T makemathname(minfval) = (FLOAT_T) -INFINITY;
50 volatile FLOAT_T makemathname(qnanval) = (FLOAT_T) NAN;
51 volatile FLOAT_T makemathname(snanval) = (FLOAT_T) sNAN;
52 volatile FLOAT_T makemathname(pio2) = (FLOAT_T) (PI_VAL/(FLOAT_T)2.0);
53 volatile FLOAT_T makemathname(min_val) = (FLOAT_T) MIN_VAL;
54 volatile FLOAT_T makemathname(max_val) = (FLOAT_T) MAX_VAL;
55 
56 FLOAT_T makemathname(scalb)(FLOAT_T, FLOAT_T);
57 
58 #define cat2(a,b) a ## b
59 #define str(a) #a
60 #define TEST(n,v,ex,er)	{ .func = makemathname(cat2(test_, n)), .name = str(n), .value = (v), .except = (ex), .errno_expect = (er) }
61 
62 static int _signgam;
63 
64 #ifndef SIMPLE_MATH_ONLY
makemathname(test_acos_2)65 FLOAT_T makemathname(test_acos_2)(void) { return makemathname(acos)(makemathname(two)); }
makemathname(test_acos_qnan)66 FLOAT_T makemathname(test_acos_qnan)(void) { return makemathname(acos)(makemathname(qnanval)); }
makemathname(test_acos_snan)67 FLOAT_T makemathname(test_acos_snan)(void) { return makemathname(acos)(makemathname(snanval)); }
makemathname(test_acos_inf)68 FLOAT_T makemathname(test_acos_inf)(void) { return makemathname(acos)(makemathname(infval)); }
makemathname(test_acos_minf)69 FLOAT_T makemathname(test_acos_minf)(void) { return makemathname(acos)(makemathname(minfval)); }
70 
makemathname(test_acosh_half)71 FLOAT_T makemathname(test_acosh_half)(void) { return makemathname(acosh)(makemathname(one)/makemathname(two)); }
makemathname(test_acosh_qnan)72 FLOAT_T makemathname(test_acosh_qnan)(void) { return makemathname(acosh)(makemathname(qnanval)); }
makemathname(test_acosh_snan)73 FLOAT_T makemathname(test_acosh_snan)(void) { return makemathname(acosh)(makemathname(snanval)); }
makemathname(test_acosh_inf)74 FLOAT_T makemathname(test_acosh_inf)(void) { return makemathname(acosh)(makemathname(infval)); }
makemathname(test_acosh_minf)75 FLOAT_T makemathname(test_acosh_minf)(void) { return makemathname(acosh)(makemathname(minfval)); }
76 
makemathname(test_asin_2)77 FLOAT_T makemathname(test_asin_2)(void) { return makemathname(asin)(makemathname(two)); }
makemathname(test_asin_qnan)78 FLOAT_T makemathname(test_asin_qnan)(void) { return makemathname(asin)(makemathname(qnanval)); }
makemathname(test_asin_snan)79 FLOAT_T makemathname(test_asin_snan)(void) { return makemathname(asin)(makemathname(snanval)); }
makemathname(test_asin_inf)80 FLOAT_T makemathname(test_asin_inf)(void) { return makemathname(asin)(makemathname(infval)); }
makemathname(test_asin_minf)81 FLOAT_T makemathname(test_asin_minf)(void) { return makemathname(asin)(makemathname(minfval)); }
82 
makemathname(test_asinh_0)83 FLOAT_T makemathname(test_asinh_0)(void) { return makemathname(asinh)(makemathname(zero)); }
makemathname(test_asinh_neg0)84 FLOAT_T makemathname(test_asinh_neg0)(void) { return makemathname(asinh)(makemathname(negzero)); }
makemathname(test_asinh_qnan)85 FLOAT_T makemathname(test_asinh_qnan)(void) { return makemathname(asinh)(makemathname(qnanval)); }
makemathname(test_asinh_snan)86 FLOAT_T makemathname(test_asinh_snan)(void) { return makemathname(asinh)(makemathname(snanval)); }
makemathname(test_asinh_inf)87 FLOAT_T makemathname(test_asinh_inf)(void) { return makemathname(asinh)(makemathname(infval)); }
makemathname(test_asinh_minf)88 FLOAT_T makemathname(test_asinh_minf)(void) { return makemathname(asinh)(makemathname(minfval)); }
89 
makemathname(test_atan2_qnanx)90 FLOAT_T makemathname(test_atan2_qnanx)(void) { return makemathname(atan2)(makemathname(one), makemathname(qnanval)); }
makemathname(test_atan2_qnany)91 FLOAT_T makemathname(test_atan2_qnany)(void) { return makemathname(atan2)(makemathname(qnanval), makemathname(one)); }
makemathname(test_atan2_snanx)92 FLOAT_T makemathname(test_atan2_snanx)(void) { return makemathname(atan2)(makemathname(one), makemathname(snanval)); }
makemathname(test_atan2_snany)93 FLOAT_T makemathname(test_atan2_snany)(void) { return makemathname(atan2)(makemathname(snanval), makemathname(one)); }
makemathname(test_atan2_tiny)94 FLOAT_T makemathname(test_atan2_tiny)(void) { return makemathname(atan2)(makemathname(min_val), makemathname(max_val)); }
makemathname(test_atan2_nottiny)95 FLOAT_T makemathname(test_atan2_nottiny)(void) { return makemathname(atan2)(makemathname(min_val), (FLOAT_T) -0x8p-20); }
96 
makemathname(test_atanh_qnan)97 FLOAT_T makemathname(test_atanh_qnan)(void) { return makemathname(atanh)(makemathname(qnanval)); }
makemathname(test_atanh_snan)98 FLOAT_T makemathname(test_atanh_snan)(void) { return makemathname(atanh)(makemathname(snanval)); }
makemathname(test_atanh_1)99 FLOAT_T makemathname(test_atanh_1)(void) { return makemathname(atanh)(makemathname(one)); }
makemathname(test_atanh_neg1)100 FLOAT_T makemathname(test_atanh_neg1)(void) { return makemathname(atanh)(-makemathname(one)); }
makemathname(test_atanh_2)101 FLOAT_T makemathname(test_atanh_2)(void) { return makemathname(atanh)(makemathname(two)); }
makemathname(test_atanh_neg2)102 FLOAT_T makemathname(test_atanh_neg2)(void) { return makemathname(atanh)(-makemathname(two)); }
103 
makemathname(test_cbrt_0)104 FLOAT_T makemathname(test_cbrt_0)(void) { return makemathname(cbrt)(makemathname(zero)); }
makemathname(test_cbrt_neg0)105 FLOAT_T makemathname(test_cbrt_neg0)(void) { return makemathname(cbrt)(-makemathname(zero)); }
makemathname(test_cbrt_inf)106 FLOAT_T makemathname(test_cbrt_inf)(void) { return makemathname(cbrt)(makemathname(infval)); }
makemathname(test_cbrt_neginf)107 FLOAT_T makemathname(test_cbrt_neginf)(void) { return makemathname(cbrt)(-makemathname(infval)); }
makemathname(test_cbrt_qnan)108 FLOAT_T makemathname(test_cbrt_qnan)(void) { return makemathname(cbrt)(makemathname(qnanval)); }
makemathname(test_cbrt_snan)109 FLOAT_T makemathname(test_cbrt_snan)(void) { return makemathname(cbrt)(makemathname(snanval)); }
110 
makemathname(test_cos_inf)111 FLOAT_T makemathname(test_cos_inf)(void) { return makemathname(cos)(makemathname(infval)); }
makemathname(test_cos_qnan)112 FLOAT_T makemathname(test_cos_qnan)(void) { return makemathname(cos)(makemathname(qnanval)); }
makemathname(test_cos_snan)113 FLOAT_T makemathname(test_cos_snan)(void) { return makemathname(cos)(makemathname(snanval)); }
makemathname(test_cos_0)114 FLOAT_T makemathname(test_cos_0)(void) { return makemathname(cos)(makemathname(zero)); }
115 
makemathname(test_cosh_big)116 FLOAT_T makemathname(test_cosh_big)(void) { return makemathname(cosh)(makemathname(big)); }
makemathname(test_cosh_negbig)117 FLOAT_T makemathname(test_cosh_negbig)(void) { return makemathname(cosh)(makemathname(big)); }
makemathname(test_cosh_inf)118 FLOAT_T makemathname(test_cosh_inf)(void) { return makemathname(cosh)(makemathname(infval)); }
makemathname(test_cosh_qnan)119 FLOAT_T makemathname(test_cosh_qnan)(void) { return makemathname(cosh)(makemathname(qnanval)); }
makemathname(test_cosh_snan)120 FLOAT_T makemathname(test_cosh_snan)(void) { return makemathname(cosh)(makemathname(snanval)); }
121 
makemathname(test_drem_0)122 FLOAT_T makemathname(test_drem_0)(void) { return makemathname(drem)(makemathname(two), makemathname(zero)); }
makemathname(test_drem_qnan_1)123 FLOAT_T makemathname(test_drem_qnan_1)(void) { return makemathname(drem)(makemathname(qnanval), makemathname(one)); }
makemathname(test_drem_1_qnan)124 FLOAT_T makemathname(test_drem_1_qnan)(void) { return makemathname(drem)(makemathname(one), makemathname(qnanval)); }
makemathname(test_drem_snan_1)125 FLOAT_T makemathname(test_drem_snan_1)(void) { return makemathname(drem)(makemathname(snanval), makemathname(one)); }
makemathname(test_drem_1_snan)126 FLOAT_T makemathname(test_drem_1_snan)(void) { return makemathname(drem)(makemathname(one), makemathname(snanval)); }
makemathname(test_drem_inf_2)127 FLOAT_T makemathname(test_drem_inf_2)(void) { return makemathname(drem)(makemathname(infval), makemathname(two)); }
makemathname(test_drem_inf_0)128 FLOAT_T makemathname(test_drem_inf_0)(void) { return makemathname(drem)(makemathname(infval), makemathname(zero)); }
makemathname(test_drem_2_0)129 FLOAT_T makemathname(test_drem_2_0)(void) { return makemathname(drem)(makemathname(two), makemathname(zero)); }
makemathname(test_drem_1_2)130 FLOAT_T makemathname(test_drem_1_2)(void) { return makemathname(drem)(makemathname(one), makemathname(two)); }
makemathname(test_drem_neg1_2)131 FLOAT_T makemathname(test_drem_neg1_2)(void) { return makemathname(drem)(-makemathname(one), makemathname(two)); }
132 
makemathname(test_erf_qnan)133 FLOAT_T makemathname(test_erf_qnan)(void) { return makemathname(erf)(makemathname(qnanval)); }
makemathname(test_erf_snan)134 FLOAT_T makemathname(test_erf_snan)(void) { return makemathname(erf)(makemathname(snanval)); }
makemathname(test_erf_0)135 FLOAT_T makemathname(test_erf_0)(void) { return makemathname(erf)(makemathname(zero)); }
makemathname(test_erf_neg0)136 FLOAT_T makemathname(test_erf_neg0)(void) { return makemathname(erf)(-makemathname(zero)); }
makemathname(test_erf_inf)137 FLOAT_T makemathname(test_erf_inf)(void) { return makemathname(erf)(makemathname(infval)); }
makemathname(test_erf_neginf)138 FLOAT_T makemathname(test_erf_neginf)(void) { return makemathname(erf)(-makemathname(infval)); }
makemathname(test_erf_small)139 FLOAT_T makemathname(test_erf_small)(void) { return makemathname(erf)(makemathname(small)); }
140 
makemathname(test_exp_qnan)141 FLOAT_T makemathname(test_exp_qnan)(void) { return makemathname(exp)(makemathname(qnanval)); }
makemathname(test_exp_snan)142 FLOAT_T makemathname(test_exp_snan)(void) { return makemathname(exp)(makemathname(snanval)); }
makemathname(test_exp_inf)143 FLOAT_T makemathname(test_exp_inf)(void) { return makemathname(exp)(makemathname(infval)); }
makemathname(test_exp_neginf)144 FLOAT_T makemathname(test_exp_neginf)(void) { return makemathname(exp)(-makemathname(infval)); }
makemathname(test_exp_big)145 FLOAT_T makemathname(test_exp_big)(void) { return makemathname(exp)(makemathname(big)); }
makemathname(test_exp_negbig)146 FLOAT_T makemathname(test_exp_negbig)(void) { return makemathname(exp)(-makemathname(big)); }
147 
makemathname(test_exp2_qnan)148 FLOAT_T makemathname(test_exp2_qnan)(void) { return makemathname(exp2)(makemathname(qnanval)); }
makemathname(test_exp2_snan)149 FLOAT_T makemathname(test_exp2_snan)(void) { return makemathname(exp2)(makemathname(snanval)); }
makemathname(test_exp2_inf)150 FLOAT_T makemathname(test_exp2_inf)(void) { return makemathname(exp2)(makemathname(infval)); }
makemathname(test_exp2_neginf)151 FLOAT_T makemathname(test_exp2_neginf)(void) { return makemathname(exp2)(-makemathname(infval)); }
makemathname(test_exp2_big)152 FLOAT_T makemathname(test_exp2_big)(void) { return makemathname(exp2)(makemathname(big)); }
makemathname(test_exp2_negbig)153 FLOAT_T makemathname(test_exp2_negbig)(void) { return makemathname(exp2)(-makemathname(big)); }
154 
makemathname(test_exp10_qnan)155 FLOAT_T makemathname(test_exp10_qnan)(void) { return makemathname(exp10)(makemathname(qnanval)); }
makemathname(test_exp10_snan)156 FLOAT_T makemathname(test_exp10_snan)(void) { return makemathname(exp10)(makemathname(snanval)); }
makemathname(test_exp10_inf)157 FLOAT_T makemathname(test_exp10_inf)(void) { return makemathname(exp10)(makemathname(infval)); }
makemathname(test_exp10_neginf)158 FLOAT_T makemathname(test_exp10_neginf)(void) { return makemathname(exp10)(-makemathname(infval)); }
makemathname(test_exp10_big)159 FLOAT_T makemathname(test_exp10_big)(void) { return makemathname(exp10)(makemathname(big)); }
makemathname(test_exp10_negbig)160 FLOAT_T makemathname(test_exp10_negbig)(void) { return makemathname(exp10)(-makemathname(big)); }
161 
makemathname(test_expm1_qnan)162 FLOAT_T makemathname(test_expm1_qnan)(void) { return makemathname(expm1)(makemathname(qnanval)); }
makemathname(test_expm1_snan)163 FLOAT_T makemathname(test_expm1_snan)(void) { return makemathname(expm1)(makemathname(snanval)); }
makemathname(test_expm1_0)164 FLOAT_T makemathname(test_expm1_0)(void) { return makemathname(expm1)(makemathname(zero)); }
makemathname(test_expm1_neg0)165 FLOAT_T makemathname(test_expm1_neg0)(void) { return makemathname(expm1)(-makemathname(zero)); }
makemathname(test_expm1_inf)166 FLOAT_T makemathname(test_expm1_inf)(void) { return makemathname(expm1)(makemathname(infval)); }
makemathname(test_expm1_neginf)167 FLOAT_T makemathname(test_expm1_neginf)(void) { return makemathname(expm1)(-makemathname(infval)); }
makemathname(test_expm1_big)168 FLOAT_T makemathname(test_expm1_big)(void) { return makemathname(expm1)(makemathname(big)); }
makemathname(test_expm1_negbig)169 FLOAT_T makemathname(test_expm1_negbig)(void) { return makemathname(expm1)(-makemathname(big)); }
170 
171 #endif /* SIMPLE_MATH_ONLY */
172 
makemathname(test_fabs_qnan)173 FLOAT_T makemathname(test_fabs_qnan)(void) { return makemathname(fabs)(makemathname(qnanval)); }
makemathname(test_fabs_snan)174 FLOAT_T makemathname(test_fabs_snan)(void) { return makemathname(fabs)(makemathname(snanval)); }
makemathname(test_fabs_0)175 FLOAT_T makemathname(test_fabs_0)(void) { return makemathname(fabs)(makemathname(zero)); }
makemathname(test_fabs_neg0)176 FLOAT_T makemathname(test_fabs_neg0)(void) { return makemathname(fabs)(-makemathname(zero)); }
makemathname(test_fabs_inf)177 FLOAT_T makemathname(test_fabs_inf)(void) { return makemathname(fabs)(makemathname(infval)); }
makemathname(test_fabs_neginf)178 FLOAT_T makemathname(test_fabs_neginf)(void) { return makemathname(fabs)(-makemathname(infval)); }
179 
180 #ifndef SIMPLE_MATH_ONLY
181 
makemathname(test_fdim_qnan_1)182 FLOAT_T makemathname(test_fdim_qnan_1)(void) { return makemathname(fdim)(makemathname(qnanval), makemathname(one)); }
makemathname(test_fdim_1_qnan)183 FLOAT_T makemathname(test_fdim_1_qnan)(void) { return makemathname(fdim)(makemathname(one), makemathname(qnanval)); }
makemathname(test_fdim_snan_1)184 FLOAT_T makemathname(test_fdim_snan_1)(void) { return makemathname(fdim)(makemathname(snanval), makemathname(one)); }
makemathname(test_fdim_1_snan)185 FLOAT_T makemathname(test_fdim_1_snan)(void) { return makemathname(fdim)(makemathname(one), makemathname(snanval)); }
makemathname(test_fdim_inf_1)186 FLOAT_T makemathname(test_fdim_inf_1)(void) { return makemathname(fdim)(makemathname(infval), makemathname(one)); }
makemathname(test_fdim_1_inf)187 FLOAT_T makemathname(test_fdim_1_inf)(void) { return makemathname(fdim)(makemathname(one), makemathname(infval)); }
makemathname(test_fdim_big_negbig)188 FLOAT_T makemathname(test_fdim_big_negbig)(void) { return makemathname(fdim)(makemathname(big), -makemathname(big)); }
189 
190 #endif
191 
makemathname(test_floor_1)192 FLOAT_T makemathname(test_floor_1)(void) { return makemathname(floor)(makemathname(one)); }
makemathname(test_floor_0)193 FLOAT_T makemathname(test_floor_0)(void) { return makemathname(floor)(makemathname(zero)); }
makemathname(test_floor_neg0)194 FLOAT_T makemathname(test_floor_neg0)(void) { return makemathname(floor)(-makemathname(zero)); }
makemathname(test_floor_qnan)195 FLOAT_T makemathname(test_floor_qnan)(void) { return makemathname(floor)(makemathname(qnanval)); }
makemathname(test_floor_snan)196 FLOAT_T makemathname(test_floor_snan)(void) { return makemathname(floor)(makemathname(snanval)); }
makemathname(test_floor_inf)197 FLOAT_T makemathname(test_floor_inf)(void) { return makemathname(floor)(makemathname(infval)); }
makemathname(test_floor_neginf)198 FLOAT_T makemathname(test_floor_neginf)(void) { return makemathname(floor)(-makemathname(infval)); }
199 
200 #ifndef SIMPLE_MATH_ONLY
201 
makemathname(test_fma_big_big_1)202 FLOAT_T makemathname(test_fma_big_big_1)(void) { return makemathname(fma)(makemathname(big), makemathname(big), makemathname(one)); }
makemathname(test_fma_big_negbig_1)203 FLOAT_T makemathname(test_fma_big_negbig_1)(void) { return makemathname(fma)(makemathname(big), -makemathname(big), makemathname(one)); }
makemathname(test_fma_small_small_1)204 FLOAT_T makemathname(test_fma_small_small_1)(void) { return makemathname(fma)(makemathname(small), makemathname(small), makemathname(one)); }
makemathname(test_fma_small_negsmall_1)205 FLOAT_T makemathname(test_fma_small_negsmall_1)(void) { return makemathname(fma)(makemathname(small), -makemathname(small), makemathname(one)); }
makemathname(test_fma_small_small_0)206 FLOAT_T makemathname(test_fma_small_small_0)(void) { return makemathname(fma)(makemathname(small), makemathname(small), makemathname(zero)); }
makemathname(test_fma_small_negsmall_0)207 FLOAT_T makemathname(test_fma_small_negsmall_0)(void) { return makemathname(fma)(makemathname(small), -makemathname(small), makemathname(zero)); }
makemathname(test_fma_qnan_1_1)208 FLOAT_T makemathname(test_fma_qnan_1_1)(void) { return makemathname(fma)(makemathname(qnanval), makemathname(one), makemathname(one)); }
makemathname(test_fma_1_qnan_1)209 FLOAT_T makemathname(test_fma_1_qnan_1)(void) { return makemathname(fma)(makemathname(one), makemathname(qnanval), makemathname(one)); }
makemathname(test_fma_1_1_qnan)210 FLOAT_T makemathname(test_fma_1_1_qnan)(void) { return makemathname(fma)(makemathname(one), makemathname(one), makemathname(qnanval)); }
makemathname(test_fma_snan_1_1)211 FLOAT_T makemathname(test_fma_snan_1_1)(void) { return makemathname(fma)(makemathname(snanval), makemathname(one), makemathname(one)); }
makemathname(test_fma_1_snan_1)212 FLOAT_T makemathname(test_fma_1_snan_1)(void) { return makemathname(fma)(makemathname(one), makemathname(snanval), makemathname(one)); }
makemathname(test_fma_1_1_snan)213 FLOAT_T makemathname(test_fma_1_1_snan)(void) { return makemathname(fma)(makemathname(one), makemathname(one), makemathname(snanval)); }
makemathname(test_fma_inf_1_neginf)214 FLOAT_T makemathname(test_fma_inf_1_neginf)(void) { return makemathname(fma)(makemathname(infval), makemathname(one), -makemathname(infval)); }
makemathname(test_fma_1_inf_neginf)215 FLOAT_T makemathname(test_fma_1_inf_neginf)(void) { return makemathname(fma)(makemathname(one), makemathname(infval), -makemathname(infval)); }
makemathname(test_fma_neginf_1_inf)216 FLOAT_T makemathname(test_fma_neginf_1_inf)(void) { return makemathname(fma)(makemathname(one), -makemathname(infval), makemathname(infval)); }
makemathname(test_fma_1_neginf_inf)217 FLOAT_T makemathname(test_fma_1_neginf_inf)(void) { return makemathname(fma)(-makemathname(infval), makemathname(one), makemathname(infval)); }
makemathname(test_fma_inf_0_1)218 FLOAT_T makemathname(test_fma_inf_0_1)(void) { return makemathname(fma)(makemathname(infval), makemathname(zero), makemathname(one)); }
makemathname(test_fma_0_inf_1)219 FLOAT_T makemathname(test_fma_0_inf_1)(void) { return makemathname(fma)(makemathname(zero), makemathname(infval), makemathname(one)); }
makemathname(test_fma_inf_0_qnan)220 FLOAT_T makemathname(test_fma_inf_0_qnan)(void) { return makemathname(fma)(makemathname(infval), makemathname(zero), makemathname(qnanval)); }
makemathname(test_fma_0_inf_qnan)221 FLOAT_T makemathname(test_fma_0_inf_qnan)(void) { return makemathname(fma)(makemathname(zero), makemathname(infval), makemathname(qnanval)); }
makemathname(test_fma_inf_0_snan)222 FLOAT_T makemathname(test_fma_inf_0_snan)(void) { return makemathname(fma)(makemathname(infval), makemathname(zero), makemathname(snanval)); }
makemathname(test_fma_0_inf_snan)223 FLOAT_T makemathname(test_fma_0_inf_snan)(void) { return makemathname(fma)(makemathname(zero), makemathname(infval), makemathname(snanval)); }
224 
225 #endif
226 
makemathname(test_fmax_qnan_qnan)227 FLOAT_T makemathname(test_fmax_qnan_qnan)(void) { return makemathname(fmax)(makemathname(qnanval), makemathname(qnanval)); }
makemathname(test_fmax_qnan_1)228 FLOAT_T makemathname(test_fmax_qnan_1)(void) { return makemathname(fmax)(makemathname(qnanval), makemathname(one)); }
makemathname(test_fmax_1_qnan)229 FLOAT_T makemathname(test_fmax_1_qnan)(void) { return makemathname(fmax)(makemathname(one), makemathname(qnanval)); }
makemathname(test_fmax_snan_snan)230 FLOAT_T makemathname(test_fmax_snan_snan)(void) { return makemathname(fmax)(makemathname(snanval), makemathname(snanval)); }
makemathname(test_fmax_snan_1)231 FLOAT_T makemathname(test_fmax_snan_1)(void) { return makemathname(fmax)(makemathname(snanval), makemathname(one)); }
makemathname(test_fmax_1_snan)232 FLOAT_T makemathname(test_fmax_1_snan)(void) { return makemathname(fmax)(makemathname(one), makemathname(snanval)); }
233 
makemathname(test_fmin_qnan_qnan)234 FLOAT_T makemathname(test_fmin_qnan_qnan)(void) { return makemathname(fmin)(makemathname(qnanval), makemathname(qnanval)); }
makemathname(test_fmin_qnan_1)235 FLOAT_T makemathname(test_fmin_qnan_1)(void) { return makemathname(fmin)(makemathname(qnanval), makemathname(one)); }
makemathname(test_fmin_1_qnan)236 FLOAT_T makemathname(test_fmin_1_qnan)(void) { return makemathname(fmin)(makemathname(one), makemathname(qnanval)); }
makemathname(test_fmin_snan_snan)237 FLOAT_T makemathname(test_fmin_snan_snan)(void) { return makemathname(fmin)(makemathname(snanval), makemathname(snanval)); }
makemathname(test_fmin_snan_1)238 FLOAT_T makemathname(test_fmin_snan_1)(void) { return makemathname(fmin)(makemathname(snanval), makemathname(one)); }
makemathname(test_fmin_1_snan)239 FLOAT_T makemathname(test_fmin_1_snan)(void) { return makemathname(fmin)(makemathname(one), makemathname(snanval)); }
240 
241 #ifndef SIMPLE_MATH_ONLY
242 
makemathname(test_fmod_qnan_1)243 FLOAT_T makemathname(test_fmod_qnan_1)(void) { return makemathname(fmod)(makemathname(qnanval), makemathname(one)); }
makemathname(test_fmod_1_qnan)244 FLOAT_T makemathname(test_fmod_1_qnan)(void) { return makemathname(fmod)(makemathname(one), makemathname(qnanval)); }
makemathname(test_fmod_snan_1)245 FLOAT_T makemathname(test_fmod_snan_1)(void) { return makemathname(fmod)(makemathname(snanval), makemathname(one)); }
makemathname(test_fmod_1_snan)246 FLOAT_T makemathname(test_fmod_1_snan)(void) { return makemathname(fmod)(makemathname(one), makemathname(snanval)); }
makemathname(test_fmod_inf_1)247 FLOAT_T makemathname(test_fmod_inf_1)(void) { return makemathname(fmod)(makemathname(infval), makemathname(one)); }
makemathname(test_fmod_neginf_1)248 FLOAT_T makemathname(test_fmod_neginf_1)(void) { return makemathname(fmod)(-makemathname(infval), makemathname(one)); }
makemathname(test_fmod_1_0)249 FLOAT_T makemathname(test_fmod_1_0)(void) { return makemathname(fmod)(makemathname(one), makemathname(zero)); }
makemathname(test_fmod_0_1)250 FLOAT_T makemathname(test_fmod_0_1)(void) { return makemathname(fmod)(makemathname(zero), makemathname(one)); }
makemathname(test_fmod_neg0_1)251 FLOAT_T makemathname(test_fmod_neg0_1)(void) { return makemathname(fmod)(-makemathname(zero), makemathname(one)); }
252 
253 #endif
254 
makemathname(test_hypot_big)255 FLOAT_T makemathname(test_hypot_big)(void) { return makemathname(hypot)(makemathname(big), makemathname(big)); }
makemathname(test_hypot_1_qnan)256 FLOAT_T makemathname(test_hypot_1_qnan)(void) { return makemathname(hypot)(makemathname(one), makemathname(qnanval)); }
makemathname(test_hypot_qnan_1)257 FLOAT_T makemathname(test_hypot_qnan_1)(void) { return makemathname(hypot)(makemathname(qnanval), makemathname(one)); }
makemathname(test_hypot_inf_qnan)258 FLOAT_T makemathname(test_hypot_inf_qnan)(void) { return makemathname(hypot)(makemathname(infval), makemathname(qnanval)); }
makemathname(test_hypot_neginf_qnan)259 FLOAT_T makemathname(test_hypot_neginf_qnan)(void) { return makemathname(hypot)(-makemathname(infval), makemathname(qnanval)); }
makemathname(test_hypot_qnan_inf)260 FLOAT_T makemathname(test_hypot_qnan_inf)(void) { return makemathname(hypot)(makemathname(qnanval), makemathname(infval)); }
makemathname(test_hypot_qnan_neginf)261 FLOAT_T makemathname(test_hypot_qnan_neginf)(void) { return makemathname(hypot)(makemathname(qnanval), -makemathname(infval)); }
makemathname(test_hypot_snan_inf)262 FLOAT_T makemathname(test_hypot_snan_inf)(void) { return makemathname(hypot)(makemathname(snanval), makemathname(infval)); }
makemathname(test_hypot_snan_neginf)263 FLOAT_T makemathname(test_hypot_snan_neginf)(void) { return makemathname(hypot)(makemathname(snanval), -makemathname(infval)); }
makemathname(test_hypot_1_inf)264 FLOAT_T makemathname(test_hypot_1_inf)(void) { return makemathname(hypot)(makemathname(one), makemathname(infval)); }
makemathname(test_hypot_1_neginf)265 FLOAT_T makemathname(test_hypot_1_neginf)(void) { return makemathname(hypot)(makemathname(one), -makemathname(infval)); }
makemathname(test_hypot_inf_1)266 FLOAT_T makemathname(test_hypot_inf_1)(void) { return makemathname(hypot)(makemathname(infval), makemathname(one)); }
makemathname(test_hypot_neginf_1)267 FLOAT_T makemathname(test_hypot_neginf_1)(void) { return makemathname(hypot)(-makemathname(infval), makemathname(one)); }
268 
makemathname(test_ilogb_0)269 long makemathname(test_ilogb_0)(void) { return makemathname(ilogb)(makemathname(zero)); }
makemathname(test_ilogb_qnan)270 long makemathname(test_ilogb_qnan)(void) { return makemathname(ilogb)(makemathname(qnanval)); }
makemathname(test_ilogb_snan)271 long makemathname(test_ilogb_snan)(void) { return makemathname(ilogb)(makemathname(snanval)); }
makemathname(test_ilogb_inf)272 long makemathname(test_ilogb_inf)(void) { return makemathname(ilogb)(makemathname(infval)); }
makemathname(test_ilogb_neginf)273 long makemathname(test_ilogb_neginf)(void) { return makemathname(ilogb)(-makemathname(infval)); }
274 
makemathname(test_fpclassify_snan)275 long makemathname(test_fpclassify_snan)(void) { return fpclassify(makemathname(snanval)); }
makemathname(test_fpclassify_nan)276 long makemathname(test_fpclassify_nan)(void) { return fpclassify(makemathname(qnanval)); }
makemathname(test_fpclassify_inf)277 long makemathname(test_fpclassify_inf)(void) { return fpclassify(makemathname(infval)); }
makemathname(test_fpclassify_neginf)278 long makemathname(test_fpclassify_neginf)(void) { return fpclassify(-makemathname(infval)); }
makemathname(test_fpclassify_zero)279 long makemathname(test_fpclassify_zero)(void) { return fpclassify(makemathname(zero)); }
makemathname(test_fpclassify_negzero)280 long makemathname(test_fpclassify_negzero)(void) { return fpclassify(-makemathname(zero)); }
makemathname(test_fpclassify_small)281 long makemathname(test_fpclassify_small)(void) { return fpclassify(makemathname(small)); }
makemathname(test_fpclassify_negsmall)282 long makemathname(test_fpclassify_negsmall)(void) { return fpclassify(-makemathname(small)); }
makemathname(test_fpclassify_two)283 long makemathname(test_fpclassify_two)(void) { return fpclassify(makemathname(two)); }
makemathname(test_fpclassify_negtwo)284 long makemathname(test_fpclassify_negtwo)(void) { return fpclassify(-makemathname(two)); }
285 
makemathname(test_isfinite_snan)286 long makemathname(test_isfinite_snan)(void) { return !!isfinite(makemathname(snanval)); }
makemathname(test_isfinite_nan)287 long makemathname(test_isfinite_nan)(void) { return !!isfinite(makemathname(qnanval)); }
makemathname(test_isfinite_inf)288 long makemathname(test_isfinite_inf)(void) { return !!isfinite(makemathname(infval)); }
makemathname(test_isfinite_neginf)289 long makemathname(test_isfinite_neginf)(void) { return !!isfinite(-makemathname(infval)); }
makemathname(test_isfinite_zero)290 long makemathname(test_isfinite_zero)(void) { return !!isfinite(makemathname(zero)); }
makemathname(test_isfinite_negzero)291 long makemathname(test_isfinite_negzero)(void) { return !!isfinite(-makemathname(zero)); }
makemathname(test_isfinite_small)292 long makemathname(test_isfinite_small)(void) { return !!isfinite(makemathname(small)); }
makemathname(test_isfinite_negsmall)293 long makemathname(test_isfinite_negsmall)(void) { return !!isfinite(-makemathname(small)); }
makemathname(test_isfinite_two)294 long makemathname(test_isfinite_two)(void) { return !!isfinite(makemathname(two)); }
makemathname(test_isfinite_negtwo)295 long makemathname(test_isfinite_negtwo)(void) { return !!isfinite(-makemathname(two)); }
296 
makemathname(test_isnormal_snan)297 long makemathname(test_isnormal_snan)(void) { return !!isnormal(makemathname(snanval)); }
makemathname(test_isnormal_nan)298 long makemathname(test_isnormal_nan)(void) { return !!isnormal(makemathname(qnanval)); }
makemathname(test_isnormal_inf)299 long makemathname(test_isnormal_inf)(void) { return !!isnormal(makemathname(infval)); }
makemathname(test_isnormal_neginf)300 long makemathname(test_isnormal_neginf)(void) { return !!isnormal(-makemathname(infval)); }
makemathname(test_isnormal_zero)301 long makemathname(test_isnormal_zero)(void) { return !!isnormal(makemathname(zero)); }
makemathname(test_isnormal_negzero)302 long makemathname(test_isnormal_negzero)(void) { return !!isnormal(-makemathname(zero)); }
makemathname(test_isnormal_small)303 long makemathname(test_isnormal_small)(void) { return !!isnormal(makemathname(small)); }
makemathname(test_isnormal_negsmall)304 long makemathname(test_isnormal_negsmall)(void) { return !!isnormal(-makemathname(small)); }
makemathname(test_isnormal_two)305 long makemathname(test_isnormal_two)(void) { return !!isnormal(makemathname(two)); }
makemathname(test_isnormal_negtwo)306 long makemathname(test_isnormal_negtwo)(void) { return !!isnormal(-makemathname(two)); }
307 
makemathname(test_isnan_snan)308 long makemathname(test_isnan_snan)(void) { return !!isnan(makemathname(snanval)); }
makemathname(test_isnan_nan)309 long makemathname(test_isnan_nan)(void) { return !!isnan(makemathname(qnanval)); }
makemathname(test_isnan_inf)310 long makemathname(test_isnan_inf)(void) { return !!isnan(makemathname(infval)); }
makemathname(test_isnan_neginf)311 long makemathname(test_isnan_neginf)(void) { return !!isnan(-makemathname(infval)); }
makemathname(test_isnan_zero)312 long makemathname(test_isnan_zero)(void) { return !!isnan(makemathname(zero)); }
makemathname(test_isnan_negzero)313 long makemathname(test_isnan_negzero)(void) { return !!isnan(-makemathname(zero)); }
makemathname(test_isnan_small)314 long makemathname(test_isnan_small)(void) { return !!isnan(makemathname(small)); }
makemathname(test_isnan_negsmall)315 long makemathname(test_isnan_negsmall)(void) { return !!isnan(-makemathname(small)); }
makemathname(test_isnan_two)316 long makemathname(test_isnan_two)(void) { return !!isnan(makemathname(two)); }
makemathname(test_isnan_negtwo)317 long makemathname(test_isnan_negtwo)(void) { return !!isnan(-makemathname(two)); }
318 
makemathname(test_isinf_snan)319 long makemathname(test_isinf_snan)(void) { return !!isinf(makemathname(snanval)); }
makemathname(test_isinf_nan)320 long makemathname(test_isinf_nan)(void) { return !!isinf(makemathname(qnanval)); }
makemathname(test_isinf_inf)321 long makemathname(test_isinf_inf)(void) { return !!isinf(makemathname(infval)); }
makemathname(test_isinf_neginf)322 long makemathname(test_isinf_neginf)(void) { return !!isinf(-makemathname(infval)); }
makemathname(test_isinf_zero)323 long makemathname(test_isinf_zero)(void) { return !!isinf(makemathname(zero)); }
makemathname(test_isinf_negzero)324 long makemathname(test_isinf_negzero)(void) { return !!isinf(-makemathname(zero)); }
makemathname(test_isinf_small)325 long makemathname(test_isinf_small)(void) { return !!isinf(makemathname(small)); }
makemathname(test_isinf_negsmall)326 long makemathname(test_isinf_negsmall)(void) { return !!isinf(-makemathname(small)); }
makemathname(test_isinf_two)327 long makemathname(test_isinf_two)(void) { return !!isinf(makemathname(two)); }
makemathname(test_isinf_negtwo)328 long makemathname(test_isinf_negtwo)(void) { return !!isinf(-makemathname(two)); }
329 
330 #ifndef SIMPLE_MATH_ONLY
331 
332 #ifndef NO_BESSEL_TESTS
333 
makemathname(test_j0_inf)334 FLOAT_T makemathname(test_j0_inf)(void) { return makemathname(j0)(makemathname(infval)); }
makemathname(test_j0_qnan)335 FLOAT_T makemathname(test_j0_qnan)(void) { return makemathname(j0)(makemathname(qnanval)); }
makemathname(test_j0_snan)336 FLOAT_T makemathname(test_j0_snan)(void) { return makemathname(j0)(makemathname(snanval)); }
337 
makemathname(test_j1_inf)338 FLOAT_T makemathname(test_j1_inf)(void) { return makemathname(j1)(makemathname(infval)); }
makemathname(test_j1_qnan)339 FLOAT_T makemathname(test_j1_qnan)(void) { return makemathname(j1)(makemathname(qnanval)); }
makemathname(test_j1_snan)340 FLOAT_T makemathname(test_j1_snan)(void) { return makemathname(j1)(makemathname(snanval)); }
341 
makemathname(test_jn_inf)342 FLOAT_T makemathname(test_jn_inf)(void) { return makemathname(jn)(3, makemathname(infval)); }
makemathname(test_jn_qnan)343 FLOAT_T makemathname(test_jn_qnan)(void) { return makemathname(jn)(3, makemathname(qnanval)); }
makemathname(test_jn_snan)344 FLOAT_T makemathname(test_jn_snan)(void) { return makemathname(jn)(3, makemathname(snanval)); }
345 #endif
346 
347 #endif
348 
makemathname(test_ldexp_1_0)349 FLOAT_T makemathname(test_ldexp_1_0)(void) { return makemathname(ldexp)(makemathname(one), 0); }
makemathname(test_ldexp_qnan_0)350 FLOAT_T makemathname(test_ldexp_qnan_0)(void) { return makemathname(ldexp)(makemathname(qnanval), 0); }
makemathname(test_ldexp_snan_0)351 FLOAT_T makemathname(test_ldexp_snan_0)(void) { return makemathname(ldexp)(makemathname(snanval), 0); }
makemathname(test_ldexp_inf_0)352 FLOAT_T makemathname(test_ldexp_inf_0)(void) { return makemathname(ldexp)(makemathname(infval), 0); }
makemathname(test_ldexp_neginf_0)353 FLOAT_T makemathname(test_ldexp_neginf_0)(void) { return makemathname(ldexp)(-makemathname(infval), 0); }
makemathname(test_ldexp_1_negbig)354 FLOAT_T makemathname(test_ldexp_1_negbig)(void) { return makemathname(ldexp)(makemathname(one), -(__DBL_MAX_EXP__ * 100)); }
makemathname(test_ldexp_1_big)355 FLOAT_T makemathname(test_ldexp_1_big)(void) { return makemathname(ldexp)(makemathname(one),(__DBL_MAX_EXP__ * 100)); }
356 
makemathname(test_rint_qnan)357 FLOAT_T makemathname(test_rint_qnan)(void) { return makemathname(rint)(makemathname(qnanval)); }
makemathname(test_rint_snan)358 FLOAT_T makemathname(test_rint_snan)(void) { return makemathname(rint)(makemathname(snanval)); }
makemathname(test_rint_inf)359 FLOAT_T makemathname(test_rint_inf)(void) { return makemathname(rint)(makemathname(infval)); }
makemathname(test_rint_neginf)360 FLOAT_T makemathname(test_rint_neginf)(void) { return makemathname(rint)(-makemathname(infval)); }
makemathname(test_rint_big)361 FLOAT_T makemathname(test_rint_big)(void) { return makemathname(rint)(makemathname(big)); }
makemathname(test_rint_negbig)362 FLOAT_T makemathname(test_rint_negbig)(void) { return makemathname(rint)(-makemathname(big)); }
makemathname(test_rint_half)363 FLOAT_T makemathname(test_rint_half)(void) { return makemathname(rint)(makemathname(half)); }
makemathname(test_rint_neghalf)364 FLOAT_T makemathname(test_rint_neghalf)(void) { return makemathname(rint)(makemathname(half)); }
365 
makemathname(test_nearbyint_qnan)366 FLOAT_T makemathname(test_nearbyint_qnan)(void) { return makemathname(nearbyint)(makemathname(qnanval)); }
makemathname(test_nearbyint_snan)367 FLOAT_T makemathname(test_nearbyint_snan)(void) { return makemathname(nearbyint)(makemathname(snanval)); }
makemathname(test_nearbyint_inf)368 FLOAT_T makemathname(test_nearbyint_inf)(void) { return makemathname(nearbyint)(makemathname(infval)); }
makemathname(test_nearbyint_neginf)369 FLOAT_T makemathname(test_nearbyint_neginf)(void) { return makemathname(nearbyint)(-makemathname(infval)); }
makemathname(test_nearbyint_big)370 FLOAT_T makemathname(test_nearbyint_big)(void) { return makemathname(nearbyint)(makemathname(big)); }
makemathname(test_nearbyint_negbig)371 FLOAT_T makemathname(test_nearbyint_negbig)(void) { return makemathname(nearbyint)(-makemathname(big)); }
makemathname(test_nearbyint_half)372 FLOAT_T makemathname(test_nearbyint_half)(void) { return makemathname(nearbyint)(makemathname(half)); }
makemathname(test_nearbyint_neghalf)373 FLOAT_T makemathname(test_nearbyint_neghalf)(void) { return makemathname(nearbyint)(makemathname(half)); }
374 
makemathname(test_lrint_qnan)375 long makemathname(test_lrint_qnan)(void) { makemathname(lrint)(makemathname(qnanval)); return 0; }
makemathname(test_lrint_snan)376 long makemathname(test_lrint_snan)(void) { makemathname(lrint)(makemathname(snanval)); return 0; }
makemathname(test_lrint_inf)377 long makemathname(test_lrint_inf)(void) { makemathname(lrint)(makemathname(infval)); return 0; }
makemathname(test_lrint_neginf)378 long makemathname(test_lrint_neginf)(void) { makemathname(lrint)(-makemathname(infval)); return 0; }
makemathname(test_lrint_big)379 long makemathname(test_lrint_big)(void) { makemathname(lrint)(makemathname(big)); return 0; }
makemathname(test_lrint_negbig)380 long makemathname(test_lrint_negbig)(void) { makemathname(lrint)(-makemathname(big)); return 0; }
381 
makemathname(test_lround_qnan)382 long makemathname(test_lround_qnan)(void) { makemathname(lround)(makemathname(qnanval)); return 0; }
makemathname(test_lround_snan)383 long makemathname(test_lround_snan)(void) { makemathname(lround)(makemathname(snanval)); return 0; }
makemathname(test_lround_inf)384 long makemathname(test_lround_inf)(void) { makemathname(lround)(makemathname(infval)); return 0; }
makemathname(test_lround_neginf)385 long makemathname(test_lround_neginf)(void) { makemathname(lround)(-makemathname(infval)); return 0; }
makemathname(test_lround_big)386 long makemathname(test_lround_big)(void) { makemathname(lround)(makemathname(big)); return 0; }
makemathname(test_lround_negbig)387 long makemathname(test_lround_negbig)(void) { makemathname(lround)(-makemathname(big)); return 0; }
388 
389 #ifndef SIMPLE_MATH_ONLY
390 
makemathname(test_nextafter_0_neg0)391 FLOAT_T makemathname(test_nextafter_0_neg0)(void) { return makemathname(nextafter)(makemathname(zero), -makemathname(zero)); }
makemathname(test_nextafter_neg0_0)392 FLOAT_T makemathname(test_nextafter_neg0_0)(void) { return makemathname(nextafter)(-makemathname(zero), makemathname(zero)); }
makemathname(test_nextafter_0_1)393 FLOAT_T makemathname(test_nextafter_0_1)(void) { return makemathname(nextafter)(makemathname(zero), makemathname(one)); }
makemathname(test_nextafter_0_neg1)394 FLOAT_T makemathname(test_nextafter_0_neg1)(void) { return makemathname(nextafter)(makemathname(zero), -makemathname(one)); }
makemathname(test_nextafter_min_1)395 FLOAT_T makemathname(test_nextafter_min_1)(void) { return makemathname(nextafter)(makemathname(min_val), makemathname(one)); }
makemathname(test_nextafter_negmin_neg1)396 FLOAT_T makemathname(test_nextafter_negmin_neg1)(void) { return makemathname(nextafter)(-makemathname(min_val), -makemathname(one)); }
makemathname(test_nextafter_qnan_1)397 FLOAT_T makemathname(test_nextafter_qnan_1)(void) { return makemathname(nextafter)(makemathname(qnanval), makemathname(one)); }
makemathname(test_nextafter_snan_1)398 FLOAT_T makemathname(test_nextafter_snan_1)(void) { return makemathname(nextafter)(makemathname(snanval), makemathname(one)); }
makemathname(test_nextafter_1_qnan)399 FLOAT_T makemathname(test_nextafter_1_qnan)(void) { return makemathname(nextafter)(makemathname(one), makemathname(qnanval)); }
makemathname(test_nextafter_1_snan)400 FLOAT_T makemathname(test_nextafter_1_snan)(void) { return makemathname(nextafter)(makemathname(one), makemathname(snanval)); }
makemathname(test_nextafter_max_inf)401 FLOAT_T makemathname(test_nextafter_max_inf)(void) { return makemathname(nextafter)(makemathname(max_val), makemathname(infval)); }
makemathname(test_nextafter_negmax_neginf)402 FLOAT_T makemathname(test_nextafter_negmax_neginf)(void) { return makemathname(nextafter)(-makemathname(max_val), -makemathname(infval)); }
makemathname(test_nextafter_min_0)403 FLOAT_T makemathname(test_nextafter_min_0)(void) { return makemathname(nextafter)(makemathname(min_val), makemathname(zero)); }
makemathname(test_nextafter_negmin_0)404 FLOAT_T makemathname(test_nextafter_negmin_0)(void) { return makemathname(nextafter)(-makemathname(min_val), makemathname(zero)); }
makemathname(test_nextafter_1_2)405 FLOAT_T makemathname(test_nextafter_1_2)(void) {return makemathname(nextafter)(makemathname(one), makemathname(two)); }
makemathname(test_nextafter_neg1_neg2)406 FLOAT_T makemathname(test_nextafter_neg1_neg2)(void) {return makemathname(nextafter)(-makemathname(one), -makemathname(two)); }
407 
408 #if defined(__SIZEOF_LONG_DOUBLE__) && !defined(NO_NEXTTOWARD)
409 
makemathname(test_nexttoward_0_neg0)410 FLOAT_T makemathname(test_nexttoward_0_neg0)(void) { return makemathname(nexttoward)(makemathname(zero), -makelname(zero)); }
makemathname(test_nexttoward_neg0_0)411 FLOAT_T makemathname(test_nexttoward_neg0_0)(void) { return makemathname(nexttoward)(-makemathname(zero), makelname(zero)); }
makemathname(test_nexttoward_0_1)412 FLOAT_T makemathname(test_nexttoward_0_1)(void) { return makemathname(nexttoward)(makemathname(zero), makelname(one)); }
makemathname(test_nexttoward_0_neg1)413 FLOAT_T makemathname(test_nexttoward_0_neg1)(void) { return makemathname(nexttoward)(makemathname(zero), -makelname(one)); }
makemathname(test_nexttoward_min_1)414 FLOAT_T makemathname(test_nexttoward_min_1)(void) { return makemathname(nexttoward)(makemathname(min_val), makelname(one)); }
makemathname(test_nexttoward_negmin_neg1)415 FLOAT_T makemathname(test_nexttoward_negmin_neg1)(void) { return makemathname(nexttoward)(-makemathname(min_val), -makelname(one)); }
makemathname(test_nexttoward_qnan_1)416 FLOAT_T makemathname(test_nexttoward_qnan_1)(void) { return makemathname(nexttoward)(makemathname(qnanval), makelname(one)); }
makemathname(test_nexttoward_snan_1)417 FLOAT_T makemathname(test_nexttoward_snan_1)(void) { return makemathname(nexttoward)(makemathname(snanval), makelname(one)); }
makemathname(test_nexttoward_1_qnan)418 FLOAT_T makemathname(test_nexttoward_1_qnan)(void) { return makemathname(nexttoward)(makemathname(one), makelname(qnanval)); }
makemathname(test_nexttoward_1_snan)419 FLOAT_T makemathname(test_nexttoward_1_snan)(void) { return makemathname(nexttoward)(makemathname(one), makelname(snanval)); }
makemathname(test_nexttoward_max_inf)420 FLOAT_T makemathname(test_nexttoward_max_inf)(void) { return makemathname(nexttoward)(makemathname(max_val), makelname(infval)); }
makemathname(test_nexttoward_negmax_neginf)421 FLOAT_T makemathname(test_nexttoward_negmax_neginf)(void) { return makemathname(nexttoward)(-makemathname(max_val), -makelname(infval)); }
makemathname(test_nexttoward_min_0)422 FLOAT_T makemathname(test_nexttoward_min_0)(void) { return makemathname(nexttoward)(makemathname(min_val), makelname(zero)); }
makemathname(test_nexttoward_negmin_0)423 FLOAT_T makemathname(test_nexttoward_negmin_0)(void) { return makemathname(nexttoward)(-makemathname(min_val), makelname(zero)); }
makemathname(test_nexttoward_1_2)424 FLOAT_T makemathname(test_nexttoward_1_2)(void) {return makemathname(nexttoward)(makemathname(one), makelname(two)); }
makemathname(test_nexttoward_neg1_neg2)425 FLOAT_T makemathname(test_nexttoward_neg1_neg2)(void) {return makemathname(nexttoward)(-makemathname(one), -makelname(two)); }
426 
427 #endif
428 
makemathname(test_sin_inf)429 FLOAT_T makemathname(test_sin_inf)(void) { return makemathname(sin)(makemathname(infval)); }
makemathname(test_sin_qnan)430 FLOAT_T makemathname(test_sin_qnan)(void) { return makemathname(sin)(makemathname(qnanval)); }
makemathname(test_sin_snan)431 FLOAT_T makemathname(test_sin_snan)(void) { return makemathname(sin)(makemathname(snanval)); }
makemathname(test_sin_pio2)432 FLOAT_T makemathname(test_sin_pio2)(void) { return makemathname(sin)(makemathname(pio2)); }
makemathname(test_sin_small)433 FLOAT_T makemathname(test_sin_small)(void) { return makemathname(sin)(makemathname(small)); }
makemathname(test_sin_0)434 FLOAT_T makemathname(test_sin_0)(void) { return makemathname(sin)(makemathname(zero)); }
435 
436 /* This is mostly here to make sure sincos doesn't infinite loop due to compiler optimization */
makemathname(test_sincos)437 FLOAT_T makemathname(test_sincos)(void) {
438         FLOAT_T s, c;
439         makemathname(sincos)(makemathname(one), &s, &c);
440         FLOAT_T h = makemathname(sqrt)(s*s+c*c);
441         return (FLOAT_T)0.9999 <= h && h <= (FLOAT_T)1.0001;
442 }
makemathname(test_sincos_inf)443 FLOAT_T makemathname(test_sincos_inf)(void) { FLOAT_T s, c; makemathname(sincos)(makemathname(infval), &s, &c); return s + c; }
makemathname(test_sincos_qnan)444 FLOAT_T makemathname(test_sincos_qnan)(void) { FLOAT_T s, c; makemathname(sincos)(makemathname(qnanval), &s, &c); return s + c; }
makemathname(test_sincos_snan)445 FLOAT_T makemathname(test_sincos_snan)(void) { FLOAT_T s, c; makemathname(sincos)(makemathname(snanval), &s, &c); return s + c; }
446 
makemathname(test_sinh_qnan)447 FLOAT_T makemathname(test_sinh_qnan)(void) { return makemathname(sinh)(makemathname(qnanval)); }
makemathname(test_sinh_snan)448 FLOAT_T makemathname(test_sinh_snan)(void) { return makemathname(sinh)(makemathname(snanval)); }
makemathname(test_sinh_0)449 FLOAT_T makemathname(test_sinh_0)(void) { return makemathname(sinh)(makemathname(zero)); }
makemathname(test_sinh_neg0)450 FLOAT_T makemathname(test_sinh_neg0)(void) { return makemathname(sinh)(-makemathname(zero)); }
makemathname(test_sinh_inf)451 FLOAT_T makemathname(test_sinh_inf)(void) { return makemathname(sinh)(makemathname(infval)); }
makemathname(test_sinh_neginf)452 FLOAT_T makemathname(test_sinh_neginf)(void) { return makemathname(sinh)(-makemathname(infval)); }
453 
makemathname(test_tgamma_qnan)454 FLOAT_T makemathname(test_tgamma_qnan)(void) { return makemathname(tgamma)(makemathname(qnanval)); }
makemathname(test_tgamma_snan)455 FLOAT_T makemathname(test_tgamma_snan)(void) { return makemathname(tgamma)(makemathname(snanval)); }
makemathname(test_tgamma_0)456 FLOAT_T makemathname(test_tgamma_0)(void) { return makemathname(tgamma)(makemathname(zero)); }
makemathname(test_tgamma_neg0)457 FLOAT_T makemathname(test_tgamma_neg0)(void) { return makemathname(tgamma)(makemathname(negzero)); }
makemathname(test_tgamma_neg1)458 FLOAT_T makemathname(test_tgamma_neg1)(void) { return makemathname(tgamma)(-makemathname(one)); }
makemathname(test_tgamma_big)459 FLOAT_T makemathname(test_tgamma_big)(void) { return makemathname(tgamma)(makemathname(big)); }
makemathname(test_tgamma_negbig)460 FLOAT_T makemathname(test_tgamma_negbig)(void) { return makemathname(tgamma)(makemathname(-big)); }
makemathname(test_tgamma_inf)461 FLOAT_T makemathname(test_tgamma_inf)(void) { return makemathname(tgamma)(makemathname(infval)); }
makemathname(test_tgamma_neginf)462 FLOAT_T makemathname(test_tgamma_neginf)(void) { return makemathname(tgamma)(-makemathname(infval)); }
makemathname(test_tgamma_small)463 FLOAT_T makemathname(test_tgamma_small)(void) { return makemathname(tgamma)(makemathname(small)); }
makemathname(test_tgamma_negsmall)464 FLOAT_T makemathname(test_tgamma_negsmall)(void) { return makemathname(tgamma)(-makemathname(small)); }
465 
makemathname(test_lgamma_qnan)466 FLOAT_T makemathname(test_lgamma_qnan)(void) { return makemathname(lgamma)(makemathname(qnanval)); }
makemathname(test_lgamma_snan)467 FLOAT_T makemathname(test_lgamma_snan)(void) { return makemathname(lgamma)(makemathname(snanval)); }
makemathname(test_lgamma_1)468 FLOAT_T makemathname(test_lgamma_1)(void) { return makemathname(lgamma)(makemathname(one)); }
makemathname(test_lgamma_2)469 FLOAT_T makemathname(test_lgamma_2)(void) { return makemathname(lgamma)(makemathname(two)); }
makemathname(test_lgamma_inf)470 FLOAT_T makemathname(test_lgamma_inf)(void) { return makemathname(lgamma)(makemathname(infval)); }
makemathname(test_lgamma_neginf)471 FLOAT_T makemathname(test_lgamma_neginf)(void) { return makemathname(lgamma)(-makemathname(infval)); }
makemathname(test_lgamma_0)472 FLOAT_T makemathname(test_lgamma_0)(void) { return makemathname(lgamma)(makemathname(zero)); }
makemathname(test_lgamma_neg0)473 FLOAT_T makemathname(test_lgamma_neg0)(void) { return makemathname(lgamma)(makemathname(negzero)); }
makemathname(test_lgamma_neg1)474 FLOAT_T makemathname(test_lgamma_neg1)(void) { return makemathname(lgamma)(-makemathname(one)); }
makemathname(test_lgamma_neg2)475 FLOAT_T makemathname(test_lgamma_neg2)(void) { return makemathname(lgamma)(-makemathname(two)); }
makemathname(test_lgamma_big)476 FLOAT_T makemathname(test_lgamma_big)(void) { return makemathname(lgamma)(makemathname(big)); }
makemathname(test_lgamma_negbig)477 FLOAT_T makemathname(test_lgamma_negbig)(void) { return makemathname(lgamma)(makemathname(-big)); }
478 
makemathname(test_lgamma_r_qnan)479 FLOAT_T makemathname(test_lgamma_r_qnan)(void) { return makemathname_r(lgamma)(makemathname(qnanval), &_signgam); }
makemathname(test_lgamma_r_snan)480 FLOAT_T makemathname(test_lgamma_r_snan)(void) { return makemathname_r(lgamma)(makemathname(snanval), &_signgam); }
makemathname(test_lgamma_r_1)481 FLOAT_T makemathname(test_lgamma_r_1)(void) { return makemathname_r(lgamma)(makemathname(one), &_signgam); }
makemathname(test_lgamma_r_2)482 FLOAT_T makemathname(test_lgamma_r_2)(void) { return makemathname_r(lgamma)(makemathname(two), &_signgam); }
makemathname(test_lgamma_r_inf)483 FLOAT_T makemathname(test_lgamma_r_inf)(void) { return makemathname_r(lgamma)(makemathname(infval), &_signgam); }
makemathname(test_lgamma_r_neginf)484 FLOAT_T makemathname(test_lgamma_r_neginf)(void) { return makemathname_r(lgamma)(-makemathname(infval), &_signgam); }
makemathname(test_lgamma_r_0)485 FLOAT_T makemathname(test_lgamma_r_0)(void) { return makemathname_r(lgamma)(makemathname(zero), &_signgam); }
makemathname(test_lgamma_r_neg0)486 FLOAT_T makemathname(test_lgamma_r_neg0)(void) { return makemathname_r(lgamma)(makemathname(negzero), &_signgam); }
makemathname(test_lgamma_r_neg1)487 FLOAT_T makemathname(test_lgamma_r_neg1)(void) { return makemathname_r(lgamma)(-makemathname(one), &_signgam); }
makemathname(test_lgamma_r_neg2)488 FLOAT_T makemathname(test_lgamma_r_neg2)(void) { return makemathname_r(lgamma)(-makemathname(two), &_signgam); }
makemathname(test_lgamma_r_big)489 FLOAT_T makemathname(test_lgamma_r_big)(void) { return makemathname_r(lgamma)(makemathname(big), &_signgam); }
makemathname(test_lgamma_r_negbig)490 FLOAT_T makemathname(test_lgamma_r_negbig)(void) { return makemathname_r(lgamma)(makemathname(-big), &_signgam); }
491 
makemathname(test_gamma_qnan)492 FLOAT_T makemathname(test_gamma_qnan)(void) { return makemathname(gamma)(makemathname(qnanval)); }
makemathname(test_gamma_snan)493 FLOAT_T makemathname(test_gamma_snan)(void) { return makemathname(gamma)(makemathname(snanval)); }
makemathname(test_gamma_1)494 FLOAT_T makemathname(test_gamma_1)(void) { return makemathname(gamma)(makemathname(one)); }
makemathname(test_gamma_2)495 FLOAT_T makemathname(test_gamma_2)(void) { return makemathname(gamma)(makemathname(two)); }
makemathname(test_gamma_inf)496 FLOAT_T makemathname(test_gamma_inf)(void) { return makemathname(gamma)(makemathname(infval)); }
makemathname(test_gamma_neginf)497 FLOAT_T makemathname(test_gamma_neginf)(void) { return makemathname(gamma)(-makemathname(infval)); }
makemathname(test_gamma_0)498 FLOAT_T makemathname(test_gamma_0)(void) { return makemathname(gamma)(makemathname(zero)); }
makemathname(test_gamma_neg0)499 FLOAT_T makemathname(test_gamma_neg0)(void) { return makemathname(gamma)(makemathname(negzero)); }
makemathname(test_gamma_neg1)500 FLOAT_T makemathname(test_gamma_neg1)(void) { return makemathname(gamma)(-makemathname(one)); }
makemathname(test_gamma_neg2)501 FLOAT_T makemathname(test_gamma_neg2)(void) { return makemathname(gamma)(-makemathname(two)); }
makemathname(test_gamma_big)502 FLOAT_T makemathname(test_gamma_big)(void) { return makemathname(gamma)(makemathname(big)); }
makemathname(test_gamma_negbig)503 FLOAT_T makemathname(test_gamma_negbig)(void) { return makemathname(gamma)(makemathname(-big)); }
504 
makemathname(test_log_qnan)505 FLOAT_T makemathname(test_log_qnan)(void) { return makemathname(log)(makemathname(qnanval)); }
makemathname(test_log_snan)506 FLOAT_T makemathname(test_log_snan)(void) { return makemathname(log)(makemathname(snanval)); }
makemathname(test_log_1)507 FLOAT_T makemathname(test_log_1)(void) { return makemathname(log)(makemathname(one)); }
makemathname(test_log_inf)508 FLOAT_T makemathname(test_log_inf)(void) { return makemathname(log)(makemathname(infval)); }
makemathname(test_log_0)509 FLOAT_T makemathname(test_log_0)(void) { return makemathname(log)(makemathname(zero)); }
makemathname(test_log_neg)510 FLOAT_T makemathname(test_log_neg)(void) { return makemathname(log)(-makemathname(one)); }
makemathname(test_log_neginf)511 FLOAT_T makemathname(test_log_neginf)(void) { return makemathname(log)(-makemathname(one)); }
512 
makemathname(test_log10_qnan)513 FLOAT_T makemathname(test_log10_qnan)(void) { return makemathname(log10)(makemathname(qnanval)); }
makemathname(test_log10_snan)514 FLOAT_T makemathname(test_log10_snan)(void) { return makemathname(log10)(makemathname(snanval)); }
makemathname(test_log10_1)515 FLOAT_T makemathname(test_log10_1)(void) { return makemathname(log10)(makemathname(one)); }
makemathname(test_log10_inf)516 FLOAT_T makemathname(test_log10_inf)(void) { return makemathname(log10)(makemathname(infval)); }
makemathname(test_log10_0)517 FLOAT_T makemathname(test_log10_0)(void) { return makemathname(log10)(makemathname(zero)); }
makemathname(test_log10_neg)518 FLOAT_T makemathname(test_log10_neg)(void) { return makemathname(log10)(-makemathname(one)); }
makemathname(test_log10_neginf)519 FLOAT_T makemathname(test_log10_neginf)(void) { return makemathname(log10)(-makemathname(one)); }
520 
makemathname(test_log1p_qnan)521 FLOAT_T makemathname(test_log1p_qnan)(void) { return makemathname(log1p)(makemathname(qnanval)); }
makemathname(test_log1p_snan)522 FLOAT_T makemathname(test_log1p_snan)(void) { return makemathname(log1p)(makemathname(snanval)); }
makemathname(test_log1p_inf)523 FLOAT_T makemathname(test_log1p_inf)(void) { return makemathname(log1p)(makemathname(infval)); }
makemathname(test_log1p_neginf)524 FLOAT_T makemathname(test_log1p_neginf)(void) { return makemathname(log1p)(-makemathname(infval)); }
makemathname(test_log1p_neg1)525 FLOAT_T makemathname(test_log1p_neg1)(void) { return makemathname(log1p)(-makemathname(one)); }
makemathname(test_log1p_neg2)526 FLOAT_T makemathname(test_log1p_neg2)(void) { return makemathname(log1p)(-makemathname(two)); }
527 
makemathname(test_log2_qnan)528 FLOAT_T makemathname(test_log2_qnan)(void) { return makemathname(log2)(makemathname(qnanval)); }
makemathname(test_log2_snan)529 FLOAT_T makemathname(test_log2_snan)(void) { return makemathname(log2)(makemathname(snanval)); }
makemathname(test_log2_1)530 FLOAT_T makemathname(test_log2_1)(void) { return makemathname(log2)(makemathname(one)); }
makemathname(test_log2_inf)531 FLOAT_T makemathname(test_log2_inf)(void) { return makemathname(log2)(makemathname(infval)); }
makemathname(test_log2_0)532 FLOAT_T makemathname(test_log2_0)(void) { return makemathname(log2)(makemathname(zero)); }
makemathname(test_log2_neg)533 FLOAT_T makemathname(test_log2_neg)(void) { return makemathname(log2)(-makemathname(one)); }
makemathname(test_log2_neginf)534 FLOAT_T makemathname(test_log2_neginf)(void) { return makemathname(log2)(-makemathname(one)); }
535 
536 #endif
537 
makemathname(test_logb_qnan)538 FLOAT_T makemathname(test_logb_qnan)(void) { return makemathname(logb)(makemathname(qnanval)); }
makemathname(test_logb_snan)539 FLOAT_T makemathname(test_logb_snan)(void) { return makemathname(logb)(makemathname(snanval)); }
makemathname(test_logb_0)540 FLOAT_T makemathname(test_logb_0)(void) { return makemathname(logb)(makemathname(zero)); }
makemathname(test_logb_neg0)541 FLOAT_T makemathname(test_logb_neg0)(void) { return makemathname(logb)(-makemathname(zero)); }
makemathname(test_logb_inf)542 FLOAT_T makemathname(test_logb_inf)(void) { return makemathname(logb)(makemathname(infval)); }
makemathname(test_logb_neginf)543 FLOAT_T makemathname(test_logb_neginf)(void) { return makemathname(logb)(-makemathname(infval)); }
544 
545 #ifndef SIMPLE_MATH_ONLY
546 
makemathname(test_pow_neg_half)547 FLOAT_T makemathname(test_pow_neg_half)(void) { return makemathname(pow)(-makemathname(two), makemathname(half)); }
makemathname(test_pow_big)548 FLOAT_T makemathname(test_pow_big)(void) { return makemathname(pow)(makemathname(two), makemathname(big)); }
makemathname(test_pow_negbig)549 FLOAT_T makemathname(test_pow_negbig)(void) { return makemathname(pow)(-makemathname(big), makemathname(three)); }
makemathname(test_pow_tiny)550 FLOAT_T makemathname(test_pow_tiny)(void) { return makemathname(pow)(makemathname(two), -makemathname(big)); }
makemathname(test_pow_1_1)551 FLOAT_T makemathname(test_pow_1_1)(void) { return makemathname(pow)(makemathname(one), makemathname(one)); }
makemathname(test_pow_1_2)552 FLOAT_T makemathname(test_pow_1_2)(void) { return makemathname(pow)(makemathname(one), makemathname(two)); }
makemathname(test_pow_1_neg2)553 FLOAT_T makemathname(test_pow_1_neg2)(void) { return makemathname(pow)(makemathname(one), makemathname(two)); }
makemathname(test_pow_1_inf)554 FLOAT_T makemathname(test_pow_1_inf)(void) { return makemathname(pow)(makemathname(one), makemathname(infval)); }
makemathname(test_pow_1_neginf)555 FLOAT_T makemathname(test_pow_1_neginf)(void) { return makemathname(pow)(makemathname(one), -makemathname(infval)); }
makemathname(test_pow_1_qnan)556 FLOAT_T makemathname(test_pow_1_qnan)(void) { return makemathname(pow)(makemathname(one), makemathname(qnanval)); }
makemathname(test_pow_qnan_0)557 FLOAT_T makemathname(test_pow_qnan_0)(void) { return makemathname(pow)(makemathname(qnanval), makemathname(zero)); }
makemathname(test_pow_qnan_neg0)558 FLOAT_T makemathname(test_pow_qnan_neg0)(void) { return makemathname(pow)(makemathname(qnanval), -makemathname(zero)); }
makemathname(test_pow_1_snan)559 FLOAT_T makemathname(test_pow_1_snan)(void) { return makemathname(pow)(makemathname(one), makemathname(snanval)); }
makemathname(test_pow_snan_0)560 FLOAT_T makemathname(test_pow_snan_0)(void) { return makemathname(pow)(makemathname(snanval), makemathname(zero)); }
makemathname(test_pow_snan_neg0)561 FLOAT_T makemathname(test_pow_snan_neg0)(void) { return makemathname(pow)(makemathname(snanval), -makemathname(zero)); }
makemathname(test_pow_1_0)562 FLOAT_T makemathname(test_pow_1_0)(void) { return makemathname(pow)(makemathname(one), makemathname(zero)); }
makemathname(test_pow_1_neg0)563 FLOAT_T makemathname(test_pow_1_neg0)(void) { return makemathname(pow)(makemathname(one), -makemathname(zero)); }
makemathname(test_pow_0_0)564 FLOAT_T makemathname(test_pow_0_0)(void) { return makemathname(pow)(makemathname(zero), makemathname(zero)); }
makemathname(test_pow_0_neg0)565 FLOAT_T makemathname(test_pow_0_neg0)(void) { return makemathname(pow)(makemathname(zero), -makemathname(zero)); }
makemathname(test_pow_inf_0)566 FLOAT_T makemathname(test_pow_inf_0)(void) { return makemathname(pow)(makemathname(infval), makemathname(zero)); }
makemathname(test_pow_inf_neg0)567 FLOAT_T makemathname(test_pow_inf_neg0)(void) { return makemathname(pow)(makemathname(infval), -makemathname(zero)); }
makemathname(test_pow_0_odd)568 FLOAT_T makemathname(test_pow_0_odd)(void) { return makemathname(pow)(makemathname(zero), makemathname(three)); }
makemathname(test_pow_neg0_odd)569 FLOAT_T makemathname(test_pow_neg0_odd)(void) { return makemathname(pow)(-makemathname(zero), makemathname(three)); }
makemathname(test_pow_neg1_inf)570 FLOAT_T makemathname(test_pow_neg1_inf)(void) { return makemathname(pow)(-makemathname(one), makemathname(infval)); }
makemathname(test_pow_neg1_neginf)571 FLOAT_T makemathname(test_pow_neg1_neginf)(void) { return makemathname(pow)(-makemathname(one), -makemathname(infval)); }
makemathname(test_pow_half_neginf)572 FLOAT_T makemathname(test_pow_half_neginf)(void) { return makemathname(pow)(makemathname(half), -makemathname(infval)); }
makemathname(test_pow_neghalf_neginf)573 FLOAT_T makemathname(test_pow_neghalf_neginf)(void) { return makemathname(pow)(-makemathname(half), -makemathname(infval)); }
makemathname(test_pow_2_neginf)574 FLOAT_T makemathname(test_pow_2_neginf)(void) { return makemathname(pow)(makemathname(two), -makemathname(infval)); }
makemathname(test_pow_neg2_neginf)575 FLOAT_T makemathname(test_pow_neg2_neginf)(void) { return makemathname(pow)(-makemathname(two), -makemathname(infval)); }
makemathname(test_pow_half_inf)576 FLOAT_T makemathname(test_pow_half_inf)(void) { return makemathname(pow)(makemathname(half), makemathname(infval)); }
makemathname(test_pow_neghalf_inf)577 FLOAT_T makemathname(test_pow_neghalf_inf)(void) { return makemathname(pow)(-makemathname(half), makemathname(infval)); }
makemathname(test_pow_2_inf)578 FLOAT_T makemathname(test_pow_2_inf)(void) { return makemathname(pow)(makemathname(two), makemathname(infval)); }
makemathname(test_pow_2_qnan)579 FLOAT_T makemathname(test_pow_2_qnan)(void) { return makemathname(pow)(makemathname(two), makemathname(qnanval)); }
makemathname(test_pow_2_snan)580 FLOAT_T makemathname(test_pow_2_snan)(void) { return makemathname(pow)(makemathname(two), makemathname(snanval)); }
makemathname(test_pow_neg2_inf)581 FLOAT_T makemathname(test_pow_neg2_inf)(void) { return makemathname(pow)(-makemathname(two), makemathname(infval)); }
makemathname(test_pow_neginf_negodd)582 FLOAT_T makemathname(test_pow_neginf_negodd)(void) { return makemathname(pow)(-makemathname(infval), -makemathname(three)); }
makemathname(test_pow_neginf_neghalf)583 FLOAT_T makemathname(test_pow_neginf_neghalf)(void) { return makemathname(pow)(-makemathname(infval), -makemathname(half)); }
makemathname(test_pow_neginf_neg2)584 FLOAT_T makemathname(test_pow_neginf_neg2)(void) { return makemathname(pow)(-makemathname(infval), -makemathname(two)); }
makemathname(test_pow_neginf_odd)585 FLOAT_T makemathname(test_pow_neginf_odd)(void) { return makemathname(pow)(-makemathname(infval), makemathname(three)); }
makemathname(test_pow_neginf_half)586 FLOAT_T makemathname(test_pow_neginf_half)(void) { return makemathname(pow)(-makemathname(infval), makemathname(half)); }
makemathname(test_pow_neginf_2)587 FLOAT_T makemathname(test_pow_neginf_2)(void) { return makemathname(pow)(-makemathname(infval), makemathname(two)); }
makemathname(test_pow_inf_neg2)588 FLOAT_T makemathname(test_pow_inf_neg2)(void) { return makemathname(pow)(makemathname(infval), -makemathname(two)); }
makemathname(test_pow_inf_2)589 FLOAT_T makemathname(test_pow_inf_2)(void) { return makemathname(pow)(makemathname(infval), makemathname(two)); }
makemathname(test_pow_0_neg2)590 FLOAT_T makemathname(test_pow_0_neg2)(void) { return makemathname(pow)(makemathname(zero), -makemathname(two)); }
makemathname(test_pow_neg0_neg2)591 FLOAT_T makemathname(test_pow_neg0_neg2)(void) { return makemathname(pow)(-makemathname(zero), -makemathname(two)); }
makemathname(test_pow_0_neghalf)592 FLOAT_T makemathname(test_pow_0_neghalf)(void) { return makemathname(pow)(makemathname(zero), -makemathname(half)); }
makemathname(test_pow_neg0_neghalf)593 FLOAT_T makemathname(test_pow_neg0_neghalf)(void) { return makemathname(pow)(-makemathname(zero), -makemathname(half)); }
makemathname(test_pow_0_neg3)594 FLOAT_T makemathname(test_pow_0_neg3)(void) { return makemathname(pow)(makemathname(zero), -makemathname(three)); }
makemathname(test_pow_neg0_neg3)595 FLOAT_T makemathname(test_pow_neg0_neg3)(void) { return makemathname(pow)(-makemathname(zero), -makemathname(three)); }
makemathname(test_pow_negsmall_negbigodd)596 FLOAT_T makemathname(test_pow_negsmall_negbigodd)(void) { return makemathname(pow)(-makemathname(small), -makemathname(bigodd)); }
makemathname(test_pow_negbig_bigodd)597 FLOAT_T makemathname(test_pow_negbig_bigodd)(void) { return makemathname(pow)(-makemathname(big), makemathname(bigodd)); }
makemathname(test_pow_negsmall_negbigeven)598 FLOAT_T makemathname(test_pow_negsmall_negbigeven)(void) { return makemathname(pow)(-makemathname(small), -makemathname(bigeven)); }
makemathname(test_pow_negbig_bigeven)599 FLOAT_T makemathname(test_pow_negbig_bigeven)(void) { return makemathname(pow)(-makemathname(big), makemathname(bigeven)); }
600 
601 #ifndef __PICOLIBC__
602 #define pow10(x) exp10(x)
603 #define pow10f(x) exp10f(x)
604 #define pow10l(x) exp10l(x)
605 #endif
606 
makemathname(test_pow10_qnan)607 FLOAT_T makemathname(test_pow10_qnan)(void) { return makemathname(pow10)(makemathname(qnanval)); }
makemathname(test_pow10_snan)608 FLOAT_T makemathname(test_pow10_snan)(void) { return makemathname(pow10)(makemathname(snanval)); }
makemathname(test_pow10_inf)609 FLOAT_T makemathname(test_pow10_inf)(void) { return makemathname(pow10)(makemathname(infval)); }
makemathname(test_pow10_neginf)610 FLOAT_T makemathname(test_pow10_neginf)(void) { return makemathname(pow10)(-makemathname(infval)); }
makemathname(test_pow10_big)611 FLOAT_T makemathname(test_pow10_big)(void) { return makemathname(pow10)(makemathname(big)); }
makemathname(test_pow10_negbig)612 FLOAT_T makemathname(test_pow10_negbig)(void) { return makemathname(pow10)(-makemathname(big)); }
613 
makemathname(test_remainder_0)614 FLOAT_T makemathname(test_remainder_0)(void) { return makemathname(remainder)(makemathname(two), makemathname(zero)); }
makemathname(test_remainder_qnan_1)615 FLOAT_T makemathname(test_remainder_qnan_1)(void) { return makemathname(remainder)(makemathname(qnanval), makemathname(one)); }
makemathname(test_remainder_1_qnan)616 FLOAT_T makemathname(test_remainder_1_qnan)(void) { return makemathname(remainder)(makemathname(one), makemathname(qnanval)); }
makemathname(test_remainder_snan_1)617 FLOAT_T makemathname(test_remainder_snan_1)(void) { return makemathname(remainder)(makemathname(snanval), makemathname(one)); }
makemathname(test_remainder_1_snan)618 FLOAT_T makemathname(test_remainder_1_snan)(void) { return makemathname(remainder)(makemathname(one), makemathname(snanval)); }
makemathname(test_remainder_inf_2)619 FLOAT_T makemathname(test_remainder_inf_2)(void) { return makemathname(remainder)(makemathname(infval), makemathname(two)); }
makemathname(test_remainder_inf_0)620 FLOAT_T makemathname(test_remainder_inf_0)(void) { return makemathname(remainder)(makemathname(infval), makemathname(zero)); }
makemathname(test_remainder_2_0)621 FLOAT_T makemathname(test_remainder_2_0)(void) { return makemathname(remainder)(makemathname(two), makemathname(zero)); }
makemathname(test_remainder_1_2)622 FLOAT_T makemathname(test_remainder_1_2)(void) { return makemathname(remainder)(makemathname(one), makemathname(two)); }
makemathname(test_remainder_neg1_2)623 FLOAT_T makemathname(test_remainder_neg1_2)(void) { return makemathname(remainder)(-makemathname(one), makemathname(two)); }
624 
625 #endif
626 
makemathname(test_sqrt_qnan)627 FLOAT_T makemathname(test_sqrt_qnan)(void) { return makemathname(sqrt)(makemathname(qnanval)); }
makemathname(test_sqrt_snan)628 FLOAT_T makemathname(test_sqrt_snan)(void) { return makemathname(sqrt)(makemathname(snanval)); }
makemathname(test_sqrt_0)629 FLOAT_T makemathname(test_sqrt_0)(void) { return makemathname(sqrt)(makemathname(zero)); }
makemathname(test_sqrt_neg0)630 FLOAT_T makemathname(test_sqrt_neg0)(void) { return makemathname(sqrt)(-makemathname(zero)); }
makemathname(test_sqrt_inf)631 FLOAT_T makemathname(test_sqrt_inf)(void) { return makemathname(sqrt)(makemathname(infval)); }
makemathname(test_sqrt_neginf)632 FLOAT_T makemathname(test_sqrt_neginf)(void) { return makemathname(sqrt)(-makemathname(infval)); }
makemathname(test_sqrt_neg)633 FLOAT_T makemathname(test_sqrt_neg)(void) { return makemathname(sqrt)(-makemathname(two)); }
makemathname(test_sqrt_2)634 FLOAT_T makemathname(test_sqrt_2)(void) { return makemathname(sqrt)(makemathname(two)); }
635 
636 #ifndef SIMPLE_MATH_ONLY
637 
makemathname(test_tan_qnan)638 FLOAT_T makemathname(test_tan_qnan)(void) { return makemathname(tan)(makemathname(qnanval)); }
makemathname(test_tan_snan)639 FLOAT_T makemathname(test_tan_snan)(void) { return makemathname(tan)(makemathname(snanval)); }
makemathname(test_tan_inf)640 FLOAT_T makemathname(test_tan_inf)(void) { return makemathname(tan)(makemathname(infval)); }
makemathname(test_tan_neginf)641 FLOAT_T makemathname(test_tan_neginf)(void) { return makemathname(tan)(-makemathname(infval)); }
makemathname(test_tan_pio2)642 FLOAT_T makemathname(test_tan_pio2)(void) { return makemathname(tan)(makemathname(pio2)); }
643 
makemathname(test_tanh_qnan)644 FLOAT_T makemathname(test_tanh_qnan)(void) { return makemathname(tanh)(makemathname(qnanval)); }
makemathname(test_tanh_snan)645 FLOAT_T makemathname(test_tanh_snan)(void) { return makemathname(tanh)(makemathname(snanval)); }
makemathname(test_tanh_0)646 FLOAT_T makemathname(test_tanh_0)(void) { return makemathname(tanh)(makemathname(zero)); }
makemathname(test_tanh_neg0)647 FLOAT_T makemathname(test_tanh_neg0)(void) { return makemathname(tanh)(-makemathname(zero)); }
makemathname(test_tanh_inf)648 FLOAT_T makemathname(test_tanh_inf)(void) { return makemathname(tanh)(makemathname(infval)); }
makemathname(test_tanh_neginf)649 FLOAT_T makemathname(test_tanh_neginf)(void) { return makemathname(tanh)(-makemathname(infval)); }
650 
651 #ifndef NO_BESSEL_TESTS
makemathname(test_y0_qnan)652 FLOAT_T makemathname(test_y0_qnan)(void) { return makemathname(y0)(makemathname(qnanval)); }
makemathname(test_y0_snan)653 FLOAT_T makemathname(test_y0_snan)(void) { return makemathname(y0)(makemathname(snanval)); }
makemathname(test_y0_inf)654 FLOAT_T makemathname(test_y0_inf)(void) { return makemathname(y0)(makemathname(infval)); }
makemathname(test_y0_neg)655 FLOAT_T makemathname(test_y0_neg)(void) { return makemathname(y0)(-makemathname(one)); }
makemathname(test_y0_0)656 FLOAT_T makemathname(test_y0_0)(void) { return makemathname(y0)(makemathname(zero)); }
657 
makemathname(test_y1_qnan)658 FLOAT_T makemathname(test_y1_qnan)(void) { return makemathname(y1)(makemathname(qnanval)); }
makemathname(test_y1_snan)659 FLOAT_T makemathname(test_y1_snan)(void) { return makemathname(y1)(makemathname(snanval)); }
makemathname(test_y1_inf)660 FLOAT_T makemathname(test_y1_inf)(void) { return makemathname(y1)(makemathname(infval)); }
makemathname(test_y1_neg)661 FLOAT_T makemathname(test_y1_neg)(void) { return makemathname(y1)(-makemathname(one)); }
makemathname(test_y1_0)662 FLOAT_T makemathname(test_y1_0)(void) { return makemathname(y1)(makemathname(zero)); }
663 
makemathname(test_yn_qnan)664 FLOAT_T makemathname(test_yn_qnan)(void) { return makemathname(yn)(2, makemathname(qnanval)); }
makemathname(test_yn_snan)665 FLOAT_T makemathname(test_yn_snan)(void) { return makemathname(yn)(2, makemathname(snanval)); }
makemathname(test_yn_inf)666 FLOAT_T makemathname(test_yn_inf)(void) { return makemathname(yn)(2, makemathname(infval)); }
makemathname(test_yn_neg)667 FLOAT_T makemathname(test_yn_neg)(void) { return makemathname(yn)(2, -makemathname(one)); }
makemathname(test_yn_0)668 FLOAT_T makemathname(test_yn_0)(void) { return makemathname(yn)(2, makemathname(zero)); }
669 #endif
670 
671 #endif
672 
makemathname(test_scalb_1_1)673 FLOAT_T makemathname(test_scalb_1_1)(void) { return makemathname(scalb)(makemathname(one), makemathname(one)); }
makemathname(test_scalb_1_half)674 FLOAT_T makemathname(test_scalb_1_half)(void) { return makemathname(scalb)(makemathname(one), makemathname(half)); }
makemathname(test_scalb_qnan_1)675 FLOAT_T makemathname(test_scalb_qnan_1)(void) { return makemathname(scalb)(makemathname(qnanval), makemathname(one)); }
makemathname(test_scalb_1_qnan)676 FLOAT_T makemathname(test_scalb_1_qnan)(void) { return makemathname(scalb)(makemathname(one), makemathname(qnanval)); }
makemathname(test_scalb_snan_1)677 FLOAT_T makemathname(test_scalb_snan_1)(void) { return makemathname(scalb)(makemathname(snanval), makemathname(one)); }
makemathname(test_scalb_1_snan)678 FLOAT_T makemathname(test_scalb_1_snan)(void) { return makemathname(scalb)(makemathname(one), makemathname(snanval)); }
makemathname(test_scalb_inf_2)679 FLOAT_T makemathname(test_scalb_inf_2)(void) { return makemathname(scalb)(makemathname(infval), makemathname(two)); }
makemathname(test_scalb_neginf_2)680 FLOAT_T makemathname(test_scalb_neginf_2)(void) { return makemathname(scalb)(-makemathname(infval), makemathname(two)); }
makemathname(test_scalb_0_2)681 FLOAT_T makemathname(test_scalb_0_2)(void) { return makemathname(scalb)(makemathname(zero), makemathname(two)); }
makemathname(test_scalb_neg0_2)682 FLOAT_T makemathname(test_scalb_neg0_2)(void) { return makemathname(scalb)(-makemathname(zero), makemathname(two)); }
makemathname(test_scalb_0_inf)683 FLOAT_T makemathname(test_scalb_0_inf)(void) { return makemathname(scalb)(makemathname(zero), makemathname(infval)); }
makemathname(test_scalb_inf_neginf)684 FLOAT_T makemathname(test_scalb_inf_neginf)(void) { return makemathname(scalb)(makemathname(infval), -makemathname(infval)); }
makemathname(test_scalb_neginf_neginf)685 FLOAT_T makemathname(test_scalb_neginf_neginf)(void) { return makemathname(scalb)(-makemathname(infval), -makemathname(infval)); }
makemathname(test_scalb_1_big)686 FLOAT_T makemathname(test_scalb_1_big)(void) { return makemathname(scalb)(makemathname(one), makemathname(big)); }
makemathname(test_scalb_neg1_big)687 FLOAT_T makemathname(test_scalb_neg1_big)(void) { return makemathname(scalb)(-makemathname(one), makemathname(big)); }
makemathname(test_scalb_1_negbig)688 FLOAT_T makemathname(test_scalb_1_negbig)(void) { return makemathname(scalb)(makemathname(one), -makemathname(big)); }
makemathname(test_scalb_neg1_negbig)689 FLOAT_T makemathname(test_scalb_neg1_negbig)(void) { return makemathname(scalb)(-makemathname(one), -makemathname(big)); }
690 
makemathname(test_scalbn_big)691 FLOAT_T makemathname(test_scalbn_big)(void) { return makemathname(scalbn)(makemathname(one), 0x7fffffff); }
makemathname(test_scalbn_tiny)692 FLOAT_T makemathname(test_scalbn_tiny)(void) { return makemathname(scalbn)(makemathname(one), -0x7fffffff); }
693 
694 #ifndef FE_DIVBYZERO
695 #define FE_DIVBYZERO 0
696 #endif
697 #ifndef FE_INEXACT
698 #define FE_INEXACT 0
699 #endif
700 #ifndef FE_INVALID
701 #define FE_INVALID 0
702 #endif
703 #ifndef FE_OVERFLOW
704 #define FE_OVERFLOW 0
705 #endif
706 #ifndef FE_UNDERFLOW
707 #define FE_UNDERFLOW 0
708 #endif
709 
710 #define MY_EXCEPT (FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW)
711 
712 #undef sNAN_RET
713 #undef sNAN_EXCEPTION
714 #if defined(__i386__) && !defined(TEST_LONG_DOUBLE)
715 /*
716  * i386 ABI returns floats in the 8087 registers, which convert sNAN
717  * to NAN on load, so you can't ever return a sNAN value successfully.
718  */
719 #define sNAN_RET        NAN
720 #define sNAN_EXCEPTION  FE_INVALID
721 #else
722 #define sNAN_RET        sNAN
723 #define sNAN_EXCEPTION  0
724 #endif
725 
726 struct {
727 	FLOAT_T	(*func)(void);
728 	char	*name;
729 	FLOAT_T	value;
730 	int	except;
731 	int	errno_expect;
732 } makemathname(tests)[] = {
733 #ifndef SIMPLE_MATH_ONLY
734 	TEST(acos_2, (FLOAT_T) NAN, FE_INVALID, EDOM),
735 	TEST(acos_qnan, (FLOAT_T) NAN, 0, 0),
736 	TEST(acos_snan, (FLOAT_T) NAN, FE_INVALID, 0),
737 	TEST(acos_inf, (FLOAT_T) NAN, FE_INVALID, EDOM),
738 	TEST(acos_minf, (FLOAT_T) NAN, FE_INVALID, EDOM),
739 
740 	TEST(acosh_half, (FLOAT_T)NAN, FE_INVALID, EDOM),
741 	TEST(acosh_qnan, (FLOAT_T)NAN, 0, 0),
742 	TEST(acosh_snan, (FLOAT_T)NAN, FE_INVALID, 0),
743 	TEST(acosh_inf, (FLOAT_T)INFINITY, 0, 0),
744 	TEST(acosh_minf, (FLOAT_T)NAN, FE_INVALID, EDOM),
745 
746 	TEST(asin_2, (FLOAT_T)NAN, FE_INVALID, EDOM),
747 	TEST(asin_qnan, (FLOAT_T) NAN, 0, 0),
748 	TEST(asin_snan, (FLOAT_T) NAN, FE_INVALID, 0),
749 	TEST(asin_inf, (FLOAT_T) NAN, FE_INVALID, EDOM),
750 	TEST(asin_minf, (FLOAT_T) NAN, FE_INVALID, EDOM),
751 
752         TEST(asinh_qnan, (FLOAT_T)NAN, 0, 0),
753         TEST(asinh_snan, (FLOAT_T)NAN, FE_INVALID, 0),
754         TEST(asinh_0, (FLOAT_T)0.0, 0, 0),
755         TEST(asinh_neg0, (FLOAT_T)-0.0, 0, 0),
756         TEST(asinh_inf, (FLOAT_T)INFINITY, 0, 0),
757         TEST(asinh_minf, (FLOAT_T)-INFINITY, 0, 0),
758 
759         TEST(atan2_qnanx, (FLOAT_T)NAN, 0, 0),
760         TEST(atan2_qnany, (FLOAT_T)NAN, 0, 0),
761         TEST(atan2_snanx, (FLOAT_T)NAN, FE_INVALID, 0),
762         TEST(atan2_snany, (FLOAT_T)NAN, FE_INVALID, 0),
763         TEST(atan2_tiny, (FLOAT_T)0.0, FE_UNDERFLOW|FE_INEXACT, ERANGE),
764         TEST(atan2_nottiny, PI_VAL, 0, 0),
765 
766         TEST(atanh_qnan, (FLOAT_T)NAN, 0, 0),
767         TEST(atanh_snan, (FLOAT_T)NAN, FE_INVALID, 0),
768         TEST(atanh_1, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
769         TEST(atanh_neg1, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
770         TEST(atanh_2, (FLOAT_T)NAN, FE_INVALID, EDOM),
771         TEST(atanh_neg2, (FLOAT_T)NAN, FE_INVALID, EDOM),
772 
773         TEST(cbrt_0, (FLOAT_T)0.0, 0, 0),
774         TEST(cbrt_neg0, -(FLOAT_T)0.0, 0, 0),
775         TEST(cbrt_inf, (FLOAT_T)INFINITY, 0, 0),
776         TEST(cbrt_neginf, -(FLOAT_T)INFINITY, 0, 0),
777         TEST(cbrt_qnan, (FLOAT_T)NAN, 0, 0),
778         TEST(cbrt_snan, (FLOAT_T)NAN, FE_INVALID, 0),
779 
780         TEST(cos_inf, (FLOAT_T)NAN, FE_INVALID, EDOM),
781         TEST(cos_qnan, (FLOAT_T)NAN, 0, 0),
782         TEST(cos_snan, (FLOAT_T)NAN, FE_INVALID, 0),
783         TEST(cos_0, (FLOAT_T)1.0, 0, 0),
784 
785         TEST(cosh_inf, (FLOAT_T)INFINITY, 0, 0),
786         TEST(cosh_qnan, (FLOAT_T)NAN, 0, 0),
787         TEST(cosh_snan, (FLOAT_T)NAN, FE_INVALID, 0),
788         TEST(cosh_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
789         TEST(cosh_negbig, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
790 
791 	TEST(drem_0, (FLOAT_T)NAN, FE_INVALID, EDOM),
792 	TEST(drem_qnan_1, (FLOAT_T)NAN, 0, 0),
793 	TEST(drem_1_qnan, (FLOAT_T)NAN, 0, 0),
794 	TEST(drem_snan_1, (FLOAT_T)NAN, FE_INVALID, 0),
795 	TEST(drem_1_snan, (FLOAT_T)NAN, FE_INVALID, 0),
796         TEST(drem_inf_2, (FLOAT_T)NAN, FE_INVALID, EDOM),
797         TEST(drem_inf_0, (FLOAT_T)NAN, FE_INVALID, EDOM),
798         TEST(drem_2_0, (FLOAT_T)NAN, FE_INVALID, EDOM),
799         TEST(drem_1_2, (FLOAT_T)1.0, 0, 0),
800         TEST(drem_neg1_2, -(FLOAT_T)1.0, 0, 0),
801 
802         TEST(erf_qnan, (FLOAT_T) NAN, 0, 0),
803         TEST(erf_snan, (FLOAT_T) NAN, FE_INVALID, 0),
804         TEST(erf_0, (FLOAT_T) 0, 0, 0),
805         TEST(erf_neg0, -(FLOAT_T) 0, 0, 0),
806         TEST(erf_inf, (FLOAT_T) 1.0, 0, 0),
807         TEST(erf_neginf, -(FLOAT_T) 1.0, 0, 0),
808         TEST(erf_small, (FLOAT_T) 2.0 * (FLOAT_T) SMALL / (FLOAT_T) 1.772453850905516027298167, FE_UNDERFLOW, 0),
809 
810 	TEST(exp_qnan, (FLOAT_T)NAN, 0, 0),
811 	TEST(exp_snan, (FLOAT_T)NAN, FE_INVALID, 0),
812 	TEST(exp_inf, (FLOAT_T)INFINITY, 0, 0),
813 	TEST(exp_neginf, (FLOAT_T)0.0, 0, 0),
814 	TEST(exp_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
815 	TEST(exp_negbig, (FLOAT_T)0.0, FE_UNDERFLOW, ERANGE),
816 
817 	TEST(exp2_qnan, (FLOAT_T)NAN, 0, 0),
818 	TEST(exp2_snan, (FLOAT_T)NAN, FE_INVALID, 0),
819 	TEST(exp2_inf, (FLOAT_T)INFINITY, 0, 0),
820 	TEST(exp2_neginf, (FLOAT_T)0.0, 0, 0),
821 	TEST(exp2_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
822 	TEST(exp2_negbig, (FLOAT_T)0.0, FE_UNDERFLOW, ERANGE),
823 
824 	TEST(exp10_qnan, (FLOAT_T)NAN, 0, 0),
825 	TEST(exp10_snan, (FLOAT_T)NAN, FE_INVALID, 0),
826 	TEST(exp10_inf, (FLOAT_T)INFINITY, 0, 0),
827 	TEST(exp10_neginf, (FLOAT_T)0.0, 0, 0),
828 	TEST(exp10_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
829 	TEST(exp10_negbig, (FLOAT_T)0.0, FE_UNDERFLOW, ERANGE),
830 
831 	TEST(expm1_qnan, (FLOAT_T)NAN, 0, 0),
832 	TEST(expm1_snan, (FLOAT_T)NAN, FE_INVALID, 0),
833 	TEST(expm1_0, (FLOAT_T)0.0, 0, 0),
834 	TEST(expm1_neg0, -(FLOAT_T)0.0, 0, 0),
835 	TEST(expm1_inf, (FLOAT_T)INFINITY, 0, 0),
836 	TEST(expm1_neginf, -(FLOAT_T)1.0, 0, 0),
837 	TEST(expm1_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
838 #if !defined(__PICOLIBC__) && defined(TEST_LONG_DOUBLE) && (defined(__x86_64) || defined(__i386))
839         /* glibc returns incorrect value on x86 */
840 	TEST(expm1_negbig, -(FLOAT_T)1.0, 0, 0),
841 #else
842 	TEST(expm1_negbig, -(FLOAT_T)1.0, FE_INEXACT, 0),
843 #endif
844 
845 #endif
846         TEST(fabs_qnan, (FLOAT_T)NAN, 0, 0),
847         TEST(fabs_snan, (FLOAT_T)sNAN_RET, sNAN_EXCEPTION, 0),
848         TEST(fabs_0, (FLOAT_T)0.0, 0, 0),
849         TEST(fabs_neg0, (FLOAT_T)0.0, 0, 0),
850         TEST(fabs_inf, (FLOAT_T)INFINITY, 0, 0),
851         TEST(fabs_neginf, (FLOAT_T)INFINITY, 0, 0),
852 
853 #ifndef SIMPLE_MATH_ONLY
854         TEST(fdim_qnan_1, (FLOAT_T)NAN, 0, 0),
855         TEST(fdim_1_qnan, (FLOAT_T)NAN, 0, 0),
856         TEST(fdim_snan_1, (FLOAT_T)NAN, FE_INVALID, 0),
857         TEST(fdim_1_snan, (FLOAT_T)NAN, FE_INVALID, 0),
858         TEST(fdim_inf_1, (FLOAT_T)INFINITY, 0, 0),
859         TEST(fdim_1_inf, (FLOAT_T)0.0, 0, 0),
860         TEST(fdim_big_negbig, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
861 #endif
862 
863         TEST(floor_1, (FLOAT_T)1.0, 0, 0),
864         TEST(floor_0, (FLOAT_T)0.0, 0, 0),
865         TEST(floor_neg0, -(FLOAT_T)0.0, 0, 0),
866         TEST(floor_qnan, (FLOAT_T)NAN, 0, 0),
867 #ifdef __PICOLIBC__
868         /* looks like glibc gets this wrong */
869         TEST(floor_snan, (FLOAT_T)NAN, FE_INVALID, 0),
870 #endif
871         TEST(floor_inf, (FLOAT_T)INFINITY, 0, 0),
872         TEST(floor_neginf, -(FLOAT_T)INFINITY, 0, 0),
873 
874 #ifndef SIMPLE_MATH_ONLY
875         TEST(fma_big_big_1, (FLOAT_T)INFINITY, FE_OVERFLOW, 0),
876         TEST(fma_big_negbig_1, -(FLOAT_T)INFINITY, FE_OVERFLOW, 0),
877         TEST(fma_small_small_1, (FLOAT_T)1.0, FE_INEXACT, 0),
878         TEST(fma_small_negsmall_1, (FLOAT_T)1.0, FE_INEXACT, 0),
879         TEST(fma_small_small_0, (FLOAT_T)0.0, FE_UNDERFLOW, 0),
880         TEST(fma_small_negsmall_0, -(FLOAT_T)0.0, FE_UNDERFLOW, 0),
881         TEST(fma_qnan_1_1, (FLOAT_T)NAN, 0, 0),
882         TEST(fma_1_qnan_1, (FLOAT_T)NAN, 0, 0),
883         TEST(fma_1_1_qnan, (FLOAT_T)NAN, 0, 0),
884         TEST(fma_inf_1_neginf, (FLOAT_T)NAN, FE_INVALID, 0),
885         TEST(fma_1_inf_neginf, (FLOAT_T)NAN, FE_INVALID, 0),
886         TEST(fma_neginf_1_inf, (FLOAT_T)NAN, FE_INVALID, 0),
887         TEST(fma_1_neginf_inf, (FLOAT_T)NAN, FE_INVALID, 0),
888         TEST(fma_inf_0_1, (FLOAT_T)NAN, FE_INVALID, 0),
889         TEST(fma_0_inf_1, (FLOAT_T)NAN, FE_INVALID, 0),
890 #ifdef __PICOLIBC__
891         /* Linux says these will set FE_INVALID, POSIX says optional, glibc does not set exception */
892         TEST(fma_inf_0_qnan, (FLOAT_T)NAN, FE_INVALID, 0),
893         TEST(fma_0_inf_qnan, (FLOAT_T)NAN, FE_INVALID, 0),
894 #endif
895 #endif
896 
897         TEST(fmax_qnan_qnan, (FLOAT_T)NAN, 0, 0),
898         TEST(fmax_qnan_1, (FLOAT_T)1.0, 0, 0),
899         TEST(fmax_1_qnan, (FLOAT_T)1.0, 0, 0),
900 
901         TEST(fmin_qnan_qnan, (FLOAT_T)NAN, 0, 0),
902         TEST(fmin_qnan_1, (FLOAT_T)1.0, 0, 0),
903         TEST(fmin_1_qnan, (FLOAT_T)1.0, 0, 0),
904 
905 #ifndef SIMPLE_MATH_ONLY
906 
907         TEST(fmod_qnan_1, (FLOAT_T)NAN, 0, 0),
908         TEST(fmod_1_qnan, (FLOAT_T)NAN, 0, 0),
909         TEST(fmod_inf_1, (FLOAT_T)NAN, FE_INVALID, EDOM),
910         TEST(fmod_neginf_1, (FLOAT_T)NAN, FE_INVALID, EDOM),
911         TEST(fmod_1_0, (FLOAT_T)NAN, FE_INVALID, EDOM),
912         TEST(fmod_0_1, (FLOAT_T)0.0, 0, 0),
913         TEST(fmod_neg0_1, -(FLOAT_T)0.0, 0, 0),
914 
915         TEST(gamma_qnan, (FLOAT_T)NAN, 0, 0),
916         TEST(gamma_1, (FLOAT_T) 0.0, 0, 0),
917         TEST(gamma_2, (FLOAT_T) 0.0, 0, 0),
918 	TEST(gamma_0, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
919 	TEST(gamma_neg0, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
920 	TEST(gamma_neg1, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
921 	TEST(gamma_neg2, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
922 	TEST(gamma_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
923 	TEST(gamma_negbig, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
924 	TEST(gamma_inf, (FLOAT_T)INFINITY, 0, 0),
925 	TEST(gamma_neginf, (FLOAT_T)INFINITY, 0, 0),
926 
927 #endif
928 
929 	TEST(hypot_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
930         TEST(hypot_1_qnan, (FLOAT_T)NAN, 0, 0),
931         TEST(hypot_qnan_1, (FLOAT_T)NAN, 0, 0),
932         TEST(hypot_inf_qnan, (FLOAT_T)INFINITY, 0, 0),
933         TEST(hypot_neginf_qnan, (FLOAT_T)INFINITY, 0, 0),
934         TEST(hypot_qnan_inf, (FLOAT_T)INFINITY, 0, 0),
935         TEST(hypot_qnan_neginf, (FLOAT_T)INFINITY, 0, 0),
936         TEST(hypot_snan_inf, (FLOAT_T)NAN, FE_INVALID, 0),
937         TEST(hypot_snan_neginf, (FLOAT_T)NAN, FE_INVALID, 0),
938         TEST(hypot_1_inf, (FLOAT_T)INFINITY, 0, 0),
939         TEST(hypot_1_neginf, (FLOAT_T)INFINITY, 0, 0),
940         TEST(hypot_inf_1, (FLOAT_T)INFINITY, 0, 0),
941         TEST(hypot_neginf_1, (FLOAT_T)INFINITY, 0, 0),
942 
943 #ifndef SIMPLE_MATH_ONLY
944 
945 #ifndef NO_BESSEL_TESTS
946         TEST(j0_inf, 0, 0, 0),
947         TEST(j0_qnan, (FLOAT_T)NAN, 0, 0),
948         TEST(j0_snan, (FLOAT_T)NAN, FE_INVALID, 0),
949 
950         TEST(j1_inf, 0, 0, 0),
951         TEST(j1_qnan, (FLOAT_T)NAN, 0, 0),
952         TEST(j1_snan, (FLOAT_T)NAN, FE_INVALID, 0),
953 
954         TEST(jn_inf, 0, 0, 0),
955         TEST(jn_qnan, (FLOAT_T)NAN, 0, 0),
956         TEST(jn_snan, (FLOAT_T)NAN, FE_INVALID, 0),
957 #endif
958 
959 #endif
960 
961         TEST(ldexp_1_0, (FLOAT_T)1.0, 0, 0),
962         TEST(ldexp_qnan_0, (FLOAT_T)NAN, 0, 0),
963         TEST(ldexp_snan_0, (FLOAT_T)NAN, FE_INVALID, 0),
964         TEST(ldexp_inf_0, (FLOAT_T)INFINITY, 0, 0),
965         TEST(ldexp_neginf_0, -(FLOAT_T)INFINITY, 0, 0),
966         TEST(ldexp_1_negbig, (FLOAT_T)0.0, FE_UNDERFLOW, ERANGE),
967         TEST(ldexp_1_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
968 
969 #ifndef SIMPLE_MATH_ONLY
970 
971         TEST(lgamma_qnan, (FLOAT_T)NAN, 0, 0),
972         TEST(lgamma_snan, (FLOAT_T)NAN, FE_INVALID, 0),
973         TEST(lgamma_1, (FLOAT_T) 0.0, 0, 0),
974         TEST(lgamma_2, (FLOAT_T) 0.0, 0, 0),
975 	TEST(lgamma_0, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
976 	TEST(lgamma_neg0, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
977 	TEST(lgamma_neg1, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
978 	TEST(lgamma_neg2, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
979 	TEST(lgamma_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
980 	TEST(lgamma_negbig, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
981 	TEST(lgamma_inf, (FLOAT_T)INFINITY, 0, 0),
982 	TEST(lgamma_neginf, (FLOAT_T)INFINITY, 0, 0),
983 
984         TEST(lgamma_r_qnan, (FLOAT_T)NAN, 0, 0),
985         TEST(lgamma_r_snan, (FLOAT_T)NAN, FE_INVALID, 0),
986         TEST(lgamma_r_1, (FLOAT_T) 0.0, 0, 0),
987         TEST(lgamma_r_2, (FLOAT_T) 0.0, 0, 0),
988 	TEST(lgamma_r_0, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
989 	TEST(lgamma_r_neg0, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
990 	TEST(lgamma_r_neg1, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
991 	TEST(lgamma_r_neg2, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
992 	TEST(lgamma_r_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
993 #if !defined(__PICOLIBC__) && defined(TEST_LONG_DOUBLE) && (defined(__x86_64) || defined(__i386))
994         /* glibc on x86 gets this wrong */
995 	TEST(lgamma_r_negbig, (FLOAT_T)INFINITY, FE_DIVBYZERO|FE_OVERFLOW|FE_INEXACT, ERANGE),
996 #else
997 	TEST(lgamma_r_negbig, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
998 #endif
999 	TEST(lgamma_r_inf, (FLOAT_T)INFINITY, 0, 0),
1000 	TEST(lgamma_r_neginf, (FLOAT_T)INFINITY, 0, 0),
1001 
1002 	TEST(log_qnan, (FLOAT_T)NAN, 0, 0),
1003 	TEST(log_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1004 	TEST(log_1, (FLOAT_T)0, 0, 0),
1005 	TEST(log_inf, (FLOAT_T)INFINITY, 0, 0),
1006 	TEST(log_0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1007 	TEST(log_neg, (FLOAT_T)NAN, FE_INVALID, EDOM),
1008 	TEST(log_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1009 
1010 	TEST(log10_qnan, (FLOAT_T)NAN, 0, 0),
1011 	TEST(log10_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1012 	TEST(log10_1, (FLOAT_T)0, 0, 0),
1013 	TEST(log10_inf, (FLOAT_T)INFINITY, 0, 0),
1014 	TEST(log10_0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1015 	TEST(log10_neg, (FLOAT_T)NAN, FE_INVALID, EDOM),
1016 	TEST(log10_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1017 
1018 	TEST(log1p_qnan, (FLOAT_T)NAN, 0, 0),
1019 	TEST(log1p_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1020 	TEST(log1p_inf, (FLOAT_T)INFINITY, 0, 0),
1021 	TEST(log1p_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1022 	TEST(log1p_neg1, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1023 	TEST(log1p_neg2, (FLOAT_T)NAN, FE_INVALID, EDOM),
1024 
1025 	TEST(log2_qnan, (FLOAT_T)NAN, 0, 0),
1026 	TEST(log2_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1027 	TEST(log2_1, (FLOAT_T)0, 0, 0),
1028 	TEST(log2_inf, (FLOAT_T)INFINITY, 0, 0),
1029 	TEST(log2_0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1030 	TEST(log2_neg, (FLOAT_T)NAN, FE_INVALID, EDOM),
1031 	TEST(log2_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1032 
1033 #endif
1034 
1035         TEST(logb_qnan, (FLOAT_T)NAN, 0, 0),
1036         TEST(logb_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1037         TEST(logb_0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, 0),
1038         TEST(logb_neg0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, 0),
1039         TEST(logb_inf, (FLOAT_T)INFINITY, 0, 0),
1040         TEST(logb_neginf, (FLOAT_T)INFINITY, 0, 0),
1041 
1042 #ifndef SIMPLE_MATH_ONLY
1043 
1044         TEST(nearbyint_qnan, (FLOAT_T) NAN, 0, 0),
1045         TEST(nearbyint_snan, (FLOAT_T) NAN, FE_INVALID, 0),
1046         TEST(nearbyint_inf, (FLOAT_T)INFINITY, 0, 0),
1047         TEST(nearbyint_neginf, -(FLOAT_T)INFINITY, 0, 0),
1048         TEST(nearbyint_big, BIG, 0, 0),
1049         TEST(nearbyint_negbig, -BIG, 0, 0),
1050         TEST(nearbyint_half, (FLOAT_T)0.0, 0, 0),
1051         TEST(nearbyint_neghalf, (FLOAT_T)-0.0, 0, 0),
1052 
1053 	TEST(pow_neg_half, (FLOAT_T)NAN, FE_INVALID, EDOM),
1054 	TEST(pow_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1055 	TEST(pow_negbig, (FLOAT_T)-INFINITY, FE_OVERFLOW, ERANGE),
1056 	TEST(pow_tiny, (FLOAT_T)0.0, FE_UNDERFLOW, ERANGE),
1057         TEST(pow_1_1, (FLOAT_T)1.0, 0, 0),
1058         TEST(pow_1_2, (FLOAT_T)1.0, 0, 0),
1059         TEST(pow_1_neg2, (FLOAT_T)1.0, 0, 0),
1060         TEST(pow_1_inf, (FLOAT_T)1.0, 0, 0),
1061         TEST(pow_1_neginf, (FLOAT_T)1.0, 0, 0),
1062         TEST(pow_1_qnan, (FLOAT_T)1.0, 0, 0),
1063         TEST(pow_qnan_0, (FLOAT_T)1.0, 0, 0),
1064         TEST(pow_qnan_neg0, (FLOAT_T)1.0, 0, 0),
1065         TEST(pow_1_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1066         TEST(pow_snan_0, (FLOAT_T)NAN, FE_INVALID, 0),
1067         TEST(pow_snan_neg0, (FLOAT_T)NAN, FE_INVALID, 0),
1068         TEST(pow_1_0, (FLOAT_T)1.0, 0, 0),
1069         TEST(pow_1_neg0, (FLOAT_T)1.0, 0, 0),
1070         TEST(pow_0_0, (FLOAT_T)1.0, 0, 0),
1071         TEST(pow_0_neg0, (FLOAT_T)1.0, 0, 0),
1072         TEST(pow_inf_0, (FLOAT_T)1.0, 0, 0),
1073         TEST(pow_inf_neg0, (FLOAT_T)1.0, 0, 0),
1074         TEST(pow_0_odd, (FLOAT_T)0.0, 0, 0),
1075         TEST(pow_neg0_odd, (FLOAT_T)-0.0, 0, 0),
1076         TEST(pow_neg1_inf, (FLOAT_T)1.0, 0, 0),
1077         TEST(pow_neg1_neginf, (FLOAT_T)1.0, 0, 0),
1078         TEST(pow_half_neginf, (FLOAT_T)INFINITY, 0, 0),
1079         TEST(pow_neghalf_neginf, (FLOAT_T)INFINITY, 0, 0),
1080         TEST(pow_2_neginf, (FLOAT_T)0.0, 0, 0),
1081         TEST(pow_neg2_neginf, (FLOAT_T)0.0, 0, 0),
1082         TEST(pow_half_inf, (FLOAT_T)0.0, 0, 0),
1083         TEST(pow_neghalf_inf, (FLOAT_T)0.0, 0, 0),
1084         TEST(pow_2_inf, (FLOAT_T)INFINITY, 0, 0),
1085         TEST(pow_2_qnan, (FLOAT_T)NAN, 0, 0),
1086         TEST(pow_2_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1087         TEST(pow_neg2_inf, (FLOAT_T)INFINITY, 0, 0),
1088         TEST(pow_neginf_negodd, (FLOAT_T)-0.0, 0, 0),
1089         TEST(pow_neginf_neghalf, (FLOAT_T)0.0, 0, 0),
1090         TEST(pow_neginf_neg2, (FLOAT_T)0.0, 0, 0),
1091         TEST(pow_neginf_odd, (FLOAT_T)-INFINITY, 0, 0),
1092         TEST(pow_neginf_half, (FLOAT_T)INFINITY, 0, 0),
1093         TEST(pow_neginf_2, (FLOAT_T)INFINITY, 0, 0),
1094         TEST(pow_inf_neg2, (FLOAT_T)0.0, 0, 0),
1095         TEST(pow_inf_2, (FLOAT_T)INFINITY, 0, 0),
1096 	TEST(pow_0_neg2, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1097 	TEST(pow_neg0_neg2, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1098 	TEST(pow_0_neg3, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1099 	TEST(pow_neg0_neg3, (FLOAT_T)-INFINITY, FE_DIVBYZERO, ERANGE),
1100 	TEST(pow_negsmall_negbigodd, (FLOAT_T)-INFINITY, FE_OVERFLOW, ERANGE),
1101 	TEST(pow_negbig_bigodd, (FLOAT_T)-INFINITY, FE_OVERFLOW, ERANGE),
1102 	TEST(pow_negsmall_negbigeven, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1103 	TEST(pow_negbig_bigeven, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1104 
1105 	TEST(pow10_qnan, (FLOAT_T)NAN, 0, 0),
1106 	TEST(pow10_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1107 	TEST(pow10_inf, (FLOAT_T)INFINITY, 0, 0),
1108 	TEST(pow10_neginf, (FLOAT_T)0.0, 0, 0),
1109 	TEST(pow10_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1110 	TEST(pow10_negbig, (FLOAT_T)0.0, FE_UNDERFLOW, ERANGE),
1111 
1112 	TEST(remainder_0, (FLOAT_T)NAN, FE_INVALID, EDOM),
1113 	TEST(remainder_qnan_1, (FLOAT_T)NAN, 0, 0),
1114 	TEST(remainder_1_qnan, (FLOAT_T)NAN, 0, 0),
1115 	TEST(remainder_snan_1, (FLOAT_T)NAN, FE_INVALID, 0),
1116 	TEST(remainder_1_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1117         TEST(remainder_inf_2, (FLOAT_T)NAN, FE_INVALID, EDOM),
1118         TEST(remainder_inf_0, (FLOAT_T)NAN, FE_INVALID, EDOM),
1119         TEST(remainder_2_0, (FLOAT_T)NAN, FE_INVALID, EDOM),
1120         TEST(remainder_1_2, (FLOAT_T)1.0, 0, 0),
1121         TEST(remainder_neg1_2, -(FLOAT_T)1.0, 0, 0),
1122 #endif
1123 
1124         TEST(rint_qnan, (FLOAT_T) NAN, 0, 0),
1125         TEST(rint_snan, (FLOAT_T) NAN, FE_INVALID, 0),
1126         TEST(rint_inf, (FLOAT_T)INFINITY, 0, 0),
1127         TEST(rint_neginf, -(FLOAT_T)INFINITY, 0, 0),
1128         TEST(rint_big, BIG, 0, 0),
1129         TEST(rint_negbig, -BIG, 0, 0),
1130         TEST(rint_half, (FLOAT_T) 0.0, FE_INEXACT, 0),
1131         TEST(rint_neghalf, (FLOAT_T)-0.0, FE_INEXACT, 0),
1132 
1133         TEST(scalb_1_1, (FLOAT_T)2.0, 0, 0),
1134         TEST(scalb_1_half, (FLOAT_T)NAN, FE_INVALID, EDOM),
1135         TEST(scalb_qnan_1, (FLOAT_T)NAN, 0, 0),
1136         TEST(scalb_1_qnan, (FLOAT_T)NAN, 0, 0),
1137         TEST(scalb_snan_1, (FLOAT_T)NAN, FE_INVALID, 0),
1138         TEST(scalb_1_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1139         TEST(scalb_inf_2, (FLOAT_T)INFINITY, 0, 0),
1140         TEST(scalb_neginf_2, -(FLOAT_T)INFINITY, 0, 0),
1141         TEST(scalb_0_2, (FLOAT_T)0.0, 0, 0),
1142         TEST(scalb_neg0_2, (FLOAT_T)-0.0, 0, 0),
1143         TEST(scalb_0_inf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1144         TEST(scalb_inf_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1145         TEST(scalb_neginf_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1146         TEST(scalb_1_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1147         TEST(scalb_neg1_big, (FLOAT_T)-INFINITY, FE_OVERFLOW, ERANGE),
1148         TEST(scalb_1_negbig, (FLOAT_T)0.0, FE_UNDERFLOW, ERANGE),
1149         TEST(scalb_neg1_negbig, (FLOAT_T)-0.0, FE_UNDERFLOW, ERANGE),
1150         TEST(scalbn_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1151         TEST(scalbn_tiny, (FLOAT_T)0.0, FE_UNDERFLOW, ERANGE),
1152 
1153 #ifndef SIMPLE_MATH_ONLY
1154 
1155         TEST(nextafter_0_neg0, -(FLOAT_T)0, 0, 0),
1156         TEST(nextafter_neg0_0, (FLOAT_T)0, 0, 0),
1157         TEST(nextafter_0_1, (FLOAT_T) MIN_VAL, FE_UNDERFLOW, 0),
1158         TEST(nextafter_0_neg1, -(FLOAT_T) MIN_VAL, FE_UNDERFLOW, 0),
1159         TEST(nextafter_min_1, (FLOAT_T) MIN_VAL + (FLOAT_T) MIN_VAL, FE_UNDERFLOW, ERANGE),
1160         TEST(nextafter_negmin_neg1, -(FLOAT_T) MIN_VAL - (FLOAT_T) MIN_VAL, FE_UNDERFLOW, ERANGE),
1161         TEST(nextafter_qnan_1, (FLOAT_T)NAN, 0, 0),
1162         TEST(nextafter_snan_1, (FLOAT_T)NAN, FE_INVALID, 0),
1163         TEST(nextafter_max_inf, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1164         TEST(nextafter_negmax_neginf, -(FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1165         TEST(nextafter_min_0, (FLOAT_T)0, FE_UNDERFLOW, ERANGE),
1166         TEST(nextafter_negmin_0, (FLOAT_T)0, FE_UNDERFLOW, ERANGE),
1167         TEST(nextafter_1_2, (FLOAT_T)1.0 + EPSILON_VAL, 0, 0),
1168         TEST(nextafter_neg1_neg2, -(FLOAT_T)1.0 - EPSILON_VAL, 0, 0),
1169 
1170 #if defined(__SIZEOF_LONG_DOUBLE__) && !defined(NO_NEXTTOWARD)
1171         TEST(nexttoward_0_neg0, -(FLOAT_T)0, 0, 0),
1172         TEST(nexttoward_neg0_0, (FLOAT_T)0, 0, 0),
1173         TEST(nexttoward_0_1, (FLOAT_T) MIN_VAL, FE_UNDERFLOW, 0),
1174         TEST(nexttoward_0_neg1, -(FLOAT_T) MIN_VAL, FE_UNDERFLOW, 0),
1175         TEST(nexttoward_min_1, (FLOAT_T) MIN_VAL + (FLOAT_T) MIN_VAL, FE_UNDERFLOW, ERANGE),
1176         TEST(nexttoward_negmin_neg1, -(FLOAT_T) MIN_VAL - (FLOAT_T) MIN_VAL, FE_UNDERFLOW, ERANGE),
1177         TEST(nexttoward_qnan_1, (FLOAT_T)NAN, 0, 0),
1178         TEST(nexttoward_snan_1, (FLOAT_T)NAN, FE_INVALID, 0),
1179         TEST(nexttoward_max_inf, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1180         TEST(nexttoward_negmax_neginf, -(FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1181         TEST(nexttoward_min_0, (FLOAT_T)0, FE_UNDERFLOW, ERANGE),
1182         TEST(nexttoward_negmin_0, (FLOAT_T)0, FE_UNDERFLOW, ERANGE),
1183         TEST(nexttoward_1_2, (FLOAT_T)1.0 + EPSILON_VAL, 0, 0),
1184         TEST(nexttoward_neg1_neg2, -(FLOAT_T)1.0 - EPSILON_VAL, 0, 0),
1185 #endif
1186 
1187         TEST(sin_inf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1188         TEST(sin_qnan, (FLOAT_T)NAN, 0, 0),
1189         TEST(sin_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1190         TEST(sin_pio2, (FLOAT_T)1.0, FE_INEXACT, 0),
1191         TEST(sin_small, (FLOAT_T)SMALL, FE_INEXACT, 0),
1192         TEST(sin_0, (FLOAT_T)0.0, 0, 0),
1193 
1194         TEST(sincos, (FLOAT_T)1.0, 0, 0),
1195         TEST(sincos_inf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1196         TEST(sincos_qnan, (FLOAT_T)NAN, 0, 0),
1197         TEST(sincos_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1198 
1199         TEST(sinh_qnan, (FLOAT_T)NAN, 0, 0),
1200         TEST(sinh_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1201         TEST(sinh_0, (FLOAT_T)0.0, 0, 0),
1202         TEST(sinh_neg0, (FLOAT_T)-0.0, 0, 0),
1203         TEST(sinh_inf, (FLOAT_T)INFINITY, 0, 0),
1204         TEST(sinh_neginf, (FLOAT_T)-INFINITY, 0, 0),
1205 
1206 #endif
1207 
1208 	TEST(sqrt_qnan, (FLOAT_T)NAN, 0, 0),
1209 	TEST(sqrt_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1210         TEST(sqrt_0, (FLOAT_T)0.0, 0, 0),
1211         TEST(sqrt_neg0, (FLOAT_T)-0.0, 0, 0),
1212         TEST(sqrt_inf, (FLOAT_T)INFINITY, 0, 0),
1213         TEST(sqrt_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1214 	TEST(sqrt_neg, (FLOAT_T)NAN, FE_INVALID, EDOM),
1215         /*
1216          * Picolibc doesn't ever set inexact for sqrt as that's
1217          * an expensive operation
1218          */
1219 //	TEST(sqrt_2, (FLOAT_T)1.4142135623730951, FE_INEXACT, 0),
1220 
1221 #ifndef SIMPLE_MATH_ONLY
1222 
1223         TEST(tan_qnan, (FLOAT_T)NAN, 0, 0),
1224         TEST(tan_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1225         TEST(tan_inf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1226         TEST(tan_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1227 #if 0
1228         /* alas, we aren't close enough to π/2 to overflow */
1229         TEST(tan_pio2, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1230 #endif
1231 
1232         TEST(tanh_qnan, (FLOAT_T)NAN, 0, 0),
1233         TEST(tanh_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1234         TEST(tanh_0, (FLOAT_T)0.0, 0, 0),
1235         TEST(tanh_neg0, (FLOAT_T)-0.0, 0, 0),
1236         TEST(tanh_inf, (FLOAT_T)1.0, 0, 0),
1237         TEST(tanh_neginf, (FLOAT_T)-1.0, 0, 0),
1238 
1239 	TEST(tgamma_0, (FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1240 	TEST(tgamma_neg0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1241 	TEST(tgamma_neg1, (FLOAT_T)NAN, FE_INVALID, EDOM),
1242 	TEST(tgamma_big, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1243 	TEST(tgamma_negbig, (FLOAT_T)NAN, FE_INVALID, EDOM),
1244 	TEST(tgamma_inf, (FLOAT_T)INFINITY, 0, 0),
1245 	TEST(tgamma_neginf, (FLOAT_T)NAN, FE_INVALID, EDOM),
1246 	TEST(tgamma_qnan, (FLOAT_T)NAN, 0, 0),
1247 	TEST(tgamma_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1248         /* ld128 tgamma sits atop lgamma which is not accurate for this value */
1249 #if defined(__PICOLIBC__) && defined(TEST_LONG_DOUBLE) && __LDBL_MANT_DIG__ == 113
1250 #else
1251 	TEST(tgamma_small, (FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1252 	TEST(tgamma_negsmall, -(FLOAT_T)INFINITY, FE_OVERFLOW, ERANGE),
1253 #endif
1254 
1255 #ifndef NO_BESSEL_TESTS
1256         TEST(y0_inf, (FLOAT_T)0.0, 0, 0),
1257         TEST(y0_qnan, (FLOAT_T)NAN, 0, 0),
1258         TEST(y0_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1259 	TEST(y0_0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1260 	TEST(y0_neg, (FLOAT_T)NAN, FE_INVALID, EDOM),
1261 
1262         TEST(y1_inf, (FLOAT_T)0.0, 0, 0),
1263         TEST(y1_qnan, (FLOAT_T)NAN, 0, 0),
1264         TEST(y1_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1265 	TEST(y1_0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1266 	TEST(y1_neg, (FLOAT_T)NAN, FE_INVALID, EDOM),
1267 
1268 	TEST(yn_inf, (FLOAT_T)0.0, 0, 0),
1269 	TEST(yn_qnan, (FLOAT_T)NAN, 0, 0),
1270 	TEST(yn_snan, (FLOAT_T)NAN, FE_INVALID, 0),
1271 	TEST(yn_0, -(FLOAT_T)INFINITY, FE_DIVBYZERO, ERANGE),
1272 	TEST(yn_neg, (FLOAT_T)NAN, FE_INVALID, EDOM),
1273 #endif
1274 #endif
1275 
1276 	{ 0 },
1277 };
1278 
1279 struct {
1280         long    (*func)(void);
1281 	char	*name;
1282 	long	value;
1283 	int	except;
1284 	int	errno_expect;
1285 } makemathname(itests)[] = {
1286         TEST(fpclassify_snan, FP_NAN, 0, 0),
1287         TEST(fpclassify_nan, FP_NAN, 0, 0),
1288         TEST(fpclassify_inf, FP_INFINITE, 0, 0),
1289         TEST(fpclassify_neginf, FP_INFINITE, 0, 0),
1290         TEST(fpclassify_zero, FP_ZERO, 0, 0),
1291         TEST(fpclassify_negzero, FP_ZERO, 0, 0),
1292         TEST(fpclassify_small, FP_SUBNORMAL, 0, 0),
1293         TEST(fpclassify_negsmall, FP_SUBNORMAL, 0, 0),
1294         TEST(fpclassify_two, FP_NORMAL, 0, 0),
1295         TEST(fpclassify_negtwo, FP_NORMAL, 0, 0),
1296 
1297         TEST(isfinite_snan, 0, 0, 0),
1298         TEST(isfinite_nan, 0, 0, 0),
1299         TEST(isfinite_inf, 0, 0, 0),
1300         TEST(isfinite_neginf, 0, 0, 0),
1301         TEST(isfinite_zero, 1, 0, 0),
1302         TEST(isfinite_negzero, 1, 0, 0),
1303         TEST(isfinite_small, 1, 0, 0),
1304         TEST(isfinite_negsmall, 1, 0, 0),
1305         TEST(isfinite_two, 1, 0, 0),
1306         TEST(isfinite_negtwo, 1, 0, 0),
1307 
1308         TEST(isnormal_snan, 0, 0, 0),
1309         TEST(isnormal_nan, 0, 0, 0),
1310         TEST(isnormal_inf, 0, 0, 0),
1311         TEST(isnormal_neginf, 0, 0, 0),
1312         TEST(isnormal_zero, 0, 0, 0),
1313         TEST(isnormal_negzero, 0, 0, 0),
1314         TEST(isnormal_small, 0, 0, 0),
1315         TEST(isnormal_negsmall, 0, 0, 0),
1316         TEST(isnormal_two, 1, 0, 0),
1317         TEST(isnormal_negtwo, 1, 0, 0),
1318 
1319         TEST(isnan_snan, 1, 0, 0),
1320         TEST(isnan_nan, 1, 0, 0),
1321         TEST(isnan_inf, 0, 0, 0),
1322         TEST(isnan_neginf, 0, 0, 0),
1323         TEST(isnan_zero, 0, 0, 0),
1324         TEST(isnan_negzero, 0, 0, 0),
1325         TEST(isnan_small, 0, 0, 0),
1326         TEST(isnan_negsmall, 0, 0, 0),
1327         TEST(isnan_two, 0, 0, 0),
1328         TEST(isnan_negtwo, 0, 0, 0),
1329 
1330         TEST(isinf_snan, 0, 0, 0),
1331         TEST(isinf_nan, 0, 0, 0),
1332         TEST(isinf_inf, 1, 0, 0),
1333         TEST(isinf_neginf, 1, 0, 0),
1334         TEST(isinf_zero, 0, 0, 0),
1335         TEST(isinf_negzero, 0, 0, 0),
1336         TEST(isinf_small, 0, 0, 0),
1337         TEST(isinf_negsmall, 0, 0, 0),
1338         TEST(isinf_two, 0, 0, 0),
1339         TEST(isinf_negtwo, 0, 0, 0),
1340 
1341         TEST(ilogb_0, FP_ILOGB0, FE_INVALID, EDOM),
1342         TEST(ilogb_qnan, FP_ILOGBNAN, FE_INVALID, EDOM),
1343         TEST(ilogb_inf, INT_MAX, FE_INVALID, EDOM),
1344         TEST(ilogb_neginf, INT_MAX, FE_INVALID, EDOM),
1345 
1346         TEST(lrint_qnan, 0, FE_INVALID, 0),
1347         TEST(lrint_inf, 0, FE_INVALID, 0),
1348         TEST(lrint_neginf, 0, FE_INVALID, 0),
1349         TEST(lrint_big, 0, FE_INVALID, 0),
1350         TEST(lrint_negbig, 0, FE_INVALID, 0),
1351 
1352         TEST(lround_qnan, 0, FE_INVALID, 0),
1353         TEST(lround_inf, 0, FE_INVALID, 0),
1354         TEST(lround_neginf, 0, FE_INVALID, 0),
1355         TEST(lround_big, 0, FE_INVALID, 0),
1356         TEST(lround_negbig, 0, FE_INVALID, 0),
1357         { 0 },
1358 };
1359 
1360 #if defined(TINY_STDIO) || !defined(NO_FLOATING_POINT)
1361 #define PRINT	if (!printed++) printf("    %-20.20s = %g errno %d (%s) except %s\n", \
1362                        makemathname(tests)[t].name, (double) v, err, strerror(err), e_to_str(except))
1363 #else
1364 #define PRINT	if (!printed++) printf("    %-20.20s = (float) errno %d (%s) except %s\n", \
1365                        makemathname(tests)[t].name, err, strerror(err), e_to_str(except))
1366 #endif
1367 
1368 #define IPRINT	if (!printed++) printf("    %-20.20s = %ld errno %d (%s) except %s\n", \
1369                        makemathname(itests)[t].name, iv, err, strerror(err), e_to_str(except))
1370 
1371 int
makemathname(is_equal)1372 makemathname(is_equal)(FLOAT_T a, FLOAT_T b)
1373 {
1374     if (isinf(a) && isinf(b))
1375         return (a > 0) == (b > 0);
1376     if (makemathname(isnan)(a) && makemathname(isnan)(b))
1377         return issignaling(a) == issignaling(b);
1378     return a == b;
1379 }
1380 
1381 void
makemathname(print_float)1382 makemathname(print_float)(FLOAT_T a)
1383 {
1384     if (makemathname(isnan)(a)) {
1385         if (issignaling(a))
1386             printf("sNaN");
1387         else
1388             printf("qNaN");
1389     } else
1390 #if defined(TEST_LONG_DOUBLE) && !defined(__PICOLIBC__)
1391         printf("%.34g", (long double) a);
1392 #else
1393         printf("%.17g", (double) a);
1394 #endif
1395 }
1396 
1397 int
makemathname(run_tests)1398 makemathname(run_tests)(void) {
1399 	int result = 0;
1400 	volatile FLOAT_T v;
1401         volatile long iv;
1402 	int err, except;
1403 	int t;
1404         int printed;
1405 
1406 	for (t = 0; makemathname(tests)[t].func; t++) {
1407                 printed = 0;
1408 		errno = 0;
1409 		feclearexcept(FE_ALL_EXCEPT);
1410 		v = makemathname(tests)[t].func();
1411 		err = errno;
1412 		except = fetestexcept(MY_EXCEPT);
1413 		if (!makemathname(is_equal)(v, makemathname(tests)[t].value))
1414 		{
1415                         PRINT;
1416 			printf("\tbad value got ");
1417                         makemathname(print_float)(v);
1418                         printf(" expect ");
1419                         makemathname(print_float)(makemathname(tests)[t].value);
1420                         printf("\n");
1421 			++result;
1422 		}
1423 		if (math_errhandling & EXCEPTION_TEST) {
1424                     int expect_except = makemathname(tests)[t].except;
1425                     int mask = MY_EXCEPT;
1426 
1427                     /* underflow can be set for inexact operations */
1428                     if (expect_except & FE_INEXACT)
1429                         mask &= ~FE_UNDERFLOW;
1430                     else
1431                         mask &= ~FE_INEXACT;
1432 
1433                     if ((except & (expect_except | mask)) != expect_except) {
1434                                 PRINT;
1435 				printf("\texceptions supported. %s returns %s instead of %s\n",
1436                                        makemathname(tests)[t].name, e_to_str(except), e_to_str(makemathname(tests)[t].except));
1437 				++result;
1438 			}
1439 		} else {
1440 			if (except) {
1441                                 PRINT;
1442 				printf("\texceptions not supported. %s returns %s\n", makemathname(tests)[t].name, e_to_str(except));
1443 				++result;
1444 			}
1445 		}
1446 		if (math_errhandling & MATH_ERRNO) {
1447 			if (err != makemathname(tests)[t].errno_expect) {
1448                                 PRINT;
1449 				printf("\terrno supported but %s returns %d (%s) instead of %d (%s)\n",
1450                                        makemathname(tests)[t].name, err, strerror(err),
1451                                        makemathname(tests)[t].errno_expect, strerror(makemathname(tests)[t].errno_expect));
1452 				++result;
1453 			}
1454 		} else {
1455 			if (err != 0) {
1456                                 PRINT;
1457 				printf("\terrno not supported but %s returns %d (%s)\n",
1458                                        makemathname(tests)[t].name, err, strerror(err));
1459 				++result;
1460 			}
1461 		}
1462 	}
1463 
1464 	for (t = 0; makemathname(itests)[t].func; t++) {
1465                 printed = 0;
1466 		errno = 0;
1467 		feclearexcept(FE_ALL_EXCEPT);
1468 		iv = makemathname(itests)[t].func();
1469 		err = errno;
1470 		except = fetestexcept(MY_EXCEPT);
1471 		if (iv != makemathname(itests)[t].value)
1472 		{
1473                         IPRINT;
1474 			printf("\tbad value got %ld expect %ld\n", iv, makemathname(itests)[t].value);
1475 			++result;
1476 		}
1477 		if (math_errhandling & EXCEPTION_TEST) {
1478                         int expect_except = makemathname(itests)[t].except;
1479                         int mask = MY_EXCEPT;
1480 
1481                         /* underflow can be set for inexact operations */
1482                         if (expect_except & FE_INEXACT)
1483                                 mask &= ~FE_UNDERFLOW;
1484                         else
1485                                 mask &= ~FE_INEXACT;
1486 
1487                         if ((except & (expect_except | mask)) != expect_except) {
1488                                 IPRINT;
1489 				printf("\texceptions supported. %s returns %s instead of %s\n",
1490                                        makemathname(itests)[t].name, e_to_str(except), e_to_str(makemathname(itests)[t].except));
1491 				++result;
1492 			}
1493 		} else {
1494 			if (except) {
1495                                 IPRINT;
1496 				printf("\texceptions not supported. %s returns %s\n", makemathname(itests)[t].name, e_to_str(except));
1497 				++result;
1498 			}
1499 		}
1500 		if (math_errhandling & MATH_ERRNO) {
1501 			if (err != makemathname(itests)[t].errno_expect) {
1502                                 IPRINT;
1503 				printf("\terrno supported but %s returns %d (%s)\n", makemathname(itests)[t].name, err, strerror(err));
1504 				++result;
1505 			}
1506 		} else {
1507 			if (err != 0) {
1508                                 IPRINT;
1509 				printf("\terrno not supported but %s returns %d (%s)\n", makemathname(itests)[t].name, err, strerror(err));
1510 				++result;
1511 			}
1512 		}
1513 	}
1514 	return result;
1515 }
1516