This patch fixes some sinf/cosf calculations that generated unexpected
underflows exceptions.
+2012-06-01 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/fpu/k_cosf.c: Fix underflow generation.
+ * sysdeps/powerpc/fpu/k_sinf.c: Likewise.
+
2012-05-31 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
not, see <http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <fenv.h>
#include <math_private.h>
static const float twom27 = 7.4505806e-09;
ix = __builtin_fabsf (x);
if (ix < twom27)
{ /* |x| < 2**-27 */
- if (x == 0.0)
- return one;
+ __feraiseexcept (FE_INEXACT);
+ return one;
}
z = x * x;
r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * C6)))));
not, see <http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <fenv.h>
#include <math_private.h>
ix = __builtin_fabsf (x);
if (ix < twom27)
{ /* |x| < 2**-27 */
- if (x == 0.0)
- return x;
+ __feraiseexcept (FE_INEXACT);
+ return x;
}
z = x * x;
v = z * x;