gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Can't build cvs HEAD (with --enable-ansi)


From: Paul F. Dietz
Subject: Re: [Gcl-devel] Can't build cvs HEAD (with --enable-ansi)
Date: Wed, 28 Sep 2005 08:19:23 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920

Camm Maguire wrote:

Can you tell me how logl is defined at
/usr/include/bits/mathcalls.h:110: previous declaration of `logl'

Is there a manpage giving its prototype?


I couldn't find the man page.  I've attached math.h, and three files
it includes.  logl appears to be used in mathinline.h.

        Paul

/* Prototype declarations for math functions; helper file for <math.h>.
   Copyright (C) 1996-2002, 2003 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

/* NOTE: Because of the special way this file is used by <math.h>, this
   file must NOT be protected from multiple inclusion as header files
   usually are.

   This file provides prototype declarations for the math functions.
   Most functions are declared using the macro:

   __MATHCALL (NAME,[_r], (ARGS...));

   This means there is a function `NAME' returning `double' and a function
   `NAMEf' returning `float'.  Each place `_Mdouble_' appears in the
   prototype, that is actually `double' in the prototype for `NAME' and
   `float' in the prototype for `NAMEf'.  Reentrant variant functions are
   called `NAME_r' and `NAMEf_r'.

   Functions returning other types like `int' are declared using the macro:

   __MATHDECL (TYPE, NAME,[_r], (ARGS...));

   This is just like __MATHCALL but for a function returning `TYPE'
   instead of `_Mdouble_'.  In all of these cases, there is still
   both a `NAME' and a `NAMEf' that takes `float' arguments.

   Note that there must be no whitespace before the argument passed for
   NAME, to make token pasting work with -traditional.  */

#ifndef _MATH_H
# error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
#endif


/* Trigonometric functions.  */

_Mdouble_BEGIN_NAMESPACE
/* Arc cosine of X.  */
__MATHCALL (acos,, (_Mdouble_ __x));
/* Arc sine of X.  */
__MATHCALL (asin,, (_Mdouble_ __x));
/* Arc tangent of X.  */
__MATHCALL (atan,, (_Mdouble_ __x));
/* Arc tangent of Y/X.  */
__MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x));

/* Cosine of X.  */
__MATHCALL (cos,, (_Mdouble_ __x));
/* Sine of X.  */
__MATHCALL (sin,, (_Mdouble_ __x));
/* Tangent of X.  */
__MATHCALL (tan,, (_Mdouble_ __x));

/* Hyperbolic functions.  */

/* Hyperbolic cosine of X.  */
__MATHCALL (cosh,, (_Mdouble_ __x));
/* Hyperbolic sine of X.  */
__MATHCALL (sinh,, (_Mdouble_ __x));
/* Hyperbolic tangent of X.  */
__MATHCALL (tanh,, (_Mdouble_ __x));
_Mdouble_END_NAMESPACE

#ifdef __USE_GNU
/* Cosine and sine of X.  */
__MATHDECL (void,sincos,,
            (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
#endif

#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Hyperbolic arc cosine of X.  */
__MATHCALL (acosh,, (_Mdouble_ __x));
/* Hyperbolic arc sine of X.  */
__MATHCALL (asinh,, (_Mdouble_ __x));
/* Hyperbolic arc tangent of X.  */
__MATHCALL (atanh,, (_Mdouble_ __x));
__END_NAMESPACE_C99
#endif

/* Exponential and logarithmic functions.  */

_Mdouble_BEGIN_NAMESPACE
/* Exponential function of X.  */
__MATHCALL (exp,, (_Mdouble_ __x));

/* Break VALUE into a normalized fraction and an integral power of 2.  */
__MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent));

/* X times (two to the EXP power).  */
__MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent));

/* Natural logarithm of X.  */
__MATHCALL (log,, (_Mdouble_ __x));

/* Base-ten logarithm of X.  */
__MATHCALL (log10,, (_Mdouble_ __x));

/* Break VALUE into integral and fractional parts.  */
__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
_Mdouble_END_NAMESPACE

#ifdef __USE_GNU
/* A function missing in all standards: compute exponent to base ten.  */
__MATHCALL (exp10,, (_Mdouble_ __x));
/* Another name occasionally used.  */
__MATHCALL (pow10,, (_Mdouble_ __x));
#endif

#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Return exp(X) - 1.  */
__MATHCALL (expm1,, (_Mdouble_ __x));

/* Return log(1 + X).  */
__MATHCALL (log1p,, (_Mdouble_ __x));

/* Return the base 2 signed integral exponent of X.  */
__MATHCALL (logb,, (_Mdouble_ __x));
__END_NAMESPACE_C99
#endif

#ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Compute base-2 exponential of X.  */
__MATHCALL (exp2,, (_Mdouble_ __x));

/* Compute base-2 logarithm of X.  */
__MATHCALL (log2,, (_Mdouble_ __x));
__END_NAMESPACE_C99
#endif


/* Power functions.  */

_Mdouble_BEGIN_NAMESPACE
/* Return X to the Y power.  */
__MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y));

/* Return the square root of X.  */
__MATHCALL (sqrt,, (_Mdouble_ __x));
_Mdouble_END_NAMESPACE

#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Return `sqrt(X*X + Y*Y)'.  */
__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
__END_NAMESPACE_C99
#endif

#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Return the cube root of X.  */
__MATHCALL (cbrt,, (_Mdouble_ __x));
__END_NAMESPACE_C99
#endif


/* Nearest integer, absolute value, and remainder functions.  */

_Mdouble_BEGIN_NAMESPACE
/* Smallest integral value not less than X.  */
__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));

/* Absolute value of X.  */
__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));

/* Largest integer not greater than X.  */
__MATHCALLX (floor,, (_Mdouble_ __x), (__const__));

