2 /* { dg-options "-Ofast" } */
4 extern float sinf (float);
5 extern float cosf (float);
6 extern float atanf (float);
7 extern float sqrtf (float);
8 extern float nextafterf (float, float);
9 extern double sin (double);
10 extern double cos (double);
11 extern double atan (double);
12 extern double sqrt (double);
13 extern double nextafter (double, double);
14 extern long double sinl (long double);
15 extern long double cosl (long double);
16 extern long double atanl (long double);
17 extern long double sqrtl (long double);
18 extern long double nextafterl (long double, long double);
22 double __attribute__ ((noinline
, optimize("Ofast")))
25 return sin (atan (x
));
28 double __attribute__ ((noinline
, optimize("Ofast")))
31 return cos (atan (x
));
34 float __attribute__ ((noinline
, optimize("Ofast")))
37 return sinf (atanf (x
));
40 float __attribute__ ((noinline
, optimize("Ofast")))
43 return cosf (atanf (x
));
46 long double __attribute__ ((noinline
, optimize("Ofast")))
47 sinatanl (long double x
)
49 return sinl (atanl (x
));
52 long double __attribute__ ((noinline
, optimize("Ofast")))
53 cosatanl (long double x
)
55 return cosl (atanl (x
));
61 /* Get first x such that 1 + x*x will overflow */
62 float fc
= nextafterf (sqrtf (__FLT_MAX__
- 1), __FLT_MAX__
);
63 double c
= nextafter (sqrt (__DBL_MAX__
- 1), __DBL_MAX__
);
64 long double lc
= nextafter (sqrtl (__LDBL_MAX__
- 1), __LDBL_MAX__
);
66 /* Force move from FPU to memory, otherwise comparison may
67 fail due to possible more accurate registers (see 387) */
70 volatile long double ly
;
76 if (fy
!= 1.f
|| y
!= 1 || ly
!= 1.L
)
83 if (fy
!= 0.f
|| y
!= 0. || ly
!= 0.L
)
90 if (fy
!= -1.f
|| y
!= -1. || ly
!= -1.L
)
97 if (fy
!= 0.f
|| y
!= 0. || ly
!= 0.L
)