TODO update
[libm] / test / sanity / t.c
1 #include <stdio.h>
2 #include <math.h>
3
4 #define P(x) printf("%-24s = %a\n", #x, x)
5 #define Q(x) printf("%-24s = %La\n", #x, x)
6
7 int main(){
8         int i;
9         float f;
10         double d;
11         long double l;
12
13         P(acos(0.7));
14         P(acosf(0.7));
15         Q(acosl(0.7L));
16
17         P(acosh(0.7));
18         P(acoshf(0.7));
19         Q(acoshl(0.7L));
20
21         P(asin(0.7));
22         P(asinf(0.7));
23         Q(asinl(0.7L));
24
25         P(asinh(0.7));
26         P(asinhf(0.7));
27         Q(asinhl(0.7L));
28
29         P(atan(0.7));
30         P(atanf(0.7));
31         Q(atanl(0.7L));
32
33         P(atan2(0.7,1));
34         P(atan2f(0.7,1));
35         Q(atan2l(0.7L,1));
36
37         P(atanh(0.7));
38         P(atanhf(0.7));
39         Q(atanhl(0.7L));
40
41         P(cbrt(0.7));
42         P(cbrtf(0.7));
43         Q(cbrtl(0.7L));
44
45         P(ceil(0.7));
46         P(ceilf(0.7));
47         Q(ceill(0.7L));
48
49         P(copysign(0.7,-1));
50         P(copysignf(0.7,-1));
51         Q(copysignl(0.7L,-1));
52
53         P(cos(0.7));
54         P(cosf(0.7));
55         Q(cosl(0.7L));
56
57         P(cosh(0.7));
58         P(coshf(0.7));
59         Q(coshl(0.7L));
60
61         P(erf(0.7));
62         P(erff(0.7));
63         Q(erfl(0.7L));
64
65         P(erfc(0.7));
66         P(erfcf(0.7));
67         Q(erfcl(0.7L));
68
69         P(exp(0.7));
70         P(expf(0.7));
71         Q(expl(0.7L));
72
73         P(exp2(0.7));
74         P(exp2f(0.7));
75         Q(exp2l(0.7L));
76
77         P(expm1(0.7));
78         P(expm1f(0.7));
79         Q(expm1l(0.7L));
80
81         P(fabs(0.7));
82         P(fabsf(0.7));
83         Q(fabsl(0.7L));
84
85         P(fdim(0.7,0.2));
86         P(fdimf(0.7,0.2));
87         Q(fdiml(0.7L,0.2L));
88
89         P(floor(0.7));
90         P(floorf(0.7));
91         Q(floorl(0.7L));
92
93         P(fma(0.7,1,0.2));
94         P(fmaf(0.7,1,0.2));
95         Q(fmal(0.7L,1,0.2L));
96
97         P(fmax(0.7,1));
98         P(fmaxf(0.7,1));
99         Q(fmaxl(0.7L,1));
100
101         P(fmin(0.7,1));
102         P(fminf(0.7,1));
103         Q(fminl(0.7L,1));
104
105         P(fmod(0.7,0.2));
106         P(fmodf(0.7,0.2));
107         Q(fmodl(0.7L,0.2L));
108
109         P(frexp(0.7,&i));
110         P(frexpf(0.7,&i));
111         Q(frexpl(0.7L,&i));
112
113 //      P(gamma(0.7));
114 //      P(gammaf(0.7));
115
116         P(hypot(0.7,1));
117         P(hypotf(0.7,1));
118         Q(hypotl(0.7L,1));
119
120         P((double)ilogb(0.7));
121         P((double)ilogbf(0.7));
122         Q((long double)ilogbl(0.7L));
123
124         P(j0(0.7));
125         P(j0f(0.7));
126         P(j1(0.7));
127         P(j1f(0.7));
128         P(jn(1,0.7));
129         P(jnf(1,0.7));
130
131         P(ldexp(0.7,1));
132         P(ldexpf(0.7,1));
133         Q(ldexpl(0.7L,1));
134
135         P(lgamma(0.7));
136         P(lgammaf(0.7));
137         Q(lgammal(0.7L));
138
139         P(lgamma_r(0.7,&i));
140         P(lgammaf_r(0.7,&i));
141         Q(lgammal_r(0.7L,&i));
142
143         P((double)llrint(0.7));
144         P((double)llrintf(0.7));
145         Q((long double)llrintl(0.7L));
146         P((double)llround(0.7));
147         P((double)llroundf(0.7));
148         Q((long double)llroundl(0.7L));
149
150         P(log(0.7));
151         P(logf(0.7));
152         Q(logl(0.7L));
153
154         P(log10(0.7));
155         P(log10f(0.7));
156         Q(log10l(0.7L));
157
158         P(log1p(0.7));
159         P(log1pf(0.7));
160         Q(log1pl(0.7L));
161
162         P(log2(0.7));
163         P(log2f(0.7));
164         Q(log2l(0.7L));
165
166         P(logb(0.7));
167         P(logbf(0.7));
168         Q(logbl(0.7L));
169
170         P((double)lrint(0.7));
171         P((double)lrintf(0.7));
172         Q((long double)lrintl(0.7L));
173         P((double)lround(0.7));
174         P((double)lroundf(0.7));
175         Q((long double)lroundl(0.7L));
176
177         P(modf(0.7,&d));
178         P(modff(0.7,&f));
179         Q(modfl(0.7L,&l));
180
181         P(nearbyint(0.7));
182         P(nearbyintf(0.7));
183         Q(nearbyintl(0.7L));
184
185         P(nextafter(0.7,0.2));
186         P(nextafterf(0.7,0.2));
187         Q(nextafterl(0.7L,0.2L));
188         P(nexttoward(0.7,0.2L));
189         P(nexttowardf(0.7,0.2L));
190         Q(nexttowardl(0.7L,0.2L));
191
192         P(pow(0.7,0.2));
193         P(powf(0.7,0.2));
194         Q(powl(0.7L,0.2L));
195
196         P(remainder(0.7,0.2));
197         P(remainderf(0.7,0.2));
198         Q(remainderl(0.7L,0.2L));
199
200         P(remquo(0.7,0.2,&i));
201         P(remquof(0.7,0.2,&i));
202         Q(remquol(0.7L,0.2L,&i));
203
204         P(rint(0.7));
205         P(rintf(0.7));
206         Q(rintl(0.7L));
207
208         P(round(0.7));
209         P(roundf(0.7));
210         Q(roundl(0.7L));
211
212         P(scalb(0.7,1));
213         P(scalbf(0.7,1));
214         P(scalbln(0.7,1));
215         P(scalblnf(0.7,1));
216         Q(scalblnl(0.7,1));
217         P(scalbn(0.7,1));
218         P(scalbnf(0.7,1));
219         Q(scalbnl(0.7L,1));
220
221         P(sin(0.7));
222         P(sinf(0.7));
223         Q(sinl(0.7L));
224
225         P(sinh(0.7));
226         P(sinhf(0.7));
227         Q(sinhl(0.7L));
228
229         P(sqrt(0.7));
230         P(sqrtf(0.7));
231         Q(sqrtl(0.7L));
232
233         P(tan(0.7));
234         P(tanf(0.7));
235         Q(tanl(0.7L));
236
237         P(tanh(0.7));
238         P(tanhf(0.7));
239         Q(tanhl(0.7L));
240
241 //      P(tgamma(0.7));
242 //      P(tgammaf(0.7));
243         Q(tgammal(0.7L));
244
245         P(trunc(0.7));
246         P(truncf(0.7));
247         Q(truncl(0.7L));
248
249         P(y0(0.7));
250         P(y0f(0.7));
251         P(y1(0.7));
252         P(y1f(0.7));
253         P(yn(1,0.7));
254         P(ynf(1,0.7));
255
256         return 0;
257 }