/* Floating-point modulo remainder of X/Y.  */
__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));


/* Return 0 if VALUE is finite or NaN, +1 if it
   is +Infinity, -1 if it is -Infinity.  */
__MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));

/* Return nonzero if VALUE is finite and not NaN.  */
__MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
_Mdouble_END_NAMESPACE

#ifdef __USE_MISC
/* Return 0 if VALUE is finite or NaN, +1 if it
   is +Infinity, -1 if it is -Infinity.  */
__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));

/* Return nonzero if VALUE is finite and not NaN.  */
__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));

/* Return the remainder of X/Y.  */
__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));


/* Return the fractional part of X after dividing out `ilogb (X)'.  */
__MATHCALL (significand,, (_Mdouble_ __x));
#endif /* Use misc.  */

#if defined __USE_MISC || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Return X with its signed changed to Y's.  */
__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
__END_NAMESPACE_C99
#endif

#ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Return representation of NaN for double type.  */
__MATHCALLX (nan,, (__const char *__tagb), (__const__));
__END_NAMESPACE_C99
#endif


/* Return nonzero if VALUE is not a number.  */
__MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));

#if defined __USE_MISC || defined __USE_XOPEN
/* Return nonzero if VALUE is not a number.  */
__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));

/* Bessel functions.  */
__MATHCALL (j0,, (_Mdouble_));
__MATHCALL (j1,, (_Mdouble_));
__MATHCALL (jn,, (int, _Mdouble_));
__MATHCALL (y0,, (_Mdouble_));
__MATHCALL (y1,, (_Mdouble_));
__MATHCALL (yn,, (int, _Mdouble_));
#endif


#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Error and gamma functions.  */
__MATHCALL (erf,, (_Mdouble_));
__MATHCALL (erfc,, (_Mdouble_));
__MATHCALL (lgamma,, (_Mdouble_));
__END_NAMESPACE_C99
#endif

#ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* True gamma function.  */
__MATHCALL (tgamma,, (_Mdouble_));
__END_NAMESPACE_C99
#endif

#if defined __USE_MISC || defined __USE_XOPEN
/* Obsolete alias for `lgamma'.  */
__MATHCALL (gamma,, (_Mdouble_));
#endif

#ifdef __USE_MISC
/* Reentrant version of lgamma.  This function uses the global variable
   `signgam'.  The reentrant version instead takes a pointer and stores
   the value through it.  */
__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
#endif


#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* Return the integer nearest X in the direction of the
   prevailing rounding mode.  */
__MATHCALL (rint,, (_Mdouble_ __x));

/* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
# ifdef __USE_ISOC99
__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
# endif

/* Return the remainder of integer divison X / Y with infinite precision.  */
__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));

# if defined __USE_MISC || defined __USE_ISOC99
/* Return X times (2 to the Nth power).  */
__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
# endif

/* Return the binary exponent of X, which must be nonzero.  */
__MATHDECL (int,ilogb,, (_Mdouble_ __x));
#endif

#ifdef __USE_ISOC99
/* Return X times (2 to the Nth power).  */
__MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));

/* Round X to integral value in floating-point format using current
   rounding direction, but do not raise inexact exception.  */
__MATHCALL (nearbyint,, (_Mdouble_ __x));

/* Round X to nearest integral value, rounding halfway cases away from
   zero.  */
__MATHCALLX (round,, (_Mdouble_ __x), (__const__));

/* Round X to the integral value in floating-point format nearest but
   not larger in magnitude.  */
__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));

/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
   and magnitude congruent `mod 2^n' to the magnitude of the integral
   quotient x/y, with n >= 3.  */
__MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));


/* Conversion functions.  */

/* Round X to nearest integral value according to current rounding
   direction.  */
__MATHDECL (long int,lrint,, (_Mdouble_ __x));
__MATHDECL (long long int,llrint,, (_Mdouble_ __x));

/* Round X to nearest integral value, rounding halfway cases away from
   zero.  */
__MATHDECL (long int,lround,, (_Mdouble_ __x));
__MATHDECL (long long int,llround,, (_Mdouble_ __x));


/* Return positive difference between X and Y.  */
__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y));

/* Return maximum numeric value from X and Y.  */
__MATHCALL (fmax,, (_Mdouble_ __x, _Mdouble_ __y));

/* Return minimum numeric value from X and Y.  */
__MATHCALL (fmin,, (_Mdouble_ __x, _Mdouble_ __y));


/* Classify given number.  */
__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
     __attribute__ ((__const__));

/* Test for negative number.  */
__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
     __attribute__ ((__const__));


/* Multiply-add function computed as a ternary operation.  */
__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
__END_NAMESPACE_C99

# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
/* Return X times (2 to the Nth power).  */
__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
# endif
#endif /* Use ISO C99.  */
/* Declarations for math functions.
   Copyright (C) 1991-1993,1995-1999,2001,2002 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

/*
 *      ISO C99 Standard: 7.12 Mathematics      <math.h>
 */

#ifndef _MATH_H
#define _MATH_H 1

#include <features.h>

__BEGIN_DECLS

/* Get machine-dependent HUGE_VAL value (returned on overflow).
   On all IEEE754 machines, this is +Infinity.  */
#include <bits/huge_val.h>

/* Get machine-dependent NAN value (returned for some domain errors).  */
#ifdef   __USE_ISOC99
# include <bits/nan.h>
#endif
/* Get general and ISO C99 specific information.  */
#include <bits/mathdef.h>


/* The file <bits/mathcalls.h> contains the prototypes for all the
   actual math functions.  These macros are used for those prototypes,
   so we can easily declare each function as both `name' and `__name',
   and can declare the float versions `namef' and `__namef'.  */

