The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* |
| 2 | * ==================================================== |
| 3 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
| 4 | * |
| 5 | * Developed at SunPro, a Sun Microsystems, Inc. business. |
| 6 | * Permission to use, copy, modify, and distribute this |
| 7 | * software is freely granted, provided that this notice |
| 8 | * is preserved. |
| 9 | * ==================================================== |
| 10 | */ |
| 11 | |
| 12 | /* |
| 13 | * from: @(#)fdlibm.h 5.1 93/09/24 |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 14 | * $FreeBSD$ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #ifndef _MATH_H_ |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 18 | #define _MATH_H_ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 19 | |
| 20 | #include <sys/cdefs.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 21 | #include <limits.h> |
| 22 | |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 23 | __BEGIN_DECLS |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 24 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 25 | #define HUGE_VAL __builtin_huge_val() |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 26 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 27 | #define FP_ILOGB0 (-INT_MAX) |
| 28 | #define FP_ILOGBNAN INT_MAX |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 29 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 30 | #define HUGE_VALF __builtin_huge_valf() |
| 31 | #define HUGE_VALL __builtin_huge_vall() |
| 32 | #define INFINITY __builtin_inff() |
| 33 | #define NAN __builtin_nanf("") |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 34 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 35 | #define MATH_ERRNO 1 |
| 36 | #define MATH_ERREXCEPT 2 |
| 37 | #define math_errhandling MATH_ERREXCEPT |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 38 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 39 | #if defined(__FP_FAST_FMA) |
| 40 | #define FP_FAST_FMA 1 |
| 41 | #endif |
| 42 | #if defined(__FP_FAST_FMAF) |
| 43 | #define FP_FAST_FMAF 1 |
| 44 | #endif |
| 45 | #if defined(__FP_FAST_FMAL) |
| 46 | #define FP_FAST_FMAL 1 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 47 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 48 | |
| 49 | /* Symbolic constants to classify floating point numbers. */ |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 50 | #define FP_INFINITE 0x01 |
| 51 | #define FP_NAN 0x02 |
| 52 | #define FP_NORMAL 0x04 |
| 53 | #define FP_SUBNORMAL 0x08 |
| 54 | #define FP_ZERO 0x10 |
| 55 | #define fpclassify(x) \ |
| 56 | __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 57 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 58 | #define isfinite(x) __builtin_isfinite(x) |
| 59 | #define isinf(x) __builtin_isinf(x) |
| 60 | #define isnan(x) __builtin_isnan(x) |
| 61 | #define isnormal(x) __builtin_isnormal(x) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 62 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 63 | #define isgreater(x, y) __builtin_isgreater((x), (y)) |
| 64 | #define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) |
| 65 | #define isless(x, y) __builtin_isless((x), (y)) |
| 66 | #define islessequal(x, y) __builtin_islessequal((x), (y)) |
| 67 | #define islessgreater(x, y) __builtin_islessgreater((x), (y)) |
| 68 | #define isunordered(x, y) __builtin_isunordered((x), (y)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 69 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 70 | #define signbit(x) \ |
| 71 | ((sizeof(x) == sizeof(float)) ? __builtin_signbitf(x) \ |
| 72 | : (sizeof(x) == sizeof(double)) ? __builtin_signbit(x) \ |
| 73 | : __builtin_signbitl(x)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 74 | |
Elliott Hughes | 9f87a0b | 2014-02-07 14:55:58 -0800 | [diff] [blame] | 75 | typedef double __double_t; |
| 76 | typedef __double_t double_t; |
| 77 | typedef float __float_t; |
| 78 | typedef __float_t float_t; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 79 | |
Elliott Hughes | 3ba55f8 | 2016-06-08 18:11:23 -0700 | [diff] [blame] | 80 | #if defined(__USE_BSD) |
| 81 | #define HUGE MAXFLOAT |
Elliott Hughes | 9ee6adb | 2016-03-11 14:49:13 -0800 | [diff] [blame] | 82 | #endif |
| 83 | |
Elliott Hughes | c1929e4 | 2016-08-12 16:18:03 -0700 | [diff] [blame] | 84 | extern int signgam; |
| 85 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 86 | /* |
| 87 | * Most of these functions depend on the rounding mode and have the side |
| 88 | * effect of raising floating-point exceptions, so they are not declared |
Elliott Hughes | 95fa061 | 2016-09-28 12:29:52 -0700 | [diff] [blame] | 89 | * as __attribute_const__. In C99, FENV_ACCESS affects the purity of these functions. |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 90 | */ |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 91 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 92 | int __fpclassifyd(double __x) __attribute_const__; |
| 93 | int __fpclassifyf(float __x) __attribute_const__; |
| 94 | int __fpclassifyl(long double __x) __attribute_const__; |
| 95 | int __isfinitef(float __x) __attribute_const__; |
| 96 | int __isfinite(double __x) __attribute_const__; |
| 97 | int __isfinitel(long double __x) __attribute_const__; |
| 98 | int __isinff(float __x) __attribute_const__; |
| 99 | int __isinfl(long double __x) __attribute_const__; |
| 100 | int __isnanf(float __x) __attribute_const__ __INTRODUCED_IN(21); |
| 101 | int __isnanl(long double __x) __attribute_const__; |
| 102 | int __isnormalf(float __x) __attribute_const__; |
| 103 | int __isnormal(double __x) __attribute_const__; |
| 104 | int __isnormall(long double __x) __attribute_const__; |
| 105 | int __signbit(double __x) __attribute_const__; |
| 106 | int __signbitf(float __x) __attribute_const__; |
| 107 | int __signbitl(long double __x) __attribute_const__; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 108 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 109 | double acos(double __x); |
| 110 | double asin(double __x); |
| 111 | double atan(double __x); |
| 112 | double atan2(double __y, double __x); |
| 113 | double cos(double __x); |
| 114 | double sin(double __x); |
| 115 | double tan(double __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 116 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 117 | double cosh(double __x); |
| 118 | double sinh(double __x); |
| 119 | double tanh(double __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 120 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 121 | double exp(double __x); |
| 122 | double frexp(double __x, int* __exponent); /* fundamentally !__attribute_const__ */ |
| 123 | double ldexp(double __x, int __exponent); |
| 124 | double log(double __x); |
| 125 | double log10(double __x); |
| 126 | double modf(double __x, double* __integral_part); /* fundamentally !__attribute_const__ */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 127 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 128 | double pow(double __x, double __y); |
| 129 | double sqrt(double __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 130 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 131 | double ceil(double __x); |
| 132 | double fabs(double __x) __attribute_const__; |
| 133 | double floor(double __x); |
| 134 | double fmod(double __x, double __y); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 135 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 136 | double acosh(double __x); |
| 137 | double asinh(double __x); |
| 138 | double atanh(double __x); |
| 139 | double cbrt(double __x); |
| 140 | double erf(double __x); |
| 141 | double erfc(double __x); |
| 142 | double exp2(double __x); |
| 143 | double expm1(double __x); |
| 144 | double fma(double __x, double __y, double __z); |
| 145 | double hypot(double __x, double __y); |
| 146 | int ilogb(double __x) __attribute_const__; |
| 147 | double lgamma(double __x); |
| 148 | long long llrint(double __x); |
| 149 | long long llround(double __x); |
| 150 | double log1p(double __x); |
| 151 | double log2(double __x) __INTRODUCED_IN(18); |
| 152 | double logb(double __x); |
| 153 | long lrint(double __x); |
| 154 | long lround(double __x); |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 155 | |
Dan Albert | 284c8f1 | 2017-03-30 16:34:27 -0700 | [diff] [blame] | 156 | /* |
| 157 | * https://code.google.com/p/android/issues/detail?id=271629 |
| 158 | * To be fully compliant with C++, we need to not define these (C doesn't |
| 159 | * specify them either). Exposing these means that isinf and isnan will have a |
| 160 | * return type of int in C++ rather than bool like they're supposed to be. |
| 161 | * |
| 162 | * GNU libstdc++ 4.9 isn't able to handle a standard compliant C library. Its |
| 163 | * <cmath> will `#undef isnan` from math.h and only adds the function overloads |
| 164 | * to the std namespace, making it impossible to use both <cmath> (which gets |
| 165 | * included by a lot of other standard headers) and ::isnan. |
| 166 | */ |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 167 | int (isinf)(double __x) __attribute_const__ __INTRODUCED_IN(21); |
| 168 | int (isnan)(double __x) __attribute_const__; |
Dan Albert | 284c8f1 | 2017-03-30 16:34:27 -0700 | [diff] [blame] | 169 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 170 | double nan(const char* __kind) __attribute_const__ __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(13) |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 171 | __INTRODUCED_IN_X86(9); |
| 172 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 173 | double nextafter(double __x, double __y); |
| 174 | double remainder(double __x, double __y); |
| 175 | double remquo(double __x, double __y, int* __quotient_bits); |
| 176 | double rint(double __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 177 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 178 | double copysign(double __value, double __sign) __attribute_const__; |
| 179 | double fdim(double __x, double __y); |
| 180 | double fmax(double __x, double __y) __attribute_const__; |
| 181 | double fmin(double __x, double __y) __attribute_const__; |
| 182 | double nearbyint(double __x); |
| 183 | double round(double __x); |
| 184 | double scalbln(double __x, long __exponent) __INTRODUCED_IN_X86(18) __VERSIONER_NO_GUARD; |
| 185 | double scalbn(double __x, int __exponent); |
| 186 | double tgamma(double __x); |
| 187 | double trunc(double __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 188 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 189 | float acosf(float __x); |
| 190 | float asinf(float __x); |
| 191 | float atanf(float __x); |
| 192 | float atan2f(float __y, float __x); |
| 193 | float cosf(float __x); |
| 194 | float sinf(float __x); |
| 195 | float tanf(float __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 196 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 197 | float coshf(float __x); |
| 198 | float sinhf(float __x); |
| 199 | float tanhf(float __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 200 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 201 | float exp2f(float __x); |
| 202 | float expf(float __x); |
| 203 | float expm1f(float __x); |
| 204 | float frexpf(float __x, int* __exponent); /* fundamentally !__attribute_const__ */ |
| 205 | int ilogbf(float __x) __attribute_const__; |
| 206 | float ldexpf(float __x, int __exponent); |
| 207 | float log10f(float __x); |
| 208 | float log1pf(float __x); |
| 209 | float log2f(float __x) __INTRODUCED_IN(18); |
| 210 | float logf(float __x); |
| 211 | float modff(float __x, float* __integral_part); /* fundamentally !__attribute_const__ */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 212 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 213 | float powf(float __x, float __y); |
| 214 | float sqrtf(float __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 215 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 216 | float ceilf(float __x); |
| 217 | float fabsf(float __x) __attribute_const__; |
| 218 | float floorf(float __x); |
| 219 | float fmodf(float __x, float __y); |
| 220 | float roundf(float __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 221 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 222 | float erff(float __x); |
| 223 | float erfcf(float __x); |
| 224 | float hypotf(float __x, float __y); |
| 225 | float lgammaf(float __x); |
| 226 | float tgammaf(float __x) __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(13) __INTRODUCED_IN_X86(9); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 227 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 228 | float acoshf(float __x); |
| 229 | float asinhf(float __x); |
| 230 | float atanhf(float __x); |
| 231 | float cbrtf(float __x); |
| 232 | float logbf(float __x); |
| 233 | float copysignf(float __value, float __sign) __attribute_const__; |
| 234 | long long llrintf(float __x); |
| 235 | long long llroundf(float __x); |
| 236 | long lrintf(float __x); |
| 237 | long lroundf(float __x); |
| 238 | float nanf(const char* __kind) __attribute_const__ __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(13) |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 239 | __INTRODUCED_IN_X86(9); |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 240 | float nearbyintf(float __x); |
| 241 | float nextafterf(float __x, float __y); |
| 242 | float remainderf(float __x, float __y); |
| 243 | float remquof(float __x, float __y, int* __quotient_bits); |
| 244 | float rintf(float __x); |
| 245 | float scalblnf(float __x, long __exponent) __INTRODUCED_IN_X86(18) __VERSIONER_NO_GUARD; |
| 246 | float scalbnf(float __x, int __exponent); |
| 247 | float truncf(float __x); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 248 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 249 | float fdimf(float __x, float __y); |
| 250 | float fmaf(float __x, float __y, float __z); |
| 251 | float fmaxf(float __x, float __y) __attribute_const__; |
| 252 | float fminf(float __x, float __y) __attribute_const__; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 253 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 254 | long double acoshl(long double __x) __INTRODUCED_IN(21); |
| 255 | long double acosl(long double __x) __INTRODUCED_IN(21); |
| 256 | long double asinhl(long double __x) __INTRODUCED_IN(21); |
| 257 | long double asinl(long double __x) __INTRODUCED_IN(21); |
| 258 | long double atan2l(long double __y, long double __x) __INTRODUCED_IN(21); |
| 259 | long double atanhl(long double __x) __INTRODUCED_IN(21); |
| 260 | long double atanl(long double __x) __INTRODUCED_IN(21); |
| 261 | long double cbrtl(long double __x) __INTRODUCED_IN(21); |
| 262 | long double ceill(long double __x); |
| 263 | long double copysignl(long double __value, long double __sign) __attribute_const__; |
| 264 | long double coshl(long double __x) __INTRODUCED_IN(21); |
| 265 | long double cosl(long double __x) __INTRODUCED_IN(21); |
| 266 | long double erfcl(long double __x) __INTRODUCED_IN(21); |
| 267 | long double erfl(long double __x) __INTRODUCED_IN(21); |
| 268 | long double exp2l(long double __x) __INTRODUCED_IN(21); |
| 269 | long double expl(long double __x) __INTRODUCED_IN(21); |
| 270 | long double expm1l(long double __x) __INTRODUCED_IN(21); |
| 271 | long double fabsl(long double __x) __attribute_const__; |
| 272 | long double fdiml(long double __x, long double __y); |
| 273 | long double floorl(long double __x); |
| 274 | long double fmal(long double __x, long double __y, long double __z) __INTRODUCED_IN(21) __VERSIONER_NO_GUARD; |
| 275 | long double fmaxl(long double __x, long double __y) __attribute_const__; |
| 276 | long double fminl(long double __x, long double __y) __attribute_const__; |
| 277 | long double fmodl(long double __x, long double __y) __INTRODUCED_IN(21); |
| 278 | long double frexpl(long double __x, int* __exponent) |
Elliott Hughes | 95fa061 | 2016-09-28 12:29:52 -0700 | [diff] [blame] | 279 | __INTRODUCED_IN(21) __VERSIONER_NO_GUARD; /* fundamentally !__attribute_const__ */ |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 280 | long double hypotl(long double __x, long double __y) __INTRODUCED_IN(21); |
| 281 | int ilogbl(long double __x) __attribute_const__; |
| 282 | long double ldexpl(long double __x, int __exponent); |
| 283 | long double lgammal(long double __x) __INTRODUCED_IN(21); |
| 284 | long long llrintl(long double __x) __INTRODUCED_IN(21); |
| 285 | long long llroundl(long double __x); |
| 286 | long double log10l(long double __x) __INTRODUCED_IN(21); |
| 287 | long double log1pl(long double __x) __INTRODUCED_IN(21); |
| 288 | long double log2l(long double __x) __INTRODUCED_IN(18); |
| 289 | long double logbl(long double __x) __INTRODUCED_IN(18); |
| 290 | long double logl(long double __x) __INTRODUCED_IN(21); |
| 291 | long lrintl(long double __x) __INTRODUCED_IN(21); |
| 292 | long lroundl(long double __x); |
| 293 | long double modfl(long double __x, long double* __integral_part) __INTRODUCED_IN(21); /* fundamentally !__attribute_const__ */ |
| 294 | long double nanl(const char* __kind) __attribute_const__ __INTRODUCED_IN(13); |
| 295 | long double nearbyintl(long double __x) __INTRODUCED_IN(21); |
| 296 | long double nextafterl(long double __x, long double __y) __INTRODUCED_IN(21) __VERSIONER_NO_GUARD; |
| 297 | double nexttoward(double __x, long double __y) __INTRODUCED_IN(18) __VERSIONER_NO_GUARD; |
| 298 | float nexttowardf(float __x, long double __y); |
| 299 | long double nexttowardl(long double __x, long double __y) __INTRODUCED_IN(18) __VERSIONER_NO_GUARD; |
| 300 | long double powl(long double __x, long double __y) __INTRODUCED_IN(21); |
| 301 | long double remainderl(long double __x, long double __y) __INTRODUCED_IN(21); |
| 302 | long double remquol(long double __x, long double __y, int* __quotient_bits) __INTRODUCED_IN(21); |
| 303 | long double rintl(long double __x) __INTRODUCED_IN(21); |
| 304 | long double roundl(long double __x); |
| 305 | long double scalblnl(long double __x, long __exponent) __INTRODUCED_IN_X86(18) __VERSIONER_NO_GUARD; |
| 306 | long double scalbnl(long double __x, int __exponent); |
| 307 | long double sinhl(long double __x) __INTRODUCED_IN(21); |
| 308 | long double sinl(long double __x) __INTRODUCED_IN(21); |
| 309 | long double sqrtl(long double __x) __INTRODUCED_IN(21); |
| 310 | long double tanhl(long double __x) __INTRODUCED_IN(21); |
| 311 | long double tanl(long double __x) __INTRODUCED_IN(21); |
| 312 | long double tgammal(long double __x) __INTRODUCED_IN(21); |
| 313 | long double truncl(long double __x); |
Elliott Hughes | b4f2f28 | 2014-05-08 21:19:12 -0700 | [diff] [blame] | 314 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 315 | double j0(double __x); |
| 316 | double j1(double __x); |
| 317 | double jn(int __n, double __x); |
| 318 | double y0(double __x); |
| 319 | double y1(double __x); |
| 320 | double yn(int __n, double __x); |
Elliott Hughes | c1929e4 | 2016-08-12 16:18:03 -0700 | [diff] [blame] | 321 | |
Elliott Hughes | 3ba55f8 | 2016-06-08 18:11:23 -0700 | [diff] [blame] | 322 | #define M_E 2.7182818284590452354 /* e */ |
| 323 | #define M_LOG2E 1.4426950408889634074 /* log 2e */ |
| 324 | #define M_LOG10E 0.43429448190325182765 /* log 10e */ |
| 325 | #define M_LN2 0.69314718055994530942 /* log e2 */ |
| 326 | #define M_LN10 2.30258509299404568402 /* log e10 */ |
| 327 | #define M_PI 3.14159265358979323846 /* pi */ |
| 328 | #define M_PI_2 1.57079632679489661923 /* pi/2 */ |
| 329 | #define M_PI_4 0.78539816339744830962 /* pi/4 */ |
| 330 | #define M_1_PI 0.31830988618379067154 /* 1/pi */ |
| 331 | #define M_2_PI 0.63661977236758134308 /* 2/pi */ |
| 332 | #define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ |
| 333 | #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ |
| 334 | #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ |
Elliott Hughes | 9c8d711 | 2016-06-13 13:23:42 -0700 | [diff] [blame] | 335 | |
Elliott Hughes | 3ba55f8 | 2016-06-08 18:11:23 -0700 | [diff] [blame] | 336 | #define MAXFLOAT ((float)3.40282346638528860e+38) |
Elliott Hughes | 9c8d711 | 2016-06-13 13:23:42 -0700 | [diff] [blame] | 337 | |
| 338 | #if defined(__USE_BSD) || defined(__USE_GNU) |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 339 | double gamma(double __x); |
| 340 | double scalb(double __x, double __exponent); |
| 341 | double drem(double __x, double __y); |
| 342 | int finite(double __x) __attribute_const__; |
| 343 | int isnanf(float __x) __attribute_const__; |
| 344 | double gamma_r(double __x, int* __sign); |
| 345 | double lgamma_r(double __x, int* __sign); |
| 346 | double significand(double __x); |
| 347 | long double lgammal_r(long double __x, int* __sign) __INTRODUCED_IN(23); |
| 348 | long double significandl(long double __x) __INTRODUCED_IN(21); |
| 349 | float dremf(float __x, float __y); |
| 350 | int finitef(float __x) __attribute_const__; |
| 351 | float gammaf(float __x); |
| 352 | float j0f(float __x); |
| 353 | float j1f(float __x); |
| 354 | float jnf(int __n, float __x); |
| 355 | float scalbf(float __x, float __exponent); |
| 356 | float y0f(float __x); |
| 357 | float y1f(float __x); |
| 358 | float ynf(int __n, float __x); |
| 359 | float gammaf_r(float __x, int* __sign); |
| 360 | float lgammaf_r(float __x, int* __sign); |
| 361 | float significandf(float __x); |
Elliott Hughes | 7553185 | 2014-09-18 11:23:58 -0700 | [diff] [blame] | 362 | #endif |
| 363 | |
Elliott Hughes | 5f5cc45 | 2014-08-18 16:04:03 -0700 | [diff] [blame] | 364 | #if defined(__USE_GNU) |
Elliott Hughes | 3ba55f8 | 2016-06-08 18:11:23 -0700 | [diff] [blame] | 365 | #define M_El 2.718281828459045235360287471352662498L /* e */ |
| 366 | #define M_LOG2El 1.442695040888963407359924681001892137L /* log 2e */ |
| 367 | #define M_LOG10El 0.434294481903251827651128918916605082L /* log 10e */ |
| 368 | #define M_LN2l 0.693147180559945309417232121458176568L /* log e2 */ |
| 369 | #define M_LN10l 2.302585092994045684017991454684364208L /* log e10 */ |
| 370 | #define M_PIl 3.141592653589793238462643383279502884L /* pi */ |
| 371 | #define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ |
| 372 | #define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ |
| 373 | #define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ |
| 374 | #define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ |
| 375 | #define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ |
| 376 | #define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ |
| 377 | #define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 378 | void sincos(double __x, double* __sin, double* __cos); |
| 379 | void sincosf(float __x, float* __sin, float* __cos); |
| 380 | void sincosl(long double __x, long double* __sin, long double* __cos); |
Elliott Hughes | 3ba55f8 | 2016-06-08 18:11:23 -0700 | [diff] [blame] | 381 | #endif |
Elliott Hughes | b4f2f28 | 2014-05-08 21:19:12 -0700 | [diff] [blame] | 382 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 383 | __END_DECLS |
| 384 | |
Elliott Hughes | 684c31a | 2017-08-18 15:07:41 -0700 | [diff] [blame^] | 385 | #endif |