Example #1
0
/* wrapper yn */
double
yn (int n, double x)
{
  if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_)
    {
      if (x < 0.0)
	{
	  /* d = zero/(x-x) */
	  feraiseexcept (FE_INVALID);
	  return __kernel_standard (n, x, 13);
	}
      else if (x == 0.0)
	{
	  /* d = -one/(x-x) */
	  feraiseexcept (FE_DIVBYZERO);
	  return __kernel_standard (n, x, 12);
	}
      else if (_LIB_VERSION != _POSIX_)
	/* yn(n,x>X_TLOSS) */
	return __kernel_standard (n, x, 39);
    }

  return __ieee754_yn (n, x);
}
Example #2
0
double lgamma(double x)
{
	double y = __ieee754_lgamma_r(x, &signgam);
	if (_LIB_VERSION == _IEEE_)
		return y;
	if (!isfinite(y) && isfinite(x)) {
		if (floor(x) == x && x <= 0.0)
			return __kernel_standard(x, x, 15); /* lgamma pole */
		return __kernel_standard(x, x, 14); /* lgamma overflow */
	}
	return y;
}
Example #3
0
double log10(double x)
{
	double z = __ieee754_log10(x);
	if (_LIB_VERSION == _IEEE_ || isnan(x))
		return z;
	if (x <= 0.0) {
		if(x == 0.0)
			return __kernel_standard(x, x, 18); /* log10(0) */
		return __kernel_standard(x, x, 19); /* log10(x<0) */
	}
	return z;
}
double scalb(double x, double fn)
{
	double z = __ieee754_scalb(x, fn);
	if (_LIB_VERSION == _IEEE_)
		return z;
	if (!(isfinite(z) || isnan(z)) && isfinite(x))
		return __kernel_standard(x, (double)fn, 32); /* scalb overflow */
	if (z == 0.0 && z != x)
		return __kernel_standard(x, (double)fn, 33); /* scalb underflow */
	if (!isfinite(fn))
		errno = ERANGE;
	return z;
}
Example #5
0
        double log(double x)            /* wrapper log */
{
#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
        return __ieee754_log(x);
#else
        double z;
        z = __ieee754_log(x);
        if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x) || x > 0.0) return z;
        if(x==0.0)
            return __kernel_standard(x,x,16); /* log(0) */
        else 
            return __kernel_standard(x,x,17); /* log(x<0) */