#define __MATHCALL(function,suffix, args)       \
  __MATHDECL (_Mdouble_,function,suffix, args)
#define __MATHDECL(type, function,suffix, args) \
  __MATHDECL_1(type, function,suffix, args); \
  __MATHDECL_1(type, __CONCAT(__,function),suffix, args)
#define __MATHCALLX(function,suffix, args, attrib)      \
  __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
#define __MATHDECLX(type, function,suffix, args, attrib) \
  __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
  __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
#define __MATHDECL_1(type, function,suffix, args) \
  extern type __MATH_PRECNAME(function,suffix) args __THROW

#define _Mdouble_               double
#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
# define _Mdouble_END_NAMESPACE   __END_NAMESPACE_STD
#include <bits/mathcalls.h>
#undef  _Mdouble_
#undef _Mdouble_BEGIN_NAMESPACE
#undef _Mdouble_END_NAMESPACE
#undef  __MATH_PRECNAME

#if defined __USE_MISC || defined __USE_ISOC99


/* Include the file of declarations again, this time using `float'
   instead of `double' and appending f to each function name.  */

# ifndef _Mfloat_
#  define _Mfloat_              float
# endif
# define _Mdouble_              _Mfloat_
# ifdef __STDC__
#  define __MATH_PRECNAME(name,r) name##f##r
# else
#  define __MATH_PRECNAME(name,r) name/**/f/**/r
# endif
# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
# define _Mdouble_END_NAMESPACE   __END_NAMESPACE_C99
# include <bits/mathcalls.h>
# undef _Mdouble_
# undef _Mdouble_BEGIN_NAMESPACE
# undef _Mdouble_END_NAMESPACE
# undef __MATH_PRECNAME

# if (__STDC__ - 0 || __GNUC__ - 0) && !defined __NO_LONG_DOUBLE_MATH
/* Include the file of declarations again, this time using `long double'
   instead of `double' and appending l to each function name.  */

#  ifndef _Mlong_double_
#   define _Mlong_double_       long double
#  endif
#  define _Mdouble_             _Mlong_double_
#  ifdef __STDC__
#   define __MATH_PRECNAME(name,r) name##l##r
#  else
#   define __MATH_PRECNAME(name,r) name/**/l/**/r
#  endif
#  define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
#  define _Mdouble_END_NAMESPACE   __END_NAMESPACE_C99
#  include <bits/mathcalls.h>
#  undef _Mdouble_
# undef _Mdouble_BEGIN_NAMESPACE
# undef _Mdouble_END_NAMESPACE
#  undef __MATH_PRECNAME

# endif /* __STDC__ || __GNUC__ */

#endif  /* Use misc or ISO C99.  */
#undef  __MATHDECL_1
#undef  __MATHDECL
#undef  __MATHCALL


#if defined __USE_MISC || defined __USE_XOPEN
/* This variable is used by `gamma' and `lgamma'.  */
extern int signgam;
#endif


/* ISO C99 defines some generic macros which work on any data type.  */
#if __USE_ISOC99

/* 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.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define signbit(x) \
     (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
# else
#  define signbit(x) \
     (sizeof (x) == sizeof (float)                                            \
      ? __signbitf (x)                                                        \
      : sizeof (x) == sizeof (double)                                         \
      ? __signbit (x) : __signbitl (x))
# endif

/* Return nonzero value if X is not +-Inf or NaN.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define isfinite(x) \
     (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x))
# else
#  define isfinite(x) \
     (sizeof (x) == sizeof (float)                                            \
      ? __finitef (x)                                                         \
      : sizeof (x) == sizeof (double)                                         \
      ? __finite (x) : __finitel (x))
# endif

/* 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.  We could use `fpclassify' but
   we already have this functions `__isnan' and it is faster.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define isnan(x) \
     (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x))
# else
#  define isnan(x) \
     (sizeof (x) == sizeof (float)                                            \
      ? __isnanf (x)                                                          \
      : sizeof (x) == sizeof (double)                                         \
      ? __isnan (x) : __isnanl (x))
# endif

/* 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

/* Bitmasks for the math_errhandling macro.  */
# define MATH_ERRNO     1       /* errno set by math functions.  */
# define MATH_ERREXCEPT 2       /* Exceptions raised by math functions.  */

#endif /* Use ISO C99.  */

#ifdef  __USE_MISC
/* Support for various different standard error handling behaviors.  */
typedef enum
{
  _IEEE_ = -1,  /* According to IEEE 754/IEEE 854.  */
  _SVID_,       /* According to System V, release 4.  */
  _XOPEN_,      /* Nowadays also Unix98.  */
  _POSIX_,
  _ISOC_        /* Actually this is ISO C99.  */
} _LIB_VERSION_TYPE;

/* This variable can be changed at run-time to any of the values above to
   affect floating point error handling behavior (it may also be necessary
   to change the hardware FPU exception settings).  */
extern _LIB_VERSION_TYPE _LIB_VERSION;
#endif


#ifdef __USE_SVID
/* In SVID error handling, `matherr' is called with this description
   of the exceptional condition.

   We have a problem when using C++ since `exception' is a reserved
   name in C++.  */
# ifdef __cplusplus
struct __exception
# else
struct exception
# endif
  {
    int type;
    char *name;
    double arg1;
    double arg2;
    double retval;
  };

# ifdef __cplusplus
extern int matherr (struct __exception *__exc) throw ();
# else
extern int matherr (struct exception *__exc);
# endif

# define X_TLOSS        1.41484755040568800000e+16

/* Types of exceptions in the `type' field.  */
# define DOMAIN         1
# define SING           2
# define OVERFLOW       3
# define UNDERFLOW      4
# define TLOSS          5
# define PLOSS          6

