示例#1
0
/* wrapper y1f */
float
y1f (float x)
{
  if (__builtin_expect (islessequal (x, 0.0f)
			|| isgreater (x, (float) X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_)
    {
      if (x < 0.0f)
	{
	  /* d = zero/(x-x) */
	  feraiseexcept (FE_INVALID);
	  return __kernel_standard_f (x, x, 111);
	}
      else if (x == 0.0f)
	{
	  /* d = -one/(x-x) */
	  feraiseexcept (FE_DIVBYZERO);
	  return __kernel_standard_f (x, x, 110);
	}
      else if (_LIB_VERSION != _POSIX_)
	/* y1(x>X_TLOSS) */
	return __kernel_standard_f (x, x, 137);
    }

  return __ieee754_y1f (x);
}
示例#2
0
文件: w_scalbf.c 项目: dreal/tai
sysv_scalbf (float x, float fn)
{
  float z = __ieee754_scalbf (x, fn);

  if (__builtin_expect (__isinff (z), 0))
    {
      if (__finitef (x))
	return __kernel_standard_f (x, fn, 132); /* scalb overflow */
      else
	__set_errno (ERANGE);
    }
  else if (__builtin_expect (z == 0.0f, 0) && z != x)
    return __kernel_standard_f (x, fn, 133); /* scalb underflow */

  return z;
}
示例#3
0
文件: w_sqrtf.c 项目: AubrCool/glibc
/* wrapper sqrtf */
float
__sqrtf (float x)
{
  if (__builtin_expect (isless (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
    return __kernel_standard_f (x, x, 126); /* sqrt(negative) */

  return __ieee754_sqrtf (x);
}
示例#4
0
文件: w_atan2f.c 项目: Xilinx/eglibc
float
__atan2f (float y, float x)
{
  if (__builtin_expect (x == 0.0f && y == 0.0f, 0) && _LIB_VERSION == _SVID_)
    return __kernel_standard_f (y, x, 103); /* atan2(+-0,+-0) */

  return __ieee754_atan2f (y, x);
}
示例#5
0
文件: w_j1f.c 项目: endplay/omniplay
/* wrapper j1f */
float
j1f (float x)
{
  if (__builtin_expect (fabsf (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
    /* j1(|x|>X_TLOSS) */
    return __kernel_standard_f (x, x, 136);

  return __ieee754_j1f (x);
}
示例#6
0
/* wrapper acoshf */
float
__acoshf (float x)
{
  if (__builtin_expect (isless (x, 1.0f), 0) && _LIB_VERSION != _IEEE_)
    /* acosh(x<1) */
    return __kernel_standard_f (x, x, 129);

  return __ieee754_acoshf (x);
}
示例#7
0
文件: w_fmodf.c 项目: AdvancedC/glibc
/* wrapper fmodf */
float
__fmodf (float x, float y)
{
  if (__builtin_expect (__isinf_nsf (x) || y == 0.0f, 0)
      && _LIB_VERSION != _IEEE_ && !__isnanf (y) && !__isnanf (x))
    /* fmod(+-Inf,y) or fmod(x,0) */
    return __kernel_standard_f (x, y, 127);

  return __ieee754_fmodf (x, y);
}
示例#8
0
/* wrapper j1f */
float
__j1f (float x)
{
  if (__builtin_expect (isgreater (fabsf (x), X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
    /* j1(|x|>X_TLOSS) */
    return __kernel_standard_f (x, x, 136);

  return __ieee754_j1f (x);
}
示例#9
0
文件: w_jnf.c 项目: AubrCool/glibc
/* wrapper jnf */
float
jnf (int n, float x)
{
  if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
    /* jn(n,|x|>X_TLOSS) */
    return __kernel_standard_f (n, x, 138);

  return __ieee754_jnf (n, x);
}
示例#10
0
文件: w_logf.c 项目: endplay/omniplay
/* wrapper logf(x) */
float
__logf (float x)
{
  if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
    {
      if (x == 0.0f)
	{
	  feraiseexcept (FE_DIVBYZERO);
	  return __kernel_standard_f (x, x, 116); /* log(0) */
	}
      else
	{
	  feraiseexcept (FE_INVALID);
	  return __kernel_standard_f (x, x, 117); /* log(x<0) */
	}
    }

  return  __ieee754_logf (x);
}
示例#11
0
/* wrapper expf */
float
__expf_compat (float x)
{
  float z = __ieee754_expf (x);
  if (__builtin_expect (!isfinite (z) || z == 0, 0)
      && isfinite (x) && _LIB_VERSION != _IEEE_)
    return __kernel_standard_f (x, x, 106 + !!signbit (x));

  return z;
}
示例#12
0
文件: w_j0f.c 项目: dreal/tai
/* wrapper j0f */
float
j0f (float x)
{
  if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_)
    /* j0(|x|>X_TLOSS) */
    return __kernel_standard_f (x, x, 134);

  return __ieee754_j0f (x);
}
示例#13
0
float
__coshf (float x)
{
    float z = __ieee754_coshf (x);
    if (__builtin_expect (!isfinite (z), 0) && isfinite (x)
            && _LIB_VERSION != _IEEE_)
        return __kernel_standard_f (x, x, 105); /* cosh overflow */

    return z;
}
示例#14
0
/* wrapper remainderf */
float
__remainderf (float x, float y)
{
  if (((__builtin_expect (y == 0.0f, 0) && ! isnan (x))
       || (__builtin_expect (isinf (x), 0) && ! isnan (y)))
      && _LIB_VERSION != _IEEE_)
    return __kernel_standard_f (x, y, 128); /* remainder domain */

  return __ieee754_remainderf (x, y);
}
示例#15
0
文件: w_log2f.c 项目: AdvancedC/glibc
/* wrapper log2f(x) */
float
__log2f (float x)
{
  if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
    {
      if (x == 0.0)
	{
	  feraiseexcept (FE_DIVBYZERO);
	  return __kernel_standard_f (x, x, 148); /* log2(0) */
	}
      else
	{
	  feraiseexcept (FE_INVALID);
	  return __kernel_standard_f (x, x, 149); /* log2(x<0) */
	}
    }

  return  __ieee754_log2f (x);
}
示例#16
0
/* wrapper remainderf */
float
remainderf (float x, float y)
{
#if defined(__UCLIBC_HAS_FENV__)
  if (((__builtin_expect (y == 0.0f, 0) && ! isnan (x))
       || (__builtin_expect (isinf (x), 0) && ! isnan (y)))
      && _LIB_VERSION != _IEEE_)
    return __kernel_standard_f (x, y, 128); /* remainder domain */
#endif
  return (float) __ieee754_remainder ((double) x,(double) y);
}
示例#17
0
float
__exp2f (float x)
{
  float z = __ieee754_exp2f (x);
  if (__builtin_expect (!isfinite (z) || z == 0, 0)
      && isfinite (x) && _LIB_VERSION != _IEEE_)
    /* exp2 overflow: 144, exp2 underflow: 145 */
    return __kernel_standard_f (x, x, 144 + !!signbit (x));

  return z;
}
示例#18
0
/* wrapper log2f(x) */
float
log2f (float x)
{
#if defined(__UCLIBC_HAS_FENV__)
  if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
    {
      if (x == 0.0)
	{
	  feraiseexcept (FE_DIVBYZERO);
	  return __kernel_standard_f (x, x, 148); /* log2(0) */
	}
      else
	{
	  feraiseexcept (FE_INVALID);
	  return __kernel_standard_f (x, x, 149); /* log2(x<0) */
	}
    }
#endif
  return (float) __ieee754_log2 ((double) x);
}
示例#19
0
/* wrapper fmodf */
float
fmodf (float x, float y)
{
#if defined(__UCLIBC_HAS_FENV__)
  if (__builtin_expect (isinf (x) || y == 0.0f, 0)
      && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x))
    /* fmod(+-Inf,y) or fmod(x,0) */
    return __kernel_standard_f (x, y, 127);
#endif
  return (float) __ieee754_fmod ((double) x,(double) y);
}
示例#20
0
float
__hypotf(float x, float y)
{
	float z = __ieee754_hypotf(x,y);
	if(__builtin_expect(!__finitef(z), 0)
	   && __finitef(x) && __finitef(y) && _LIB_VERSION != _IEEE_)
	    /* hypot overflow */
	    return __kernel_standard_f(x, y, 104);

	return z;
}
示例#21
0
文件: w_acosf.c 项目: AdvancedC/glibc
/* wrapper acosf */
float
__acosf (float x)
{
  if (__builtin_expect (isgreater (fabsf (x), 1.0f), 0)
      && _LIB_VERSION != _IEEE_)
    {
      /* acos(|x|>1) */
      feraiseexcept (FE_INVALID);
      return __kernel_standard_f (x, x, 101);
    }

  return __ieee754_acosf (x);
}
示例#22
0
文件: w_j1f.c 项目: endplay/omniplay
/* wrapper y1f */
float
y1f (float x)
{
  if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
      && _LIB_VERSION != _IEEE_)
    {
      if (x < 0.0f)
	{
	  /* d = zero/(x-x) */
	  feraiseexcept (FE_INVALID);
	  return __kernel_standard_f (x, x, 111);
	}
      else if (x == 0.0f)
	/* d = -one/(x-x) */
	return __kernel_standard_f (x, x, 110);
      else
	/* y1(x>X_TLOSS) */
	return __kernel_standard_f (x, x, 137);
    }

  return __ieee754_y1f (x);
}
示例#23
0
float
__atan2f (float y, float x)
{
  float z;

  if (__builtin_expect (x == 0.0f && y == 0.0f, 0) && _LIB_VERSION == _SVID_)
    return __kernel_standard_f (y, x, 103); /* atan2(+-0,+-0) */

  z = __ieee754_atan2f (y, x);
  if (__glibc_unlikely (z == 0.0f && y != 0.0f && isfinite (x)))
    __set_errno (ERANGE);
  return z;
}
示例#24
0
float
LGFUNC (__lgammaf) (float x)
{
	float y = CALL_LGAMMA (float, __ieee754_lgammaf_r, x);
	if(__builtin_expect(!isfinite(y), 0)
	   && isfinite(x) && _LIB_VERSION != _IEEE_)
		return __kernel_standard_f(x, x,
					   floorf(x)==x&&x<=0.0f
					   ? 115 /* lgamma pole */
					   : 114); /* lgamma overflow */

	return y;
}
示例#25
0
/* wrapper powf */
float
powf (float x, float y)
{
#if defined(__UCLIBC_HAS_FENV__)
  float z = (float)  __ieee754_pow ((double) x, (double) y);
  if (__builtin_expect (!isfinite (z), 0))
    {
      if (_LIB_VERSION != _IEEE_)
	{
	  if (isnan (x))
	    {
	      if (y == 0.0f)
		/* pow(NaN,0.0) */
		return __kernel_standard_f (x, y, 142);
	    }
	  else if (isfinite (x) && isfinite (y))
	    {
	      if (isnan (z))
		/* pow neg**non-int */
		return __kernel_standard_f (x, y, 124);
	      else if (x == 0.0f && y < 0.0f)
		{
		  if (signbit (x) && signbit (z))
		    /* pow(-0.0,negative) */
		    return __kernel_standard_f (x, y, 123);
		  else
		    /* pow(+0.0,negative) */
		    return __kernel_standard_f (x, y, 143);
		}
	      else
		/* pow overflow */
		return __kernel_standard_f (x, y, 121);
	    }
	}
    }
  else if (__builtin_expect (z == 0.0f, 0) && isfinite (x) && isfinite (y)
	   && _LIB_VERSION != _IEEE_)
    {
      if (x == 0.0f)
	{
	  if (y == 0.0f)
	    /* pow(0.0,0.0) */
	    return __kernel_standard_f (x, y, 120);
	}
      else
	/* pow underflow */
	return __kernel_standard_f (x, y, 122);
    }

	return z;
#else
	return (float) __ieee754_pow ((double) x, (double) y);
#endif /* __UCLIBC_HAS_FENV__ */
}
示例#26
0
float
__lgammaf_r(float x, int *signgamp)
{
	float y = __ieee754_lgammaf_r(x,signgamp);
	if(__builtin_expect(!__finitef(y), 0)
	   && __finitef(x) && _LIB_VERSION != _IEEE_)
		return __kernel_standard_f(x, x,
					   __floorf(x)==x&&x<=0.0f
					   ? 115 /* lgamma pole */
					   : 114); /* lgamma overflow */

	return y;
}
示例#27
0
float
sinhf (float x)
{
#if defined(__UCLIBC_HAS_FENV__)
	float z = (float) __ieee754_sinh ((double) x);
	if (__builtin_expect (!isfinite (z), 0) && isfinite (x)
	    && _LIB_VERSION != _IEEE_)
	    return __kernel_standard_f (x, x, 125); /* sinhf overflow */

	return z;
#else
	return (float) __ieee754_sinh ((double) x);
#endif
}
示例#28
0
文件: w_j0f.c 项目: dreal/tai
/* wrapper y0f */
float
y0f (float x)
{
  if (__builtin_expect (islessequal (x, 0.0f)
                        || isgreater (x, (float) X_TLOSS), 0)
      && _LIB_VERSION != _IEEE_)
    {
      if (x < 0.0f)
	{
	  /* d = zero/(x-x) */
	  feraiseexcept (FE_INVALID);
	  return __kernel_standard_f (x, x, 109);
	}
      else if (x == 0.0f)
	/* d = -one/(x-x) */
	return __kernel_standard_f (x, x, 108);
      else
	/* y0(x>X_TLOSS) */
	return __kernel_standard_f (x, x, 135);
    }

  return __ieee754_y0f (x);
}
示例#29
0
/* wrapper powf */
float
__powf (float x, float y)
{
    float z = __ieee754_powf (x, y);
    if (__builtin_expect (!__finitef (z), 0))
    {
        if (_LIB_VERSION != _IEEE_)
        {
            if (__isnanf (x))
            {
                if (y == 0.0f)
                    /* pow(NaN,0.0) */
                    return __kernel_standard_f (x, y, 142);
            }
            else if (__finitef (x) && __finitef (y))
            {
                if (__isnanf (z))
                    /* pow neg**non-int */
                    return __kernel_standard_f (x, y, 124);
                else if (x == 0.0f && y < 0.0f)
                {
                    if (signbit (x) && signbit (z))
                        /* pow(-0.0,negative) */
                        return __kernel_standard_f (x, y, 123);
                    else
                        /* pow(+0.0,negative) */
                        return __kernel_standard_f (x, y, 143);
                }
                else
                    /* pow overflow */
                    return __kernel_standard_f (x, y, 121);
            }
        }
    }
    else if (__builtin_expect (z == 0.0f, 0) && __finitef (x) && __finitef (y)
             && _LIB_VERSION != _IEEE_)
    {
        if (x == 0.0f)
        {
            if (y == 0.0f)
                /* pow(0.0,0.0) */
                return __kernel_standard_f (x, y, 120);
        }
        else
            /* pow underflow */
            return __kernel_standard_f (x, y, 122);
    }

    return z;
}