blob: fc6c228294d56e131e719a7b6037fdbdc0db25d1 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/*
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/*
Elliott Hughesfee514e2020-09-17 11:57:50 -070013 * Originally based on fdlibm.h 5.1 via FreeBSD.
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080014 */
15
Elliott Hughesfee514e2020-09-17 11:57:50 -070016#pragma once
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017
18#include <sys/cdefs.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080019#include <limits.h>
20
Elliott Hughesde9ac712014-05-19 16:58:52 -070021__BEGIN_DECLS
Elliott Hughesde9ac712014-05-19 16:58:52 -070022
Elliott Hughes50cda382017-09-14 15:30:08 -070023/* C11. */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024
Elliott Hughes50cda382017-09-14 15:30:08 -070025typedef double __double_t;
26typedef __double_t double_t;
27typedef float __float_t;
28typedef __float_t float_t;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029
Elliott Hughes50cda382017-09-14 15:30:08 -070030#define HUGE_VAL __builtin_huge_val()
31#define HUGE_VALF __builtin_huge_valf()
32#define HUGE_VALL __builtin_huge_vall()
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080033
Elliott Hughes50cda382017-09-14 15:30:08 -070034#define INFINITY __builtin_inff()
35
36#define NAN __builtin_nanf("")
37
38#define FP_INFINITE 0x01
39#define FP_NAN 0x02
40#define FP_NORMAL 0x04
41#define FP_SUBNORMAL 0x08
42#define FP_ZERO 0x10
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080043
Elliott Hughesb6622802015-08-14 14:04:30 -070044#if defined(__FP_FAST_FMA)
45#define FP_FAST_FMA 1
46#endif
47#if defined(__FP_FAST_FMAF)
48#define FP_FAST_FMAF 1
49#endif
50#if defined(__FP_FAST_FMAL)
51#define FP_FAST_FMAL 1
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080052#endif
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080053
Elliott Hughes50cda382017-09-14 15:30:08 -070054#define FP_ILOGB0 (-INT_MAX)
55#define FP_ILOGBNAN INT_MAX
56
57#define MATH_ERRNO 1
58#define MATH_ERREXCEPT 2
59#define math_errhandling MATH_ERREXCEPT
60
61#define fpclassify(x) __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080062
Elliott Hughesb6622802015-08-14 14:04:30 -070063#define isfinite(x) __builtin_isfinite(x)
Elliott Hughes50cda382017-09-14 15:30:08 -070064
Elliott Hughesb6622802015-08-14 14:04:30 -070065#define isinf(x) __builtin_isinf(x)
Elliott Hughes50cda382017-09-14 15:30:08 -070066
Elliott Hughesb6622802015-08-14 14:04:30 -070067#define isnan(x) __builtin_isnan(x)
Elliott Hughes50cda382017-09-14 15:30:08 -070068
Elliott Hughesb6622802015-08-14 14:04:30 -070069#define isnormal(x) __builtin_isnormal(x)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080070
Elliott Hughes50cda382017-09-14 15:30:08 -070071#define signbit(x) \
72 ((sizeof(x) == sizeof(float)) ? __builtin_signbitf(x) \
73 : (sizeof(x) == sizeof(double)) ? __builtin_signbit(x) \
74 : __builtin_signbitl(x))
75
76double acos(double __x);
77float acosf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +000078long double acosl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -070079
80double asin(double __x);
81float asinf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +000082long double asinl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -070083
84double atan(double __x);
85float atanf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +000086long double atanl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -070087
88double atan2(double __y, double __x);
89float atan2f(float __y, float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +000090long double atan2l(long double __y, long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -070091
92double cos(double __x);
93float cosf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +000094long double cosl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -070095
96double sin(double __x);
97float sinf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +000098long double sinl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -070099
100double tan(double __x);
101float tanf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000102long double tanl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700103
104double acosh(double __x);
105float acoshf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000106long double acoshl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700107
108double asinh(double __x);
109float asinhf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000110long double asinhl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700111
112double atanh(double __x);
113float atanhf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000114long double atanhl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700115
116double cosh(double __x);
117float coshf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000118long double coshl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700119
120double sinh(double __x);
121float sinhf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000122long double sinhl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700123
124double tanh(double __x);
125float tanhf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000126long double tanhl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700127
128double exp(double __x);
129float expf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000130long double expl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700131
132double exp2(double __x);
133float exp2f(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000134long double exp2l(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700135
136double expm1(double __x);
137float expm1f(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000138long double expm1l(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700139
zijunzhao195b90b2023-02-08 02:00:09 +0000140double frexp(double __x, int* _Nonnull __exponent);
141float frexpf(float __x, int* _Nonnull __exponent);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000142long double frexpl(long double __x, int* _Nonnull __exponent);
Elliott Hughes50cda382017-09-14 15:30:08 -0700143
144int ilogb(double __x) __attribute_const__;
145int ilogbf(float __x) __attribute_const__;
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000146int ilogbl(long double __x) __attribute_const__;
Elliott Hughes50cda382017-09-14 15:30:08 -0700147
148double ldexp(double __x, int __exponent);
149float ldexpf(float __x, int __exponent);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000150long double ldexpl(long double __x, int __exponent);
Elliott Hughes50cda382017-09-14 15:30:08 -0700151
152double log(double __x);
153float logf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000154long double logl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700155
156double log10(double __x);
157float log10f(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000158long double log10l(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700159
160double log1p(double __x);
161float log1pf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000162long double log1pl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700163
Elliott Hughes655e4302023-06-16 12:39:33 -0700164double log2(double __x);
165float log2f(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000166long double log2l(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700167
168double logb(double __x);
169float logbf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000170long double logbl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700171
zijunzhao195b90b2023-02-08 02:00:09 +0000172double modf(double __x, double* _Nonnull __integral_part);
173float modff(float __x, float* _Nonnull __integral_part);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000174long double modfl(long double __x, long double* _Nonnull __integral_part);
Elliott Hughes50cda382017-09-14 15:30:08 -0700175
176double scalbn(double __x, int __exponent);
177float scalbnf(float __x, int __exponent);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000178long double scalbnl(long double __x, int __exponent);
Elliott Hughes50cda382017-09-14 15:30:08 -0700179
Elliott Hughese17ebfd2023-05-26 13:00:51 -0700180double scalbln(double __x, long __exponent);
181float scalblnf(float __x, long __exponent);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000182long double scalblnl(long double __x, long __exponent);
Elliott Hughes50cda382017-09-14 15:30:08 -0700183
184double cbrt(double __x);
185float cbrtf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000186long double cbrtl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700187
188double fabs(double __x) __attribute_const__;
189float fabsf(float __x) __attribute_const__;
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000190long double fabsl(long double __x) __attribute_const__;
Elliott Hughes50cda382017-09-14 15:30:08 -0700191
192double hypot(double __x, double __y);
193float hypotf(float __x, float __y);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000194long double hypotl(long double __x, long double __y);
Elliott Hughes50cda382017-09-14 15:30:08 -0700195
196double pow(double __x, double __y);
197float powf(float __x, float __y);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000198long double powl(long double __x, long double __y);
Elliott Hughes50cda382017-09-14 15:30:08 -0700199
200double sqrt(double __x);
201float sqrtf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000202long double sqrtl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700203
204double erf(double __x);
205float erff(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000206long double erfl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700207
208double erfc(double __x);
209float erfcf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000210long double erfcl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700211
212double lgamma(double __x);
213float lgammaf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000214long double lgammal(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700215
216double tgamma(double __x);
Elliott Hughesf106a392019-10-03 16:09:04 -0700217float tgammaf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000218long double tgammal(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700219
220double ceil(double __x);
221float ceilf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000222long double ceill(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700223
224double floor(double __x);
225float floorf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000226long double floorl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700227
228double nearbyint(double __x);
229float nearbyintf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000230long double nearbyintl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700231
232double rint(double __x);
233float rintf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000234long double rintl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700235
236long lrint(double __x);
237long lrintf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000238long lrintl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700239
240long long llrint(double __x);
241long long llrintf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000242long long llrintl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700243
244double round(double __x);
245float roundf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000246long double roundl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700247
248long lround(double __x);
249long lroundf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000250long lroundl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700251
252long long llround(double __x);
253long long llroundf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000254long long llroundl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700255
256double trunc(double __x);
257float truncf(float __x);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000258long double truncl(long double __x);
Elliott Hughes50cda382017-09-14 15:30:08 -0700259
260double fmod(double __x, double __y);
261float fmodf(float __x, float __y);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000262long double fmodl(long double __x, long double __y);
Elliott Hughes50cda382017-09-14 15:30:08 -0700263
264double remainder(double __x, double __y);
265float remainderf(float __x, float __y);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000266long double remainderl(long double __x, long double __y);
Elliott Hughes50cda382017-09-14 15:30:08 -0700267
zijunzhao195b90b2023-02-08 02:00:09 +0000268double remquo(double __x, double __y, int* _Nonnull __quotient_bits);
269float remquof(float __x, float __y, int* _Nonnull __quotient_bits);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000270long double remquol(long double __x, long double __y, int* _Nonnull __quotient_bits);
Elliott Hughes50cda382017-09-14 15:30:08 -0700271
272double copysign(double __value, double __sign) __attribute_const__;
273float copysignf(float __value, float __sign) __attribute_const__;
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000274long double copysignl(long double __value, long double __sign) __attribute_const__;
Elliott Hughes50cda382017-09-14 15:30:08 -0700275
zijunzhao195b90b2023-02-08 02:00:09 +0000276double nan(const char* _Nonnull __kind) __attribute_const__;
277float nanf(const char* _Nonnull __kind) __attribute_const__;
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000278long double nanl(const char* _Nonnull __kind) __attribute_const__;
Elliott Hughes50cda382017-09-14 15:30:08 -0700279
280double nextafter(double __x, double __y);
281float nextafterf(float __x, float __y);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000282long double nextafterl(long double __x, long double __y);
Elliott Hughes50cda382017-09-14 15:30:08 -0700283
Elliott Hughese17ebfd2023-05-26 13:00:51 -0700284double nexttoward(double __x, long double __y);
Elliott Hughes50cda382017-09-14 15:30:08 -0700285float nexttowardf(float __x, long double __y);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000286long double nexttowardl(long double __x, long double __y);
Elliott Hughes50cda382017-09-14 15:30:08 -0700287
288double fdim(double __x, double __y);
289float fdimf(float __x, float __y);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000290long double fdiml(long double __x, long double __y);
Elliott Hughes50cda382017-09-14 15:30:08 -0700291
292double fmax(double __x, double __y) __attribute_const__;
293float fmaxf(float __x, float __y) __attribute_const__;
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000294long double fmaxl(long double __x, long double __y) __attribute_const__;
Elliott Hughes50cda382017-09-14 15:30:08 -0700295
296double fmin(double __x, double __y) __attribute_const__;
297float fminf(float __x, float __y) __attribute_const__;
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000298long double fminl(long double __x, long double __y) __attribute_const__;
Elliott Hughes50cda382017-09-14 15:30:08 -0700299
300double fma(double __x, double __y, double __z);
301float fmaf(float __x, float __y, float __z);
Elliott Hughesab2d3e12023-06-07 17:16:34 +0000302long double fmal(long double __x, long double __y, long double __z);
Elliott Hughes50cda382017-09-14 15:30:08 -0700303
Elliott Hughesb6622802015-08-14 14:04:30 -0700304#define isgreater(x, y) __builtin_isgreater((x), (y))
305#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y))
306#define isless(x, y) __builtin_isless((x), (y))
307#define islessequal(x, y) __builtin_islessequal((x), (y))
308#define islessgreater(x, y) __builtin_islessgreater((x), (y))
309#define isunordered(x, y) __builtin_isunordered((x), (y))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800310
Dan Albert284c8f12017-03-30 16:34:27 -0700311/*
312 * https://code.google.com/p/android/issues/detail?id=271629
313 * To be fully compliant with C++, we need to not define these (C doesn't
314 * specify them either). Exposing these means that isinf and isnan will have a
315 * return type of int in C++ rather than bool like they're supposed to be.
316 *
317 * GNU libstdc++ 4.9 isn't able to handle a standard compliant C library. Its
318 * <cmath> will `#undef isnan` from math.h and only adds the function overloads
319 * to the std namespace, making it impossible to use both <cmath> (which gets
320 * included by a lot of other standard headers) and ::isnan.
321 */
Elliott Hughes655e4302023-06-16 12:39:33 -0700322int (isinf)(double __x) __attribute_const__;
Elliott Hughes684c31a2017-08-18 15:07:41 -0700323int (isnan)(double __x) __attribute_const__;
Dan Albert284c8f12017-03-30 16:34:27 -0700324
Elliott Hughes50cda382017-09-14 15:30:08 -0700325/* POSIX extensions. */
Josh Gao46b44162016-05-27 11:14:16 -0700326
Elliott Hughes50cda382017-09-14 15:30:08 -0700327extern int signgam;
Elliott Hughesb4f2f282014-05-08 21:19:12 -0700328
Elliott Hughes684c31a2017-08-18 15:07:41 -0700329double j0(double __x);
330double j1(double __x);
331double jn(int __n, double __x);
332double y0(double __x);
333double y1(double __x);
334double yn(int __n, double __x);
Elliott Hughesc1929e42016-08-12 16:18:03 -0700335
Elliott Hughes3ba55f82016-06-08 18:11:23 -0700336#define M_E 2.7182818284590452354 /* e */
337#define M_LOG2E 1.4426950408889634074 /* log 2e */
338#define M_LOG10E 0.43429448190325182765 /* log 10e */
339#define M_LN2 0.69314718055994530942 /* log e2 */
340#define M_LN10 2.30258509299404568402 /* log e10 */
341#define M_PI 3.14159265358979323846 /* pi */
342#define M_PI_2 1.57079632679489661923 /* pi/2 */
343#define M_PI_4 0.78539816339744830962 /* pi/4 */
344#define M_1_PI 0.31830988618379067154 /* 1/pi */
345#define M_2_PI 0.63661977236758134308 /* 2/pi */
346#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
347#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
348#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
Elliott Hughes9c8d7112016-06-13 13:23:42 -0700349
Elliott Hughes3ba55f82016-06-08 18:11:23 -0700350#define MAXFLOAT ((float)3.40282346638528860e+38)
Elliott Hughes9c8d7112016-06-13 13:23:42 -0700351
Elliott Hughes50cda382017-09-14 15:30:08 -0700352/* BSD extensions. */
353
354#if defined(__USE_BSD)
355#define HUGE MAXFLOAT
356#endif
357
358/* Extensions in both BSD and GNU. */
359
Elliott Hughes9c8d7112016-06-13 13:23:42 -0700360#if defined(__USE_BSD) || defined(__USE_GNU)
Elliott Hughes684c31a2017-08-18 15:07:41 -0700361double gamma(double __x);
362double scalb(double __x, double __exponent);
363double drem(double __x, double __y);
364int finite(double __x) __attribute_const__;
365int isnanf(float __x) __attribute_const__;
zijunzhao195b90b2023-02-08 02:00:09 +0000366double gamma_r(double __x, int* _Nonnull __sign);
367double lgamma_r(double __x, int* _Nonnull __sign);
Elliott Hughes684c31a2017-08-18 15:07:41 -0700368double significand(double __x);
zijunzhao195b90b2023-02-08 02:00:09 +0000369long double lgammal_r(long double __x, int* _Nonnull __sign) __INTRODUCED_IN(23);
Elliott Hughes655e4302023-06-16 12:39:33 -0700370long double significandl(long double __x);
Elliott Hughes684c31a2017-08-18 15:07:41 -0700371float dremf(float __x, float __y);
372int finitef(float __x) __attribute_const__;
373float gammaf(float __x);
374float j0f(float __x);
375float j1f(float __x);
376float jnf(int __n, float __x);
377float scalbf(float __x, float __exponent);
378float y0f(float __x);
379float y1f(float __x);
380float ynf(int __n, float __x);
zijunzhao195b90b2023-02-08 02:00:09 +0000381float gammaf_r(float __x, int* _Nonnull __sign);
382float lgammaf_r(float __x, int* _Nonnull __sign);
Elliott Hughes684c31a2017-08-18 15:07:41 -0700383float significandf(float __x);
zijunzhao195b90b2023-02-08 02:00:09 +0000384void sincos(double __x, double* _Nonnull __sin, double* _Nonnull __cos);
385void sincosf(float __x, float* _Nonnull __sin, float* _Nonnull __cos);
386void sincosl(long double __x, long double* _Nonnull __sin, long double* _Nonnull __cos);
Elliott Hughes75531852014-09-18 11:23:58 -0700387#endif
388
Elliott Hughes50cda382017-09-14 15:30:08 -0700389/* GNU extensions. */
390
Elliott Hughes5f5cc452014-08-18 16:04:03 -0700391#if defined(__USE_GNU)
Elliott Hughes3ba55f82016-06-08 18:11:23 -0700392#define M_El 2.718281828459045235360287471352662498L /* e */
393#define M_LOG2El 1.442695040888963407359924681001892137L /* log 2e */
394#define M_LOG10El 0.434294481903251827651128918916605082L /* log 10e */
395#define M_LN2l 0.693147180559945309417232121458176568L /* log e2 */
396#define M_LN10l 2.302585092994045684017991454684364208L /* log e10 */
397#define M_PIl 3.141592653589793238462643383279502884L /* pi */
398#define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */
399#define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */
400#define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */
401#define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */
402#define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */
403#define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */
404#define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */
Elliott Hughes3ba55f82016-06-08 18:11:23 -0700405#endif
Elliott Hughesb4f2f282014-05-08 21:19:12 -0700406
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800407__END_DECLS