/* SVID mode specifies returning this large value instead of infinity.  */
# define HUGE           3.40282347e+38F

#else   /* !SVID */

# ifdef __USE_XOPEN
/* X/Open wants another strange constant.  */
#  define MAXFLOAT      3.40282347e+38F
# endif

#endif  /* SVID */


/* Some useful constants.  */
#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

/* The above constants are not adequate for computation using `long double's.
   Therefore we provide as an extension constants with similar names as a
   GNU extension.  Provide enough digits for the 128-bit IEEE quad.  */
#ifdef __USE_GNU
# define M_El           2.7182818284590452353602874713526625L  /* e */
# define M_LOG2El       1.4426950408889634073599246810018921L  /* log_2 e */
# define M_LOG10El      0.4342944819032518276511289189166051L  /* log_10 e */
# define M_LN2l         0.6931471805599453094172321214581766L  /* log_e 2 */
# define M_LN10l        2.3025850929940456840179914546843642L  /* log_e 10 */
# define M_PIl          3.1415926535897932384626433832795029L  /* pi */
# define M_PI_2l        1.5707963267948966192313216916397514L  /* pi/2 */
# define M_PI_4l        0.7853981633974483096156608458198757L  /* pi/4 */
# define M_1_PIl        0.3183098861837906715377675267450287L  /* 1/pi */
# define M_2_PIl        0.6366197723675813430755350534900574L  /* 2/pi */
# define M_2_SQRTPIl    1.1283791670955125738961589031215452L  /* 2/sqrt(pi) */
# define M_SQRT2l       1.4142135623730950488016887242096981L  /* sqrt(2) */
# define M_SQRT1_2l     0.7071067811865475244008443621048490L  /* 1/sqrt(2) */
#endif


/* When compiling in strict ISO C compatible mode we must not use the
   inline functions since they, among other things, do not set the
   `errno' variable correctly.  */
#if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES
# define __NO_MATH_INLINES      1
#endif

/* Get machine-dependent inline versions (if there are any).  */
#ifdef __USE_EXTERN_INLINES
# include <bits/mathinline.h>
#endif


#if __USE_ISOC99
/* ISO C99 defines some macros to compare number while taking care
   for unordered numbers.  Since many FPUs provide special
   instructions to support these operations and these tests are
   defined in <bits/mathinline.h>, we define the generic macros at
   this late point and only if they are not defined yet.  */

/* Return nonzero value if X is greater than Y.  */
# 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

#endif

__END_DECLS


#endif /* math.h  */
/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

#if !defined _MATH_H && !defined _COMPLEX_H
# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
#endif

#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
# define _MATH_H_MATHDEF        1

/* The ix87 FPUs evaluate all values in the 80 bit floating-point format
   which is also available for the user as `long double'.  Therefore we
   define:  */
typedef long double float_t;    /* `float' expressions are evaluated as
                                   `long double'.  */
typedef long double double_t;   /* `double' expressions are evaluated as
                                   `long double'.  */

/* Define `INFINITY' as value of type `float'.  */
# define INFINITY       HUGE_VALF

/* The values returned by `ilogb' for 0 and NaN respectively.  */
# define FP_ILOGB0      (-2147483647 - 1)
# define FP_ILOGBNAN    (-2147483647 - 1)

#endif  /* ISO C99 */
/* Inline math functions for i387.
   Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   Contributed by John C. Bowman <address@hidden>, 1995.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

#ifndef _MATH_H
# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
#endif

#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
# define __MATH_INLINE extern __inline
#endif


#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
# if __GNUC_PREREQ (2,97)
/* GCC 2.97 and up have builtins that actually can be used.  */
#  define isgreater(x, y) __builtin_isgreater (x, y)
#  define isgreaterequal(x, y) __builtin_isgreaterequal (x, y)
#  define isless(x, y) __builtin_isless (x, y)
#  define islessequal(x, y) __builtin_islessequal (x, y)
#  define islessgreater(x, y) __builtin_islessgreater (x, y)
#  define isunordered(x, y) __builtin_isunordered (x, y)
# else
/* ISO C99 defines some macros to perform unordered comparisons.  The
   ix87 FPU supports this with special opcodes and we should use them.
   These must not be inline functions since we have to be able to handle
   all floating-point types.  */
#  ifdef __i686__
/* For the PentiumPro and more recent processors we can provide
   better code.  */
#   define isgreater(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucomip %%st(1), %%st; seta %%al"                           \
                 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");          \
        __result; })
#   define isgreaterequal(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucomip %%st(1), %%st; setae %%al"                          \
                 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");          \
        __result; })

#   define isless(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucomip %%st(1), %%st; seta %%al"                           \
                 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st");          \
        __result; })

#   define islessequal(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucomip %%st(1), %%st; setae %%al"                          \
                 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st");          \
        __result; })

#   define islessgreater(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucomip %%st(1), %%st; setne %%al"                          \
                 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");          \
        __result; })

#   define isunordered(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucomip %%st(1), %%st; setp %%al"                           \
                 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");          \
        __result; })
#  else
/* This is the dumb, portable code for i386 and above.  */
#   define isgreater(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al"              \
                 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
        __result; })

#   define isgreaterequal(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al"              \
                 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
        __result; })

#   define isless(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al"              \
                 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
        __result; })

#   define islessequal(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al"              \
                 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
        __result; })

#   define islessgreater(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al"              \
                 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
        __result; })

