summaryrefslogtreecommitdiff
path: root/tests/sqrt.dat
diff options
context:
space:
mode:
authorthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-10-03 17:06:51 +0000
committerthevenyp <thevenyp@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-10-03 17:06:51 +0000
commitcfbac58ce478af9f9ca403dfe43842162a15a0d0 (patch)
treeca2a8596d114cc3434076bdeeed7803b879ebb29 /tests/sqrt.dat
parent5bd754980c1c2afdea03c128bea81513d60e4747 (diff)
downloadmpc-cfbac58ce478af9f9ca403dfe43842162a15a0d0.tar.gz
sqrt.dat: move data tests from tsqrt in this text file.
tsqrt.c: remove tests now in sqrt.dat, add check_data function. Makefile.am: add sqrt.dat. git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@238 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'tests/sqrt.dat')
-rw-r--r--tests/sqrt.dat121
1 files changed, 121 insertions, 0 deletions
diff --git a/tests/sqrt.dat b/tests/sqrt.dat
new file mode 100644
index 0000000..c14fcf3
--- /dev/null
+++ b/tests/sqrt.dat
@@ -0,0 +1,121 @@
+# Data file for mpc_sqrt.
+#
+# Copyright (C) 2008 Philippe Th\'eveny
+#
+# This file is part of the MPC Library.
+#
+# The MPC Library is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# The MPC Library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with the MPC Library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA.
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND_RE RND_IM
+#
+# see sin.dat for precisions
+
+# special values (following ISO C99 standard)
+53 +inf 53 -inf 53 -inf 53 -inf N N
+53 +0 53 -inf 53 -inf 53 -1 N N
+53 +0 53 -inf 53 -inf 53 -0 N N
+53 +0 53 +inf 53 -inf 53 +0 N N
+53 +0 53 +inf 53 -inf 53 +1 N N
+53 +inf 53 +inf 53 -inf 53 +inf N N
+53 nan 53 inf 53 -inf 53 nan N N
+53 +inf 53 -inf 53 -1 53 -inf N N
+53 +0 53 -1 53 -1 53 -0 N N
+53 +0 53 +1 53 -1 53 +0 N N
+53 +inf 53 +inf 53 -1 53 +inf N N
+53 nan 53 nan 53 -1 53 nan N N
+53 +inf 53 -inf 53 -0 53 -inf N N
+53 +1 53 -1 53 -0 53 -2 N N
+53 +0 53 -0 53 -0 53 -0 N N
+53 +0 53 +0 53 -0 53 +0 N N
+53 +1 53 +1 53 -0 53 +2 N N
+53 +inf 53 +inf 53 -0 53 +inf N N
+53 nan 53 nan 53 -0 53 nan N N
+53 +inf 53 -inf 53 +0 53 -inf N N
+53 +1 53 -1 53 +0 53 -2 N N
+53 +0 53 -0 53 +0 53 -0 N N
+53 +0 53 +0 53 +0 53 +0 N N
+53 +1 53 +1 53 +0 53 +2 N N
+53 +inf 53 +inf 53 +0 53 +inf N N
+53 nan 53 nan 53 +0 53 nan N N
+53 +inf 53 -inf 53 +1 53 -inf N N
+53 +1 53 -0 53 +1 53 -0 N N
+53 +1 53 +0 53 +1 53 +0 N N
+53 +inf 53 +inf 53 +1 53 +inf N N
+53 nan 53 nan 53 +1 53 nan N N
+53 +inf 53 -inf 53 +inf 53 -inf N N
+53 +inf 53 -0 53 +inf 53 -1 N N
+53 +inf 53 -0 53 +inf 53 -0 N N
+53 +inf 53 +0 53 +inf 53 +0 N N
+53 +inf 53 +0 53 +inf 53 +1 N N
+53 +inf 53 +inf 53 +inf 53 +inf N N
+53 +inf 53 nan 53 +inf 53 nan N N
+53 +inf 53 -inf 53 nan 53 -inf N N
+53 nan 53 nan 53 nan 53 -1 N N
+53 nan 53 nan 53 nan 53 -0 N N
+53 nan 53 nan 53 nan 53 +0 N N
+53 nan 53 nan 53 nan 53 +1 N N
+53 +inf 53 +inf 53 nan 53 +inf N N
+53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
+# sqrt(x +i*0) = sqrt(x) +i*0, when x>0
+# sqrt(x -i*0) = sqrt(x) -i*0, when x>0
+# sqrt(x +i*0) = +0 +i*sqrt(-x) +i*0, when x<0
+# sqrt(x -i*0) = +0 -i*sqrt(-x) +i*0, when x<0
+53 0x16a09e667f3bcdp-52 53 +0 53 2 17 +0 N N
+53 +0 53 0x16a09e667f3bcdp-52 54 -2 16 +0 Z N
+53 0x16a09e667f3bcdp-52 53 -0 55 2 15 -0 U N
+53 +0 53 -0x16a09e667f3bcdp-52 56 -2 14 -0 D N
+53 0x5a827999fcef30p-54 53 +0 57 2 13 +0 Z Z
+53 +0 53 0x5a827999fcef30p-54 58 -2 12 +0 U Z
+53 0x5a827999fcef30p-54 53 -0 59 2 11 -0 D Z
+53 +0 53 -0x5a827999fcef30p-54 60 -2 10 -0 N Z
+53 0x16a09e667f3bcdp-52 53 +0 61 2 9 +0 U U
+53 +0 53 0x16a09e667f3bcdp-52 62 -2 8 +0 D U
+53 0x16a09e667f3bcdp-52 53 -0 63 2 7 -0 N U
+53 +0 53 -0x5a827999fcef30p-54 64 -2 6 -0 Z U
+53 0x5a827999fcef30p-54 53 +0 65 2 5 +0 D D
+53 +0 53 0x5a827999fcef30p-54 66 -2 4 +0 N D
+53 0x5a827999fcef30p-54 53 -0 67 2 3 -0 Z D
+53 +0 53 -0x16a09e667f3bcdp-52 68 -2 2 -0 U D
+
+# pure imaginary argument
+# sqrt(+/-0 +i*y) = sqrt(y/2) * (1 +i), when y >0
+# sqrt(+/-0 +i*y) = sqrt(-y/2) * (1 -i), when y < 0
+53 0x16a09e667f3bcdp-52 53 0x16a09e667f3bcdp-52 53 +0 53 4 N N
+53 0x5a827999fcef30p-54 53 0x16a09e667f3bcdp-52 51 -0 54 4 Z N
+53 0x16a09e667f3bcdp-52 53 -0x16a09e667f3bcdp-52 49 +0 55 -4 U N
+53 0x5a827999fcef30p-54 53 -0x16a09e667f3bcdp-52 47 -0 56 -4 D N
+53 0x5a827999fcef30p-54 53 0x5a827999fcef30p-54 45 +0 57 4 Z Z
+53 0x16a09e667f3bcdp-52 53 0x5a827999fcef30p-54 43 -0 58 4 U Z
+53 0x5a827999fcef30p-54 53 -0x5a827999fcef30p-54 41 +0 59 -4 D Z
+53 0x16a09e667f3bcdp-52 53 -0x5a827999fcef30p-54 39 -0 60 -4 N Z
+53 0x16a09e667f3bcdp-52 53 0x16a09e667f3bcdp-52 37 +0 61 4 U U
+53 0x5a827999fcef30p-54 53 0x16a09e667f3bcdp-52 35 -0 62 4 D U
+53 0x16a09e667f3bcdp-52 53 -0x5a827999fcef30p-54 33 +0 63 -4 N U
+53 0x5a827999fcef30p-54 53 -0x5a827999fcef30p-54 31 -0 64 -4 Z U
+53 0x5a827999fcef30p-54 53 0x5a827999fcef30p-54 29 +0 65 4 D D
+53 0x16a09e667f3bcdp-52 53 0x5a827999fcef30p-54 27 -0 66 4 N D
+53 0x5a827999fcef30p-54 53 -0x16a09e667f3bcdp-52 25 +0 67 -4 Z D
+53 0x16a09e667f3bcdp-52 53 -0x16a09e667f3bcdp-52 23 -0 68 -4 U D
+
+# bugs fixed in r160 2008-07-15
+19 0b11101001001001001100p+39 19 -0b1010110101100111011p-236 19 0b1.101010001010100000p+117 19 -0b1.001110111101100001p-158 N Z
+ 2 0b11p+100 2 -0b11p+100 2 -0 2 -0b11p+203 N Z
+ 2 0 2 -0b10p+117 2 -0b11p+235 2 -0 N Z