diff --git a/liba/include/math.h b/liba/include/math.h index 7fef24005..3cb95bcb5 100644 --- a/liba/include/math.h +++ b/liba/include/math.h @@ -35,13 +35,13 @@ typedef double double_t; #define FP_SUBNORMAL 0x08 #define FP_ZERO 0x10 -#define fpclassify(x) __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x) -#define signbit(x) __builtin_signbit(x) #define finite(x) __builtin_finite(x) +#define fpclassify(x) __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x) #define isfinite(x) __builtin_isfinite(x) #define isnormal(x) __builtin_isnormal(x) #define isnan(x) __builtin_isnan(x) #define isinf(x) __builtin_isinf(x) +#define signbit(x) __builtin_signbit(x) float acosf(float x); float acoshf(float x); @@ -60,19 +60,19 @@ float fabsf(float x); float fmaxf(float x, float y); float floorf(float x); float fmodf(float x, float y); -float frexpf(float x, int *eptr); +float frexpf(float x, int *exp); float hypotf(float x, float y); -float ldexpf(float x, int n); +float ldexpf(float x, int exp); float lgammaf(float x); float lgammaf_r(float x, int *signgamp); float log1pf(float x); float log10f(float x); float logf(float x); -float modff(float value, float *iptr); +float modff(float x, float *iptr); float nearbyintf(float x); float powf(float x, float y); float roundf(float x); -float scalbnf(float x, int n); +float scalbnf(float x, int exp); float sinf(float x); float sinhf(float x); float sqrtf(float x); @@ -99,7 +99,7 @@ double fabs(double x); double fmax(double x, double y); double floor(double x); double fmod(double x, double y); -double frexp(double x, int *eptr); +double frexp(double x, int *exp); double hypot(double x, double y); double lgamma(double x); double lgamma_r(double x, int *signgamp); @@ -108,14 +108,13 @@ double log1p(double x); double log10(double x); double log2(double x); double logb(double x); -double modf(double value, double *iptr); +double modf(double x, double *iptr); double nearbyint(double x); double pow(double x, double y); -double nearbyint(double x); double rint(double x); double round(double x); -double scalb(double x, double fn); -double scalbn(double x, int n); +double scalb(double x, double exp); +double scalbn(double x, int exp); double sin(double x); double sinh(double x); double sqrt(double x); @@ -124,6 +123,8 @@ double tanh(double x); double tgamma(double x); double trunc(double x); +extern int signgam; + /* The C99 standard says that any libc function can be re-declared as a macro. * (See N1124 paragraph 7.1.4). This means that C files willing to actually * implement said functions should either re-define the prototype or #undef the @@ -145,18 +146,19 @@ double trunc(double x); #define fabsf(x) __builtin_fabsf(x) #define floorf(x) __builtin_floorf(x) #define fmodf(x, y) __builtin_fmodf(x, y) -#define frexpf(x, y) __builtin_frexpf(x, y) -#define ldexpf(x, n) __builtin_ldexpf(x, n) +#define frexpf(x, exp) __builtin_frexpf(x, exp) +#define ldexpf(x, exp) __builtin_ldexpf(x, exp) #define lgammaf(x) __builtin_lgammaf(x) #define lgammaf_r(x, signgamp) __builtin_lgammaf_r(x, signgamp) #define log1pf(x) __builtin_log1pf(x) #define log10f(x) __builtin_log10f(x) #define logf(x) __builtin_logf(x) -#define nanf(s) __builtin_nanf(s) +#define modff(x, iptr) __builtin_modff(x, iptr) +#define nanf(tagp) __builtin_nanf(tagp) #define nearbyintf(x) __builtin_nearbyintf(x) #define powf(x, y) __builtin_powf(x, y) #define roundf(x) __builtin_roundf(x) -#define scalbnf(x, n) __builtin_scalbnf(x, n) +#define scalbnf(x, exp) __builtin_scalbnf(x, exp) #define sinf(x) __builtin_sinf(x) #define sinhf(x) __builtin_sinhf(x) #define sqrtf(x) __builtin_sqrtf(x) @@ -182,7 +184,8 @@ double trunc(double x); #define fabs(x) __builtin_fabs(x) #define floor(x) __builtin_floor(x) #define fmod(x, y) __builtin_fmod(x, y) -#define ldexp(x, n) __builtin_scalbn(x, n) +#define frexp(x, exp) __builtin_frexp(x, exp) +#define ldexp(x, exp) __builtin_scalbn(x, exp) #define lgamma(x) __builtin_lgamma(x) #define lgamma_r(x, signgamp) __builtin_lgamma_r(x, signgamp) #define log(x) __builtin_log(x) @@ -190,11 +193,14 @@ double trunc(double x); #define log10(x) __builtin_log10(x) #define log2(x) __builtin_log2(x) #define logb(x) __builtin_logb(x) -#define nan(s) __builtin_nan(s) +#define modf(x, iptr) __builtin_modf(x, iptr) +#define nan(tagp) __builtin_nan(tagp) +#define nearbyint(x) __builtin_nearbyint(x) #define pow(x, y) __builtin_pow(x, y) #define rint(x) __builtin_rint(x) #define round(x) __builtin_round(x) -#define scalbn(x, n) __builtin_scalbn(x, n) +#define scalb(x, exp) __builtin_scalb(x, exp) +#define scalbn(x, exp) __builtin_scalbn(x, exp) #define sin(x) __builtin_sin(x) #define sinh(x) __builtin_sinh(x) #define sqrt(x) __builtin_sqrt(x) @@ -203,8 +209,6 @@ double trunc(double x); #define tgamma(x) __builtin_tgamma(x) #define trunc(x) __builtin_trunc(x) -extern int signgam; - LIBA_END_DECLS #endif diff --git a/liba/test/math.c b/liba/test/math.c index 64f874df8..c09fc30f2 100644 --- a/liba/test/math.c +++ b/liba/test/math.c @@ -1,210 +1,97 @@ // This file tests that each math fuction links. #include -int test_fpclassifyf(float x) { - return fpclassify(x); -} -int test_isfinitef(float x) { - return isfinite(x); -} -int test_isnormalf(float x) { - return isnormal(x); -} -int test_isnanf(float x) { - return isnan(x); -} -int test_isinff(float x) { - return isinf(x); -} +int test_fpclassifyf(float x) { return fpclassify(x); } +int test_signbitf(float x) { return signbit(x); } +int test_finitef(float x) { return finite(x); } +int test_isfinitef(float x) { return isfinite(x); } +int test_isnormalf(float x) { return isnormal(x); } +int test_isnanf(float x) { return isnan(x); } +int test_isinff(float x) { return isinf(x); } -float test_acosf(float x) { - return acosf(x); -} -float test_acoshf(float x) { - return acoshf(x); -} -float test_asinf(float x) { - return asinf(x); -} -float test_asinhf(float x) { - return asinhf(x); -} -float test_atanf(float x) { - return atanf(x); -} -float test_atan2f(float y, float x) { - return atan2f(y, x); -} -float test_atanhf(float x) { - return atanhf(x); -} -float test_ceilf(float x) { - return ceilf(x); -} -float test_copysignf(float x, float y) { - return copysignf(x, y); -} -float test_cosf(float x) { - return cosf(x); -} -float test_coshf(float x) { - return coshf(x); -} -float test_expf(float x) { - return expf(x); -} -float test_expm1f(float x) { - return expm1f(x); -} -float test_fabsf(float x) { - return fabsf(x); -} -float test_floorf(float x) { - return floorf(x); -} -float test_fmodf(float x, float y) { - return fmodf(x, y); -} -float test_lgammaf(float x) { - return lgammaf(x); -} -float test_lgammaf_r(float x, int *signgamp) { - return lgammaf_r(x, signgamp); -} -float test_log1pf(float x) { - return log1pf(x); -} -float test_log10f(float x) { - return log10f(x); -} -float test_logf(float x) { - return logf(x); -} -float test_nanf(const char *s) { - return nanf(s); -} -float test_nearbyintf(float x) { - return nearbyintf(x); -} -float test_powf(float x, float y) { - return powf(x, y); -} -float test_roundf(float x) { - return roundf(x); -} -float test_scalbnf(float x, int n) { - return scalbnf(x, n); -} -float test_sinf(float x) { - return sinf(x); -} -float test_sinhf(float x) { - return sinhf(x); -} -float test_sqrtf(float x) { - return sqrtf(x); -} -float test_tanf(float x) { - return tanf(x); -} -float test_tanhf(float x) { - return tanhf(x); -} +float test_acosf(float x) { return acosf(x); } +float test_acoshf(float x) { return acoshf(x); } +float test_asinf(float x) { return asinf(x); } +float test_asinhf(float x) { return asinhf(x); } +float test_atanf(float x) { return atanf(x); } +float test_atan2f(float y, float x) { return atan2f(y, x); } +float test_atanhf(float x) { return atanhf(x); } +float test_ceilf(float x) { return ceilf(x); } +float test_copysignf(float x, float y) { return copysignf(x, y); } +float test_cosf(float x) { return cosf(x); } +float test_coshf(float x) { return coshf(x); } +float test_expf(float x) { return expf(x); } +float test_expm1f(float x) { return expm1f(x); } +float test_fabsf(float x) { return fabsf(x); } +float test_floorf(float x) { return floorf(x); } +float test_fmodf(float x, float y) { return fmodf(x, y); } +float test_frexpf(float x, int *exp) { return frexpf(x, exp); } +float test_ldexpf(float x, int exp) { return ldexpf(x, exp); } +float test_lgammaf(float x) { return lgammaf(x); } +float test_lgammaf_r(float x, int *signgamp) { return lgammaf_r(x, signgamp); } +float test_log1pf(float x) { return log1pf(x); } +float test_log10f(float x) { return log10f(x); } +float test_logf(float x) { return logf(x); } +float test_modff(float x, float *iptr) { return modff(x, iptr); } +float test_nanf(const char *s) { return nanf(s); } +float test_nearbyintf(float x) { return nearbyintf(x); } +float test_powf(float x, float y) { return powf(x, y); } +float test_roundf(float x) { return roundf(x); } +float test_scalbnf(float x, int exp) { return scalbnf(x, exp); } +float test_sinf(float x) { return sinf(x); } +float test_sinhf(float x) { return sinhf(x); } +float test_sqrtf(float x) { return sqrtf(x); } +float test_tanf(float x) { return tanf(x); } +float test_tanhf(float x) { return tanhf(x); } +float test_truncf(float x) { return truncf(x); } -int test_fpclassify(double x) { - return fpclassify(x); -} -int test_isfinite(double x) { - return isfinite(x); -} -int test_isnormal(double x) { - return isnormal(x); -} -int test_isnan(double x) { - return isnan(x); -} -int test_isinf(double x) { - return isinf(x); -} +int test_fpclassify(double x) { return fpclassify(x); } +int test_signbit(double x) { return signbit(x); } +int test_finite(double x) { return finite(x); } +int test_isfinite(double x) { return isfinite(x); } +int test_isnormal(double x) { return isnormal(x); } +int test_isnan(double x) { return isnan(x); } +int test_isinf(double x) { return isinf(x); } -double test_acos(double x) { - return acos(x); -} -double test_acosh(double x) { - return acosh(x); -} -double test_asin(double x) { - return asin(x); -} -double test_asinh(double x) { - return asinh(x); -} -double test_atan(double x) { - return atan(x); -} -double test_atanh(double x) { - return atanh(x); -} -double test_ceil(double x) { - return ceil(x); -} -double test_copysign(double x, double y) { - return copysign(x, y); -} -double test_cos(double x) { - return cos(x); -} -double test_cosh(double x) { - return cosh(x); -} -double test_exp(double x) { - return exp(x); -} -double test_expm1(double x) { - return expm1(x); -} -double test_fabs(double x) { - return fabs(x); -} -double test_floor(double x) { - return floor(x); -} -double test_lgamma(double x) { - return lgamma(x); -} -double test_lgamma_r(double x, int *signgamp) { - return lgamma_r(x, signgamp); -} -double test_log1p(double x) { - return log1p(x); -} -double test_log10(double x) { - return log10(x); -} -double test_log(double x) { - return log(x); -} -double test_pow(double x, double y) { - return pow(x, y); -} -double test_round(double x) { - return round(x); -} -double test_scalbn(double x, int n) { - return scalbn(x, n); -} -double test_sin(double x) { - return sin(x); -} -double test_sinh(double x) { - return sinh(x); -} -double test_sqrt(double x) { - return sqrt(x); -} -double test_tan(double x) { - return tan(x); -} -double test_tanh(double x) { - return tanh(x); -} +double test_acos(double x) { return acos(x); } +double test_acosh(double x) { return acosh(x); } +double test_asin(double x) { return asin(x); } +double test_asinh(double x) { return asinh(x); } +double test_atan(double x) { return atan(x); } +double test_atan2(double y, double x) { return atan2(y, x); } +double test_atanh(double x) { return atanh(x); } +double test_ceil(double x) { return ceil(x); } +double test_copysign(double x, double y) { return copysign(x, y); } +double test_cos(double x) { return cos(x); } +double test_cosh(double x) { return cosh(x); } +double test_erf(double x) { return erf(x); } +double test_erfc(double x) { return erfc(x); } +double test_exp(double x) { return exp(x); } +double test_expm1(double x) { return expm1(x); } +double test_fabs(double x) { return fabs(x); } +double test_floor(double x) { return floor(x); } +double test_fmod(double x, double y) { return fmod(x, y); } +double test_frexp(double x, int *exp) { return frexp(x, exp); } +double test_ldexp(double x, int exp) { return ldexp(x, exp); } +double test_lgamma(double x) { return lgamma(x); } +double test_lgamma_r(double x, int *signgamp) { return lgamma_r(x, signgamp); } +double test_log(double x) { return log(x); } +double test_log1p(double x) { return log1p(x); } +double test_log10(double x) { return log10(x); } +double test_log2(double x) { return log2(x); } +double test_logb(double x) { return logb(x); } +double test_modf(double x, double *iptr) { return modf(x, iptr); } +double test_nan(const char *s) { return nan(s); } +double test_nearbyint(double x) { return nearbyint(x); } +double test_pow(double x, double y) { return pow(x, y); } +double test_rint(double x) { return rint(x); } +double test_round(double x) { return round(x); } +double test_scalb(double x, double exp) { return scalb(x, exp); } +double test_scalbn(double x, int exp) { return scalbn(x, exp); } +double test_sin(double x) { return sin(x); } +double test_sinh(double x) { return sinh(x); } +double test_sqrt(double x) { return sqrt(x); } +double test_tan(double x) { return tan(x); } +double test_tanh(double x) { return tanh(x); } +double test_tgamma(double x) { return tgamma(x); } +double test_trunc(double x) { return trunc(x); } diff --git a/libaxx/include/cmath b/libaxx/include/cmath index e3c7835e2..6a3e3894e 100644 --- a/libaxx/include/cmath +++ b/libaxx/include/cmath @@ -3,11 +3,13 @@ #include +#undef finite #undef fpclassify #undef isfinite #undef isnormal #undef isnan #undef isinf +#undef signbit #undef acosf #undef acoshf @@ -26,12 +28,15 @@ #undef fmaxf #undef floorf #undef fmodf +#undef frexpf #undef hypotf +#undef ldexpf #undef lgammaf #undef lgammaf_r #undef log1pf #undef log10f #undef logf +#undef modff #undef nanf #undef nearbyintf #undef powf @@ -42,12 +47,14 @@ #undef sqrtf #undef tanf #undef tanhf +#undef truncf #undef acos #undef acosh #undef asin #undef asinh #undef atan +#undef atan2 #undef atanh #undef ceil #undef copysign @@ -61,88 +68,129 @@ #undef fmax #undef floor #undef fmod +#undef frexp #undef hypot +#undef ldexp #undef lgamma #undef lgamma_r +#undef log #undef log1p #undef log10 -#undef log +#undef log2 +#undef logb +#undef modf +#undef nan +#undef nearbyint #undef pow +#undef rint #undef round +#undef scalb #undef scalbn #undef sin #undef sinh #undef sqrt #undef tan #undef tanh +#undef tgamma +#undef trunc namespace std { +inline constexpr int fpclassify(float x) { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x); } +inline constexpr bool isfinite(float x) { return __builtin_isfinite(x); } +inline constexpr bool isinf(float x) { return __builtin_isinf(x); } +inline constexpr bool isnan(float x) { return __builtin_isnan(x); } +inline constexpr bool isnormal(float x) { return __builtin_isnormal(x); } +inline constexpr bool signbit(float x) { return __builtin_signbit(x); } -static inline double acos(double x) { return __builtin_acos(x); } -static inline float acos(float x) { return __builtin_acosf(x); } -static inline double acosh(double x) { return __builtin_acosh(x); } -static inline float acosh(float x) { return __builtin_acoshf(x); } -static inline double asin(double x) { return __builtin_asin(x); } -static inline float asin(float x) { return __builtin_asinf(x); } -static inline double asinh(double x) { return __builtin_asinh(x); } -static inline float asinh(float x) { return __builtin_asinhf(x); } -static inline double atan(double x) { return __builtin_atan(x); } -static inline float atan(float x) { return __builtin_atanf(x); } -static inline double atanh(double x) { return __builtin_atanh(x); } -static inline float atanh(float x) { return __builtin_atanhf(x); } -static inline double ceil(double x) { return __builtin_ceil(x); } -static inline float ceil(float x) { return __builtin_ceilf(x); } -static inline double copysign(double x, double y) { return __builtin_copysign(x, y); } -static inline float copysign(float x, float y) { return __builtin_copysignf(x, y); } -static inline double cos(double x) { return __builtin_cos(x); } -static inline float cos(float x) { return __builtin_cosf(x); } -static inline double cosh(double x) { return __builtin_cosh(x); } -static inline float cosh(float x) { return __builtin_coshf(x); } -static inline double erf(double x) { return __builtin_erf(x); } -static inline double erfc(double x) { return __builtin_erfc(x); } -static inline double exp(double x) { return __builtin_exp(x); } -static inline float exp(float x) { return __builtin_expf(x); } -static inline double fabs(double x) { return __builtin_fabs(x); } -static inline float fabs(float x) { return __builtin_fabsf(x); } -static inline double fmax(double x, double y) { return __builtin_fmax(x, y); } -static inline float fmax(float x, float y) { return __builtin_fmaxf(x, y); } -static inline double floor(double x) { return __builtin_floor(x); } -static inline float floor(float x) { return __builtin_floorf(x); } -static inline double fmod(double x, double y) { return __builtin_fmod(x, y); } -static inline float fmod(float x, float y) { return __builtin_fmodf(x, y); } -static inline int fpclassify(double x) { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x); } -static inline int fpclassify(float x) { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x); } -static inline double hypot(double x, double y) { return __builtin_hypot(x, y); } -static inline float hypotf(float x, float y) { return __builtin_hypotf(x, y); } -static inline bool isfinite(double x) { return __builtin_isfinite(x); } -static inline bool isfinite(float x) { return __builtin_isfinite(x); } -static inline bool isinf(double x) { return __builtin_isinf(x); } -static inline bool isinf(float x) { return __builtin_isinf(x); } -static inline bool isnan(double x) { return __builtin_isnan(x); } -static inline bool isnan(float x) { return __builtin_isnan(x); } -static inline bool isnormal(double x) { return __builtin_isnormal(x); } -static inline bool isnormal(float x) { return __builtin_isnormal(x); } -static inline double lgamma(double x) { return __builtin_lgamma(x); } -static inline float lgamma(float x) { return __builtin_lgammaf(x); } -static inline double log10(double x) { return __builtin_log10(x); } -static inline float log10(float x) { return __builtin_log10f(x); } -static inline double log(double x) { return __builtin_log(x); } -static inline float log(float x) { return __builtin_logf(x); } -static inline double pow(double x, double y) { return __builtin_pow(x, y); } -static inline float pow(float x, float y) { return __builtin_powf(x, y); } -static inline double round(double x) { return __builtin_round(x); } -static inline float round(float x) { return __builtin_roundf(x); } -static inline double sin(double x) { return __builtin_sin(x); } -static inline float sin(float x) { return __builtin_sinf(x); } -static inline double sinh(double x) { return __builtin_sinh(x); } -static inline float sinh(float x) { return __builtin_sinhf(x); } -static inline double sqrt(double x) { return __builtin_sqrt(x); } -static inline float sqrt(float x) { return __builtin_sqrtf(x); } -static inline double tan(double x) { return __builtin_tan(x); } -static inline float tan(float x) { return __builtin_tanf(x); } -static inline double tanh(double x) { return __builtin_tanh(x); } -static inline float tanh(float x) { return __builtin_tanhf(x); } +inline constexpr float acos(float x) { return __builtin_acosf(x); } +inline constexpr float acosh(float x) { return __builtin_acoshf(x); } +inline constexpr float asin(float x) { return __builtin_asinf(x); } +inline constexpr float asinh(float x) { return __builtin_asinhf(x); } +inline constexpr float atan(float x) { return __builtin_atanf(x); } +inline constexpr float atan2(float y, float x) { return __builtin_atan2f(y, x); } +inline constexpr float atanh(float x) { return __builtin_atanhf(x); } +inline constexpr float ceil(float x) { return __builtin_ceilf(x); } +inline constexpr float copysign(float x, float y) { return __builtin_copysignf(x, y); } +inline constexpr float cos(float x) { return __builtin_cosf(x); } +inline constexpr float cosh(float x) { return __builtin_coshf(x); } +inline constexpr float exp(float x) { return __builtin_expf(x); } +inline constexpr float expm1(float x) { return __builtin_expm1f(x); } +inline constexpr float fabs(float x) { return __builtin_fabsf(x); } +inline constexpr float floor(float x) { return __builtin_floorf(x); } +inline constexpr float fmax(float x, float y) { return __builtin_fmaxf(x, y); } +inline constexpr float fmod(float x, float y) { return __builtin_fmodf(x, y); } +inline constexpr float frexp(float x, int *exp) { return __builtin_frexpf(x, exp); } +inline constexpr float ldexp(float x, int exp) { return __builtin_ldexpf(x, exp); } +inline constexpr float lgamma(float x) { return __builtin_lgammaf(x); } +inline constexpr float lgamma_r(float x, int *signgamp) { return __builtin_lgammaf_r(x, signgamp); } +inline constexpr float log1p(float x) { return __builtin_log1pf(x); } +inline constexpr float log10(float x) { return __builtin_log10f(x); } +inline constexpr float log(float x) { return __builtin_logf(x); } +inline constexpr float modf(float x, float *iptr) { return __builtin_modff(x, iptr); } +inline constexpr float nanf(const char *tagp) { return __builtin_nanf(tagp); } +inline constexpr float nearbyint(float x) { return __builtin_nearbyintf(x); } +inline constexpr float pow(float x, float y) { return __builtin_powf(x, y); } +inline constexpr float round(float x) { return __builtin_roundf(x); } +inline constexpr float scalbn(float x, int exp) { return __builtin_scalbnf(x, exp); } +inline constexpr float sin(float x) { return __builtin_sinf(x); } +inline constexpr float sinh(float x) { return __builtin_sinhf(x); } +inline constexpr float sqrt(float x) { return __builtin_sqrtf(x); } +inline constexpr float tan(float x) { return __builtin_tanf(x); } +inline constexpr float tanh(float x) { return __builtin_tanhf(x); } +inline constexpr float trunc(float x) { return __builtin_truncf(x); } + +inline constexpr int fpclassify(double x) { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x); } +inline constexpr bool isfinite(double x) { return __builtin_isfinite(x); } +inline constexpr bool isinf(double x) { return __builtin_isinf(x); } +inline constexpr bool isnan(double x) { return __builtin_isnan(x); } +inline constexpr bool isnormal(double x) { return __builtin_isnormal(x); } +inline constexpr bool signbit(double x) { return __builtin_signbit(x); } + +inline constexpr double acos(double x) { return __builtin_acos(x); } +inline constexpr double acosh(double x) { return __builtin_acosh(x); } +inline constexpr double asin(double x) { return __builtin_asin(x); } +inline constexpr double asinh(double x) { return __builtin_asinh(x); } +inline constexpr double atan(double x) { return __builtin_atan(x); } +inline constexpr double atan2(double y, double x) { return __builtin_atan2(y, x); } +inline constexpr double atanh(double x) { return __builtin_atanh(x); } +inline constexpr double ceil(double x) { return __builtin_ceil(x); } +inline constexpr double copysign(double x, double y) { return __builtin_copysign(x, y); } +inline constexpr double cos(double x) { return __builtin_cos(x); } +inline constexpr double cosh(double x) { return __builtin_cosh(x); } +inline constexpr double erf(double x) { return __builtin_erf(x); } +inline constexpr double erfc(double x) { return __builtin_erfc(x); } +inline constexpr double exp(double x) { return __builtin_exp(x); } +inline constexpr double expm1(double x) { return __builtin_expm1(x); } +inline constexpr double fabs(double x) { return __builtin_fabs(x); } +inline constexpr double floor(double x) { return __builtin_floor(x); } +inline constexpr double fmax(double x, double y) { return __builtin_fmax(x, y); } +inline constexpr double fmod(double x, double y) { return __builtin_fmod(x, y); } +inline constexpr double frexp(double x, int *exp) { return __builtin_frexp(x, exp); } +inline constexpr double hypot(double x, double y) { return __builtin_hypot(x, y); } +inline constexpr double ldexp(double x, int exp) { return __builtin_scalbn(x, exp); } +inline constexpr double lgamma(double x) { return __builtin_lgamma(x); } +inline constexpr double lgamma_r(double x, int *signgamp) { return __builtin_lgamma_r(x, signgamp); } +inline constexpr double log(double x) { return __builtin_log(x); } +inline constexpr double log1p(double x) { return __builtin_log1p(x); } +inline constexpr double log10(double x) { return __builtin_log10(x); } +inline constexpr double log2(double x) { return __builtin_log2(x); } +inline constexpr double logb(double x) { return __builtin_logb(x); } +inline constexpr double modf(double x, double *iptr) { return __builtin_modf(x, iptr); } +inline constexpr double nan(const char *tagp) { return __builtin_nan(tagp); } +inline constexpr double nearbyint(double x) { return __builtin_nearbyint(x); } +inline constexpr double pow(double x, double y) { return __builtin_pow(x, y); } +inline constexpr double rint(double x) { return __builtin_rint(x); } +inline constexpr double round(double x) { return __builtin_round(x); } +inline constexpr double scalb(double x, double exp) { return __builtin_scalb(x, exp); } +inline constexpr double scalbn(double x, int exp) { return __builtin_scalbn(x, exp); } +inline constexpr double sin(double x) { return __builtin_sin(x); } +inline constexpr double sinh(double x) { return __builtin_sinh(x); } +inline constexpr double sqrt(double x) { return __builtin_sqrt(x); } +inline constexpr double tan(double x) { return __builtin_tan(x); } +inline constexpr double tanh(double x) { return __builtin_tanh(x); } +inline constexpr double tgamma(double x) { return __builtin_tgamma(x); } +inline constexpr double trunc(double x) { return __builtin_trunc(x); } }