summaryrefslogtreecommitdiff
path: root/include/math.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-10 00:40:28 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-10 00:40:28 +0000
commit1077fa4d772832f77a677ce7fb7c2d513b959e3f (patch)
tree579bee13fb0b58d2800206366ec2caecbb15f3fc /include/math.h
parent22358dd7ce7bb49792204b698f01a6f69b9c8e08 (diff)
uClibc now has a math library. muahahahaha!
-Erik
Diffstat (limited to 'include/math.h')
-rw-r--r--include/math.h796
1 files changed, 627 insertions, 169 deletions
diff --git a/include/math.h b/include/math.h
index ab74e5ee8..853d71368 100644
--- a/include/math.h
+++ b/include/math.h
@@ -1,176 +1,634 @@
-#ifndef _MATH_H
-#define _MATH_H
-/*
- * This file was automatically generated by version 1.7 of cextract.
- * Manual editing not recommended.
+/* mconf.h
+ * <math.h>
+ * ISO/IEC 9899:1999 -- Programming Languages C: 7.12 Mathematics
+ * Derived from the Cephes Math Library Release 2.3
+ * Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier
*
- * Created: Fri Feb 23 20:31:13 1996
*
- * Modified (anyway) for PalmOS Feb 22, 1997, D.Jeff Dionne
+ * DESCRIPTION:
+ *
+ * The file also includes a conditional assembly definition
+ * for the type of computer arithmetic (IEEE, DEC, Motorola
+ * IEEE, or UNKnown).
+ *
+ * For Digital Equipment PDP-11 and VAX computers, certain
+ * IBM systems, and others that use numbers with a 56-bit
+ * significand, the symbol DEC should be defined. In this
+ * mode, most floating point constants are given as arrays
+ * of octal integers to eliminate decimal to binary conversion
+ * errors that might be introduced by the compiler.
+ *
+ * For little-endian computers, such as IBM PC, that follow the
+ * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE
+ * Std 754-1985), the symbol IBMPC should be defined. These
+ * numbers have 53-bit significands. In this mode, constants
+ * are provided as arrays of hexadecimal 16 bit integers.
+ *
+ * Big-endian IEEE format is denoted MIEEE. On some RISC
+ * systems such as Sun SPARC, double precision constants
+ * must be stored on 8-byte address boundaries. Since integer
+ * arrays may be aligned differently, the MIEEE configuration
+ * may fail on such machines.
+ *
+ * To accommodate other types of computer arithmetic, all
+ * constants are also provided in a normal decimal radix
+ * which one can hope are correctly converted to a suitable
+ * format by the available C language compiler. To invoke
+ * this mode, define the symbol UNK.
+ *
+ * An important difference among these modes is a predefined
+ * set of machine arithmetic constants for each. The numbers
+ * MACHEP (the machine roundoff error), MAXNUM (largest number
+ * represented), and several other parameters are preset by
+ * the configuration symbol. Check the file const.c to
+ * ensure that these values are correct for your computer.
+ *
+ * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL
+ * may fail on many systems. Verify that they are supposed
+ * to work on your computer.
+ */
+
+
+#ifndef _MATH_H
+#define _MATH_H 1
+
+#include <features.h>
+
+#ifndef __UCLIBC_HAS_FLOATS__
+ #define float int
+#endif
+#ifndef __UCLIBC_HAS_DOUBLE__
+ #define double int
+#endif
+#ifndef __UCLIBC_HAS_LONG_DOUBLE__
+ #define long
+ #ifndef double
+ # define double int
+ #endif
+#endif
+
+/* Type of computer arithmetic */
+
+/* PDP-11, Pro350, VAX:
+ */
+/* #define DEC 1 */
+
+/* Intel IEEE, low order words come first:
+ */
+/* #define IBMPC 1 */
+
+/* Motorola IEEE, high order words come first
+ * (Sun 680x0 workstation):
+ */
+/* #define MIEEE 1 */
+
+/* UNKnown arithmetic, invokes coefficients given in
+ * normal decimal format. Beware of range boundary
+ * problems (MACHEP, MAXLOG, etc. in const.c) and
+ * roundoff problems in pow.c:
+ * (Sun SPARCstation)
+ */
+#define UNK 1
+
+
+/* Define if the `long double' type works. */
+#define HAVE_LONG_DOUBLE 1
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if your processor stores words with the most significant
+ byte first (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define if floating point words are bigendian. */
+/* #undef FLOAT_WORDS_BIGENDIAN */
+
+/* The number of bytes in a int. */
+#define SIZEOF_INT 4
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+
+/* Define this `volatile' if your compiler thinks
+ * that floating point arithmetic obeys the associative
+ * and distributive laws. It will defeat some optimizations
+ * (but probably not enough of them).
+ *
+ * #define VOLATILE volatile
+ */
+#define VOLATILE
+
+/* For 12-byte long doubles on an i386, pad a 16-bit short 0
+ * to the end of real constants initialized by integer arrays.
+ *
+ * #define XPD 0,
+ *
+ * Otherwise, the type is 10 bytes long and XPD should be
+ * defined blank (e.g., Microsoft C).
+ *
+ * #define XPD
*/
+#define XPD 0,
+
+/* Define to support tiny denormal numbers, else undefine. */
+#define DENORMAL 1
+
+/* Define to ask for infinity support, else undefine. */
+#define INFINITIES 1
+
+/* Define to ask for support of numbers that are Not-a-Number,
+ else undefine. This may automatically define INFINITIES in some files. */
+#define NANS 1
+
+/* Define to distinguish between -0.0 and +0.0. */
+#define MINUSZERO 1
+
+/* Define 1 for ANSI C atan2() function
+ and ANSI prototypes for float arguments.
+ See atan.c and clog.c. */
+#define ANSIC 1
+#define ANSIPROT 1
+
+
+/* Constant definitions for math error conditions */
+
+#define DOMAIN 1 /* argument domain error */
+#define SING 2 /* argument singularity */
+#define OVERFLOW 3 /* overflow range error */
+#define UNDERFLOW 4 /* underflow range error */
+#define TLOSS 5 /* total loss of precision */
+#define PLOSS 6 /* partial loss of precision */
+
+#define EDOM 33
+#define ERANGE 34
+
+/* Complex numeral. */
+typedef struct
+ {
+ double r;
+ double i;
+ } cmplx;
+
+typedef struct
+ {
+ float r;
+ float i;
+ } cmplxf;
+
+#ifdef HAVE_LONG_DOUBLE
+/* Long double complex numeral. */
+typedef struct
+ {
+ long double r;
+ long double i;
+ } cmplxl;
+#endif
+
+
+
+/* Variable for error reporting. See mtherr.c. */
+extern int mtherr();
+extern int merror;
+
+
+/* If you define UNK, then be sure to set BIGENDIAN properly. */
+#include <endian.h>
+#if __BYTE_ORDER == __BIG_ENDIAN
+# define BIGENDIAN 1
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
+# define BIGENDIAN 0
+#endif
+
+
+#define __USE_ISOC9X
+/* Get general and ISO C 9X specific information. */
+#include <bits/mathdef.h>
+#undef INFINITY
+#undef DECIMAL_DIG
+#undef FP_ILOGB0
+#undef FP_ILOGBNAN
+
+/* Get the architecture specific values describing the floating-point
+ evaluation. The following symbols will get defined:
+
+ float_t floating-point type at least as wide as `float' used
+ to evaluate `float' expressions
+ double_t floating-point type at least as wide as `double' used
+ to evaluate `double' expressions
+
+ FLT_EVAL_METHOD
+ Defined to
+ 0 if `float_t' is `float' and `double_t' is `double'
+ 1 if `float_t' and `double_t' are `double'
+ 2 if `float_t' and `double_t' are `long double'
+ else `float_t' and `double_t' are unspecified
+
+ INFINITY representation of the infinity value of type `float'
+
+ FP_FAST_FMA
+ FP_FAST_FMAF
+ FP_FAST_FMAL
+ If defined it indicates that the `fma' function
+ generally executes about as fast as a multiply and an add.
+ This macro is defined only iff the `fma' function is
+ implemented directly with a hardware multiply-add instructions.
+
+ FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'.
+ FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'.
+
+ DECIMAL_DIG Number of decimal digits supported by conversion between
+ decimal and all internal floating-point formats.
+
+*/
+
+/* All floating-point numbers can be put in one of these categories. */
+enum
+ {
+ FP_NAN,
+# define FP_NAN FP_NAN
+ FP_INFINITE,
+# define FP_INFINITE FP_INFINITE
+ FP_ZERO,
+# define FP_ZERO FP_ZERO
+ FP_SUBNORMAL,
+# define FP_SUBNORMAL FP_SUBNORMAL
+ FP_NORMAL
+# define FP_NORMAL FP_NORMAL
+ };
+
+/* Return number of classification appropriate for X. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define fpclassify(x) \
+ (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x))
+# else
+# define fpclassify(x) \
+ (sizeof (x) == sizeof (float) ? \
+ __fpclassifyf (x) \
+ : sizeof (x) == sizeof (double) ? \
+ __fpclassify (x) : __fpclassifyl (x))
+# endif
+
+/* Return nonzero value if sign of X is negative. */
+int signbit(double x);
+int signbitl(long double x);
+
+/* Return nonzero value if X is not +-Inf or NaN. */
+int isfinite(double x);
+int isfinitel(long double x);
+
+/* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */
+# define isnormal(x) (fpclassify (x) == FP_NORMAL)
+
+/* Return nonzero value if X is a NaN */
+int isnan(double x);
+int isnanl(long double x);
+
+/* Return nonzero value is X is positive or negative infinity. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define isinf(x) \
+ (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
+# else
+# define isinf(x) \
+ (sizeof (x) == sizeof (float) ? \
+ __isinff (x) \
+ : sizeof (x) == sizeof (double) ? \
+ __isinf (x) : __isinfl (x))
+# endif
+
-typedef struct {
- double r;
- double i;
-}cmplxf;
/* Some useful constants. */
-#define M_E 2.7182818284590452354 /* e */
-#define M_LOG2E 1.4426950408889634074 /* log_2 e */
-#define M_LOG10E 0.43429448190325182765 /* log_10 e */
-#define M_LN2 0.69314718055994530942 /* log_e 2 */
-#define M_LN10 2.30258509299404568402 /* log_e 10 */
-#define M_PI 3.14159265358979323846 /* pi */
-#define M_PI_2 1.57079632679489661923 /* pi/2 */
-#define M_PI_4 0.78539816339744830962 /* pi/4 */
-#define M_1_PI 0.31830988618379067154 /* 1/pi */
-#define M_2_PI 0.63661977236758134308 /* 2/pi */
-#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
-#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
-#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
-
-
-extern double acos ( double x );
-extern double acosh ( double xx );
-extern int airy ( double xx, double *ai, double *aip, double *bi, double *bip );
-extern double asin ( double xx );
-extern double asinh ( double xx );
-extern double atan2 ( double y, double x );
-extern double atan ( double xx );
-extern double atanh ( double xx );
-extern double bdtrc ( int k, int n, double pp );
-extern double bdtr ( int k, int n, double pp );
-extern double bdtri ( int k, int n, double yy );
-extern double beta ( double aa, double bb );
-extern double cabs ( cmplxf *z );
-extern void cacos ( cmplxf *z, cmplxf *w );
-extern void cadd ( cmplxf *a, cmplxf *b, cmplxf *c );
-extern void casin ( cmplxf *z, cmplxf *w );
-extern void catan ( cmplxf *z, cmplxf *w );
-extern double cbrt ( double xx );
-extern void cchsh ( double xx, double *c, double *s );
-extern void ccos ( cmplxf *z, cmplxf *w );
-extern void ccot ( cmplxf *z, cmplxf *w );
-extern void cdiv ( cmplxf *a, cmplxf *b, cmplxf *c );
-extern double ceil ( double x );
-extern void cexp ( cmplxf *z, cmplxf *w );
-extern double chbevl ( double x, double *array, int n );
-extern double chdtrc ( double dff, double xx );
-extern double chdtr ( double dff, double xx );
-extern double chdtri ( double dff, double yy );
-#if 0
-extern void clog ( cmplxf *z, cmplxf *w );
+#if defined __USE_BSD || defined __USE_XOPEN
+# define M_E 2.7182818284590452354 /* e */
+# define M_LOG2E 1.4426950408889634074 /* log_2 e */
+# define M_LOG10E 0.43429448190325182765 /* log_10 e */
+# define M_LN2 0.69314718055994530942 /* log_e 2 */
+# define M_LN10 2.30258509299404568402 /* log_e 10 */
+# define M_PI 3.14159265358979323846 /* pi */
+# define M_PI_2 1.57079632679489661923 /* pi/2 */
+# define M_PI_4 0.78539816339744830962 /* pi/4 */
+# define M_1_PI 0.31830988618379067154 /* 1/pi */
+# define M_2_PI 0.63661977236758134308 /* 2/pi */
+# define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
+# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
+# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+#endif
+#ifdef __USE_GNU
+# define M_El M_E
+# define M_LOG2El M_LOG2E
+# define M_LOG10El M_LOG10E
+# define M_LN2l M_LN2
+# define M_LN10l M_LN10
+# define M_PIl M_PI
+# define M_PI_2l M_PI_2
+# define M_PI_4l M_PI_4
+# define M_1_PIl M_1_PI
+# define M_2_PIl M_2_PI
+# define M_2_SQRTPIl M_2_SQRTPI
+# define M_SQRT2l M_SQRT2
+# define M_SQRT1_2l M_SQRT1_2
+#endif
+
+
+
+
+/* 7.12.4 Trigonometric functions */
+extern double acos(double x);
+extern float acosf(float x);
+extern long double acosl(long double x);
+
+extern double asin(double x);
+extern float asinf(float x);
+extern long double asinl(long double x);
+
+extern double atan(double x);
+extern float atanf(float x);
+extern long double atanl(long double x);
+
+double atan2(double y, double x);
+float atan2f(float y, float x);
+long double atan2l(long double y, long double x);
+
+double cos(double x);
+float cosf(float x);
+long double cosl(long double x);
+
+double sin(double x);
+float sinf(float x);
+long double sinl(long double x);
+
+double tan(double x);
+float tanf(float x);
+long double tanl(long double x);
+
+
+/* 7.12.5 Hyperbolic functions */
+double acosh(double x);
+float acoshf(float x);
+long double acoshl(long double x);
+
+double asinh(double x);
+float asinhf(float x);
+long double asinhl(long double x);
+
+double atanh(double x);
+float atanhf(float x);
+long double atanhl(long double x);
+
+double cosh(double x);
+float coshf(float x);
+long double coshl(long double x);
+
+double sinh(double x);
+float sinhf(float x);
+long double sinhl(long double x);
+
+double tanh(double x);
+float tanhf(float x);
+long double tanhl(long double x);
+
+
+/* 7.12.6 Exponential and logarithmic functions */
+double exp(double x);
+float expf(float x);
+long double expl(long double x);
+
+double exp2(double x);
+float exp2f(float x);
+long double exp2l(long double x);
+
+double expm1(double x);
+float expm1f(float x);
+long double expm1l(long double x);
+
+double frexp(double value, int *exp);
+float frexpf(float value, int *exp);
+long double frexpl(long double value, int *exp);
+
+int ilogb(double x);
+int ilogbf(float x);
+int ilogbl(long double x);
+
+double ldexp(double x, int exp);
+float ldexpf(float x, int exp);
+long double ldexpl(long double x, int exp);
+
+double log(double x);
+float logf(float x);
+long double logl(long double x);
+
+double log10(double x);
+float log10f(float x);
+long double log10l(long double x);
+
+double log1p(double x);
+float log1pf(float x);
+long double log1pl(long double x);
+
+double log2(double x);
+float log2f(float x);
+long double log2l(long double x);
+
+double logb(double x);
+float logbf(float x);
+long double logbl(long double x);
+
+double modf(double value, double *iptr);
+float modff(float value, float *iptr);
+long double modfl(long double value, long double *iptr);
+
+double scalbn(double x, int n);
+float scalbnf(float x, int n);
+long double scalbnl(long double x, int n);
+double scalbln(double x, long int n);
+float scalblnf(float x, long int n);
+long double scalblnl(long double x, long int n);
+
+/* 7.12.7 Power and absolute-value functions */
+double fabs(double x);
+float fabsf(float x);
+long double fabsl(long double x);
+
+double hypot(double x, double y);
+float hypotf(float x, float y);
+long double hypotl(long double x, long double y);
+
+double pow(double x, double y);
+float powf(float x, float y);
+long double powl(long double x, long double y);
+
+double sqrt(double x);
+float sqrtf(float x);
+long double sqrtl(long double x);
+
+/* 7.12.8 Error and gamma functions */
+double erf(double x);
+float erff(float x);
+long double erfl(long double x);
+
+double erfc(double x);
+float erfcf(float x);
+long double erfcl(long double x);
+
+double lgamma(double x);
+float lgammaf(float x);
+long double lgammal(long double x);
+
+double tgamma(double x);
+float tgammaf(float x);
+long double tgammal(long double x);
+
+/* 7.12.9 Nearest integer functions */
+double ceil(double x);
+float ceilf(float x);
+long double ceill(long double x);
+
+double floor(double x);
+float floorf(float x);
+long double floorl(long double x);
+
+double nearbyint(double x);
+float nearbyintf(float x);
+long double nearbyintl(long double x);
+
+double rint(double x);
+float rintf(float x);
+long double rintl(long double x);
+
+long int lrint(double x);
+long int lrintf(float x);
+long int lrintl(long double x);
+long long int llrint(double x);
+long long int llrintf(float x);
+long long int llrintl(long double x);
+
+double round(double x);
+float roundf(float x);
+long double roundl(long double x);
+
+long int lround(double x);
+long int lroundf(float x);
+long int lroundl(long double x);
+long long int llround(double x);
+long long int llroundf(float x);
+long long int llroundl(long double x);
+
+double trunc(double x);
+float truncf(float x);
+long double truncl(long double x);
+
+/* 7.12.10 Remainder functions */
+double fmod(double x, double y);
+float fmodf(float x, float y);
+long double fmodl(long double x, long double y);
+
+double remainder(double x, double y);
+float remainderf(float x, float y);
+long double remainderl(long double x, long double y);
+
+double remquo(double x, double y, int *quo);
+float remquof(float x, float y, int *quo);
+long double remquol(long double x, long double y, int *quo);
+
+/* 7.12.11 Manipulation functions */
+double copysign(double x, double y);
+float copysignf(float x, float y);
+long double copysignl(long double x, long double y);
+
+double nan(const char *tagp);
+float nanf(const char *tagp);
+long double nanl(const char *tagp);
+
+double nextafter(double x, double y);
+float nextafterf(float x, float y);
+long double nextafterl(long double x, long double y);
+
+double nexttoward(double x, long double y);
+float nexttowardf(float x, long double y);
+long double nexttowardl(long double x, long double y);
+
+/* 7.12.12 Maximum, minimum, and positive difference functions */
+double fdim(double x, double y);
+float fdimf(float x, float y);
+long double fdiml(long double x, long double y);
+
+double fmax(double x, double y);
+float fmaxf(float x, float y);
+long double fmaxl(long double x, long double y);
+
+double fmin(double x, double y);
+float fminf(float x, float y);
+long double fminl(long double x, long double y);
+
+/* 7.12.13 Floating multiply-add */
+double fma(double x, double y, double z);
+float fmaf(float x, float y, float z);
+long double fmal(long double x, long double y, long double z);
+
+/* 7.12.14 Comparison macros */
+# ifndef isgreater
+# define isgreater(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x > __y; }))
+# endif
+
+/* Return nonzero value if X is greater than or equal to Y. */
+# ifndef isgreaterequal
+# define isgreaterequal(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x >= __y; }))
+# endif
+
+/* Return nonzero value if X is less than Y. */
+# ifndef isless
+# define isless(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x < __y; }))
+# endif
+
+/* Return nonzero value if X is less than or equal to Y. */
+# ifndef islessequal
+# define islessequal(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && __x <= __y; }))
+# endif
+
+/* Return nonzero value if either X is less than Y or Y is less than X. */
+# ifndef islessgreater
+# define islessgreater(x, y) \
+ (__extension__ \
+ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered (__x, __y) && (__x < __y || __y < __x); }))
+# endif
+
+/* Return nonzero value if arguments are unordered. */
+# ifndef isunordered
+# define isunordered(u, v) \
+ (__extension__ \
+ ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
+ fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; }))
+# endif
+
+
+#ifndef __UCLIBC_HAS_FLOATS__
+ #undef float
#endif
-extern void cmov ( short *a, short *b );
-extern void cmul ( cmplxf *a, cmplxf *b, cmplxf *c );
-extern void cneg ( cmplxf *a );
-extern double cosdg ( double xx );
-extern double cos ( double xx );
-extern double cosh ( double xx );
-extern double cotdg ( double x );
-extern double cot ( double x );
-extern void csin ( cmplxf *z, cmplxf *w );
-extern void csqrt ( cmplxf *z, cmplxf *w );
-extern void csub ( cmplxf *a, cmplxf *b, cmplxf *c );
-extern void ctan ( cmplxf *z, cmplxf *w );
-extern double ctans ( cmplxf *z );
-extern double dawsn ( double xxx );
-extern int dprec ( void );
-extern double ellie ( double phia, double ma );
-extern double ellik ( double phia, double ma );
-extern double ellpe ( double xx );
-extern int ellpj ( double uu, double mm, double *sn, double *cn, double *dn, double *ph );
-extern double ellpk ( double xx );
-extern double erfc ( double aa );
-extern double erf ( double xx );
-extern double exp10 ( double xx );
-extern double exp2 ( double xx );
-extern double exp ( double xx );
-extern double expn ( int n, double xx );
-extern double fac ( int i );
-extern double fdtrc ( int ia, int ib, double xx );
-extern double fdtr ( int ia, int ib, int xx );
-extern double fdtri ( int ia, int ib, double yy );
-extern double floor ( double x );
-extern void fresnl ( double xxa, double *ssa, double *cca );
-extern double frexp ( double x, int *pw2 );
-extern double gamma ( double xx );
-extern double gdtrc ( double aa, double bb, double xx );
-extern double gdtr ( double aa, double bb, double xx );
-extern double hyp2f0 ( double aa, double bb, double xx, int type, double *err );
-extern double hyp2f1 ( double aa, double bb, double cc, double xx );
-extern double hyperg ( double aa, double bb, double xx );
-extern double i0e ( double x );
-extern double i0 ( double x );
-extern double i1e ( double xx );
-extern double i1 ( double xx );
-extern double igamc ( double aa, double xx );
-extern double igam ( double aa, double xx );
-extern double igami ( double aa, double yy0 );
-extern double incbet ( double aaa, double bbb, double xxx );
-extern double incbi ( double aaa, double bbb, double yyy0 );
-extern double incbps ( double aa, double bb, double xx );
-extern double iv ( double v, double x );
-extern double j0 ( double xx );
-extern double j1 ( double xx );
-extern double jn ( int n, double xx );
-extern double jv ( double nn, double xx );
-extern double k0e ( double xx );
-extern double k0 ( double xx );
-extern double k1e ( double xx );
-extern double k1 ( double xx );
-extern double kn ( int nnn, double xx );
-extern double ldexp ( double x, int pw2 );
-extern int ldprec ( void );
-extern double lgam ( double xx );
-extern double log10 ( double xx );
-extern double log2 ( double xx );
-extern double log ( double xx );
-/* extern int mtherr ( char *name, int code ); */
-extern double nbdtrc ( int k, int n, double pp );
-extern double nbdtr ( int k, int n, double pp );
-extern double ndtr ( double aa );
-extern double ndtri ( double yy0 );
-extern double onef2 ( double aa, double bb, double cc, double xx, double *err );
-extern double p1evl ( double xx, double *coef, int N );
-extern double pdtrc ( int k, double mm );
-extern double pdtr ( int k, double mm );
-extern double pdtri ( int k, double yy );
-extern void poladd ( double a[], int na, double b[], int nb, double c[] );
-extern void polclr ( double *a, int n );
-extern int poldiv ( double a[], int na, double b[], int nb, double c[] );
-extern double poleva ( double *a, int na, double xx );
-extern double polevl ( double xx, double *coef, int N );
-extern void polini ( int maxdeg );
-extern void polmov ( double *a, int na, double *b );
-extern void polmul ( double a[], int na, double b[], int nb, double c[] );
-extern void polprt ( double *a, int na, int d );
-extern void polsbt ( double a[], int na, double b[], int nb, double c[] );
-extern void polsub ( double a[], int na, double b[], int nb, double c[] );
-extern double pow ( double x, double y );
-extern double powi ( double x, int nn );
-extern double psi ( double xx );
-extern double redupi ( double xx );
-extern double rgamma ( double xx );
-extern int shichi ( double xx, double *si, double *ci );
-extern int sici ( double xx, double *si, double *ci );
-extern double sindg ( double xx );
-extern double sin ( double xx );
-extern double sinh ( double xx );
-extern double spence ( double xx );
-extern int sprec ( void );
-extern double sqrt ( double xx );
-extern double stdtr ( int k, double tt );
-extern double struve ( double vv, double xx );
-extern double tandg ( double x );
-extern double tan ( double x );
-extern double tanh ( double xx );
-extern double threef0 ( double aa, double bb, double cc, double xx, double *err );
-extern double y0 ( double xx );
-extern double y1 ( double xx );
-extern double yn ( int nn, double xx );
-extern double yv ( double vv, double xx );
-extern double zetac ( double xx );
-extern double zeta ( double xx, double qq );
-
-#endif /* _MATH_H */
+#ifndef __UCLIBC_HAS_DOUBLE__
+ #undef double
+#endif
+#ifndef __UCLIBC_HAS_LONG_DOUBLE__
+ #undef long
+ #undef double
+#endif
+
+
+#endif /* math.h */