summaryrefslogtreecommitdiff
path: root/tests/tlog.c
diff options
context:
space:
mode:
authorenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-10-02 15:27:08 +0000
committerenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2009-10-02 15:27:08 +0000
commitd3577e2fe3ca6a313bc3fe22c36246e17376aac1 (patch)
treea0c183128d00383e822acbe6066406ef070e2883 /tests/tlog.c
parent2242234863ec57cf9a8cb06878e166dafc3e551f (diff)
downloadmpc-d3577e2fe3ca6a313bc3fe22c36246e17376aac1.tar.gz
tlog.c: removed test that f^(-1) (f (z)) == z; this was apparently the
only function with such a test git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@696 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/tlog.c')
-rw-r--r--tests/tlog.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/tests/tlog.c b/tests/tlog.c
index 1d13ae6..2775a19 100644
--- a/tests/tlog.c
+++ b/tests/tlog.c
@@ -22,75 +22,6 @@ MA 02111-1307, USA. */
#include <stdlib.h>
#include "mpc-tests.h"
-/* PZ: disabled check_exp_log since it gives false positives, for example
- with GMP_CHECK_RANDOMIZE=1254693391 with GMP 4.3.0 on 64-bit computers */
-#if 0
-static void
-check_exp_log (void)
-{
- mpc_t z, z2, tmp;
- mpfr_t twopi;
- mp_prec_t prec;
-
- mpc_init2 (z, 1000);
- mpc_init2 (z2, 1000);
- mpc_init2 (tmp, 4000);
- mpfr_init2 (twopi, 1000);
- mpfr_const_pi (twopi, GMP_RNDD);
- mpfr_div_2ui (twopi, twopi, 1, GMP_RNDN);
-
- for (prec = 4; prec <= 1000; prec = prec*1.1 + 1)
- {
- mpc_set_prec (z, prec);
- mpc_set_prec (z2, prec);
- mpc_set_prec (tmp, 4*prec);
-
- /* Test whether exp (log (z)) = z, where z is no pure real
- and no pure imaginary. */
- test_default_random (z, 0, 10, 128, 0);
-
- mpc_log (tmp, z, MPC_RNDNN);
- mpc_exp (z2, tmp, MPC_RNDNN);
-
- if (mpc_cmp (z, z2) != 0)
- {
- printf ("Possible error in log; difference between z and "\
- "z2=exp(log(z)):\n");
- OUT (z);
- OUT (tmp);
- OUT (z2);
- exit (1);
- }
-
-
- /* Test whether log (exp (z)) = z for purely imaginary z; then exp (x) */
- /* lies on the unit cercle, a critical case for the logarithm. */
- mpfr_set_ui (MPC_RE (z), 0, GMP_RNDN);
-
- mpfr_remainder (MPC_IM (z), MPC_IM (z), twopi, GMP_RNDZ);
- mpc_exp (tmp, z, MPC_RNDNN);
- mpc_log (z2, tmp, MPC_RNDNN);
-
- /* There is a tiny real part, do not care if it si sufficiently small. */
- if (mpfr_cmp (MPC_IM (z), MPC_IM (z2)) != 0
- || MPFR_EXP (MPC_RE (z)) > -4 * (mp_exp_t) prec)
- {
- printf ("Possible error in purely imaginary log; difference "\
- "between z and z2=log(exp(z)):\n");
- OUT (z);
- OUT (tmp);
- OUT (z2);
- exit (1);
- }
- }
-
- mpc_clear (z);
- mpc_clear (z2);
- mpc_clear (tmp);
- mpfr_clear (twopi);
-}
-#endif
-
int
main (void)
{