diff options
author | Philippe Theveny <philippe.theveny@laposte.net> | 2008-11-17 10:55:25 +0000 |
---|---|---|
committer | Philippe Theveny <philippe.theveny@laposte.net> | 2008-11-17 10:55:25 +0000 |
commit | 7562d667f884683e4dd238d6a777ced9d368685e (patch) | |
tree | 57133ef7faee5884fe537fdebeebc13a735483d5 /src/sqr.c | |
parent | ba3aee8ac9e7bfbb65d1b3e6258ca5cb949d7ed6 (diff) | |
download | mpc-git-7562d667f884683e4dd238d6a777ced9d368685e.tar.gz |
src/sqr.c: Partly revert r321, error of 3 bits in u.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/mpc/trunk@322 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src/sqr.c')
-rw-r--r-- | src/sqr.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -160,7 +160,7 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) else if (mpfr_sgn (u) * mpfr_sgn (v) > 0) { inexact |= mpfr_mul (u, u, v, GMP_RNDU); /* error 5 */ - ok = !inexact | mpfr_can_round (u, prec - 5, GMP_RNDU, GMP_RNDZ, + ok = !inexact | mpfr_can_round (u, prec - 3, GMP_RNDU, GMP_RNDZ, MPFR_PREC (MPC_RE (rop)) + (MPC_RND_RE (rnd) == GMP_RNDN)); if (ok) { @@ -173,7 +173,7 @@ mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) else { inexact |= mpfr_mul (u, u, v, GMP_RNDD); /* error 5 */ - ok = !inexact | mpfr_can_round (u, prec - 5, GMP_RNDD, GMP_RNDZ, + ok = !inexact | mpfr_can_round (u, prec - 3, GMP_RNDD, GMP_RNDZ, MPFR_PREC (MPC_RE (rop)) + (MPC_RND_RE (rnd) == GMP_RNDN)); if (ok) { |