1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
|
/* Copyright (C) 2002 Free Software Foundation.
Verify that built-in math function constant folding doesn't
cause any problems for the compiler.
Written by Roger Sayle, 16th August 2002. */
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math" } */
extern double atan (double);
extern float atanf (float);
extern long double atanl (long double);
extern double exp (double);
extern float expf (float);
extern long double expl (long double);
extern double fabs (double);
extern float fabsf (float);
extern long double fabsl (long double);
extern double log (double);
extern float logf (float);
extern long double logl (long double);
extern double pow (double, double);
extern float powf (float, float);
extern long double powl (long double, long double);
extern double sqrt (double);
extern float sqrtf (float);
extern long double sqrtl (long double);
extern double tan (double);
extern float tanf (float);
extern long double tanl (long double);
double test1(double x)
{
return log(exp(x));
}
double test2(double x)
{
return exp(log(x));
}
double test3(double x)
{
return sqrt(exp(x));
}
double test4(double x)
{
return log(sqrt(x));
}
double test5(double x, double y)
{
return sqrt(x)*sqrt(y);
}
double test6(double x, double y)
{
return exp(x)*exp(y);
}
double test7(double x, double y)
{
return x/exp(y);
}
double test8(double x)
{
return fabs(sqrt(x));
}
double test9(double x)
{
return fabs(exp(x));
}
double test10(double x)
{
return tan(atan(x));
}
double test11(double x)
{
return fabs(fabs(x));
}
double test12(double x)
{
return fabs(atan(x));
}
double test13(double x)
{
return fabs(pow(2.0,x));
}
float test1f(float x)
{
return logf(expf(x));
}
float test2f(float x)
{
return expf(logf(x));
}
float test3f(float x)
{
return sqrtf(expf(x));
}
float test4f(float x)
{
return logf(sqrtf(x));
}
float test5f(float x, float y)
{
return sqrtf(x)*sqrtf(y);
}
float test6f(float x, float y)
{
return expf(x)*expf(y);
}
float test7f(float x, float y)
{
return x/expf(y);
}
float test8f(float x)
{
return fabsf(sqrtf(x));
}
float test9f(float x)
{
return fabsf(expf(x));
}
float test10f(float x)
{
return tanf(atanf(x));
}
float test11f(float x)
{
return fabsf(fabsf(x));
}
float test12f(float x)
{
return fabsf(atanf(x));
}
float test13f(float x)
{
return fabsf(powf(2.0f,x));
}
long double test1l(long double x)
{
return logl(expl(x));
}
long double test2l(long double x)
{
return expl(logl(x));
}
long double test3l(long double x)
{
return sqrtl(expl(x));
}
long double test4l(long double x)
{
return logl(sqrtl(x));
}
long double test5l(long double x, long double y)
{
return sqrtl(x)*sqrtl(y);
}
long double test6l(long double x, long double y)
{
return expl(x)*expl(y);
}
long double test7l(long double x, long double y)
{
return x/expl(y);
}
long double test8l(long double x)
{
return fabsl(sqrtl(x));
}
long double test9l(long double x)
{
return fabsl(expl(x));
}
long double test10l(long double x)
{
return tanl(atanl(x));
}
long double test11l(long double x)
{
return fabsl(fabsl(x));
}
long double test12l(long double x)
{
return fabsl(atanl(x));
}
long double test13l(long double x)
{
return fabsl(powl(2.0l,x));
}
|