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 | f9f4a43 | 2015-08-24 22:57:08 +0000 | [diff] [blame] | 23 | #if !defined(__BIONIC_NO_MATH_INLINES) |
| 24 | #define __BIONIC_MATH_INLINE(__def) extern __inline__ __always_inline __attribute__((gnu_inline)) __attribute__((__artificial__)) __def |
| 25 | #else |
| 26 | #define __BIONIC_MATH_INLINE(__def) |
| 27 | #endif |
| 28 | |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 29 | __BEGIN_DECLS |
| 30 | #pragma GCC visibility push(default) |
| 31 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 32 | #define HUGE_VAL __builtin_huge_val() |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 33 | |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 34 | #if __ISO_C_VISIBLE >= 1999 |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 35 | #define FP_ILOGB0 (-INT_MAX) |
| 36 | #define FP_ILOGBNAN INT_MAX |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 37 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 38 | #define HUGE_VALF __builtin_huge_valf() |
| 39 | #define HUGE_VALL __builtin_huge_vall() |
| 40 | #define INFINITY __builtin_inff() |
| 41 | #define NAN __builtin_nanf("") |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 42 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 43 | #define MATH_ERRNO 1 |
| 44 | #define MATH_ERREXCEPT 2 |
| 45 | #define math_errhandling MATH_ERREXCEPT |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 46 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 47 | #if defined(__FP_FAST_FMA) |
| 48 | #define FP_FAST_FMA 1 |
| 49 | #endif |
| 50 | #if defined(__FP_FAST_FMAF) |
| 51 | #define FP_FAST_FMAF 1 |
| 52 | #endif |
| 53 | #if defined(__FP_FAST_FMAL) |
| 54 | #define FP_FAST_FMAL 1 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 55 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 56 | |
| 57 | /* Symbolic constants to classify floating point numbers. */ |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 58 | #define FP_INFINITE 0x01 |
| 59 | #define FP_NAN 0x02 |
| 60 | #define FP_NORMAL 0x04 |
| 61 | #define FP_SUBNORMAL 0x08 |
| 62 | #define FP_ZERO 0x10 |
| 63 | #define fpclassify(x) \ |
| 64 | __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] | 65 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 66 | #define isfinite(x) __builtin_isfinite(x) |
| 67 | #define isinf(x) __builtin_isinf(x) |
| 68 | #define isnan(x) __builtin_isnan(x) |
| 69 | #define isnormal(x) __builtin_isnormal(x) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 70 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 71 | #define isgreater(x, y) __builtin_isgreater((x), (y)) |
| 72 | #define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) |
| 73 | #define isless(x, y) __builtin_isless((x), (y)) |
| 74 | #define islessequal(x, y) __builtin_islessequal((x), (y)) |
| 75 | #define islessgreater(x, y) __builtin_islessgreater((x), (y)) |
| 76 | #define isunordered(x, y) __builtin_isunordered((x), (y)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 77 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 78 | #define signbit(x) \ |
| 79 | ((sizeof(x) == sizeof(float)) ? __builtin_signbitf(x) \ |
| 80 | : (sizeof(x) == sizeof(double)) ? __builtin_signbit(x) \ |
| 81 | : __builtin_signbitl(x)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 82 | |
Elliott Hughes | 9f87a0b | 2014-02-07 14:55:58 -0800 | [diff] [blame] | 83 | typedef double __double_t; |
| 84 | typedef __double_t double_t; |
| 85 | typedef float __float_t; |
| 86 | typedef __float_t float_t; |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 87 | #endif /* __ISO_C_VISIBLE >= 1999 */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 88 | |
| 89 | /* |
| 90 | * XOPEN/SVID |
| 91 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 92 | #if __BSD_VISIBLE || __XSI_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 93 | #define M_E 2.7182818284590452354 /* e */ |
| 94 | #define M_LOG2E 1.4426950408889634074 /* log 2e */ |
| 95 | #define M_LOG10E 0.43429448190325182765 /* log 10e */ |
| 96 | #define M_LN2 0.69314718055994530942 /* log e2 */ |
| 97 | #define M_LN10 2.30258509299404568402 /* log e10 */ |
| 98 | #define M_PI 3.14159265358979323846 /* pi */ |
| 99 | #define M_PI_2 1.57079632679489661923 /* pi/2 */ |
| 100 | #define M_PI_4 0.78539816339744830962 /* pi/4 */ |
| 101 | #define M_1_PI 0.31830988618379067154 /* 1/pi */ |
| 102 | #define M_2_PI 0.63661977236758134308 /* 2/pi */ |
| 103 | #define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ |
| 104 | #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ |
| 105 | #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ |
| 106 | |
| 107 | #define MAXFLOAT ((float)3.40282346638528860e+38) |
| 108 | extern int signgam; |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 109 | #endif /* __BSD_VISIBLE || __XSI_VISIBLE */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 110 | |
| 111 | #if __BSD_VISIBLE |
| 112 | #if 0 |
| 113 | /* Old value from 4.4BSD-Lite math.h; this is probably better. */ |
| 114 | #define HUGE HUGE_VAL |
| 115 | #else |
| 116 | #define HUGE MAXFLOAT |
| 117 | #endif |
| 118 | #endif /* __BSD_VISIBLE */ |
| 119 | |
| 120 | /* |
| 121 | * Most of these functions depend on the rounding mode and have the side |
| 122 | * effect of raising floating-point exceptions, so they are not declared |
| 123 | * as __pure2. In C99, FENV_ACCESS affects the purity of these functions. |
| 124 | */ |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 125 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 126 | /* |
| 127 | * ANSI/POSIX |
| 128 | */ |
| 129 | int __fpclassifyd(double) __pure2; |
| 130 | int __fpclassifyf(float) __pure2; |
| 131 | int __fpclassifyl(long double) __pure2; |
| 132 | int __isfinitef(float) __pure2; |
| 133 | int __isfinite(double) __pure2; |
| 134 | int __isfinitel(long double) __pure2; |
| 135 | int __isinff(float) __pure2; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 136 | int __isinfl(long double) __pure2; |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 137 | int __isnanf(float) __pure2; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 138 | int __isnanl(long double) __pure2; |
| 139 | int __isnormalf(float) __pure2; |
| 140 | int __isnormal(double) __pure2; |
| 141 | int __isnormall(long double) __pure2; |
| 142 | int __signbit(double) __pure2; |
| 143 | int __signbitf(float) __pure2; |
| 144 | int __signbitl(long double) __pure2; |
| 145 | |
| 146 | double acos(double); |
| 147 | double asin(double); |
| 148 | double atan(double); |
| 149 | double atan2(double, double); |
| 150 | double cos(double); |
| 151 | double sin(double); |
| 152 | double tan(double); |
| 153 | |
| 154 | double cosh(double); |
| 155 | double sinh(double); |
| 156 | double tanh(double); |
| 157 | |
| 158 | double exp(double); |
| 159 | double frexp(double, int *); /* fundamentally !__pure2 */ |
| 160 | double ldexp(double, int); |
| 161 | double log(double); |
| 162 | double log10(double); |
| 163 | double modf(double, double *); /* fundamentally !__pure2 */ |
| 164 | |
| 165 | double pow(double, double); |
| 166 | double sqrt(double); |
| 167 | |
| 168 | double ceil(double); |
| 169 | double fabs(double) __pure2; |
Elliott Hughes | f9f4a43 | 2015-08-24 22:57:08 +0000 | [diff] [blame] | 170 | __BIONIC_MATH_INLINE(double fabs(double x) { return __builtin_fabs(x); }) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 171 | double floor(double); |
| 172 | double fmod(double, double); |
| 173 | |
| 174 | /* |
| 175 | * These functions are not in C90. |
| 176 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 177 | #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 178 | double acosh(double); |
| 179 | double asinh(double); |
| 180 | double atanh(double); |
| 181 | double cbrt(double); |
| 182 | double erf(double); |
| 183 | double erfc(double); |
| 184 | double exp2(double); |
| 185 | double expm1(double); |
| 186 | double fma(double, double, double); |
| 187 | double hypot(double, double); |
| 188 | int ilogb(double) __pure2; |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 189 | int (isinf)(double) __pure2; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 190 | int (isnan)(double) __pure2; |
| 191 | double lgamma(double); |
| 192 | long long llrint(double); |
| 193 | long long llround(double); |
| 194 | double log1p(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 195 | double log2(double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 196 | double logb(double); |
| 197 | long lrint(double); |
| 198 | long lround(double); |
David 'Digit' Turner | 8e2ff16 | 2011-01-25 17:05:50 +0100 | [diff] [blame] | 199 | double nan(const char *) __pure2; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 200 | double nextafter(double, double); |
| 201 | double remainder(double, double); |
| 202 | double remquo(double, double, int *); |
| 203 | double rint(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 204 | #endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 205 | |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 206 | #if __BSD_VISIBLE || __XSI_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 207 | double j0(double); |
| 208 | double j1(double); |
| 209 | double jn(int, double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 210 | double y0(double); |
| 211 | double y1(double); |
| 212 | double yn(int, double); |
| 213 | |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 214 | #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 215 | double gamma(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 216 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 217 | |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 218 | #if __XSI_VISIBLE <= 600 || __BSD_VISIBLE |
| 219 | double scalb(double, double); |
| 220 | #endif |
| 221 | #endif /* __BSD_VISIBLE || __XSI_VISIBLE */ |
| 222 | |
| 223 | #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 224 | double copysign(double, double) __pure2; |
| 225 | double fdim(double, double); |
| 226 | double fmax(double, double) __pure2; |
| 227 | double fmin(double, double) __pure2; |
| 228 | double nearbyint(double); |
| 229 | double round(double); |
| 230 | double scalbln(double, long); |
| 231 | double scalbn(double, int); |
| 232 | double tgamma(double); |
| 233 | double trunc(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 234 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 235 | |
| 236 | /* |
| 237 | * BSD math library entry points |
| 238 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 239 | #if __BSD_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 240 | double drem(double, double); |
| 241 | int finite(double) __pure2; |
| 242 | int isnanf(float) __pure2; |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 243 | long double significandl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 244 | |
| 245 | /* |
| 246 | * Reentrant version of gamma & lgamma; passes signgam back by reference |
| 247 | * as the second argument; user must allocate space for signgam. |
| 248 | */ |
| 249 | double gamma_r(double, int *); |
| 250 | double lgamma_r(double, int *); |
| 251 | |
| 252 | /* |
| 253 | * IEEE Test Vector |
| 254 | */ |
| 255 | double significand(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 256 | #endif /* __BSD_VISIBLE */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 257 | |
| 258 | /* float versions of ANSI/POSIX functions */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 259 | #if __ISO_C_VISIBLE >= 1999 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 260 | float acosf(float); |
| 261 | float asinf(float); |
| 262 | float atanf(float); |
| 263 | float atan2f(float, float); |
| 264 | float cosf(float); |
| 265 | float sinf(float); |
| 266 | float tanf(float); |
| 267 | |
| 268 | float coshf(float); |
| 269 | float sinhf(float); |
| 270 | float tanhf(float); |
| 271 | |
| 272 | float exp2f(float); |
| 273 | float expf(float); |
| 274 | float expm1f(float); |
| 275 | float frexpf(float, int *); /* fundamentally !__pure2 */ |
| 276 | int ilogbf(float) __pure2; |
| 277 | float ldexpf(float, int); |
| 278 | float log10f(float); |
| 279 | float log1pf(float); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 280 | float log2f(float); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 281 | float logf(float); |
| 282 | float modff(float, float *); /* fundamentally !__pure2 */ |
| 283 | |
| 284 | float powf(float, float); |
| 285 | float sqrtf(float); |
| 286 | |
| 287 | float ceilf(float); |
| 288 | float fabsf(float) __pure2; |
Elliott Hughes | f9f4a43 | 2015-08-24 22:57:08 +0000 | [diff] [blame] | 289 | __BIONIC_MATH_INLINE(float fabsf(float x) { return __builtin_fabsf(x); }) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 290 | float floorf(float); |
| 291 | float fmodf(float, float); |
| 292 | float roundf(float); |
| 293 | |
| 294 | float erff(float); |
| 295 | float erfcf(float); |
| 296 | float hypotf(float, float); |
| 297 | float lgammaf(float); |
David 'Digit' Turner | 8e2ff16 | 2011-01-25 17:05:50 +0100 | [diff] [blame] | 298 | float tgammaf(float); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 299 | |
| 300 | float acoshf(float); |
| 301 | float asinhf(float); |
| 302 | float atanhf(float); |
| 303 | float cbrtf(float); |
| 304 | float logbf(float); |
| 305 | float copysignf(float, float) __pure2; |
| 306 | long long llrintf(float); |
| 307 | long long llroundf(float); |
| 308 | long lrintf(float); |
| 309 | long lroundf(float); |
David 'Digit' Turner | 8e2ff16 | 2011-01-25 17:05:50 +0100 | [diff] [blame] | 310 | float nanf(const char *) __pure2; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 311 | float nearbyintf(float); |
| 312 | float nextafterf(float, float); |
| 313 | float remainderf(float, float); |
| 314 | float remquof(float, float, int *); |
| 315 | float rintf(float); |
| 316 | float scalblnf(float, long); |
| 317 | float scalbnf(float, int); |
| 318 | float truncf(float); |
| 319 | |
| 320 | float fdimf(float, float); |
| 321 | float fmaf(float, float, float); |
| 322 | float fmaxf(float, float) __pure2; |
| 323 | float fminf(float, float) __pure2; |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 324 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 325 | |
| 326 | /* |
| 327 | * float versions of BSD math library entry points |
| 328 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 329 | #if __BSD_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 330 | float dremf(float, float); |
| 331 | int finitef(float) __pure2; |
| 332 | float gammaf(float); |
| 333 | float j0f(float); |
| 334 | float j1f(float); |
| 335 | float jnf(int, float); |
| 336 | float scalbf(float, float); |
| 337 | float y0f(float); |
| 338 | float y1f(float); |
| 339 | float ynf(int, float); |
| 340 | |
| 341 | /* |
| 342 | * Float versions of reentrant version of gamma & lgamma; passes |
| 343 | * signgam back by reference as the second argument; user must |
| 344 | * allocate space for signgam. |
| 345 | */ |
| 346 | float gammaf_r(float, int *); |
| 347 | float lgammaf_r(float, int *); |
| 348 | |
| 349 | /* |
| 350 | * float version of IEEE Test Vector |
| 351 | */ |
| 352 | float significandf(float); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 353 | #endif /* __BSD_VISIBLE */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 354 | |
| 355 | /* |
| 356 | * long double versions of ISO/POSIX math functions |
| 357 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 358 | #if __ISO_C_VISIBLE >= 1999 |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 359 | long double acoshl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 360 | long double acosl(long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 361 | long double asinhl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 362 | long double asinl(long double); |
| 363 | long double atan2l(long double, long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 364 | long double atanhl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 365 | long double atanl(long double); |
| 366 | long double cbrtl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 367 | long double ceill(long double); |
| 368 | long double copysignl(long double, long double) __pure2; |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 369 | long double coshl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 370 | long double cosl(long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 371 | long double erfcl(long double); |
| 372 | long double erfl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 373 | long double exp2l(long double); |
| 374 | long double expl(long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 375 | long double expm1l(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 376 | long double fabsl(long double) __pure2; |
Elliott Hughes | f9f4a43 | 2015-08-24 22:57:08 +0000 | [diff] [blame] | 377 | __BIONIC_MATH_INLINE(long double fabsl(long double x) { return __builtin_fabsl(x); }) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 378 | long double fdiml(long double, long double); |
| 379 | long double floorl(long double); |
| 380 | long double fmal(long double, long double, long double); |
| 381 | long double fmaxl(long double, long double) __pure2; |
| 382 | long double fminl(long double, long double) __pure2; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 383 | long double fmodl(long double, long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 384 | long double frexpl(long double value, int *); /* fundamentally !__pure2 */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 385 | long double hypotl(long double, long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 386 | int ilogbl(long double) __pure2; |
| 387 | long double ldexpl(long double, int); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 388 | long double lgammal(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 389 | long long llrintl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 390 | long long llroundl(long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 391 | long double log10l(long double); |
| 392 | long double log1pl(long double); |
| 393 | long double log2l(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 394 | long double logbl(long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 395 | long double logl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 396 | long lrintl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 397 | long lroundl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 398 | long double modfl(long double, long double *); /* fundamentally !__pure2 */ |
| 399 | long double nanl(const char *) __pure2; |
| 400 | long double nearbyintl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 401 | long double nextafterl(long double, long double); |
| 402 | double nexttoward(double, long double); |
| 403 | float nexttowardf(float, long double); |
| 404 | long double nexttowardl(long double, long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 405 | long double powl(long double, long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 406 | long double remainderl(long double, long double); |
| 407 | long double remquol(long double, long double, int *); |
| 408 | long double rintl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 409 | long double roundl(long double); |
| 410 | long double scalblnl(long double, long); |
| 411 | long double scalbnl(long double, int); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 412 | long double sinhl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 413 | long double sinl(long double); |
| 414 | long double sqrtl(long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 415 | long double tanhl(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 416 | long double tanl(long double); |
Elliott Hughes | 9a5a3e8 | 2014-05-05 20:28:28 -0700 | [diff] [blame] | 417 | long double tgammal(long double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 418 | long double truncl(long double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 419 | #endif /* __ISO_C_VISIBLE >= 1999 */ |
Elliott Hughes | b4f2f28 | 2014-05-08 21:19:12 -0700 | [diff] [blame] | 420 | |
Elliott Hughes | 7553185 | 2014-09-18 11:23:58 -0700 | [diff] [blame] | 421 | #if __BSD_VISIBLE |
| 422 | long double lgammal_r(long double, int *); |
| 423 | #endif |
| 424 | |
Elliott Hughes | 5f5cc45 | 2014-08-18 16:04:03 -0700 | [diff] [blame] | 425 | #if defined(__USE_GNU) |
Elliott Hughes | b4f2f28 | 2014-05-08 21:19:12 -0700 | [diff] [blame] | 426 | void sincos(double, double*, double*); |
| 427 | void sincosf(float, float*, float*); |
| 428 | void sincosl(long double, long double*, long double*); |
Elliott Hughes | 5f5cc45 | 2014-08-18 16:04:03 -0700 | [diff] [blame] | 429 | #endif /* __USE_GNU */ |
Elliott Hughes | b4f2f28 | 2014-05-08 21:19:12 -0700 | [diff] [blame] | 430 | |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 431 | #pragma GCC visibility pop |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 432 | __END_DECLS |
| 433 | |
| 434 | #endif /* !_MATH_H_ */ |