Numworks Epsilon  1.4.1
Graphing Calculator Operating System
math.h
Go to the documentation of this file.
1 #ifndef LIBA_MATH_H
2 #define LIBA_MATH_H
3 
4 #include "private/macros.h"
5 #include <float.h>
6 
8 
9 typedef float float_t;
10 typedef double double_t;
11 
12 #define M_E 2.71828182845904524
13 #define M_LOG2E 1.44269504088896341
14 #define M_LOG10E 0.43429448190325183
15 #define M_LN2 0.69314718055994531
16 #define M_LN10 2.30258509299404568
17 #define M_PI 3.14159265358979324
18 #define M_PI_2 1.57079632679489662
19 #define M_PI_4 0.78539816339744831
20 #define M_1_PI 0.31830988618379067
21 #define M_2_PI 0.63661977236758134
22 #define M_2_SQRTPI 1.12837916709551257
23 #define M_SQRT2 1.41421356237309505
24 #define M_SQRT1_2 0.70710678118654752
25 
26 #define MAXFLOAT FLT_MAX
27 #define HUGE_VAL __builtin_huge_val()
28 #define HUGE_VALF __builtin_huge_valf()
29 #define INFINITY __builtin_inff()
30 #define NAN __builtin_nanf("")
31 
32 #define FP_INFINITE 0x01
33 #define FP_NAN 0x02
34 #define FP_NORMAL 0x04
35 #define FP_SUBNORMAL 0x08
36 #define FP_ZERO 0x10
37 
38 #define fpclassify(x) __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x)
39 #define signbit(x) __builtin_signbit(x)
40 #define finite(x) __builtin_finite(x)
41 #define isfinite(x) __builtin_isfinite(x)
42 #define isnormal(x) __builtin_isnormal(x)
43 #define isnan(x) __builtin_isnan(x)
44 #define isinf(x) __builtin_isinf(x)
45 
46 float acosf(float x);
47 float acoshf(float x);
48 float asinf(float x);
49 float asinhf(float x);
50 float atanf(float x);
51 float atan2f(float y, float x);
52 float atanhf(float x);
53 float ceilf(float x);
54 float copysignf(float x, float y);
55 float cosf(float x);
56 float coshf(float x);
57 float expf(float x);
58 float expm1f(float x);
59 float fabsf(float x);
60 float floorf(float x);
61 float fmodf(float x, float y);
62 float frexpf(float x, int *eptr);
63 float ldexpf(float x, int n);
64 float lgammaf(float x);
65 float lgammaf_r(float x, int *signgamp);
66 float log1pf(float x);
67 float log10f(float x);
68 float logf(float x);
69 float modff(float value, float *iptr);
70 float nearbyintf(float x);
71 float powf(float x, float y);
72 float roundf(float x);
73 float scalbnf(float x, int n);
74 float sinf(float x);
75 float sinhf(float x);
76 float sqrtf(float x);
77 float tanf(float x);
78 float tanhf(float x);
79 float truncf(float x);
80 
81 double acos(double x);
82 double acosh(double x);
83 double asin(double x);
84 double asinh(double x);
85 double atan(double x);
86 double atan2(double y, double x);
87 double atanh(double x);
88 double ceil(double x);
89 double copysign(double x, double y);
90 double cos(double x);
91 double cosh(double x);
92 double erf(double x);
93 double erfc(double x);
94 double exp(double x);
95 double expm1(double x);
96 double fabs(double x);
97 double floor(double x);
98 double fmod(double x, double y);
99 double frexp(double x, int *eptr);
100 double lgamma(double x);
101 double lgamma_r(double x, int *signgamp);
102 double log(double x);
103 double log1p(double x);
104 double log10(double x);
105 double log2(double x);
106 double logb(double x);
107 double modf(double value, double *iptr);
108 double nearbyint(double x);
109 double pow(double x, double y);
110 double nearbyint(double x);
111 double rint(double x);
112 double round(double x);
113 double scalb(double x, double fn);
114 double scalbn(double x, int n);
115 double sin(double x);
116 double sinh(double x);
117 double sqrt(double x);
118 double tan(double x);
119 double tanh(double x);
120 double tgamma(double x);
121 double trunc(double x);
122 
123 /* The C99 standard says that any libc function can be re-declared as a macro.
124  * (See N1124 paragraph 7.1.4). This means that C files willing to actually
125  * implement said functions should either re-define the prototype or #undef the
126  * macro. */
127 
128 #define acosf(x) __builtin_acosf(x)
129 #define acoshf(x) __builtin_acoshf(x)
130 #define asinf(x) __builtin_asinf(x)
131 #define asinhf(x) __builtin_asinhf(x)
132 #define atanf(x) __builtin_atanf(x)
133 #define atan2f(y, x) __builtin_atan2f(y, x)
134 #define atanhf(x) __builtin_atanhf(x)
135 #define ceilf(x) __builtin_ceilf(x)
136 #define copysignf(x, y) __builtin_copysignf(x, y)
137 #define cosf(x) __builtin_cosf(x)
138 #define coshf(x) __builtin_coshf(x)
139 #define expf(x) __builtin_expf(x)
140 #define expm1f(x) __builtin_expm1f(x)
141 #define fabsf(x) __builtin_fabsf(x)
142 #define floorf(x) __builtin_floorf(x)
143 #define fmodf(x, y) __builtin_fmodf(x, y)
144 #define frexpf(x, y) __builtin_frexpf(x, y)
145 #define ldexpf(x, n) __builtin_ldexpf(x, n)
146 #define lgammaf(x) __builtin_lgammaf(x)
147 #define lgammaf_r(x, signgamp) __builtin_lgammaf_r(x, signgamp)
148 #define log1pf(x) __builtin_log1pf(x)
149 #define log10f(x) __builtin_log10f(x)
150 #define logf(x) __builtin_logf(x)
151 #define nanf(s) __builtin_nanf(s)
152 #define nearbyintf(x) __builtin_nearbyintf(x)
153 #define powf(x, y) __builtin_powf(x, y)
154 #define roundf(x) __builtin_roundf(x)
155 #define scalbnf(x, n) __builtin_scalbnf(x, n)
156 #define sinf(x) __builtin_sinf(x)
157 #define sinhf(x) __builtin_sinhf(x)
158 #define sqrtf(x) __builtin_sqrtf(x)
159 #define tanf(x) __builtin_tanf(x)
160 #define tanhf(x) __builtin_tanhf(x)
161 #define truncf(x) __builtin_truncf(x)
162 
163 #define acos(x) __builtin_acos(x)
164 #define acosh(x) __builtin_acosh(x)
165 #define asin(x) __builtin_asin(x)
166 #define asinh(x) __builtin_asinh(x)
167 #define atan(x) __builtin_atan(x)
168 #define atan2(y, x) __builtin_atan2(y, x)
169 #define atanh(x) __builtin_atanh(x)
170 #define ceil(x) __builtin_ceil(x)
171 #define copysign(x, y) __builtin_copysign(x, y)
172 #define cos(x) __builtin_cos(x)
173 #define cosh(x) __builtin_cosh(x)
174 #define erf(x) __builtin_erf(x)
175 #define erfc(x) __builtin_erfc(x)
176 #define exp(x) __builtin_exp(x)
177 #define expm1(x) __builtin_expm1(x)
178 #define fabs(x) __builtin_fabs(x)
179 #define floor(x) __builtin_floor(x)
180 #define fmod(x, y) __builtin_fmod(x, y)
181 #define ldexp(x, n) __builtin_scalbn(x, n)
182 #define lgamma(x) __builtin_lgamma(x)
183 #define lgamma_r(x, signgamp) __builtin_lgamma_r(x, signgamp)
184 #define log(x) __builtin_log(x)
185 #define log1p(x) __builtin_log1p(x)
186 #define log10(x) __builtin_log10(x)
187 #define log2(x) __builtin_log2(x)
188 #define logb(x) __builtin_logb(x)
189 #define nan(s) __builtin_nan(s)
190 #define pow(x, y) __builtin_pow(x, y)
191 #define rint(x) __builtin_rint(x)
192 #define round(x) __builtin_round(x)
193 #define scalbn(x, n) __builtin_scalbn(x, n)
194 #define sin(x) __builtin_sin(x)
195 #define sinh(x) __builtin_sinh(x)
196 #define sqrt(x) __builtin_sqrt(x)
197 #define tan(x) __builtin_tan(x)
198 #define tanh(x) __builtin_tanh(x)
199 #define tgamma(x) __builtin_tgamma(x)
200 #define trunc(x) __builtin_trunc(x)
201 
202 extern int signgam;
203 
205 
206 #endif
#define exp(x)
Definition: math.h:176
#define log1pf(x)
Definition: math.h:148
#define scalbn(x, n)
Definition: math.h:193
#define acosh(x)
Definition: math.h:164
#define log1p(x)
Definition: math.h:185
#define LIBA_BEGIN_DECLS
Definition: macros.h:8
#define copysign(x, y)
Definition: math.h:171
#define log10f(x)
Definition: math.h:149
#define floorf(x)
Definition: math.h:142
#define fabsf(x)
Definition: math.h:141
#define lgamma_r(x, signgamp)
Definition: math.h:183
LIBA_BEGIN_DECLS typedef float float_t
Definition: math.h:9
#define expm1f(x)
Definition: math.h:140
#define rint(x)
Definition: math.h:191
#define lgammaf(x)
Definition: math.h:146
#define lgamma(x)
Definition: math.h:182
#define trunc(x)
Definition: math.h:200
#define coshf(x)
Definition: math.h:138
#define atanhf(x)
Definition: math.h:134
#define copysignf(x, y)
Definition: math.h:136
#define logf(x)
Definition: math.h:150
#define atan(x)
Definition: math.h:167
#define tanf(x)
Definition: math.h:159
#define expf(x)
Definition: math.h:139
#define powf(x, y)
Definition: math.h:153
#define fabs(x)
Definition: math.h:178
double double_t
Definition: math.h:10
#define cosf(x)
Definition: math.h:137
#define frexpf(x, y)
Definition: math.h:144
#define asin(x)
Definition: math.h:165
#define atan2(y, x)
Definition: math.h:168
#define atanf(x)
Definition: math.h:132
#define sinhf(x)
Definition: math.h:157
#define sin(x)
Definition: math.h:194
#define sqrtf(x)
Definition: math.h:158
#define log(x)
Definition: math.h:184
#define acoshf(x)
Definition: math.h:129
#define fmod(x, y)
Definition: math.h:180
double scalb(double x, double fn)
Definition: e_scalb.c:32
#define atan2f(y, x)
Definition: math.h:133
#define tgamma(x)
Definition: math.h:199
#define round(x)
Definition: math.h:192
#define atanh(x)
Definition: math.h:169
#define pow(x, y)
Definition: math.h:190
#define cos(x)
Definition: math.h:172
#define erfc(x)
Definition: math.h:175
#define ldexpf(x, n)
Definition: math.h:145
#define tanh(x)
Definition: math.h:198
double frexp(double x, int *eptr)
Definition: s_frexp.c:33
#define log10(x)
Definition: math.h:186
#define ceil(x)
Definition: math.h:170
#define sinh(x)
Definition: math.h:195
#define logb(x)
Definition: math.h:188
float modff(float value, float *iptr)
Definition: s_modff.c:22
#define sinf(x)
Definition: math.h:156
#define asinf(x)
Definition: math.h:130
#define fmodf(x, y)
Definition: math.h:143
#define acos(x)
Definition: math.h:163
#define acosf(x)
Definition: math.h:128
#define roundf(x)
Definition: math.h:154
#define nearbyintf(x)
Definition: math.h:152
#define truncf(x)
Definition: math.h:161
#define cosh(x)
Definition: math.h:173
int signgam
Definition: s_signgam.c:3
#define erf(x)
Definition: math.h:174
#define asinh(x)
Definition: math.h:166
#define log2(x)
Definition: math.h:187
#define floor(x)
Definition: math.h:179
#define asinhf(x)
Definition: math.h:131
#define expm1(x)
Definition: math.h:177
#define LIBA_END_DECLS
Definition: macros.h:9
#define sqrt(x)
Definition: math.h:196
double nearbyint(double x)
Definition: nearbyint.c:7
#define lgammaf_r(x, signgamp)
Definition: math.h:147
#define tanhf(x)
Definition: math.h:160
#define tan(x)
Definition: math.h:197
#define ceilf(x)
Definition: math.h:135
double modf(double value, double *iptr)
Definition: s_modf.c:29
#define scalbnf(x, n)
Definition: math.h:155