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