#   define isunordered(x, y) \
     ({ register char __result;                                               \
        __asm__ ("fucompp; fnstsw; sahf; setp %%al"                           \
                 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
        __result; })
#  endif /* __i686__ */
# endif /* GCC 2.97 */

/* The gcc, version 2.7 or below, has problems with all this inlining
   code.  So disable it for this version of the compiler.  */
# if __GNUC_PREREQ (2, 8)
/* Test for negative number.  Used in the signbit() macro.  */
__MATH_INLINE int
__signbitf (float __x) __THROW
{
  __extension__ union { float __f; int __i; } __u = { __f: __x };
  return __u.__i < 0;
}
__MATH_INLINE int
__signbit (double __x) __THROW
{
  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
  return __u.__i[1] < 0;
}
__MATH_INLINE int
__signbitl (long double __x) __THROW
{
  __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
  return (__u.__i[2] & 0x8000) != 0;
}
# endif
#endif


/* The gcc, version 2.7 or below, has problems with all this inlining
   code.  So disable it for this version of the compiler.  */
#if __GNUC_PREREQ (2, 8)

#if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
     && defined __OPTIMIZE__)

/* A macro to define float, double, and long double versions of various
   math functions for the ix87 FPU.  FUNC is the function name (which will
   be suffixed with f and l for the float and long double version,
   respectively).  OP is the name of the FPU operation.
   We define two sets of macros.  The set with the additional NP
   doesn't add a prototype declaration.  */

#if defined __USE_MISC || defined __USE_ISOC99
# define __inline_mathop(func, op) \
  __inline_mathop_ (double, func, op)                                         \
  __inline_mathop_ (float, __CONCAT(func,f), op)                              \
  __inline_mathop_ (long double, __CONCAT(func,l), op)
# define __inline_mathopNP(func, op) \
  __inline_mathopNP_ (double, func, op)                                       \
  __inline_mathopNP_ (float, __CONCAT(func,f), op)                            \
  __inline_mathopNP_ (long double, __CONCAT(func,l), op)
#else
# define __inline_mathop(func, op) \
  __inline_mathop_ (double, func, op)
# define __inline_mathopNP(func, op) \
  __inline_mathopNP_ (double, func, op)
#endif

#define __inline_mathop_(float_type, func, op) \
  __inline_mathop_decl_ (float_type, func, op, "0" (__x))
#define __inline_mathopNP_(float_type, func, op) \
  __inline_mathop_declNP_ (float_type, func, op, "0" (__x))


#if defined __USE_MISC || defined __USE_ISOC99
# define __inline_mathop_decl(func, op, params...) \
  __inline_mathop_decl_ (double, func, op, params)                            \
  __inline_mathop_decl_ (float, __CONCAT(func,f), op, params)                 \
  __inline_mathop_decl_ (long double, __CONCAT(func,l), op, params)
# define __inline_mathop_declNP(func, op, params...) \
  __inline_mathop_declNP_ (double, func, op, params)                          \
  __inline_mathop_declNP_ (float, __CONCAT(func,f), op, params)               \
  __inline_mathop_declNP_ (long double, __CONCAT(func,l), op, params)
#else
# define __inline_mathop_decl(func, op, params...) \
  __inline_mathop_decl_ (double, func, op, params)
# define __inline_mathop_declNP(func, op, params...) \
  __inline_mathop_declNP_ (double, func, op, params)
#endif

#define __inline_mathop_decl_(float_type, func, op, params...) \
  __MATH_INLINE float_type func (float_type) __THROW;                         \
  __inline_mathop_declNP_ (float_type, func, op, params)

#define __inline_mathop_declNP_(float_type, func, op, params...) \
  __MATH_INLINE float_type func (float_type __x) __THROW                      \
  {                                                                           \
    register float_type __result;                                             \
    __asm __volatile__ (op : "=t" (__result) : params);                       \
    return __result;                                                          \
  }


#if defined __USE_MISC || defined __USE_ISOC99
# define __inline_mathcode(func, arg, code) \
  __inline_mathcode_ (double, func, arg, code)                                \
  __inline_mathcode_ (float, __CONCAT(func,f), arg, code)                     \
  __inline_mathcode_ (long double, __CONCAT(func,l), arg, code)
# define __inline_mathcodeNP(func, arg, code) \
  __inline_mathcodeNP_ (double, func, arg, code)                                
      \
  __inline_mathcodeNP_ (float, __CONCAT(func,f), arg, code)                   \
  __inline_mathcodeNP_ (long double, __CONCAT(func,l), arg, code)
# define __inline_mathcode2(func, arg1, arg2, code) \
  __inline_mathcode2_ (double, func, arg1, arg2, code)                        \
  __inline_mathcode2_ (float, __CONCAT(func,f), arg1, arg2, code)             \
  __inline_mathcode2_ (long double, __CONCAT(func,l), arg1, arg2, code)
# define __inline_mathcodeNP2(func, arg1, arg2, code) \
  __inline_mathcodeNP2_ (double, func, arg1, arg2, code)                        
      \
  __inline_mathcodeNP2_ (float, __CONCAT(func,f), arg1, arg2, code)           \
  __inline_mathcodeNP2_ (long double, __CONCAT(func,l), arg1, arg2, code)
# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
  __inline_mathcode3_ (double, func, arg1, arg2, arg3, code)                  \
  __inline_mathcode3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code)       \
  __inline_mathcode3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \
  __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code)                \
  __inline_mathcodeNP3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code)       
      \
  __inline_mathcodeNP3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code)
#else
# define __inline_mathcode(func, arg, code) \
  __inline_mathcode_ (double, func, (arg), code)
# define __inline_mathcodeNP(func, arg, code) \
  __inline_mathcodeNP_ (double, func, (arg), code)
# define __inline_mathcode2(func, arg1, arg2, code) \
  __inline_mathcode2_ (double, func, arg1, arg2, code)
# define __inline_mathcodeNP2(func, arg1, arg2, code) \
  __inline_mathcodeNP2_ (double, func, arg1, arg2, code)
