1 | //
|
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
|
---|
3 | //
|
---|
4 | // The contents of this file are covered under the licence agreement in the
|
---|
5 | // file "LICENCE" distributed with Cforall.
|
---|
6 | //
|
---|
7 | // math --
|
---|
8 | //
|
---|
9 | // Author : Peter A. Buhr
|
---|
10 | // Created On : Mon Apr 18 23:37:04 2016
|
---|
11 | // Last Modified By : Peter A. Buhr
|
---|
12 | // Last Modified On : Sun Apr 24 12:45:02 2016
|
---|
13 | // Update Count : 59
|
---|
14 | //
|
---|
15 |
|
---|
16 | extern "C" {
|
---|
17 | #include <math.h> // fpclassify, isfinite, isnormal, isnan, isinf
|
---|
18 | } // extern "C"
|
---|
19 |
|
---|
20 | float fabs( float );
|
---|
21 | // extern "C" { double fabs( double ); }
|
---|
22 | long double fabs( long double );
|
---|
23 | float cabs( float _Complex );
|
---|
24 | // extern "C" { double cabs( double _Complex ); }
|
---|
25 | long double cabs( long double _Complex );
|
---|
26 |
|
---|
27 | float ?%?( float, float );
|
---|
28 | float fmod( float, float );
|
---|
29 | double ?%?( double, double );
|
---|
30 | // extern "C" { double fmod( double, double ); }
|
---|
31 | long double ?%?( long double, long double );
|
---|
32 | long double fmod( long double, long double );
|
---|
33 |
|
---|
34 | float remainder( float, float );
|
---|
35 | // extern "C" { double remainder( double, double ); }
|
---|
36 | long double remainder( long double, long double );
|
---|
37 |
|
---|
38 | [ int, float ] remquo( float, float );
|
---|
39 | float remquo( float, float, int * );
|
---|
40 | [ int, double ] remquo( double, double );
|
---|
41 | // extern "C" { double remquo( double, double, int * ); }
|
---|
42 | [ int, long double ] remquo( long double, long double );
|
---|
43 | long double remquo( long double, long double, int * );
|
---|
44 |
|
---|
45 | [ int, float ] div( float, float ); // alternative name for remquo
|
---|
46 | float div( float, float, int * );
|
---|
47 | [ int, double ] div( double, double );
|
---|
48 | // extern "C" { double div( double, double, int * ); }
|
---|
49 | [ int, long double ] div( long double, long double );
|
---|
50 | long double div( long double, long double, int * );
|
---|
51 |
|
---|
52 | float fma( float, float, float );
|
---|
53 | // extern "C" { double fma( double, double, double ); }
|
---|
54 | long double fma( long double, long double, long double );
|
---|
55 |
|
---|
56 | float fdim( float, float );
|
---|
57 | // extern "C" { double fdim( double, double ); }
|
---|
58 | long double fdim( long double, long double );
|
---|
59 |
|
---|
60 | float nan( const char * );
|
---|
61 | // extern "C" { double nan( const char * ); }
|
---|
62 | long double nan( const char * );
|
---|
63 |
|
---|
64 | //---------------------- Exponential ----------------------
|
---|
65 |
|
---|
66 | float exp( float );
|
---|
67 | // extern "C" { double exp( double ); }
|
---|
68 | long double exp( long double );
|
---|
69 | float _Complex exp( float _Complex );
|
---|
70 | double _Complex exp( double _Complex );
|
---|
71 | long double _Complex exp( long double _Complex );
|
---|
72 |
|
---|
73 | float exp2( float );
|
---|
74 | // extern "C" { double exp2( double ); }
|
---|
75 | long double exp2( long double );
|
---|
76 | // float _Complex exp2( float _Complex );
|
---|
77 | // double _Complex exp2( double _Complex );
|
---|
78 | // long double _Complex exp2( long double _Complex );
|
---|
79 |
|
---|
80 | float expm1( float );
|
---|
81 | // extern "C" { double expm1( double ); }
|
---|
82 | long double expm1( long double );
|
---|
83 |
|
---|
84 | float log( float );
|
---|
85 | // extern "C" { double log( double ); }
|
---|
86 | long double log( long double );
|
---|
87 | float _Complex log( float _Complex );
|
---|
88 | double _Complex log( double _Complex );
|
---|
89 | long double _Complex log( long double _Complex );
|
---|
90 |
|
---|
91 | float log2( float );
|
---|
92 | // extern "C" { double log2( double ); }
|
---|
93 | long double log2( long double );
|
---|
94 | // float _Complex log2( float _Complex );
|
---|
95 | // double _Complex log2( double _Complex );
|
---|
96 | // long double _Complex log2( long double _Complex );
|
---|
97 |
|
---|
98 | float log10( float );
|
---|
99 | // extern "C" { double log10( double ); }
|
---|
100 | long double log10( long double );
|
---|
101 | // float _Complex log10( float _Complex );
|
---|
102 | // double _Complex log10( double _Complex );
|
---|
103 | // long double _Complex log10( long double _Complex );
|
---|
104 |
|
---|
105 | float log1p( float );
|
---|
106 | // extern "C" { double log1p( double ); }
|
---|
107 | long double log1p( long double );
|
---|
108 |
|
---|
109 | int ilogb( float );
|
---|
110 | // extern "C" { int ilogb( double ); }
|
---|
111 | int ilogb( long double );
|
---|
112 |
|
---|
113 | float logb( float );
|
---|
114 | // extern "C" { double logb( double ); }
|
---|
115 | long double logb( long double );
|
---|
116 |
|
---|
117 | //---------------------- Power ----------------------
|
---|
118 |
|
---|
119 | float sqrt( float );
|
---|
120 | // extern "C" { double sqrt( double ); }
|
---|
121 | long double sqrt( long double );
|
---|
122 | float _Complex sqrt( float _Complex );
|
---|
123 | double _Complex sqrt( double _Complex );
|
---|
124 | long double _Complex sqrt( long double _Complex );
|
---|
125 |
|
---|
126 | float cbrt( float );
|
---|
127 | // extern "C" { double cbrt( double ); }
|
---|
128 | long double cbrt( long double );
|
---|
129 |
|
---|
130 | float hypot( float, float );
|
---|
131 | // extern "C" { double hypot( double, double ); }
|
---|
132 | long double hypot( long double, long double );
|
---|
133 |
|
---|
134 | float pow( float, float );
|
---|
135 | // extern "C" { double pow( double, double ); }
|
---|
136 | long double pow( long double, long double );
|
---|
137 | float _Complex pow( float _Complex, float _Complex );
|
---|
138 | double _Complex pow( double _Complex, double _Complex );
|
---|
139 | long double _Complex pow( long double _Complex, long double _Complex );
|
---|
140 |
|
---|
141 | //---------------------- Trigonometric ----------------------
|
---|
142 |
|
---|
143 | float sin( float );
|
---|
144 | // extern "C" { double sin( double ); }
|
---|
145 | long double sin( long double );
|
---|
146 | float _Complex sin( float _Complex );
|
---|
147 | double _Complex sin( double _Complex );
|
---|
148 | long double _Complex sin( long double _Complex );
|
---|
149 |
|
---|
150 | float cos( float );
|
---|
151 | // extern "C" { double cos( double ); }
|
---|
152 | long double cos( long double );
|
---|
153 | float _Complex cos( float _Complex );
|
---|
154 | double _Complex cos( double _Complex );
|
---|
155 | long double _Complex cos( long double _Complex );
|
---|
156 |
|
---|
157 | float tan( float );
|
---|
158 | // extern "C" { double tan( double ); }
|
---|
159 | long double tan( long double );
|
---|
160 | float _Complex tan( float _Complex );
|
---|
161 | double _Complex tan( double _Complex );
|
---|
162 | long double _Complex tan( long double _Complex );
|
---|
163 |
|
---|
164 | float asin( float );
|
---|
165 | // extern "C" { double asin( double ); }
|
---|
166 | long double asin( long double );
|
---|
167 | float _Complex asin( float _Complex );
|
---|
168 | double _Complex asin( double _Complex );
|
---|
169 | long double _Complex asin( long double _Complex );
|
---|
170 |
|
---|
171 | float acos( float );
|
---|
172 | // extern "C" { double acos( double ); }
|
---|
173 | long double acos( long double );
|
---|
174 | float _Complex acos( float _Complex );
|
---|
175 | double _Complex acos( double _Complex );
|
---|
176 | long double _Complex acos( long double _Complex );
|
---|
177 |
|
---|
178 | float atan( float );
|
---|
179 | // extern "C" { double atan( double ); }
|
---|
180 | long double atan( long double );
|
---|
181 | float _Complex atan( float _Complex );
|
---|
182 | double _Complex atan( double _Complex );
|
---|
183 | long double _Complex atan( long double _Complex );
|
---|
184 |
|
---|
185 | float atan2( float, float );
|
---|
186 | double atan2( double, double );
|
---|
187 | long double atan2( long double, long double );
|
---|
188 |
|
---|
189 | float atan( float, float ); // alternative name for atan2
|
---|
190 | double atan( double, double );
|
---|
191 | long double atan( long double, long double );
|
---|
192 |
|
---|
193 | //---------------------- Hyperbolic ----------------------
|
---|
194 |
|
---|
195 | float sinh( float );
|
---|
196 | // extern "C" { double sinh( double ); }
|
---|
197 | long double sinh( long double );
|
---|
198 | float _Complex sinh( float _Complex );
|
---|
199 | double _Complex sinh( double _Complex );
|
---|
200 | long double _Complex sinh( long double _Complex );
|
---|
201 |
|
---|
202 | float cosh( float );
|
---|
203 | // extern "C" { double cosh( double ); }
|
---|
204 | long double cosh( long double );
|
---|
205 | float _Complex cosh( float _Complex );
|
---|
206 | double _Complex cosh( double _Complex );
|
---|
207 | long double _Complex cosh( long double _Complex );
|
---|
208 |
|
---|
209 | float tanh( float );
|
---|
210 | // extern "C" { double tanh( double ); }
|
---|
211 | long double tanh( long double );
|
---|
212 | float _Complex tanh( float _Complex );
|
---|
213 | double _Complex tanh( double _Complex );
|
---|
214 | long double _Complex tanh( long double _Complex );
|
---|
215 |
|
---|
216 | float asinh( float );
|
---|
217 | // extern "C" { double asinh( double ); }
|
---|
218 | long double asinh( long double );
|
---|
219 | float _Complex asinh( float _Complex );
|
---|
220 | double _Complex asinh( double _Complex );
|
---|
221 | long double _Complex asinh( long double _Complex );
|
---|
222 |
|
---|
223 | float acosh( float );
|
---|
224 | // extern "C" { double acosh( double ); }
|
---|
225 | long double acosh( long double );
|
---|
226 | float _Complex acosh( float _Complex );
|
---|
227 | double _Complex acosh( double _Complex );
|
---|
228 | long double _Complex acosh( long double _Complex );
|
---|
229 |
|
---|
230 | float atanh( float );
|
---|
231 | // extern "C" { double atanh( double ); }
|
---|
232 | long double atanh( long double );
|
---|
233 | float _Complex atanh( float _Complex );
|
---|
234 | double _Complex atanh( double _Complex );
|
---|
235 | long double _Complex atanh( long double _Complex );
|
---|
236 |
|
---|
237 | //---------------------- Error / Gamma ----------------------
|
---|
238 |
|
---|
239 | float erf( float );
|
---|
240 | // extern "C" { double erf( double ); }
|
---|
241 | long double erf( long double );
|
---|
242 | // float _Complex erf( float _Complex );
|
---|
243 | // double _Complex erf( double _Complex );
|
---|
244 | // long double _Complex erf( long double _Complex );
|
---|
245 |
|
---|
246 | float erfc( float );
|
---|
247 | // extern "C" { double erfc( double ); }
|
---|
248 | long double erfc( long double );
|
---|
249 | // float _Complex erfc( float _Complex );
|
---|
250 | // double _Complex erfc( double _Complex );
|
---|
251 | // long double _Complex erfc( long double _Complex );
|
---|
252 |
|
---|
253 | float lgamma( float );
|
---|
254 | // extern "C" { double lgamma( double ); }
|
---|
255 | long double lgamma( long double );
|
---|
256 | float lgamma( float, int * );
|
---|
257 | double lgamma( double, int * );
|
---|
258 | long double lgamma( long double, int * );
|
---|
259 |
|
---|
260 | float tgamma( float );
|
---|
261 | // extern "C" { double tgamma( double ); }
|
---|
262 | long double tgamma( long double );
|
---|
263 |
|
---|
264 | //---------------------- Nearest Integer ----------------------
|
---|
265 |
|
---|
266 | float floor( float );
|
---|
267 | // extern "C" { double floor( double ); }
|
---|
268 | long double floor( long double );
|
---|
269 |
|
---|
270 | float ceil( float );
|
---|
271 | // extern "C" { double ceil( double ); }
|
---|
272 | long double ceil( long double );
|
---|
273 |
|
---|
274 | float trunc( float );
|
---|
275 | // extern "C" { double trunc( double ); }
|
---|
276 | long double trunc( long double );
|
---|
277 |
|
---|
278 | float rint( float );
|
---|
279 | long double rint( long double );
|
---|
280 | long int rint( float );
|
---|
281 | long int rint( double );
|
---|
282 | long int rint( long double );
|
---|
283 | long long int rint( float );
|
---|
284 | long long int rint( double );
|
---|
285 | long long int rint( long double );
|
---|
286 |
|
---|
287 | long int lrint( float );
|
---|
288 | // extern "C" { long int lrint( double ); }
|
---|
289 | long int lrint( long double );
|
---|
290 | long long int llrint( float );
|
---|
291 | // extern "C" { long long int llrint( double ); }
|
---|
292 | long long int llrint( long double );
|
---|
293 |
|
---|
294 | float nearbyint( float );
|
---|
295 | // extern "C" { double nearbyint( double ); }
|
---|
296 | long double nearbyint( long double );
|
---|
297 |
|
---|
298 | float round( float );
|
---|
299 | long double round( long double );
|
---|
300 | long int round( float );
|
---|
301 | long int round( double );
|
---|
302 | long int round( long double );
|
---|
303 | long long int round( float );
|
---|
304 | long long int round( double );
|
---|
305 | long long int round( long double );
|
---|
306 |
|
---|
307 | long int lround( float );
|
---|
308 | // extern "C" { long int lround( double ); }
|
---|
309 | long int lround( long double );
|
---|
310 | long long int llround( float );
|
---|
311 | // extern "C" { long long int llround( double ); }
|
---|
312 | long long int llround( long double );
|
---|
313 |
|
---|
314 | //---------------------- Manipulation ----------------------
|
---|
315 |
|
---|
316 | float copysign( float, float );
|
---|
317 | // extern "C" { double copysign( double, double ); }
|
---|
318 | long double copysign( long double, long double );
|
---|
319 |
|
---|
320 | float frexp( float, int * );
|
---|
321 | // extern "C" { double frexp( double, int * ); }
|
---|
322 | long double frexp( long double, int * );
|
---|
323 |
|
---|
324 | float ldexp( float, int );
|
---|
325 | // extern "C" { double ldexp( double, int ); }
|
---|
326 | long double ldexp( long double, int );
|
---|
327 |
|
---|
328 | [ float, float ] modf( float );
|
---|
329 | float modf( float, float * );
|
---|
330 | [ double, double ] modf( double );
|
---|
331 | // extern "C" { double modf( double, double * ); }
|
---|
332 | [ long double, long double ] modf( long double );
|
---|
333 | long double modf( long double, long double * );
|
---|
334 |
|
---|
335 | float nextafter( float, float );
|
---|
336 | // extern "C" { double nextafter( double, double ); }
|
---|
337 | long double nextafter( long double, long double );
|
---|
338 |
|
---|
339 | float nexttoward( float, long double );
|
---|
340 | // extern "C" { double nexttoward( double, long double ); }
|
---|
341 | long double nexttoward( long double, long double );
|
---|
342 |
|
---|
343 | float scalbn( float, int );
|
---|
344 | // extern "C" { double scalbn( double, int ); }
|
---|
345 | long double scalbn( long double, int );
|
---|
346 |
|
---|
347 | float scalbln( float, long int );
|
---|
348 | // extern "C" { double scalbln( double, long int ); }
|
---|
349 | long double scalbln( long double, long int );
|
---|
350 |
|
---|
351 | // Local Variables: //
|
---|
352 | // mode: c //
|
---|
353 | // tab-width: 4 //
|
---|
354 | // End: //
|
---|