summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Enge <andreas.enge@inria.fr>2012-06-27 17:51:09 +0000
committerAndreas Enge <andreas.enge@inria.fr>2016-05-24 14:19:29 +0200
commit80aec112bad1d147055796828d4805f4c34c3e97 (patch)
treebe5d91f9406c72cd4be14e07e0c4cc59b580c0bb
parent63710beea93ead589676bf6bfd608eba1108c0dd (diff)
downloadmpc-git-rootunity.tar.gz
rootsofunity: use mean value theorem for analysis (suggested by Damien Robert)rootunity
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/mpc/branches/rootsunity@1197 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r--src/rootofunity.c8
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));