# define __inline_mathcode3(func, arg1, arg2, arg3, code) \
  __inline_mathcode3_ (double, func, arg1, arg2, arg3, code)
# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \
  __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code)
#endif

#define __inline_mathcode_(float_type, func, arg, code) \
  __MATH_INLINE float_type func (float_type) __THROW;                         \
  __inline_mathcodeNP_(float_type, func, arg, code)

#define __inline_mathcodeNP_(float_type, func, arg, code) \
  __MATH_INLINE float_type func (float_type arg) __THROW                      \
  {                                                                           \
    code;                                                                     \
  }


#define __inline_mathcode2_(float_type, func, arg1, arg2, code) \
  __MATH_INLINE float_type func (float_type, float_type) __THROW;             \
  __inline_mathcodeNP2_ (float_type, func, arg1, arg2, code)

#define __inline_mathcodeNP2_(float_type, func, arg1, arg2, code) \
  __MATH_INLINE float_type func (float_type arg1, float_type arg2) __THROW    \
  {                                                                           \
    code;                                                                     \
  }

#define __inline_mathcode3_(float_type, func, arg1, arg2, arg3, code) \
  __MATH_INLINE float_type func (float_type, float_type, float_type) __THROW; \
  __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code)

#define __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) \
  __MATH_INLINE float_type func (float_type arg1, float_type arg2,            \
                                 float_type arg3) __THROW                     \
  {                                                                           \
    code;                                                                     \
  }
#endif


#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
/* Miscellaneous functions */

__inline_mathcode (__sgn, __x, \
  return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0))

/* __FAST_MATH__ is defined by gcc -ffast-math.  */
#ifdef __FAST_MATH__
__inline_mathcode (__pow2, __x, \
  register long double __value;                                               \
  register long double __exponent;                                            \
  __extension__ long long int __p = (long long int) __x;                      \
  if (__x == (long double) __p)                                               \
    {                                                                         \
      __asm __volatile__                                                      \
        ("fscale"                                                             \
         : "=t" (__value) : "0" (1.0), "u" (__x));                            \
      return __value;                                                         \
    }                                                                         \
  __asm __volatile__                                                          \
    ("fld       %%st(0)\n\t"                                                  \
     "frndint                   # int(x)\n\t"                                 \
     "fxch\n\t"                                                               \
     "fsub      %%st(1)         # fract(x)\n\t"                               \
     "f2xm1                     # 2^(fract(x)) - 1\n\t"                       \
     : "=t" (__value), "=u" (__exponent) : "0" (__x));                        \
  __value += 1.0;                                                             \
  __asm __volatile__                                                          \
    ("fscale"                                                                 \
     : "=t" (__value) : "0" (__value), "u" (__exponent));                     \
  return __value)

# ifdef __USE_GNU
#  define __sincos_code \
  register long double __cosr;                                                \
  register long double __sinr;                                                \
  __asm __volatile__                                                          \
    ("fsincos\n\t"                                                            \
     "fnstsw    %%ax\n\t"                                                     \
     "testl     $0x400, %%eax\n\t"                                            \
     "jz        1f\n\t"                                                       \
     "fldpi\n\t"                                                              \
     "fadd      %%st(0)\n\t"                                                  \
     "fxch      %%st(1)\n\t"                                                  \
     "2: fprem1\n\t"                                                          \
     "fnstsw    %%ax\n\t"                                                     \
     "testl     $0x400, %%eax\n\t"                                            \
     "jnz       2b\n\t"                                                       \
     "fstp      %%st(1)\n\t"                                                  \
     "fsincos\n\t"                                                            \
     "1:"                                                                     \
     : "=t" (__cosr), "=u" (__sinr) : "0" (__x));                             \
  *__sinx = __sinr;                                                           \
  *__cosx = __cosr

__MATH_INLINE void
__sincos (double __x, double *__sinx, double *__cosx) __THROW
{
  __sincos_code;
}

__MATH_INLINE void
__sincosf (float __x, float *__sinx, float *__cosx) __THROW
{
  __sincos_code;
}

__MATH_INLINE void
__sincosl (long double __x, long double *__sinx, long double *__cosx) __THROW
{
  __sincos_code;
}
# endif


/* Optimized inline implementation, sometimes with reduced precision
   and/or argument range.  */

# define __expm1_code \
  register long double __value;                                               \
  register long double __exponent;                                            \
  register long double __temp;                                                \
  __asm __volatile__                                                          \
    ("fldl2e                    # e^x - 1 = 2^(x * log2(e)) - 1\n\t"          \
     "fmul      %%st(1)         # x * log2(e)\n\t"                            \
     "fst       %%st(1)\n\t"                                                  \
     "frndint                   # int(x * log2(e))\n\t"                       \
     "fxch\n\t"                                                               \
     "fsub      %%st(1)         # fract(x * log2(e))\n\t"                     \
     "f2xm1                     # 2^(fract(x * log2(e))) - 1\n\t"             \
     "fscale                    # 2^(x * log2(e)) - 2^(int(x * log2(e)))\n\t" \
     : "=t" (__value), "=u" (__exponent) : "0" (__x));                        \
  __asm __volatile__                                                          \
    ("fscale                    # 2^int(x * log2(e))\n\t"                     \
     : "=t" (__temp) : "0" (1.0), "u" (__exponent));                          \
  __temp -= 1.0;                                                              \
  __temp += __value;                                                          \
  return __temp ? __temp : __x
__inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code)


