diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2012-06-27 18:25:50 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2012-06-27 18:25:50 +0000 |
commit | def726e7ea3e72d6ae2c30d1247db557d768cacd (patch) | |
tree | 602c839bf3308939cb350c5d0b8a6614e214a0e5 /src | |
parent | e55f51561f96f0ab1c1742d6e1b1c1ac5894f187 (diff) | |
download | mpc-def726e7ea3e72d6ae2c30d1247db557d768cacd.tar.gz |
log.dat, log.c: analyse infinite loop for test added in r1192
as a preliminary workaround, add assertion and disable test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1198 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src')
-rw-r--r-- | src/log.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -28,7 +28,7 @@ mpc_log (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd){ mpfr_prec_t prec; int loops = 0; int re_cmp, im_cmp; - int inex_re, inex_im; + int inex_re, inex_im, inex; /* special values: NaN and infinities */ if (!mpc_fin_p (op)) { @@ -121,10 +121,13 @@ mpc_log (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd){ mpfr_set_prec (w, prec); /* w is rounded down */ - mpc_norm (w, op, GMP_RNDD); + inex = mpc_norm (w, op, GMP_RNDD); /* error 1 ulp */ MPC_ASSERT (!mpfr_inf_p (w)); /* FIXME: intermediate overflow; the logarithm may be representable */ + MPC_ASSERT (!(inex && mpfr_cmp_ui (w, 1) == 0)); + /* FIXME: this is like an underflow; the following call to log will + compute 0 instead of a positive result */ mpfr_log (w, w, GMP_RNDD); /* generic error of log: (2^(2 - exp(w)) + 1) ulp */ |