diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2015-02-24 15:27:04 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2015-02-24 15:27:04 +0000 |
commit | 20db0c69b612932f4ded516b0dc923001c71d2f7 (patch) | |
tree | df5f6029fe86d2568efd54acced0644f45105b77 | |
parent | 6b241d260786c30253ea96ca4a9b86581246bb15 (diff) | |
download | mpfr-20db0c69b612932f4ded516b0dc923001c71d2f7.tar.gz |
[src/sum.c] Better logging.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/new-sum@9304 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/sum.c | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -337,23 +337,25 @@ sum_raw (mp_limb_t *wp, mp_size_t ws, mpfr_prec_t wq, mpfr_ptr *const x, The error is strictly less than 2^err (and is 0 if maxexp2 == MPFR_EXP_MIN). */ - MPFR_LOG_MSG (("e = %" MPFR_EXP_FSPEC "d err= %" MPFR_EXP_FSPEC - "d maxexp2=%" MPFR_EXP_FSPEC "d%s\n", - (mpfr_eexp_t) e, (mpfr_eexp_t) err, - (mpfr_eexp_t) maxexp2, maxexp2 == MPFR_EXP_MIN ? - " (MPFR_EXP_MIN)" : "")); - /* This basically tests whether err <= e - prec without potential integer overflow... */ if (e >= 0 ? (err <= e - prec) : (err <= e && (mpfr_uexp_t) -e + prec >= -err)) { + MPFR_LOG_MSG (("(err=%" MPFR_EXP_FSPEC "d) <= (e=%" + MPFR_EXP_FSPEC "d) - (prec=%Pd)\n", + (mpfr_eexp_t) err, (mpfr_eexp_t) e, prec)); if (ep != NULL) *ep = e; if (errp != NULL) *errp = err; *minexpp = minexp; *maxexpp = maxexp2; + MPFR_LOG_MSG (("return with minexp=%" MPFR_EXP_FSPEC + "d maxexp2=%" MPFR_EXP_FSPEC "d%s\n", + (mpfr_eexp_t) minexp, (mpfr_eexp_t) maxexp2, + maxexp2 == MPFR_EXP_MIN ? + " (MPFR_EXP_MIN)" : "")); return cancel; } else @@ -363,10 +365,21 @@ sum_raw (mp_limb_t *wp, mp_size_t ws, mpfr_prec_t wq, mpfr_ptr *const x, mpfr_size_t shifts; int shiftc; + MPFR_LOG_MSG (("e=%" MPFR_EXP_FSPEC "d err=%" MPFR_EXP_FSPEC + "d maxexp2=%" MPFR_EXP_FSPEC "d%s\n", + (mpfr_eexp_t) e, (mpfr_eexp_t) err, + (mpfr_eexp_t) maxexp2, + maxexp2 == MPFR_EXP_MIN ? + " (MPFR_EXP_MIN)" : "")); + diffexp = err - e; if (diffexp < 0) diffexp = 0; /* diffexp = max(0, err - e) */ + + MPFR_LOG_MSG (("diffexp=%" MPFR_EXP_FSPEC "d\n", + (mpfr_eexp_t) diffexp)); + MPFR_ASSERTD (diffexp < cancel - 2); shiftq = cancel - 2 - (mpfr_prec_t) diffexp; MPFR_ASSERTD (shiftq > 0); |