#endif
}
Example #6
0
double y0(double x)
{
	double z = __ieee754_y0(x);
	if (_LIB_VERSION == _IEEE_ || isnan(x))
		return z;
	if (x <= 0.0) {
		if (x == 0.0) /* d= -one/(x-x); */
			return __kernel_standard(x, x, 8);
		/* d = zero/(x-x); */
		return __kernel_standard(x, x, 9);
	}
	if (x > X_TLOSS)
		return __kernel_standard(x, x, 35); /* y0(x>X_TLOSS) */
	return z;
}
Example #7
0
double
log(double x)		/* wrapper log */
{
#ifdef _IEEE_LIBM
	return __ieee754_log(x);
#else
	double z;
	z = __ieee754_log(x);
	if(_LIB_VERSION == _IEEE_ || isnan(x) || x > 0.0) return z;
	if(x==0.0)
	    return __kernel_standard(x,x,16); /* log(0) */
	else
	    return __kernel_standard(x,x,17); /* log(x<0) */
#endif
}
Example #8
0
/* wrapper sqrtl */
long double
__sqrtl (long double x)
{
  if (__builtin_expect (x < 0.0L, 0) && _LIB_VERSION != _IEEE_)
    return __kernel_standard (x, x, 226); /* sqrt(negative) */

  return __ieee754_sqrtl (x);
}
Example #9
0
/* wrapper sqrt */
double
__sqrt (double x)
{
  if (__builtin_expect (isless (x, 0.0), 0) && _LIB_VERSION != _IEEE_)
    return __kernel_standard (x, x, 26); /* sqrt(negative) */

  return __ieee754_sqrt (x);
}
Example #10
0
long double
__atan2l (long double y, long double x)
{
    if (__builtin_expect (x == 0.0L && y == 0.0L, 0) && _LIB_VERSION == _SVID_)
        return __kernel_standard (y, x, 203); /* atan2(+-0,+-0) */

    return __ieee754_atan2l (y, x);
}
Example #11
0
	double lgamma_r(double x, int *signgamp) /* wrapper lgamma_r */
{
#ifdef _IEEE_LIBM
	return __ieee754_lgamma_r(x,signgamp);
#else
        double y;
        y = __ieee754_lgamma_r(x,signgamp);
        if(_LIB_VERSION == _IEEE_) return y;
        if(!finite(y)&&finite(x)) {
            if(floor(x)==x&&x<=0.0)
                return __kernel_standard(x,x,15); /* lgamma pole */
            else
                return __kernel_standard(x,x,14); /* lgamma overflow */
        } else
            return y;
#endif
}
Example #12
0
float
logf(float x)		/* wrapper logf */
{
#ifdef _IEEE_LIBM
	return __ieee754_logf(x);
#else
	float z;
	z = __ieee754_logf(x);
	if(_LIB_VERSION == _IEEE_ || isnanf(x) || x > (float)0.0) return z;
	if(x==(float)0.0)
	    /* logf(0) */
	    return (float)__kernel_standard((double)x,(double)x,116);
	else
	    /* logf(x<0) */
	    return (float)__kernel_standard((double)x,(double)x,117);
#endif
}
Example #13
0
long double
__exp2l (long double x)			/* wrapper exp2l */
{
#ifdef _IEEE_LIBM
  return __ieee754_exp2l (x);
#else
  long double z;
  z = __ieee754_exp2l (x);
  if (_LIB_VERSION != _IEEE_ && __finitel (x))
    {
      if (x > o_threshold)
	return __kernel_standard (x, x, 244); /* exp2l overflow */
      else if (x <= u_threshold)
	return __kernel_standard (x, x, 245); /* exp2l underflow */
    }
  return z;
#endif
}
Example #14
0
File: w_acoshl.c Project: dreal/tai
/* wrapper acosl */
long double
__acoshl (long double x)
{
  if (__builtin_expect (isless (x, 1.0L), 0) && _LIB_VERSION != _IEEE_)
    /* acosh(x<1) */
    return __kernel_standard (x, x, 229);

  return __ieee754_acoshl (x);
}
Example #15
0
double hypot(double x, double y)
{
    double z = __ieee754_hypot(x, y);
    if (_LIB_VERSION == _IEEE_)
        return z;
    if ((!isfinite(z)) && isfinite(x) && isfinite(y))
        return __kernel_standard(x, y, 4); /* hypot overflow */
    return z;
}
Example #16
0
double
gamma(double x)
{
#ifdef _IEEE_LIBM
	return __ieee754_lgamma_r(x,&signgam);
#else
        double y;
        y = __ieee754_lgamma_r(x,&signgam);
        if(_LIB_VERSION == _IEEE_) return y;
        if(!finite(y)&&finite(x)) {
            if(floor(x)==x&&x<=0.0)
                return __kernel_standard(x,x,41); /* gamma pole */
            else
                return __kernel_standard(x,x,40); /* gamma overflow */
        } else
            return y;
#endif
}
Example #17
0
double j0(double x)
{
	double z = __ieee754_j0(x);
	if (_LIB_VERSION == _IEEE_ || isnan(x))
		return z;
	if (fabs(x) > X_TLOSS)
		return __kernel_standard(x, x, 34); /* j0(|x|>X_TLOSS) */
	return z;
}
Example #18
0
File: w_log2.c Project: etiago/vbox
double
log2(double x)    /* wrapper log10 */
{
#ifdef _IEEE_LIBM
  return __ieee754_log2(x);
#else
  double z;
  z = __ieee754_log2(x);
  if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
  if(x<=0.0) {
      if(x==0.0)
          return __kernel_standard(x,x,48); /* log2(0) */
      else
          return __kernel_standard(x,x,49); /* log2(x<0) */
  } else
      return z;
#endif
}
Example #19
0
/* wrapper j1 */
double
j1 (double x)
{
    if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
        /* j1(|x|>X_TLOSS) */
        return __kernel_standard (x, x, 36);

    return __ieee754_j1 (x);
}
Example #20
0
double
exp(double x)   /* wrapper exp */
{
#ifdef _IEEE_LIBM
  return __ieee754_exp(x);
#else
  double z;
  z = __ieee754_exp(x);
  if(_LIB_VERSION == _IEEE_) return z;
  if(finite(x)) {
      if(x>o_threshold)
          return __kernel_standard(x,x,6); /* exp overflow */
      else if(x<u_threshold)
          return __kernel_standard(x,x,7); /* exp underflow */
  }
  return z;
#endif
}
Example #21
0
double acos(double x)
{
    double z = __ieee754_acos(x);
    if (_LIB_VERSION == _IEEE_ || isnan(x))
        return z;
    if (fabs(x) > 1.0)
        return __kernel_standard(x, x, 1); /* acos(|x|>1) */
    return z;
}
Example #22
0
File: w_atanh.c Project: mmcx/cegcc
double
atanh(double x)		/* wrapper atanh */
{
#ifdef _IEEE_LIBM
	return __ieee754_atanh(x);
#else
	double z,y;
	z = __ieee754_atanh(x);
	if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
	y = fabs(x);
	if(y>=1.0) {
	    if(y>1.0)
	        return __kernel_standard(x,x,30); /* atanh(|x|>1) */
	    else 
	        return __kernel_standard(x,x,31); /* atanh(|x|==1) */
	} else
	    return z;
#endif
}
Example #23
0
double
ldexp(double x, int exp)
{
    double z;
    
    z = scalbn(x,exp);
    
#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY
    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z;
    if(!(finite(z)||isnan(z))&&finite(x)) {
        return __kernel_standard(x,(double)exp,43); /* ldexp overflow */
    }
    if(z==0.0&&z!=x) {
        return __kernel_standard(x,(double)exp,44); /* ldexp underflow */
    } 
#endif

    return z;
}
Example #24
0
double
__hypot (double x, double y)
{
	double z = __ieee754_hypot(x,y);
	if(__builtin_expect(!isfinite(z), 0)
	   && isfinite(x) && isfinite(y) && _LIB_VERSION != _IEEE_)
	    return __kernel_standard(x, y, 4); /* hypot overflow */

	return z;
}
Example #25
0
/* wrapper log10(x) */
double
__log10 (double x)
{
    if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_)
    {
        if (x == 0.0)
        {
            __feraiseexcept (FE_DIVBYZERO);
            return __kernel_standard (x, x, 18); /* log10(0) */
        }
        else
        {
            __feraiseexcept (FE_INVALID);
            return __kernel_standard (x, x, 19); /* log10(x<0) */
        }
    }

    return  __ieee754_log10 (x);
}
Example #26
0
/* wrapper exp */
double
__exp (double x)
{
  double z = __ieee754_exp (x);
  if (__builtin_expect (!isfinite (z) || z == 0, 0)
      && isfinite (x) && _LIB_VERSION != _IEEE_)
    return __kernel_standard (x, x, 6 + !!signbit (x));

  return z;
}
Example #27
0
/* wrapper j0 */
double
j0 (double x)
{
  if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
    /* j0(|x|>X_TLOSS) */
    return __kernel_standard (x, x, 34);

  return __ieee754_j0 (x);
}
Example #28
0
/* wrapper acosh */
double
acosh (double x)
{
#if defined(__UCLIBC_HAS_FENV__)
  if (__builtin_expect (isless (x,  1.0), 0) && _LIB_VERSION != _IEEE_)
    /* acosh(x<1) */
    return __kernel_standard (x, x, 29);
#endif
  return __ieee754_acosh (x);
}
Example #29
0
/* wrapper remainder */
double
__remainder (double x, double y)
{
  if (((__builtin_expect (y == 0.0, 0) && ! __isnan (x))
       || (__builtin_expect (__isinf_ns (x), 0) && ! __isnan (y)))
      && _LIB_VERSION != _IEEE_)
    return __kernel_standard (x, y, 28); /* remainder domain */

  return __ieee754_remainder (x, y);
}
Example #30
0
/* wrapper jn */
double
jn (int n, double x)
{
  if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
    /* jn(n,|x|>X_TLOSS) */
    return __kernel_standard (n, x, 38);

  return __ieee754_jn (n, x);
}