From 1d90e185c4ef9246e7e4bf02c3ee13cbd71dd7da Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 19 Mar 2017 16:52:20 +0000 Subject: [PATCH] scalbn and fma special cases --- src/math/special/fma.h | 9 +++++++++ src/math/special/fmaf.h | 4 ++++ src/math/special/fmal.h | 4 ++++ src/math/special/scalbln.h | 1 + src/math/special/scalblnf.h | 1 + src/math/special/scalblnl.h | 1 + src/math/special/scalbn.h | 1 + src/math/special/scalbnf.h | 1 + src/math/special/scalbnl.h | 1 + 9 files changed, 23 insertions(+) diff --git a/src/math/special/fma.h b/src/math/special/fma.h index b7b2371..5a3db10 100644 --- a/src/math/special/fma.h +++ b/src/math/special/fma.h @@ -838,3 +838,12 @@ T(RU, 0x1.000000001p-1000, 0x1.000000001p-30, -0x1p-1066, T(RU, -0x1.000000001p-1000, 0x1.000000001p-30, -0x1p-1066, -0x1.000000003p-1030, 0x1p-28, INEXACT|UNDERFLOW) T(RZ, 0x1.000000001p-1000, 0x1.000000001p-30, -0x1p-1066, 0x1.000000001p-1030, -0x1p-28, INEXACT|UNDERFLOW) T(RZ, -0x1.000000001p-1000, 0x1.000000001p-30, -0x1p-1066, -0x1.000000003p-1030, 0x1p-28, INEXACT|UNDERFLOW) +T(RN, -0x1p-1000, 0x1.000001p-74, 0x1p-1022, 0x1.ffffffffffffep-1023, 0x1p-24, INEXACT|UNDERFLOW) +T(RU, -0x1p-1000, 0x1.000001p-74, 0x1p-1022, 0x1.ffffffffffffep-1023, 0x1p-24, INEXACT|UNDERFLOW) +T(RD, -0x1p-1000, 0x1.000001p-74, 0x1p-1022, 0x1.ffffffffffffcp-1023, -0x1.fffffep-1, INEXACT|UNDERFLOW) +T(RZ, -0x1p-1000, 0x1.000001p-74, 0x1p-1022, 0x1.ffffffffffffcp-1023, -0x1.fffffep-1, INEXACT|UNDERFLOW) +// depends on underflow before or after rounding +//T(RN, -0x1p-1000, 0x1p-200, 0x1p-1022, 0x1p-1022, 0x1p-26, INEXACT) +//T(RU, -0x1p-1000, 0x1p-200, 0x1p-1022, 0x1p-1022, 0x1p-26, INEXACT) +T(RD, -0x1p-1000, 0x1p-200, 0x1p-1022, 0x1.ffffffffffffep-1023, -0x1p+0, INEXACT|UNDERFLOW) +T(RZ, -0x1p-1000, 0x1p-200, 0x1p-1022, 0x1.ffffffffffffep-1023, -0x1p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/fmaf.h b/src/math/special/fmaf.h index c6bc645..1ab2918 100644 --- a/src/math/special/fmaf.h +++ b/src/math/special/fmaf.h @@ -45,3 +45,7 @@ T(RD, -0x1p+0, -0x1p+0, -0x1p+0, -0x0p+0, T(RD, 0x1p-120, 0x1p-120, 0x1p-149, 0x1p-149, -0x1p-91, INEXACT|UNDERFLOW) T(RU, 0x1p-120, 0x1p-120, 0x1p-149, 0x1p-148, 0x1p+0, INEXACT|UNDERFLOW) T(RZ, 0x1p-120, 0x1p-120, 0x1p-149, 0x1p-149, -0x1p-91, INEXACT|UNDERFLOW) +T(RN, -0x1p-100, 0x1.001p-49, 0x1p-126, 0x1.fffffcp-127, 0x1p-12, INEXACT|UNDERFLOW) +T(RU, -0x1p-100, 0x1.001p-49, 0x1p-126, 0x1.fffffcp-127, 0x1p-12, INEXACT|UNDERFLOW) +T(RD, -0x1p-100, 0x1.001p-49, 0x1p-126, 0x1.fffff8p-127, -0x1.ffep-1, INEXACT|UNDERFLOW) +T(RZ, -0x1p-100, 0x1.001p-49, 0x1p-126, 0x1.fffff8p-127, -0x1.ffep-1, INEXACT|UNDERFLOW) diff --git a/src/math/special/fmal.h b/src/math/special/fmal.h index 5a453b9..1f60313 100644 --- a/src/math/special/fmal.h +++ b/src/math/special/fmal.h @@ -43,3 +43,7 @@ T(RU, 0x1.0000000001p-16000L, 0x1.0000000001p-400L, T(RU, -0x1.0000000001p-16000L, 0x1.0000000001p-400L, -0x1p-16440L, -0x1.0000000003p-16400L, 0x1p-35, INEXACT|UNDERFLOW) T(RZ, 0x1.0000000001p-16000L, 0x1.0000000001p-400L, -0x1p-16440L, 0x1.0000000001p-16400L, -0x1p-35, INEXACT|UNDERFLOW) T(RZ, -0x1.0000000001p-16000L, 0x1.0000000001p-400L, -0x1p-16440L, -0x1.0000000003p-16400L, 0x1p-35, INEXACT|UNDERFLOW) +T(RN, -0x1p-10000L, 0x1.0000000000001p-6445L, 0x1p-16382L, 0x1.fffffffffffffffcp-16383L, 0x1p-52, INEXACT|UNDERFLOW) +T(RU, -0x1p-10000L, 0x1.0000000000001p-6445L, 0x1p-16382L, 0x1.fffffffffffffffcp-16383L, 0x1p-52, INEXACT|UNDERFLOW) +T(RD, -0x1p-10000L, 0x1.0000000000001p-6445L, 0x1p-16382L, 0x1.fffffffffffffff8p-16383L, -0x1p+0, INEXACT|UNDERFLOW) +T(RZ, -0x1p-10000L, 0x1.0000000000001p-6445L, 0x1p-16382L, 0x1.fffffffffffffff8p-16383L, -0x1p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/scalbln.h b/src/math/special/scalbln.h index 5411e09..f6f6755 100644 --- a/src/math/special/scalbln.h +++ b/src/math/special/scalbln.h @@ -14,3 +14,4 @@ T(RN, inf, -2147483647, inf, 0x T(RN, -inf, 2147483647, -inf, 0x0p+0, 0) T(RN, 0x1p+1023, -2097, 0x1p-1074, 0x0p+0, 0) T(RN, 0x1p-1074, 2097, 0x1p+1023, 0x0p+0, 0) +T(RN, 0x1.001p+0, -1074, 0x1p-1074, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/scalblnf.h b/src/math/special/scalblnf.h index e8528b6..24b423f 100644 --- a/src/math/special/scalblnf.h +++ b/src/math/special/scalblnf.h @@ -14,3 +14,4 @@ T(RN, inf, -2147483647, inf, 0x0p+0, 0) T(RN, -inf, 2147483647, -inf, 0x0p+0, 0) T(RN, 0x1p+127, -276, 0x1p-149, 0x0p+0, 0) T(RN, 0x1p-149, 276, 0x1p+127, 0x0p+0, 0) +T(RN, 0x1.001p+0, -149, 0x1p-149, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/scalblnl.h b/src/math/special/scalblnl.h index f368410..d69bdd2 100644 --- a/src/math/special/scalblnl.h +++ b/src/math/special/scalblnl.h @@ -14,3 +14,4 @@ T(RN, inf, -2147483647, in T(RN, -inf, 2147483647, -inf, 0x0p+0, 0) T(RN, 0x1p+16383L, -32828, 0x1p-16445L, 0x0p+0, 0) T(RN, 0x1p-16445L, 32828, 0x1p+16383L, 0x0p+0, 0) +T(RN, 0x1.00000000001p+0L, -16445, 0x1p-16445L, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/scalbn.h b/src/math/special/scalbn.h index 5411e09..f6f6755 100644 --- a/src/math/special/scalbn.h +++ b/src/math/special/scalbn.h @@ -14,3 +14,4 @@ T(RN, inf, -2147483647, inf, 0x T(RN, -inf, 2147483647, -inf, 0x0p+0, 0) T(RN, 0x1p+1023, -2097, 0x1p-1074, 0x0p+0, 0) T(RN, 0x1p-1074, 2097, 0x1p+1023, 0x0p+0, 0) +T(RN, 0x1.001p+0, -1074, 0x1p-1074, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/scalbnf.h b/src/math/special/scalbnf.h index e8528b6..24b423f 100644 --- a/src/math/special/scalbnf.h +++ b/src/math/special/scalbnf.h @@ -14,3 +14,4 @@ T(RN, inf, -2147483647, inf, 0x0p+0, 0) T(RN, -inf, 2147483647, -inf, 0x0p+0, 0) T(RN, 0x1p+127, -276, 0x1p-149, 0x0p+0, 0) T(RN, 0x1p-149, 276, 0x1p+127, 0x0p+0, 0) +T(RN, 0x1.001p+0, -149, 0x1p-149, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/scalbnl.h b/src/math/special/scalbnl.h index f368410..d69bdd2 100644 --- a/src/math/special/scalbnl.h +++ b/src/math/special/scalbnl.h @@ -14,3 +14,4 @@ T(RN, inf, -2147483647, in T(RN, -inf, 2147483647, -inf, 0x0p+0, 0) T(RN, 0x1p+16383L, -32828, 0x1p-16445L, 0x0p+0, 0) T(RN, 0x1p-16445L, 32828, 0x1p+16383L, 0x0p+0, 0) +T(RN, 0x1.00000000001p+0L, -16445, 0x1p-16445L, 0x0p+0, INEXACT|UNDERFLOW) -- 2.11.4.GIT