# define __exp_code \
  register long double __value;                                               \
  register long double __exponent;                                            \
  __asm __volatile__                                                          \
    ("fldl2e                    # e^x = 2^(x * log2(e))\n\t"                  \
     "fmul      %%st(1)         # x * log2(e)\n\t"                            \
     "fst       %%st(1)\n\t"                                                  \
     "frndint                   # int(x * log2(e))\n\t"                       \
     "fxch\n\t"                                                               \
     "fsub      %%st(1)         # fract(x * log2(e))\n\t"                     \
     "f2xm1                     # 2^(fract(x * log2(e))) - 1\n\t"             \
     : "=t" (__value), "=u" (__exponent) : "0" (__x));                        \
  __value += 1.0;                                                             \
  __asm __volatile__                                                          \
    ("fscale"                                                                 \
     : "=t" (__value) : "0" (__value), "u" (__exponent));                     \
  return __value
__inline_mathcodeNP (exp, __x, __exp_code)
__inline_mathcodeNP_ (long double, __expl, __x, __exp_code)


__inline_mathcodeNP (tan, __x, \
  register long double __value;                                               \
  register long double __value2 __attribute__ ((__unused__));                 \
  __asm __volatile__                                                          \
    ("fptan"                                                                  \
     : "=t" (__value2), "=u" (__value) : "0" (__x));                          \
  return __value)
#endif /* __FAST_MATH__ */


#define __atan2_code \
  register long double __value;                                               \
  __asm __volatile__                                                          \
    ("fpatan"                                                                 \
     : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)");                      \
  return __value
__inline_mathcodeNP2 (atan2, __y, __x, __atan2_code)
__inline_mathcodeNP2_ (long double, __atan2l, __y, __x, __atan2_code)


__inline_mathcodeNP2 (fmod, __x, __y, \
  register long double __value;                                               \
  __asm __volatile__                                                          \
    ("1:        fprem\n\t"                                                    \
     "fnstsw    %%ax\n\t"                                                     \
     "sahf\n\t"                                                               \
     "jp        1b"                                                           \
     : "=t" (__value) : "0" (__x), "u" (__y) : "ax", "cc");                   \
  return __value)


__inline_mathopNP (sqrt, "fsqrt")
__inline_mathopNP_ (long double, __sqrtl, "fsqrt")

#if __GNUC_PREREQ (2, 8)
__inline_mathcodeNP_ (double, fabs, __x, return __builtin_fabs (__x))
__inline_mathcodeNP_ (float, fabsf, __x, return __builtin_fabsf (__x))
__inline_mathcodeNP_ (long double, fabsl, __x, return __builtin_fabsl (__x))
__inline_mathcodeNP_ (long double, __fabsl, __x, return __builtin_fabsl (__x))
#else
__inline_mathop (fabs, "fabs")
__inline_mathop_ (long double, __fabsl, "fabs")
#endif

#ifdef __FAST_MATH__
/* The argument range of this inline version is reduced.  */
__inline_mathopNP (sin, "fsin")
/* The argument range of this inline version is reduced.  */
__inline_mathopNP (cos, "fcos")

__inline_mathop_declNP (log, "fldln2; fxch; fyl2x", "0" (__x) : "st(1)")
__inline_mathop_declNP (log10, "fldlg2; fxch; fyl2x", "0" (__x) : "st(1)")

__inline_mathcodeNP (asin, __x, return __atan2l (__x, __sqrtl (1.0 - __x * 
__x)))
__inline_mathcodeNP (acos, __x, return __atan2l (__sqrtl (1.0 - __x * __x), 
__x))
#endif /* __FAST_MATH__ */

__inline_mathop_declNP (atan, "fld1; fpatan", "0" (__x) : "st(1)")

__inline_mathcode_ (long double, __sgn1l, __x, \
  __extension__ union { long double __xld; unsigned int __xi[3]; } __n =      \
    { __xld: __x };                                                           \
  __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff;                              \
  __n.__xi[1] = 0x80000000;                                                   \
  __n.__xi[0] = 0;                                                            \
  return __n.__xld)


#ifdef __FAST_MATH__
/* The argument range of the inline version of sinhl is slightly reduced.  */
__inline_mathcodeNP (sinh, __x, \
  register long double __exm1 = __expm1l (__fabsl (__x));                     \
  return 0.5 * (__exm1 / (__exm1 + 1.0) + __exm1) * __sgn1l (__x))

__inline_mathcodeNP (cosh, __x, \
  register long double __ex = __expl (__x);                                   \
  return 0.5 * (__ex + 1.0 / __ex))

__inline_mathcodeNP (tanh, __x, \
  register long double __exm1 = __expm1l (-__fabsl (__x + __x));              \
  return __exm1 / (__exm1 + 2.0) * __sgn1l (-__x))
#endif

__inline_mathcodeNP (floor, __x, \
  register long double __value;                                               \
  __volatile unsigned short int __cw;                                         \
  __volatile unsigned short int __cwtmp;                                      \
  __asm __volatile ("fnstcw %0" : "=m" (__cw));                               \
  __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */                     \
  __asm __volatile ("fldcw %0" : : "m" (__cwtmp));                            \
  __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));                  \
  __asm __volatile ("fldcw %0" : : "m" (__cw));                               \
  return __value)

__inline_mathcodeNP (ceil, __x, \
  register long double __value;                                               \
  __volatile unsigned short int __cw;                                         \
  __volatile unsigned short int __cwtmp;                                      \
  __asm __volatile ("fnstcw %0" : "=m" (__cw));                               \
  __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */                       \
  __asm __volatile ("fldcw %0" : : "m" (__cwtmp));                            \
  __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));                  \
  __asm __volatile ("fldcw %0" : : "m" (__cw));                               \
  return __value)

#define __ldexp_code \
  register long double __value;                                               \
  __asm __volatile__                                                          \
    ("fscale"                                                                 \
     : "=t" (__value) : "0" (__x), "u" ((long double) __y));                  \
  return __value

__MATH_INLINE double
ldexp (double __x, int __y) __THROW
{
  __ldexp_code;
}


