diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2012-06-26 15:32:47 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2012-06-26 15:32:47 +0000 |
commit | 7d58ad95ed2e3d9e5e767446f938f90fa3449966 (patch) | |
tree | 044058c0616949f9e5ec33fbc90e9e043c6f65c1 | |
parent | a27b718b63c943194c4379a011ad8a19cee99cc2 (diff) | |
download | mpc-7d58ad95ed2e3d9e5e767446f938f90fa3449966.tar.gz |
tmul.c: shortened test output using more recent macros
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1169 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | tests/tmul.c | 54 |
2 files changed, 22 insertions, 36 deletions
@@ -5,6 +5,8 @@ Changes in version 1.0: - removed compatibility with K&R compilers, untestable due to lack of such compilers - New function mpc_log10. + - Optimisation: + - fma - Bug fixes: - div and norm now return a value indicating the effective rounding direction, as the other functions. @@ -123,7 +125,7 @@ Changes in version 0.5 ("Aconitum neomontanum"): - sqrt with directed rounding -Copyright (C) 2008, 2009, 2010, 2011 INRIA +Copyright (C) 2008, 2009, 2010, 2011, 2012 INRIA Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/tests/tmul.c b/tests/tmul.c index 0f184cd..d83fca0 100644 --- a/tests/tmul.c +++ b/tests/tmul.c @@ -33,48 +33,32 @@ cmpmul (mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd) /* all have the same precision, and we use this precision also for the */ /* result. */ { - mpc_t z, t; - int inexact_z, inexact_t; + mpc_t z, t; + int inex_z, inex_t; - mpc_init2 (z, MPC_MAX_PREC (x)); - mpc_init2 (t, MPC_MAX_PREC (x)); + mpc_init2 (z, MPC_MAX_PREC (x)); + mpc_init2 (t, MPC_MAX_PREC (x)); - inexact_z = mpc_mul_naive (z, x, y, rnd); - inexact_t = mpc_mul_karatsuba (t, x, y, rnd); + inex_z = mpc_mul_naive (z, x, y, rnd); + inex_t = mpc_mul_karatsuba (t, x, y, rnd); - if (mpc_cmp (z, t)) - { - fprintf (stderr, "mul and mul2 differ for rnd=(%s,%s)\nx=", - mpfr_print_rnd_mode(MPC_RND_RE(rnd)), - mpfr_print_rnd_mode(MPC_RND_IM(rnd))); - mpc_out_str (stderr, 2, 0, x, MPC_RNDNN); - fprintf (stderr, "\ny="); - mpc_out_str (stderr, 2, 0, y, MPC_RNDNN); - fprintf (stderr, "\nmpc_mul_naive gives "); - mpc_out_str (stderr, 2, 0, z, MPC_RNDNN); - fprintf (stderr, "\nmpc_mul_karatsuba gives "); - mpc_out_str (stderr, 2, 0, t, MPC_RNDNN); - fprintf (stderr, "\n"); - exit (1); - } - if (inexact_z != inexact_t) - { - fprintf (stderr, "The return values of mul and mul2 differ for rnd=(%s,%s) \nx=", + if (mpc_cmp (z, t) != 0 || inex_z != inex_t) { + fprintf (stderr, "mul_naive and mul_karatsuba differ for rnd=(%s,%s)\n", mpfr_print_rnd_mode(MPC_RND_RE(rnd)), mpfr_print_rnd_mode(MPC_RND_IM(rnd))); - mpc_out_str (stderr, 2, 0, x, MPC_RNDNN); - fprintf (stderr, "\nand y="); - mpc_out_str (stderr, 2, 0, y, MPC_RNDNN); - fprintf (stderr, "\nand x*y="); - mpc_out_str (stderr, 2, 0, z, MPC_RNDNN); - fprintf (stderr, "\nmpc_mul_naive gives %i", inexact_z); - fprintf (stderr, "\nmpc_mul_karatsuba gives %i", inexact_t); - fprintf (stderr, "\n"); + MPC_OUT (x); + MPC_OUT (y); + MPC_OUT (z); + MPC_OUT (t); + if (inex_z != inex_t) { + fprintf (stderr, "inex_re (z): %s\n", MPC_INEX_STR (inex_z)); + fprintf (stderr, "inex_re (t): %s\n", MPC_INEX_STR (inex_t)); + } exit (1); - } + } - mpc_clear (z); - mpc_clear (t); + mpc_clear (z); + mpc_clear (t); } |