diff options
-rw-r--r-- | src/rootofunity.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rootofunity.c b/src/rootofunity.c index 8576f62..92555ee 100644 --- a/src/rootofunity.c +++ b/src/rootofunity.c @@ -67,12 +67,12 @@ mpc_rootofunity (mpc_ptr rop, unsigned long int n, mpc_rnd_t rnd) mpfr_mul_2ui (t, t, 1u, GMP_RNDN); mpfr_div_ui (t, t, n, GMP_RNDN); /* error 2*0.5+0.5=1.5 ulp */ mpfr_sin_cos (s, c, t, GMP_RNDN); - /* error (3*2^{Exp (t) - Exp (s resp.c)} + 0.5) ulp - <= 12.5 ulp for n>=3 */ + /* error (1.5*2^{Exp (t) - Exp (s resp.c)} + 0.5) ulp + <= 6.5 ulp for n>=3 */ } - while ( !mpfr_can_round (c, prec - 4, GMP_RNDN, GMP_RNDZ, + while ( !mpfr_can_round (c, prec - 3, GMP_RNDN, GMP_RNDZ, MPC_PREC_RE(rop) + (MPC_RND_RE(rnd) == GMP_RNDN)) - || !mpfr_can_round (s, prec - 4, GMP_RNDN, GMP_RNDZ, + || !mpfr_can_round (s, prec - 3, GMP_RNDN, GMP_RNDZ, MPC_PREC_IM(rop) + (MPC_RND_IM(rnd) == GMP_RNDN))); inex_re = mpfr_set (mpc_realref(rop), c, MPC_RND_RE(rnd)); |