/* Optimized versions for some non-standardized functions.  */
#if defined __USE_ISOC99 || defined __USE_MISC

# ifdef __FAST_MATH__
__inline_mathcodeNP (expm1, __x, __expm1_code)
# endif

/* We cannot rely on M_SQRT being defined.  So we do it for ourself
   here.  */
# define __M_SQRT2      1.41421356237309504880L /* sqrt(2) */

__inline_mathcodeNP (log1p, __x, \
  register long double __value;                                               \
  if (__fabsl (__x) >= 1.0 - 0.5 * __M_SQRT2)                                 \
    __value = logl (1.0 + __x);                                               \
  else                                                                        \
    __asm __volatile__                                                        \
      ("fldln2\n\t"                                                           \
       "fxch\n\t"                                                             \
       "fyl2xp1"                                                              \
       : "=t" (__value) : "0" (__x) : "st(1)");                               \
  return __value)


/* The argument range of the inline version of asinhl is slightly reduced.  */
__inline_mathcodeNP (asinh, __x, \
  register long double  __y = __fabsl (__x);                                  \
  return (log1pl (__y * __y / (__sqrtl (__y * __y + 1.0) + 1.0) + __y)        \
          * __sgn1l (__x)))

__inline_mathcodeNP (acosh, __x, \
  return logl (__x + __sqrtl (__x - 1.0) * __sqrtl (__x + 1.0)))

__inline_mathcodeNP (atanh, __x, \
  register long double __y = __fabsl (__x);                                   \
  return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x))

/* The argument range of the inline version of hypotl is slightly reduced.  */
__inline_mathcodeNP2 (hypot, __x, __y, return __sqrtl (__x * __x + __y * __y))

__inline_mathcodeNP(logb, __x, \
  register long double __value;                                               \
  register long double __junk;                                                \
  __asm __volatile__                                                          \
    ("fxtract\n\t"                                                            \
     : "=t" (__junk), "=u" (__value) : "0" (__x));                            \
  return __value)

#endif

#ifdef __USE_ISOC99
#ifdef __FAST_MATH__
__inline_mathop_declNP (log2, "fld1; fxch; fyl2x", "0" (__x) : "st(1)")
#endif /* __FAST_MATH__ */

__MATH_INLINE float
ldexpf (float __x, int __y) __THROW
{
  __ldexp_code;
}

__MATH_INLINE long double
ldexpl (long double __x, int __y) __THROW
{
  __ldexp_code;
}

#ifdef __FAST_MATH__
__inline_mathcodeNP3 (fma, __x, __y, __z, return (__x * __y) + __z)

__inline_mathopNP (rint, "frndint")
#endif /* __FAST_MATH__ */

#define __lrint_code \
  long int __lrintres;                                                        \
  __asm__ __volatile__                                                        \
    ("fistpl %0"                                                              \
     : "=m" (__lrintres) : "t" (__x) : "st");                                 \
  return __lrintres
__MATH_INLINE long int
lrintf (float __x) __THROW
{
  __lrint_code;
}
__MATH_INLINE long int
lrint (double __x) __THROW
{
  __lrint_code;
}
__MATH_INLINE long int
lrintl (long double __x) __THROW
{
  __lrint_code;
}
#undef __lrint_code

#define __llrint_code \
  long long int __llrintres;                                                  \
  __asm__ __volatile__                                                        \
    ("fistpll %0"                                                             \
     : "=m" (__llrintres) : "t" (__x) : "st");                                \
  return __llrintres
__MATH_INLINE long long int
llrintf (float __x) __THROW
{
  __llrint_code;
}
__MATH_INLINE long long int
llrint (double __x) __THROW
{
  __llrint_code;
}
__MATH_INLINE long long int
llrintl (long double __x) __THROW
{
  __llrint_code;
}
#undef __llrint_code

#endif


#ifdef __USE_MISC

__inline_mathcodeNP2 (drem, __x, __y, \
  register double __value;                                                    \
  register int __clobbered;                                                   \
  __asm __volatile__                                                          \
    ("1:        fprem1\n\t"                                                   \
     "fstsw     %%ax\n\t"                                                     \
     "sahf\n\t"                                                               \
     "jp        1b"                                                           \
     : "=t" (__value), "=&a" (__clobbered) : "0" (__x), "u" (__y) : "cc");    \
  return __value)


/* This function is used in the `isfinite' macro.  */
__MATH_INLINE int
__finite (double __x) __THROW
{
  return (__extension__
          (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1]
             | 0x800fffffu) + 1) >> 31));
}

/* Miscellaneous functions */
#ifdef __FAST_MATH__
__inline_mathcode (__coshm1, __x, \
  register long double __exm1 = __expm1l (__fabsl (__x));                     \
  return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1)

__inline_mathcode (__acosh1p, __x, \
  return log1pl (__x + __sqrtl (__x) * __sqrtl (__x + 2.0)))

#endif /* __FAST_MATH__ */
#endif /* __USE_MISC  */

/* Undefine some of the large macros which are not used anymore.  */
#undef __atan2_code
#ifdef __FAST_MATH__
# undef __expm1_code
# undef __exp_code
# undef __sincos_code
#endif /* __FAST_MATH__ */

#endif /* __NO_MATH_INLINES  */


/* This code is used internally in the GNU libc.  */
#ifdef __LIBC_INTERNAL_MATH_INLINES
__inline_mathop (__ieee754_sqrt, "fsqrt")
__inline_mathcode2 (__ieee754_atan2, __y, __x,
                    register long double __value;
                    __asm __volatile__ ("fpatan\n\t"
                                        : "=t" (__value)
                                        : "0" (__x), "u" (__y) : "st(1)");
                    return __value;)
#endif

#endif /* __GNUC__  */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]