diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-02-08 09:59:11 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-02-08 09:59:11 +0000 |
commit | d7d1502bd44b9944e3cfd9b16400a13fc0c048ea (patch) | |
tree | 5dc2f6f8813fe8c1650eda1a2fcf7445af4426b0 /tests/tsum.c | |
parent | 6de1b90603cc0d93852e79fc57aa50b2eeabce7b (diff) | |
download | mpfr-d7d1502bd44b9944e3cfd9b16400a13fc0c048ea.tar.gz |
[tests/tsum.c] Added explanations concerning the check1 test.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9986 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsum.c')
-rw-r--r-- | tests/tsum.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/tsum.c b/tests/tsum.c index d8f130db0..1f6025ae9 100644 --- a/tests/tsum.c +++ b/tests/tsum.c @@ -339,7 +339,18 @@ check_more_special (void) /* i * 2^(46+h) + j * 2^(45+h) + k * 2^(44+h) + f * 2^(-2), with -1 <= i, j, k <= 1, i != 0, -3 <= f <= 3, - ulp(exact sum) = 2^0 and ulp(exact sum) = 2^(44+h). */ + ulp(exact sum) = 2^0 and ulp(exact sum) = 2^(44+h) when possible. + ------ + Some explanations: + ulp(exact sum) = 2^q means EXP(exact sum) - prec = q where prec is + the precision of the output. Thus ulp(exact sum) = 2^0 is achieved + by setting prec = EXP(s3), where s3 is the exact sum (computed with + mpfr_add's and sufficient precision). Then ulp(exact sum) = 2^(44+h) + is achieved by subtracting 44+h from prec. The loop on prec does + this. Since EXP(s3) <= 47+h, prec <= 3 at the second iteration, + thus there will be at most 2 iterations. Whether a second iteration + is done or not depends on EXP(s3), i.e. the values of the parameters, + and the value of MPFR_PREC_MIN. */ static void check1 (int h) { |