ipiq: Add simple IPI latency measure sysctls (2)
[dragonfly.git] / lib / libm / src / math_private.h
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
14  * $FreeBSD: head/lib/msun/src/math_private.h 251292 2013-06-03 09:14:31Z das $
15  */
16
17 #ifndef _MATH_PRIVATE_H_
18 #define _MATH_PRIVATE_H_
19
20 #include <sys/types.h>
21 #include <machine/endian.h>
22
23 /*
24  * The original fdlibm code used statements like:
25  *      n0 = ((*(int*)&one)>>29)^1;             * index of high word *
26  *      ix0 = *(n0+(int*)&x);                   * high word of x *
27  *      ix1 = *((1-n0)+(int*)&x);               * low word of x *
28  * to dig two 32 bit words out of the 64 bit IEEE floating point
29  * value.  That is non-ANSI, and, moreover, the gcc instruction
30  * scheduler gets it wrong.  We instead use the following macros.
31  * Unlike the original code, we determine the endianness at compile
32  * time, not at run time; I don't see much benefit to selecting
33  * endianness at run time.
34  */
35
36 /*
37  * A union which permits us to convert between a double and two 32 bit
38  * ints.
39  */
40
41 #define IEEE_WORD_ORDER BYTE_ORDER
42
43 #if IEEE_WORD_ORDER == BIG_ENDIAN
44
45 typedef union
46 {
47   double value;
48   struct
49   {
50     u_int32_t msw;
51     u_int32_t lsw;
52   } parts;
53   struct
54   {
55     u_int64_t w;
56   } xparts;
57 } ieee_double_shape_type;
58
59 #endif
60
61 #if IEEE_WORD_ORDER == LITTLE_ENDIAN
62
63 typedef union
64 {
65   double value;
66   struct
67   {
68     u_int32_t lsw;
69     u_int32_t msw;
70   } parts;
71   struct
72   {
73     u_int64_t w;
74   } xparts;
75 } ieee_double_shape_type;
76
77 #endif
78
79 /* Get two 32 bit ints from a double.  */
80
81 #define EXTRACT_WORDS(ix0,ix1,d)                                \
82 do {                                                            \
83   ieee_double_shape_type ew_u;                                  \
84   ew_u.value = (d);                                             \
85   (ix0) = ew_u.parts.msw;                                       \
86   (ix1) = ew_u.parts.lsw;                                       \
87 } while (0)
88
89 /* Get a 64-bit int from a double. */
90 #define EXTRACT_WORD64(ix,d)                                    \
91 do {                                                            \
92   ieee_double_shape_type ew_u;                                  \
93   ew_u.value = (d);                                             \
94   (ix) = ew_u.xparts.w;                                         \
95 } while (0)
96
97 /* Get the more significant 32 bit int from a double.  */
98
99 #define GET_HIGH_WORD(i,d)                                      \
100 do {                                                            \
101   ieee_double_shape_type gh_u;                                  \
102   gh_u.value = (d);                                             \
103   (i) = gh_u.parts.msw;                                         \
104 } while (0)
105
106 /* Get the less significant 32 bit int from a double.  */
107
108 #define GET_LOW_WORD(i,d)                                       \
109 do {                                                            \
110   ieee_double_shape_type gl_u;                                  \
111   gl_u.value = (d);                                             \
112   (i) = gl_u.parts.lsw;                                         \
113 } while (0)
114
115 /* Set a double from two 32 bit ints.  */
116
117 #define INSERT_WORDS(d,ix0,ix1)                                 \
118 do {                                                            \
119   ieee_double_shape_type iw_u;                                  \
120   iw_u.parts.msw = (ix0);                                       \
121   iw_u.parts.lsw = (ix1);                                       \
122   (d) = iw_u.value;                                             \
123 } while (0)
124
125 /* Set a double from a 64-bit int. */
126 #define INSERT_WORD64(d,ix)                                     \
127 do {                                                            \
128   ieee_double_shape_type iw_u;                                  \
129   iw_u.xparts.w = (ix);                                         \
130   (d) = iw_u.value;                                             \
131 } while (0)
132
133 /* Set the more significant 32 bits of a double from an int.  */
134
135 #define SET_HIGH_WORD(d,v)                                      \
136 do {                                                            \
137   ieee_double_shape_type sh_u;                                  \
138   sh_u.value = (d);                                             \
139   sh_u.parts.msw = (v);                                         \
140   (d) = sh_u.value;                                             \
141 } while (0)
142
143 /* Set the less significant 32 bits of a double from an int.  */
144
145 #define SET_LOW_WORD(d,v)                                       \
146 do {                                                            \
147   ieee_double_shape_type sl_u;                                  \
148   sl_u.value = (d);                                             \
149   sl_u.parts.lsw = (v);                                         \
150   (d) = sl_u.value;                                             \
151 } while (0)
152
153 /*
154  * A union which permits us to convert between a float and a 32 bit
155  * int.
156  */
157
158 typedef union
159 {
160   float value;
161   /* FIXME: Assumes 32 bit int.  */
162   unsigned int word;
163 } ieee_float_shape_type;
164
165 /* Get a 32 bit int from a float.  */
166
167 #define GET_FLOAT_WORD(i,d)                                     \
168 do {                                                            \
169   ieee_float_shape_type gf_u;                                   \
170   gf_u.value = (d);                                             \
171   (i) = gf_u.word;                                              \
172 } while (0)
173
174 /* Set a float from a 32 bit int.  */
175
176 #define SET_FLOAT_WORD(d,i)                                     \
177 do {                                                            \
178   ieee_float_shape_type sf_u;                                   \
179   sf_u.word = (i);                                              \
180   (d) = sf_u.value;                                             \
181 } while (0)
182
183 /*
184  * Get expsign and mantissa as 16 bit and 64 bit ints from an 80 bit long
185  * double.
186  */
187
188 #define EXTRACT_LDBL80_WORDS(ix0,ix1,d)                         \
189 do {                                                            \
190   union IEEEl2bits ew_u;                                        \
191   ew_u.e = (d);                                                 \
192   (ix0) = ew_u.xbits.expsign;                                   \
193   (ix1) = ew_u.xbits.man;                                       \
194 } while (0)
195
196 /*
197  * Get expsign and mantissa as one 16 bit and two 64 bit ints from a 128 bit
198  * long double.
199  */
200
201 #define EXTRACT_LDBL128_WORDS(ix0,ix1,ix2,d)                    \
202 do {                                                            \
203   union IEEEl2bits ew_u;                                        \
204   ew_u.e = (d);                                                 \
205   (ix0) = ew_u.xbits.expsign;                                   \
206   (ix1) = ew_u.xbits.manh;                                      \
207   (ix2) = ew_u.xbits.manl;                                      \
208 } while (0)
209
210 /* Get expsign as a 16 bit int from a long double.  */
211
212 #define GET_LDBL_EXPSIGN(i,d)                                   \
213 do {                                                            \
214   union IEEEl2bits ge_u;                                        \
215   ge_u.e = (d);                                                 \
216   (i) = ge_u.xbits.expsign;                                     \
217 } while (0)
218
219 /*
220  * Set an 80 bit long double from a 16 bit int expsign and a 64 bit int
221  * mantissa.
222  */
223
224 #define INSERT_LDBL80_WORDS(d,ix0,ix1)                          \
225 do {                                                            \
226   union IEEEl2bits iw_u;                                        \
227   iw_u.xbits.expsign = (ix0);                                   \
228   iw_u.xbits.man = (ix1);                                       \
229   (d) = iw_u.e;                                                 \
230 } while (0)
231
232 /*
233  * Set a 128 bit long double from a 16 bit int expsign and two 64 bit ints
234  * comprising the mantissa.
235  */
236
237 #define INSERT_LDBL128_WORDS(d,ix0,ix1,ix2)                     \
238 do {                                                            \
239   union IEEEl2bits iw_u;                                        \
240   iw_u.xbits.expsign = (ix0);                                   \
241   iw_u.xbits.manh = (ix1);                                      \
242   iw_u.xbits.manl = (ix2);                                      \
243   (d) = iw_u.e;                                                 \
244 } while (0)
245
246 /* Set expsign of a long double from a 16 bit int.  */
247
248 #define SET_LDBL_EXPSIGN(d,v)                                   \
249 do {                                                            \
250   union IEEEl2bits se_u;                                        \
251   se_u.e = (d);                                                 \
252   se_u.xbits.expsign = (v);                                     \
253   (d) = se_u.e;                                                 \
254 } while (0)
255
256 #ifdef __i386__
257 /* Long double constants are broken on i386. */
258 #define LD80C(m, ex, v) {                                               \
259         .xbits.man = __CONCAT(m, ULL),                                  \
260         .xbits.expsign = (0x3fff + (ex)) | ((v) < 0 ? 0x8000 : 0),      \
261 }
262 #else
263 /* The above works on non-i386 too, but we use this to check v. */
264 #define LD80C(m, ex, v) { .e = (v), }
265 #endif
266
267 #ifdef FLT_EVAL_METHOD
268 /*
269  * Attempt to get strict C99 semantics for assignment with non-C99 compilers.
270  */
271 #if FLT_EVAL_METHOD == 0 || __GNUC__ == 0
272 #define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval))
273 #else
274 #define STRICT_ASSIGN(type, lval, rval) do {    \
275         volatile type __lval;                   \
276                                                 \
277         if (sizeof(type) >= sizeof(long double))        \
278                 (lval) = (rval);                \
279         else {                                  \
280                 __lval = (rval);                \
281                 (lval) = __lval;                \
282         }                                       \
283 } while (0)
284 #endif
285 #endif /* FLT_EVAL_METHOD */
286
287 /* Support switching the mode to FP_PE if necessary. */
288 #if defined(__i386__) && !defined(NO_FPSETPREC)
289 #define ENTERI()                                \
290         long double __retval;                   \
291         fp_prec_t __oprec;                      \
292                                                 \
293         if ((__oprec = fpgetprec()) != FP_PE)   \
294                 fpsetprec(FP_PE)
295 #define RETURNI(x) do {                         \
296         __retval = (x);                         \
297         if (__oprec != FP_PE)                   \
298                 fpsetprec(__oprec);             \
299         RETURNF(__retval);                      \
300 } while (0)
301 #else
302 #define ENTERI(x)
303 #define RETURNI(x)      RETURNF(x)
304 #endif
305
306 /* Default return statement if hack*_t() is not used. */
307 #define      RETURNF(v)      return (v)
308
309 /*
310  * 2sum gives the same result as 2sumF without requiring |a| >= |b| or
311  * a == 0, but is slower.
312  */
313 #define _2sum(a, b) do {        \
314         __typeof(a) __s, __w;   \
315                                 \
316         __w = (a) + (b);        \
317         __s = __w - (a);        \
318         (b) = ((a) - (__w - __s)) + ((b) - __s); \
319         (a) = __w;              \
320 } while (0)
321
322 /*
323  * 2sumF algorithm.
324  *
325  * "Normalize" the terms in the infinite-precision expression a + b for
326  * the sum of 2 floating point values so that b is as small as possible
327  * relative to 'a'.  (The resulting 'a' is the value of the expression in
328  * the same precision as 'a' and the resulting b is the rounding error.)
329  * |a| must be >= |b| or 0, b's type must be no larger than 'a's type, and
330  * exponent overflow or underflow must not occur.  This uses a Theorem of
331  * Dekker (1971).  See Knuth (1981) 4.2.2 Theorem C.  The name "TwoSum"
332  * is apparently due to Skewchuk (1997).
333  *
334  * For this to always work, assignment of a + b to 'a' must not retain any
335  * extra precision in a + b.  This is required by C standards but broken
336  * in many compilers.  The brokenness cannot be worked around using
337  * STRICT_ASSIGN() like we do elsewhere, since the efficiency of this
338  * algorithm would be destroyed by non-null strict assignments.  (The
339  * compilers are correct to be broken -- the efficiency of all floating
340  * point code calculations would be destroyed similarly if they forced the
341  * conversions.)
342  *
343  * Fortunately, a case that works well can usually be arranged by building
344  * any extra precision into the type of 'a' -- 'a' should have type float_t,
345  * double_t or long double.  b's type should be no larger than 'a's type.
346  * Callers should use these types with scopes as large as possible, to
347  * reduce their own extra-precision and efficiciency problems.  In
348  * particular, they shouldn't convert back and forth just to call here.
349  */
350 #ifdef DEBUG
351 #define _2sumF(a, b) do {                               \
352         __typeof(a) __w;                                \
353         volatile __typeof(a) __ia, __ib, __r, __vw;     \
354                                                         \
355         __ia = (a);                                     \
356         __ib = (b);                                     \
357         assert(__ia == 0 || fabsl(__ia) >= fabsl(__ib));        \
358                                                         \
359         __w = (a) + (b);                                \
360         (b) = ((a) - __w) + (b);                        \
361         (a) = __w;                                      \
362                                                         \
363         /* The next 2 assertions are weak if (a) is already long double. */ \
364         assert((long double)__ia + __ib == (long double)(a) + (b));     \
365         __vw = __ia + __ib;                             \
366         __r = __ia - __vw;                              \
367         __r += __ib;                                    \
368         assert(__vw == (a) && __r == (b));              \
369 } while (0)
370 #else /* !DEBUG */
371 #define _2sumF(a, b) do {       \
372         __typeof(a) __w;        \
373                                 \
374         __w = (a) + (b);        \
375         (b) = ((a) - __w) + (b); \
376         (a) = __w;              \
377 } while (0)
378 #endif /* DEBUG */
379
380 /*
381  * Set x += c, where x is represented in extra precision as a + b.
382  * x must be sufficiently normalized and sufficiently larger than c,
383  * and the result is then sufficiently normalized.
384  *
385  * The details of ordering are that |a| must be >= |c| (so that (a, c)
386  * can be normalized without extra work to swap 'a' with c).  The details of
387  * the normalization are that b must be small relative to the normalized 'a'.
388  * Normalization of (a, c) makes the normalized c tiny relative to the
389  * normalized a, so b remains small relative to 'a' in the result.  However,
390  * b need not ever be tiny relative to 'a'.  For example, b might be about
391  * 2**20 times smaller than 'a' to give about 20 extra bits of precision.
392  * That is usually enough, and adding c (which by normalization is about
393  * 2**53 times smaller than a) cannot change b significantly.  However,
394  * cancellation of 'a' with c in normalization of (a, c) may reduce 'a'
395  * significantly relative to b.  The caller must ensure that significant
396  * cancellation doesn't occur, either by having c of the same sign as 'a',
397  * or by having |c| a few percent smaller than |a|.  Pre-normalization of
398  * (a, b) may help.
399  *
400  * This is is a variant of an algorithm of Kahan (see Knuth (1981) 4.2.2
401  * exercise 19).  We gain considerable efficiency by requiring the terms to
402  * be sufficiently normalized and sufficiently increasing.
403  */
404 #define _3sumF(a, b, c) do {    \
405         __typeof(a) __tmp;      \
406                                 \
407         __tmp = (c);            \
408         _2sumF(__tmp, (a));     \
409         (b) += (a);             \
410         (a) = __tmp;            \
411 } while (0)
412
413 /*
414  * Common routine to process the arguments to nan(), nanf(), and nanl().
415  */
416 void _scan_nan(uint32_t *__words, int __num_words, const char *__s);
417
418 #ifdef _COMPLEX_H
419
420 /*
421  * C99 specifies that complex numbers have the same representation as
422  * an array of two elements, where the first element is the real part
423  * and the second element is the imaginary part.
424  */
425 typedef union {
426         float complex f;
427         float a[2];
428 } float_complex;
429 typedef union {
430         double complex f;
431         double a[2];
432 } double_complex;
433 typedef union {
434         long double complex f;
435         long double a[2];
436 } long_double_complex;
437 #define REALPART(z)     ((z).a[0])
438 #define IMAGPART(z)     ((z).a[1])
439
440 /*
441  * Inline functions that can be used to construct complex values.
442  *
443  * The C99 standard intends x+I*y to be used for this, but x+I*y is
444  * currently unusable in general since gcc introduces many overflow,
445  * underflow, sign and efficiency bugs by rewriting I*y as
446  * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product.
447  * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted
448  * to -0.0+I*0.0.
449  */
450 static __inline float complex
451 cpackf(float x, float y)
452 {
453         float_complex z;
454
455         REALPART(z) = x;
456         IMAGPART(z) = y;
457         return (z.f);
458 }
459
460 static __inline double complex
461 cpack(double x, double y)
462 {
463         double_complex z;
464
465         REALPART(z) = x;
466         IMAGPART(z) = y;
467         return (z.f);
468 }
469
470 static __inline long double complex
471 cpackl(long double x, long double y)
472 {
473         long_double_complex z;
474
475         REALPART(z) = x;
476         IMAGPART(z) = y;
477         return (z.f);
478 }
479 #endif /* _COMPLEX_H */
480  
481 #ifdef __GNUC__
482
483 /* Asm versions of some functions. */
484
485 #ifdef __x86_64__
486 static __inline int
487 irint(double x)
488 {
489         int n;
490
491         asm("cvtsd2si %1,%0" : "=r" (n) : "x" (x));
492         return (n);
493 }
494 #define HAVE_EFFICIENT_IRINT
495 #endif
496
497 #ifdef __i386__
498 static __inline int
499 irint(double x)
500 {
501         int n;
502
503         asm("fistl %0" : "=m" (n) : "t" (x));
504         return (n);
505 }
506 #define HAVE_EFFICIENT_IRINT
507 #endif
508
509 #if defined(__x86_64__) || defined(__i386__)
510 static __inline int
511 irintl(long double x)
512 {
513         int n;
514
515         asm("fistl %0" : "=m" (n) : "t" (x));
516         return (n);
517 }
518 #define HAVE_EFFICIENT_IRINTL
519 #endif
520
521 #endif /* __GNUC__ */
522
523 #ifdef DEBUG
524 #if defined(__amd64__) || defined(__i386__)
525 #define breakpoint()    asm("int $3")
526 #else
527 #include <signal.h>
528
529 #define breakpoint()    raise(SIGTRAP)
530 #endif
531 #endif
532
533 /* Write a pari script to test things externally. */
534 #ifdef DOPRINT
535 #include <stdio.h>
536
537 #ifndef DOPRINT_SWIZZLE
538 #define DOPRINT_SWIZZLE         0
539 #endif
540
541 #ifdef DOPRINT_LD80
542
543 #define DOPRINT_START(xp) do {                                          \
544         uint64_t __lx;                                                  \
545         uint16_t __hx;                                                  \
546                                                                         \
547         /* Hack to give more-problematic args. */                       \
548         EXTRACT_LDBL80_WORDS(__hx, __lx, *xp);                          \
549         __lx ^= DOPRINT_SWIZZLE;                                        \
550         INSERT_LDBL80_WORDS(*xp, __hx, __lx);                           \
551         printf("x = %.21Lg; ", (long double)*xp);                       \
552 } while (0)
553 #define DOPRINT_END1(v)                                                 \
554         printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
555 #define DOPRINT_END2(hi, lo)                                            \
556         printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n",              \
557             (long double)(hi), (long double)(lo))
558
559 #elif defined(DOPRINT_D64)
560
561 #define DOPRINT_START(xp) do {                                          \
562         uint32_t __hx, __lx;                                            \
563                                                                         \
564         EXTRACT_WORDS(__hx, __lx, *xp);                                 \
565         __lx ^= DOPRINT_SWIZZLE;                                        \
566         INSERT_WORDS(*xp, __hx, __lx);                                  \
567         printf("x = %.21Lg; ", (long double)*xp);                       \
568 } while (0)
569 #define DOPRINT_END1(v)                                                 \
570         printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
571 #define DOPRINT_END2(hi, lo)                                            \
572         printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n",              \
573             (long double)(hi), (long double)(lo))
574
575 #elif defined(DOPRINT_F32)
576
577 #define DOPRINT_START(xp) do {                                          \
578         uint32_t __hx;                                                  \
579                                                                         \
580         GET_FLOAT_WORD(__hx, *xp);                                      \
581         __hx ^= DOPRINT_SWIZZLE;                                        \
582         SET_FLOAT_WORD(*xp, __hx);                                      \
583         printf("x = %.21Lg; ", (long double)*xp);                       \
584 } while (0)
585 #define DOPRINT_END1(v)                                                 \
586         printf("y = %.21Lg; z = 0; show(x, y, z);\n", (long double)(v))
587 #define DOPRINT_END2(hi, lo)                                            \
588         printf("y = %.21Lg; z = %.21Lg; show(x, y, z);\n",              \
589             (long double)(hi), (long double)(lo))
590
591 #else /* !DOPRINT_LD80 && !DOPRINT_D64 (LD128 only) */
592
593 #ifndef DOPRINT_SWIZZLE_HIGH
594 #define DOPRINT_SWIZZLE_HIGH    0
595 #endif
596
597 #define DOPRINT_START(xp) do {                                          \
598         uint64_t __lx, __llx;                                           \
599         uint16_t __hx;                                                  \
600                                                                         \
601         EXTRACT_LDBL128_WORDS(__hx, __lx, __llx, *xp);                  \
602         __llx ^= DOPRINT_SWIZZLE;                                       \
603         __lx ^= DOPRINT_SWIZZLE_HIGH;                                   \
604         INSERT_LDBL128_WORDS(*xp, __hx, __lx, __llx);                   \
605         printf("x = %.36Lg; ", (long double)*xp);                                       \
606 } while (0)
607 #define DOPRINT_END1(v)                                                 \
608         printf("y = %.36Lg; z = 0; show(x, y, z);\n", (long double)(v))
609 #define DOPRINT_END2(hi, lo)                                            \
610         printf("y = %.36Lg; z = %.36Lg; show(x, y, z);\n",              \
611             (long double)(hi), (long double)(lo))
612
613 #endif /* DOPRINT_LD80 */
614
615 #else /* !DOPRINT */
616 #define DOPRINT_START(xp)
617 #define DOPRINT_END1(v)
618 #define DOPRINT_END2(hi, lo)
619 #endif /* DOPRINT */
620
621 #define RETURNP(x) do {                 \
622         DOPRINT_END1(x);                \
623         RETURNF(x);                     \
624 } while (0)
625 #define RETURNPI(x) do {                \
626         DOPRINT_END1(x);                \
627         RETURNI(x);                     \
628 } while (0)
629 #define RETURN2P(x, y) do {             \
630         DOPRINT_END2((x), (y));         \
631         RETURNF((x) + (y));             \
632 } while (0)
633 #define RETURN2PI(x, y) do {            \
634         DOPRINT_END2((x), (y));         \
635         RETURNI((x) + (y));             \
636 } while (0)
637 #ifdef STRUCT_RETURN
638 #define RETURNSP(rp) do {               \
639         if (!(rp)->lo_set)              \
640                 RETURNP((rp)->hi);      \
641         RETURN2P((rp)->hi, (rp)->lo);   \
642 } while (0)
643 #define RETURNSPI(rp) do {              \
644         if (!(rp)->lo_set)              \
645                 RETURNPI((rp)->hi);     \
646         RETURN2PI((rp)->hi, (rp)->lo);  \
647 } while (0)
648 #endif
649 #define SUM2P(x, y) ({                  \
650         const __typeof (x) __x = (x);   \
651         const __typeof (y) __y = (y);   \
652                                         \
653         DOPRINT_END2(__x, __y);         \
654         __x + __y;                      \
655 })
656
657 /*
658  * ieee style elementary functions
659  *
660  * We rename functions here to improve other sources' diffability
661  * against fdlibm.
662  */
663 #define __ieee754_sqrt  sqrt
664 #define __ieee754_acos  acos
665 #define __ieee754_acosh acosh
666 #define __ieee754_log   log
667 #define __ieee754_log2  log2
668 #define __ieee754_atanh atanh
669 #define __ieee754_asin  asin
670 #define __ieee754_atan2 atan2
671 #define __ieee754_exp   exp
672 #define __ieee754_cosh  cosh
673 #define __ieee754_fmod  fmod
674 #define __ieee754_pow   pow
675 #define __ieee754_lgamma lgamma
676 #define __ieee754_gamma gamma
677 #define __ieee754_lgamma_r lgamma_r
678 #define __ieee754_gamma_r gamma_r
679 #define __ieee754_log10 log10
680 #define __ieee754_sinh  sinh
681 #define __ieee754_hypot hypot
682 #define __ieee754_j0    j0
683 #define __ieee754_j1    j1
684 #define __ieee754_y0    y0
685 #define __ieee754_y1    y1
686 #define __ieee754_jn    jn
687 #define __ieee754_yn    yn
688 #define __ieee754_remainder remainder
689 #define __ieee754_scalb scalb
690 #define __ieee754_sqrtf sqrtf
691 #define __ieee754_acosf acosf
692 #define __ieee754_acoshf acoshf
693 #define __ieee754_logf  logf
694 #define __ieee754_atanhf atanhf
695 #define __ieee754_asinf asinf
696 #define __ieee754_atan2f atan2f
697 #define __ieee754_expf  expf
698 #define __ieee754_coshf coshf
699 #define __ieee754_fmodf fmodf
700 #define __ieee754_powf  powf
701 #define __ieee754_lgammaf lgammaf
702 #define __ieee754_gammaf gammaf
703 #define __ieee754_lgammaf_r lgammaf_r
704 #define __ieee754_gammaf_r gammaf_r
705 #define __ieee754_log10f log10f
706 #define __ieee754_log2f log2f
707 #define __ieee754_sinhf sinhf
708 #define __ieee754_hypotf hypotf
709 #define __ieee754_j0f   j0f
710 #define __ieee754_j1f   j1f
711 #define __ieee754_y0f   y0f
712 #define __ieee754_y1f   y1f
713 #define __ieee754_jnf   jnf
714 #define __ieee754_ynf   ynf
715 #define __ieee754_remainderf remainderf
716 #define __ieee754_scalbf scalbf
717
718 /* fdlibm kernel function */
719 int     __kernel_rem_pio2(double*,double*,int,int,int);
720
721 /* double precision kernel functions */
722 #ifndef INLINE_REM_PIO2
723 int     __ieee754_rem_pio2(double,double*);
724 #endif
725 double  __kernel_sin(double,double,int);
726 double  __kernel_cos(double,double);
727 double  __kernel_tan(double,double,int);
728 double  __ldexp_exp(double,int);
729 #ifdef _COMPLEX_H
730 double complex __ldexp_cexp(double complex,int);
731 #endif
732
733 /* float precision kernel functions */
734 #ifndef INLINE_REM_PIO2F
735 int     __ieee754_rem_pio2f(float,double*);
736 #endif
737 #ifndef INLINE_KERNEL_SINDF
738 float   __kernel_sindf(double);
739 #endif
740 #ifndef INLINE_KERNEL_COSDF
741 float   __kernel_cosdf(double);
742 #endif
743 #ifndef INLINE_KERNEL_TANDF
744 float   __kernel_tandf(double,int);
745 #endif
746 float   __ldexp_expf(float,int);
747 #ifdef _COMPLEX_H
748 float complex __ldexp_cexpf(float complex,int);
749 #endif
750
751 /* long double precision kernel functions */
752 long double __kernel_sinl(long double, long double, int);
753 long double __kernel_cosl(long double, long double);
754 long double __kernel_tanl(long double, long double, int);
755
756 #endif /* !_MATH_PRIVATE_H_ */