diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-09-07 08:20:28 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-09-07 08:20:28 +0000 |
commit | 7af6877e48d02625433124993daf3c159827b760 (patch) | |
tree | e8ceac7d8e74a2284bea449ca03e89290425ec5c /src/zeta.c | |
parent | 3d7d4f4136e62cad92dc79366a4d7a9cbbbc722d (diff) | |
download | mpfr-7af6877e48d02625433124993daf3c159827b760.tar.gz |
[src/zeta.c] Updated FIXME: also suggest a scaling.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10810 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/zeta.c')
-rw-r--r-- | src/zeta.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/zeta.c b/src/zeta.c index 962e9f2bc..c7aca97e6 100644 --- a/src/zeta.c +++ b/src/zeta.c @@ -432,7 +432,13 @@ mpfr_zeta (mpfr_t z, mpfr_srcptr s, mpfr_rnd_t rnd_mode) { /* FIXME: An overflow in gamma(s1) does not imply that Zeta(s) will overflow. In this branch, compute the - log to avoid intermediate overflows? */ + log to avoid intermediate overflows? To avoid a + problem at the overflow boundary, a scaling can + also be done without any cost here since the log(2) + already appears in the expression: compute + log(...) - log(2), then the exponential, round + correctly, then multiply by 2 (exact, with possible + overflow generation). */ mpfr_div_2ui (s1, s, 2, MPFR_RNDN); /* s/4, exact */ mpfr_frac (s1, s1, MPFR_RNDN); /* exact, -1 < s1 < 0 */ overflow = (mpfr_cmp_si_2exp (s1, -1, -1) > 0) ? -1 : 1; |