summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zimmermann <Paul.Zimmermann@inria.fr>2020-02-06 18:55:31 +0100
committerPaul Zimmermann <Paul.Zimmermann@inria.fr>2020-02-06 18:55:31 +0100
commitd40c381b95cb3ffcb8c85d2794a90e4a1da7a79b (patch)
treea3be48d904048567d02c519ae08868098e8e4a64
parent0fce03e7e78fe6bf789e3d372fdc6dbd27bf63a6 (diff)
downloadmpc-git-d40c381b95cb3ffcb8c85d2794a90e4a1da7a79b.tar.gz
fixed bug in asin (condition x=1 was not checked)
-rw-r--r--src/asin.c3
-rw-r--r--tests/mpcheck-template1.c3
-rw-r--r--tests/mpcheck-template2.c3
-rw-r--r--tests/mpcheck-template3.c3
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);