summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-06-02 14:26:51 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-06-02 14:26:51 +0000
commit6b09dc0eec6784933cb85912ae47146c3067844e (patch)
tree97609571df8ecb75a64f23b12e3e3dbe1be341bf
parentd44f0c866354bd0c2f2c4c4e07448bc49b7fd5b5 (diff)
downloadmpfr-6b09dc0eec6784933cb85912ae47146c3067844e.tar.gz
[src/sub1.c] In r10347, logging was introduced instead of #ifdef DEBUG
and printf. Removed 2 MPFR_LOG_VAR, as the variable is not normalized yet. Re-added #ifdef DEBUG for the MPFR_LOG_MSG's since this may be too low level and not much useful except in case of bugs. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10395 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--src/sub1.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sub1.c b/src/sub1.c
index c4b21f74f..f062420ab 100644
--- a/src/sub1.c
+++ b/src/sub1.c
@@ -209,9 +209,11 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
cp[0] = mpn_rshift (cp + 1, MPFR_MANT(c), cn++, shift_c);
}
+#ifdef DEBUG
MPFR_LOG_MSG (("rnd=%s shift_b=%d shift_c=%d diffexp=%" MPFR_EXP_FSPEC
"d\n", mpfr_print_rnd_mode (rnd_mode), shift_b, shift_c,
(mpfr_eexp_t) diff_exp));
+#endif
MPFR_ASSERTD (ap != cp);
MPFR_ASSERTD (bp != cp);
@@ -240,8 +242,10 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
else
cancel2 = - (mp_size_t) ((diff_exp - cancel) / GMP_NUMB_BITS);
/* the high cancel2 limbs from b should not be taken into account */
+#ifdef DEBUG
MPFR_LOG_MSG (("cancel=%Pd cancel1=%Pd cancel2=%Pd\n",
cancel, cancel1, cancel2));
+#endif
/* ap[an-1] ap[0]
<----------------+-----------|---->
@@ -277,8 +281,6 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
else
MPN_ZERO (ap, an);
- MPFR_LOG_VAR (a);
-
/* subtract high(c) */
if (MPFR_LIKELY(an + cancel2 > 0)) /* otherwise c does not overlap with a */
{
@@ -320,8 +322,6 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
}
- MPFR_LOG_VAR (a);
-
/* now perform rounding */
sh = (mpfr_prec_t) an * GMP_NUMB_BITS - aq;
/* last unused bits from a */
@@ -369,8 +369,10 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
cn0 = cn;
cn -= an + cancel2;
+#ifdef DEBUG
MPFR_LOG_MSG (("last sh=%d bits from a are %Mu, bn=%Pd, cn=%Pd\n",
sh, carry, (mpfr_prec_t) bn, (mpfr_prec_t) cn));
+#endif
/* for rounding to nearest, we couldn't conclude up to here in the following
cases:
@@ -460,7 +462,9 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
}
+#ifdef DEBUG
MPFR_LOG_MSG (("k=%d bb=%Mu cc=%Mu cmp_low=%d\n", k, bb, cc, cmp_low));
+#endif
if (cmp_low < 0) /* low(b) - low(c) < 0: either truncate or subtract
one ulp */