summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2014-01-20 20:41:52 +0000
committerzimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2014-01-20 20:41:52 +0000
commit29373a3a9371cbb35d1c95b75cbbf724f08b3906 (patch)
tree3f01fe72030e64683a0891bf7b4053b0d9201d62
parent2baa449d31f24048f894a5177fc2986eef64654d (diff)
downloadmpc-29373a3a9371cbb35d1c95b75cbbf724f08b3906.tar.gz
improve coverage, should be back to 100%
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1418 211d60ee-9f03-0410-a15a-8952a2c7a4e4
-rw-r--r--src/asin.c5
-rw-r--r--tests/asin.dat7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/asin.c b/src/asin.c
index a92421a..cdff708 100644
--- a/src/asin.c
+++ b/src/asin.c
@@ -1,6 +1,6 @@
/* mpc_asin -- arcsine of a complex number.
-Copyright (C) 2009, 2010, 2011, 2012, 2013 INRIA
+Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 INRIA
This file is part of GNU MPC.
@@ -18,6 +18,7 @@ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see http://www.gnu.org/licenses/ .
*/
+#include <stdio.h>
#include "mpc-impl.h"
/* Special case op = 1 + i*y for tiny y (see algorithms.tex).
@@ -36,8 +37,6 @@ mpc_asin_special (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd, mpc_ptr z1)
/* |Re(asin(1+i*y)) - pi/2| <= y^(1/2) */
if (ey >= 0 || ((-ey) / 2 < mpfr_get_prec (mpc_realref (z1))))
return 0;
- if (mpfr_get_prec (mpc_imagref (z1)) > (-ey) + 2) /* p > -ey + 2 */
- return 0;
mpfr_const_pi (mpc_realref (z1), MPFR_RNDN);
mpfr_div_2exp (mpc_realref (z1), mpc_realref (z1), 1, MPFR_RNDN); /* exact */
diff --git a/tests/asin.dat b/tests/asin.dat
index e93e8c5..03a3a80 100644
--- a/tests/asin.dat
+++ b/tests/asin.dat
@@ -1,6 +1,6 @@
# Data file for mpc_asin.
#
-# Copyright (C) 2009 INRIA
+# Copyright (C) 2009, 2011, 2013, 2014 INRIA
#
# This file is part of GNU MPC.
#
@@ -124,5 +124,10 @@
+ - 53 0x189BF9EC7FCD5Bp-54 53 0x1206ECFA94614Bp-50 53 17 53 42 N N
- + 2 1.5 2 6 2 96 2 0x1p-8 N N
- - 8 0xC9p-7 8 0x15p-2 2 96 2 0x1p-8 N N
+
+# special cases 1 + i*y with tiny y
- - 53 0x3243f6a8885a3p-49 53 0x1p-500 53 1 53 0x1p-1000 N N
- + 53 0x3243f6a8885a3p-49 53 -0x1p-500 53 1 53 -0x1p-1000 N N
+- - 11 0xc9p-7 11 0xb5p-28 11 1 11 0x1p-41 N N
+- + 53 0x3243f6a8885a3p-49 53 0x16a09e667f3bcdp-552 53 1 53 0x1p-999 N N
+- + 2 1.5 2 0x1p-40 2 1 20 0xff802p-100 N N