diff options
-rw-r--r-- | tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/mpcheck-double.c (renamed from tests/mpc_check.c) | 69 | ||||
-rw-r--r-- | tests/mpcheck-template1.c (renamed from tests/mpc_check_template1.c) | 0 | ||||
-rw-r--r-- | tests/mpcheck-template2.c (renamed from tests/mpc_check_template2.c) | 0 | ||||
-rw-r--r-- | tests/mpcheck-template3.c (renamed from tests/mpc_check_template3.c) | 0 |
5 files changed, 38 insertions, 35 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index d4dffec..f5cab22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -66,8 +66,8 @@ DATA_SETS = abs.dat acos.dat acosh.dat add.dat add_fr.dat arg.dat \ sin.dat sinh.dat \ sqr.dat sqrt.dat strtoc.dat sub.dat sub_fr.dat tan.dat tanh.dat EXTRA_DIST = data_check.tpl tgeneric.tpl $(DATA_SETS) $(DESCRIPTIONS) \ - mpc_check.c \ - mpc_check_template1.c mpc_check_template2.c mpc_check_template3.c + mpcheck-double.c \ + mpcheck-template1.c mpcheck-template2.c mpcheck-template3.c LOG_COMPILER = $(VALGRIND) AM_LOG_FLAGS = $(VALGRIND_OPTS) diff --git a/tests/mpc_check.c b/tests/mpcheck-double.c index 185a185..b1ef696 100644 --- a/tests/mpc_check.c +++ b/tests/mpcheck-double.c @@ -1,4 +1,5 @@ -/* mpc_check -- compare mpc functions against the GNU libc implementation +/* mpcheck-double -- compare mpc functions against "double complex" + from the GNU libc implementation Copyright (C) 2020 INRIA @@ -65,82 +66,82 @@ ulp_error (mpfr_t x, mpfr_t y) #define FOO add #define CFOO(x,y) (x+y) -#include "mpc_check_template3.c" +#include "mpcheck-template3.c" #define FOO sub #define CFOO(x,y) (x-y) -#include "mpc_check_template3.c" +#include "mpcheck-template3.c" #define FOO mul #define CFOO(x,y) (x*y) -#include "mpc_check_template3.c" +#include "mpcheck-template3.c" #define FOO div #define CFOO(x,y) (x/y) -#include "mpc_check_template3.c" +#include "mpcheck-template3.c" #define FOO pow -#include "mpc_check_template3.c" +#include "mpcheck-template3.c" #define FOO abs -#include "mpc_check_template2.c" +#include "mpcheck-template2.c" #define FOO arg -#include "mpc_check_template2.c" +#include "mpcheck-template2.c" #define FOO sqrt -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO acos -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO acosh -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO asin -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO asinh -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO atan -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO atanh -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO cos -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO cosh -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO exp -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO log -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO log10 -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO sin -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO sinh -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO tan -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" #define FOO tanh -#include "mpc_check_template1.c" +#include "mpcheck-template1.c" int main (int argc, char *argv[]) { - mpfr_prec_t p = 53; /* default precision */ - unsigned long n = 1000000; + mpfr_prec_t p = 53; /* precision of 'double' */ + unsigned long n = 1000000; /* default number of random tests per function */ while (argc >= 2 && argv[1][0] == '-') { @@ -156,6 +157,12 @@ main (int argc, char *argv[]) argc -= 2; argv += 2; } + else if (argc >= 3 && strcmp (argv[1], "-num") == 0) + { + n = atoi (argv[2]); + argc -= 2; + argv += 2; + } else if (strcmp (argv[1], "-v") == 0) { verbose ++; @@ -169,13 +176,9 @@ main (int argc, char *argv[]) } } - MPC_ASSERT (p == 53); - - if (p == 53) - { - mpfr_set_emin (-1073); - mpfr_set_emax (1024); - } + /* set exponent range for 'double' */ + mpfr_set_emin (-1073); + mpfr_set_emax (1024); gmp_randinit_default (state); diff --git a/tests/mpc_check_template1.c b/tests/mpcheck-template1.c index 771054b..771054b 100644 --- a/tests/mpc_check_template1.c +++ b/tests/mpcheck-template1.c diff --git a/tests/mpc_check_template2.c b/tests/mpcheck-template2.c index fdb26c3..fdb26c3 100644 --- a/tests/mpc_check_template2.c +++ b/tests/mpcheck-template2.c diff --git a/tests/mpc_check_template3.c b/tests/mpcheck-template3.c index 506e7ac..506e7ac 100644 --- a/tests/mpc_check_template3.c +++ b/tests/mpcheck-template3.c |