From d40c381b95cb3ffcb8c85d2794a90e4a1da7a79b Mon Sep 17 00:00:00 2001 From: Paul Zimmermann Date: Thu, 6 Feb 2020 18:55:31 +0100 Subject: fixed bug in asin (condition x=1 was not checked) --- src/asin.c | 3 ++- tests/mpcheck-template1.c | 3 ++- tests/mpcheck-template2.c | 3 ++- tests/mpcheck-template3.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/asin.c b/src/asin.c index 5fdcc33..0d975e4 100644 --- a/src/asin.c +++ b/src/asin.c @@ -216,7 +216,8 @@ mpc_asin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) mpfr_set_prec (mpc_imagref(z1), p); /* try special code for 1+i*y with tiny y */ - if (loop == 1 && mpc_asin_special (rop, op, rnd, z1)) + if (loop == 1 && mpfr_cmp_ui (mpc_realref(op), 1) == 0 && + mpc_asin_special (rop, op, rnd, z1)) break; /* z1 <- z^2 */ diff --git a/tests/mpcheck-template1.c b/tests/mpcheck-template1.c index 734f472..b6074ee 100644 --- a/tests/mpcheck-template1.c +++ b/tests/mpcheck-template1.c @@ -43,7 +43,8 @@ FUN (mpfr_prec_t p, unsigned long n) emax = FOO_EMAX; #endif - printf ("Testing function %s\n", BAR); + if (verbose > 0) + printf ("Testing function %s\n", BAR); gmp_randseed_ui (state, seed); diff --git a/tests/mpcheck-template2.c b/tests/mpcheck-template2.c index 2f94bfb..4588093 100644 --- a/tests/mpcheck-template2.c +++ b/tests/mpcheck-template2.c @@ -39,7 +39,8 @@ FUN (mpfr_prec_t p, unsigned long n) int inex; unsigned long errors = 0, max_err = 0; - printf ("Testing function %s\n", BAR); + if (verbose > 0) + printf ("Testing function %s\n", BAR); gmp_randseed_ui (state, seed); diff --git a/tests/mpcheck-template3.c b/tests/mpcheck-template3.c index 5d754c1..bb28a2a 100644 --- a/tests/mpcheck-template3.c +++ b/tests/mpcheck-template3.c @@ -40,7 +40,8 @@ FUN (mpfr_prec_t p, unsigned long n) unsigned long errors = 0, max_err_re = 0, max_err_im = 0; int cmp; - printf ("Testing function %s\n", BAR); + if (verbose > 0) + printf ("Testing function %s\n", BAR); gmp_randseed_ui (state, seed); -- cgit v1.2.1