summaryrefslogtreecommitdiff
path: root/mpc/tests
diff options
context:
space:
mode:
Diffstat (limited to 'mpc/tests')
-rw-r--r--mpc/tests/Makefile.am52
-rw-r--r--mpc/tests/Makefile.in2058
-rw-r--r--mpc/tests/abs.dat84
-rw-r--r--mpc/tests/acos.dat127
-rw-r--r--mpc/tests/acosh.dat121
-rw-r--r--mpc/tests/add.dat115
-rw-r--r--mpc/tests/add_fr.dat122
-rw-r--r--mpc/tests/arg.dat74
-rw-r--r--mpc/tests/asin.dat126
-rw-r--r--mpc/tests/asinh.dat120
-rw-r--r--mpc/tests/atan.dat148
-rw-r--r--mpc/tests/atanh.dat112
-rw-r--r--mpc/tests/comparisons.c45
-rw-r--r--mpc/tests/conj.dat114
-rw-r--r--mpc/tests/cos.dat85
-rw-r--r--mpc/tests/cosh.dat133
-rw-r--r--mpc/tests/div.dat2486
-rw-r--r--mpc/tests/div_fr.dat368
-rw-r--r--mpc/tests/exp.dat118
-rw-r--r--mpc/tests/fma.dat32
-rw-r--r--mpc/tests/fr_div.dat381
-rw-r--r--mpc/tests/fr_sub.dat373
-rw-r--r--mpc/tests/inp_str.dat163
-rw-r--r--mpc/tests/log.dat190
-rw-r--r--mpc/tests/log10.dat179
-rw-r--r--mpc/tests/mpc-tests.h235
-rwxr-xr-xmpc/tests/mul.dat178
-rw-r--r--mpc/tests/mul_fr.dat368
-rw-r--r--mpc/tests/neg.dat109
-rw-r--r--mpc/tests/norm.dat166
-rw-r--r--mpc/tests/pow.dat470
-rw-r--r--mpc/tests/pow_fr.dat74
-rw-r--r--mpc/tests/pow_si.dat29
-rw-r--r--mpc/tests/pow_ui.dat102
-rw-r--r--mpc/tests/proj.dat73
-rw-r--r--mpc/tests/random.c160
-rw-r--r--mpc/tests/read_data.c1059
-rw-r--r--mpc/tests/sin.dat163
-rw-r--r--mpc/tests/sinh.dat84
-rw-r--r--mpc/tests/sqr.dat170
-rw-r--r--mpc/tests/sqrt.dat139
-rw-r--r--mpc/tests/strtoc.dat168
-rw-r--r--mpc/tests/sub.dat94
-rw-r--r--mpc/tests/sub_fr.dat378
-rw-r--r--mpc/tests/tabs.c36
-rw-r--r--mpc/tests/tacos.c36
-rw-r--r--mpc/tests/tacosh.c57
-rw-r--r--mpc/tests/tadd.c70
-rw-r--r--mpc/tests/tadd_fr.c72
-rw-r--r--mpc/tests/tadd_si.c68
-rw-r--r--mpc/tests/tadd_ui.c68
-rw-r--r--mpc/tests/tan.dat135
-rw-r--r--mpc/tests/tanh.dat81
-rw-r--r--mpc/tests/targ.c36
-rw-r--r--mpc/tests/tasin.c36
-rw-r--r--mpc/tests/tasinh.c57
-rw-r--r--mpc/tests/tatan.c68
-rw-r--r--mpc/tests/tatanh.c57
-rw-r--r--mpc/tests/tconj.c36
-rw-r--r--mpc/tests/tcos.c65
-rw-r--r--mpc/tests/tcosh.c134
-rw-r--r--mpc/tests/tdiv.c36
-rw-r--r--mpc/tests/tdiv_2si.c35
-rw-r--r--mpc/tests/tdiv_2ui.c35
-rw-r--r--mpc/tests/tdiv_fr.c36
-rw-r--r--mpc/tests/tdiv_ui.c35
-rw-r--r--mpc/tests/texp.c36
-rw-r--r--mpc/tests/tfma.c107
-rw-r--r--mpc/tests/tfr_div.c34
-rw-r--r--mpc/tests/tfr_sub.c35
-rw-r--r--mpc/tests/tgeneric.c1412
-rw-r--r--mpc/tests/tget_version.c62
-rw-r--r--mpc/tests/timag.c35
-rw-r--r--mpc/tests/tio_str.c252
-rw-r--r--mpc/tests/tlog.c37
-rw-r--r--mpc/tests/tlog10.c37
-rw-r--r--mpc/tests/tmul.c201
-rw-r--r--mpc/tests/tmul_2si.c35
-rw-r--r--mpc/tests/tmul_2ui.c35
-rw-r--r--mpc/tests/tmul_fr.c36
-rw-r--r--mpc/tests/tmul_i.c96
-rw-r--r--mpc/tests/tmul_si.c34
-rw-r--r--mpc/tests/tmul_ui.c35
-rw-r--r--mpc/tests/tneg.c35
-rw-r--r--mpc/tests/tnorm.c110
-rw-r--r--mpc/tests/tpow.c71
-rw-r--r--mpc/tests/tpow_d.c61
-rw-r--r--mpc/tests/tpow_fr.c63
-rw-r--r--mpc/tests/tpow_ld.c43
-rw-r--r--mpc/tests/tpow_si.c89
-rw-r--r--mpc/tests/tpow_ui.c118
-rw-r--r--mpc/tests/tpow_z.c62
-rw-r--r--mpc/tests/tprec.c69
-rw-r--r--mpc/tests/tproj.c36
-rw-r--r--mpc/tests/treal.c35
-rw-r--r--mpc/tests/treimref.c48
-rw-r--r--mpc/tests/tset.c447
-rw-r--r--mpc/tests/tsin.c36
-rw-r--r--mpc/tests/tsin_cos.c35
-rw-r--r--mpc/tests/tsinh.c36
-rw-r--r--mpc/tests/tsqr.c191
-rw-r--r--mpc/tests/tsqrt.c36
-rw-r--r--mpc/tests/tstrtoc.c166
-rw-r--r--mpc/tests/tsub.c36
-rw-r--r--mpc/tests/tsub_fr.c36
-rw-r--r--mpc/tests/tsub_ui.c35
-rw-r--r--mpc/tests/tswap.c54
-rw-r--r--mpc/tests/ttan.c216
-rw-r--r--mpc/tests/ttanh.c36
-rw-r--r--mpc/tests/tui_div.c102
-rw-r--r--mpc/tests/tui_ui_sub.c35
111 files changed, 18290 insertions, 0 deletions
diff --git a/mpc/tests/Makefile.am b/mpc/tests/Makefile.am
new file mode 100644
index 0000000000..8bae3ef6f4
--- /dev/null
+++ b/mpc/tests/Makefile.am
@@ -0,0 +1,52 @@
+## tests/Makefile.am -- Process this file with automake to produce Makefile.in
+##
+## Copyright (C) 2008, 2009, 2010, 2011, 2012 INRIA
+##
+## This file is part of GNU MPC.
+##
+## GNU MPC 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 3 of the License, or (at your
+## option) any later version.
+##
+## GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+
+AM_CPPFLAGS = -I$(top_srcdir)/src
+LDADD = libmpc-tests.la $(top_builddir)/src/libmpc.la
+# let libtool create an executable instead of a shell script
+# useful for tests with valgrind
+AM_LDFLAGS = -no-install
+# LOADLIBES (documented in the "GNU make" manual and equivalent to LDLIBS)
+# enables to compile a program foo.c in the test directory by simply doing
+# "make foo".
+LOADLIBES=$(DEFS) -I$(top_srcdir)/src -I$(top_builddir) $(CPPFLAGS) $(CFLAGS) -L$(top_builddir)/tests/.libs -lmpc-tests -lmpc -lm $(LIBS)
+
+check_PROGRAMS = tabs tacos tacosh tadd tadd_fr tadd_si tadd_ui targ tasin \
+tasinh tatan tatanh tconj tcos tcosh tdiv tdiv_2si tdiv_2ui tdiv_fr tdiv_ui \
+texp tfma tfr_div tfr_sub timag tio_str tlog tlog10 \
+tmul tmul_2si tmul_2ui tmul_fr tmul_i tmul_si tmul_ui \
+tneg tnorm tpow tpow_ld tpow_d tpow_fr tpow_si tpow_ui tpow_z \
+tprec tproj treal treimref tset tsin tsin_cos tsinh tsqr tsqrt tstrtoc tsub \
+tsub_fr tsub_ui tswap ttan ttanh tui_div tui_ui_sub tget_version
+
+check_LTLIBRARIES=libmpc-tests.la
+libmpc_tests_la_SOURCES=mpc-tests.h random.c tgeneric.c read_data.c \
+comparisons.c
+
+EXTRA_DIST = abs.dat acos.dat acosh.dat asin.dat asinh.dat atan.dat atanh.dat \
+add.dat add_fr.dat arg.dat conj.dat cos.dat cosh.dat div.dat div_fr.dat \
+exp.dat fma.dat fr_div.dat fr_sub.dat inp_str.dat log.dat log10.dat mul.dat \
+mul_fr.dat neg.dat norm.dat pow.dat pow_fr.dat pow_si.dat pow_ui.dat proj.dat \
+sin.dat sinh.dat sqr.dat sqrt.dat strtoc.dat sub.dat sub_fr.dat tan.dat \
+tanh.dat
+
+TESTS_ENVIRONMENT = $(VALGRIND)
+TESTS = $(check_PROGRAMS)
+CLEANFILES = mpc_test
+
diff --git a/mpc/tests/Makefile.in b/mpc/tests/Makefile.in
new file mode 100644
index 0000000000..bbe3dff866
--- /dev/null
+++ b/mpc/tests/Makefile.in
@@ -0,0 +1,2058 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = tabs$(EXEEXT) tacos$(EXEEXT) tacosh$(EXEEXT) \
+ tadd$(EXEEXT) tadd_fr$(EXEEXT) tadd_si$(EXEEXT) \
+ tadd_ui$(EXEEXT) targ$(EXEEXT) tasin$(EXEEXT) tasinh$(EXEEXT) \
+ tatan$(EXEEXT) tatanh$(EXEEXT) tconj$(EXEEXT) tcos$(EXEEXT) \
+ tcosh$(EXEEXT) tdiv$(EXEEXT) tdiv_2si$(EXEEXT) \
+ tdiv_2ui$(EXEEXT) tdiv_fr$(EXEEXT) tdiv_ui$(EXEEXT) \
+ texp$(EXEEXT) tfma$(EXEEXT) tfr_div$(EXEEXT) tfr_sub$(EXEEXT) \
+ timag$(EXEEXT) tio_str$(EXEEXT) tlog$(EXEEXT) tlog10$(EXEEXT) \
+ tmul$(EXEEXT) tmul_2si$(EXEEXT) tmul_2ui$(EXEEXT) \
+ tmul_fr$(EXEEXT) tmul_i$(EXEEXT) tmul_si$(EXEEXT) \
+ tmul_ui$(EXEEXT) tneg$(EXEEXT) tnorm$(EXEEXT) tpow$(EXEEXT) \
+ tpow_ld$(EXEEXT) tpow_d$(EXEEXT) tpow_fr$(EXEEXT) \
+ tpow_si$(EXEEXT) tpow_ui$(EXEEXT) tpow_z$(EXEEXT) \
+ tprec$(EXEEXT) tproj$(EXEEXT) treal$(EXEEXT) treimref$(EXEEXT) \
+ tset$(EXEEXT) tsin$(EXEEXT) tsin_cos$(EXEEXT) tsinh$(EXEEXT) \
+ tsqr$(EXEEXT) tsqrt$(EXEEXT) tstrtoc$(EXEEXT) tsub$(EXEEXT) \
+ tsub_fr$(EXEEXT) tsub_ui$(EXEEXT) tswap$(EXEEXT) ttan$(EXEEXT) \
+ ttanh$(EXEEXT) tui_div$(EXEEXT) tui_ui_sub$(EXEEXT) \
+ tget_version$(EXEEXT)
+subdir = tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c_check_flag.m4 \
+ $(top_srcdir)/m4/ax_gcc_option.m4 \
+ $(top_srcdir)/m4/ax_gcc_version.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/mpc.m4 $(top_srcdir)/m4/valgrind-tests.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+libmpc_tests_la_LIBADD =
+am_libmpc_tests_la_OBJECTS = random.lo tgeneric.lo read_data.lo \
+ comparisons.lo
+libmpc_tests_la_OBJECTS = $(am_libmpc_tests_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+tabs_SOURCES = tabs.c
+tabs_OBJECTS = tabs.$(OBJEXT)
+tabs_LDADD = $(LDADD)
+tabs_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tacos_SOURCES = tacos.c
+tacos_OBJECTS = tacos.$(OBJEXT)
+tacos_LDADD = $(LDADD)
+tacos_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tacosh_SOURCES = tacosh.c
+tacosh_OBJECTS = tacosh.$(OBJEXT)
+tacosh_LDADD = $(LDADD)
+tacosh_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tadd_SOURCES = tadd.c
+tadd_OBJECTS = tadd.$(OBJEXT)
+tadd_LDADD = $(LDADD)
+tadd_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tadd_fr_SOURCES = tadd_fr.c
+tadd_fr_OBJECTS = tadd_fr.$(OBJEXT)
+tadd_fr_LDADD = $(LDADD)
+tadd_fr_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tadd_si_SOURCES = tadd_si.c
+tadd_si_OBJECTS = tadd_si.$(OBJEXT)
+tadd_si_LDADD = $(LDADD)
+tadd_si_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tadd_ui_SOURCES = tadd_ui.c
+tadd_ui_OBJECTS = tadd_ui.$(OBJEXT)
+tadd_ui_LDADD = $(LDADD)
+tadd_ui_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+targ_SOURCES = targ.c
+targ_OBJECTS = targ.$(OBJEXT)
+targ_LDADD = $(LDADD)
+targ_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tasin_SOURCES = tasin.c
+tasin_OBJECTS = tasin.$(OBJEXT)
+tasin_LDADD = $(LDADD)
+tasin_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tasinh_SOURCES = tasinh.c
+tasinh_OBJECTS = tasinh.$(OBJEXT)
+tasinh_LDADD = $(LDADD)
+tasinh_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tatan_SOURCES = tatan.c
+tatan_OBJECTS = tatan.$(OBJEXT)
+tatan_LDADD = $(LDADD)
+tatan_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tatanh_SOURCES = tatanh.c
+tatanh_OBJECTS = tatanh.$(OBJEXT)
+tatanh_LDADD = $(LDADD)
+tatanh_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tconj_SOURCES = tconj.c
+tconj_OBJECTS = tconj.$(OBJEXT)
+tconj_LDADD = $(LDADD)
+tconj_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tcos_SOURCES = tcos.c
+tcos_OBJECTS = tcos.$(OBJEXT)
+tcos_LDADD = $(LDADD)
+tcos_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tcosh_SOURCES = tcosh.c
+tcosh_OBJECTS = tcosh.$(OBJEXT)
+tcosh_LDADD = $(LDADD)
+tcosh_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tdiv_SOURCES = tdiv.c
+tdiv_OBJECTS = tdiv.$(OBJEXT)
+tdiv_LDADD = $(LDADD)
+tdiv_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tdiv_2si_SOURCES = tdiv_2si.c
+tdiv_2si_OBJECTS = tdiv_2si.$(OBJEXT)
+tdiv_2si_LDADD = $(LDADD)
+tdiv_2si_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tdiv_2ui_SOURCES = tdiv_2ui.c
+tdiv_2ui_OBJECTS = tdiv_2ui.$(OBJEXT)
+tdiv_2ui_LDADD = $(LDADD)
+tdiv_2ui_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tdiv_fr_SOURCES = tdiv_fr.c
+tdiv_fr_OBJECTS = tdiv_fr.$(OBJEXT)
+tdiv_fr_LDADD = $(LDADD)
+tdiv_fr_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tdiv_ui_SOURCES = tdiv_ui.c
+tdiv_ui_OBJECTS = tdiv_ui.$(OBJEXT)
+tdiv_ui_LDADD = $(LDADD)
+tdiv_ui_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+texp_SOURCES = texp.c
+texp_OBJECTS = texp.$(OBJEXT)
+texp_LDADD = $(LDADD)
+texp_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tfma_SOURCES = tfma.c
+tfma_OBJECTS = tfma.$(OBJEXT)
+tfma_LDADD = $(LDADD)
+tfma_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tfr_div_SOURCES = tfr_div.c
+tfr_div_OBJECTS = tfr_div.$(OBJEXT)
+tfr_div_LDADD = $(LDADD)
+tfr_div_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tfr_sub_SOURCES = tfr_sub.c
+tfr_sub_OBJECTS = tfr_sub.$(OBJEXT)
+tfr_sub_LDADD = $(LDADD)
+tfr_sub_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tget_version_SOURCES = tget_version.c
+tget_version_OBJECTS = tget_version.$(OBJEXT)
+tget_version_LDADD = $(LDADD)
+tget_version_DEPENDENCIES = libmpc-tests.la \
+ $(top_builddir)/src/libmpc.la
+timag_SOURCES = timag.c
+timag_OBJECTS = timag.$(OBJEXT)
+timag_LDADD = $(LDADD)
+timag_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tio_str_SOURCES = tio_str.c
+tio_str_OBJECTS = tio_str.$(OBJEXT)
+tio_str_LDADD = $(LDADD)
+tio_str_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tlog_SOURCES = tlog.c
+tlog_OBJECTS = tlog.$(OBJEXT)
+tlog_LDADD = $(LDADD)
+tlog_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tlog10_SOURCES = tlog10.c
+tlog10_OBJECTS = tlog10.$(OBJEXT)
+tlog10_LDADD = $(LDADD)
+tlog10_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tmul_SOURCES = tmul.c
+tmul_OBJECTS = tmul.$(OBJEXT)
+tmul_LDADD = $(LDADD)
+tmul_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tmul_2si_SOURCES = tmul_2si.c
+tmul_2si_OBJECTS = tmul_2si.$(OBJEXT)
+tmul_2si_LDADD = $(LDADD)
+tmul_2si_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tmul_2ui_SOURCES = tmul_2ui.c
+tmul_2ui_OBJECTS = tmul_2ui.$(OBJEXT)
+tmul_2ui_LDADD = $(LDADD)
+tmul_2ui_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tmul_fr_SOURCES = tmul_fr.c
+tmul_fr_OBJECTS = tmul_fr.$(OBJEXT)
+tmul_fr_LDADD = $(LDADD)
+tmul_fr_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tmul_i_SOURCES = tmul_i.c
+tmul_i_OBJECTS = tmul_i.$(OBJEXT)
+tmul_i_LDADD = $(LDADD)
+tmul_i_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tmul_si_SOURCES = tmul_si.c
+tmul_si_OBJECTS = tmul_si.$(OBJEXT)
+tmul_si_LDADD = $(LDADD)
+tmul_si_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tmul_ui_SOURCES = tmul_ui.c
+tmul_ui_OBJECTS = tmul_ui.$(OBJEXT)
+tmul_ui_LDADD = $(LDADD)
+tmul_ui_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tneg_SOURCES = tneg.c
+tneg_OBJECTS = tneg.$(OBJEXT)
+tneg_LDADD = $(LDADD)
+tneg_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tnorm_SOURCES = tnorm.c
+tnorm_OBJECTS = tnorm.$(OBJEXT)
+tnorm_LDADD = $(LDADD)
+tnorm_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tpow_SOURCES = tpow.c
+tpow_OBJECTS = tpow.$(OBJEXT)
+tpow_LDADD = $(LDADD)
+tpow_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tpow_d_SOURCES = tpow_d.c
+tpow_d_OBJECTS = tpow_d.$(OBJEXT)
+tpow_d_LDADD = $(LDADD)
+tpow_d_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tpow_fr_SOURCES = tpow_fr.c
+tpow_fr_OBJECTS = tpow_fr.$(OBJEXT)
+tpow_fr_LDADD = $(LDADD)
+tpow_fr_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tpow_ld_SOURCES = tpow_ld.c
+tpow_ld_OBJECTS = tpow_ld.$(OBJEXT)
+tpow_ld_LDADD = $(LDADD)
+tpow_ld_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tpow_si_SOURCES = tpow_si.c
+tpow_si_OBJECTS = tpow_si.$(OBJEXT)
+tpow_si_LDADD = $(LDADD)
+tpow_si_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tpow_ui_SOURCES = tpow_ui.c
+tpow_ui_OBJECTS = tpow_ui.$(OBJEXT)
+tpow_ui_LDADD = $(LDADD)
+tpow_ui_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tpow_z_SOURCES = tpow_z.c
+tpow_z_OBJECTS = tpow_z.$(OBJEXT)
+tpow_z_LDADD = $(LDADD)
+tpow_z_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tprec_SOURCES = tprec.c
+tprec_OBJECTS = tprec.$(OBJEXT)
+tprec_LDADD = $(LDADD)
+tprec_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tproj_SOURCES = tproj.c
+tproj_OBJECTS = tproj.$(OBJEXT)
+tproj_LDADD = $(LDADD)
+tproj_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+treal_SOURCES = treal.c
+treal_OBJECTS = treal.$(OBJEXT)
+treal_LDADD = $(LDADD)
+treal_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+treimref_SOURCES = treimref.c
+treimref_OBJECTS = treimref.$(OBJEXT)
+treimref_LDADD = $(LDADD)
+treimref_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tset_SOURCES = tset.c
+tset_OBJECTS = tset.$(OBJEXT)
+tset_LDADD = $(LDADD)
+tset_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tsin_SOURCES = tsin.c
+tsin_OBJECTS = tsin.$(OBJEXT)
+tsin_LDADD = $(LDADD)
+tsin_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tsin_cos_SOURCES = tsin_cos.c
+tsin_cos_OBJECTS = tsin_cos.$(OBJEXT)
+tsin_cos_LDADD = $(LDADD)
+tsin_cos_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tsinh_SOURCES = tsinh.c
+tsinh_OBJECTS = tsinh.$(OBJEXT)
+tsinh_LDADD = $(LDADD)
+tsinh_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tsqr_SOURCES = tsqr.c
+tsqr_OBJECTS = tsqr.$(OBJEXT)
+tsqr_LDADD = $(LDADD)
+tsqr_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tsqrt_SOURCES = tsqrt.c
+tsqrt_OBJECTS = tsqrt.$(OBJEXT)
+tsqrt_LDADD = $(LDADD)
+tsqrt_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tstrtoc_SOURCES = tstrtoc.c
+tstrtoc_OBJECTS = tstrtoc.$(OBJEXT)
+tstrtoc_LDADD = $(LDADD)
+tstrtoc_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tsub_SOURCES = tsub.c
+tsub_OBJECTS = tsub.$(OBJEXT)
+tsub_LDADD = $(LDADD)
+tsub_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tsub_fr_SOURCES = tsub_fr.c
+tsub_fr_OBJECTS = tsub_fr.$(OBJEXT)
+tsub_fr_LDADD = $(LDADD)
+tsub_fr_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tsub_ui_SOURCES = tsub_ui.c
+tsub_ui_OBJECTS = tsub_ui.$(OBJEXT)
+tsub_ui_LDADD = $(LDADD)
+tsub_ui_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tswap_SOURCES = tswap.c
+tswap_OBJECTS = tswap.$(OBJEXT)
+tswap_LDADD = $(LDADD)
+tswap_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+ttan_SOURCES = ttan.c
+ttan_OBJECTS = ttan.$(OBJEXT)
+ttan_LDADD = $(LDADD)
+ttan_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+ttanh_SOURCES = ttanh.c
+ttanh_OBJECTS = ttanh.$(OBJEXT)
+ttanh_LDADD = $(LDADD)
+ttanh_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tui_div_SOURCES = tui_div.c
+tui_div_OBJECTS = tui_div.$(OBJEXT)
+tui_div_LDADD = $(LDADD)
+tui_div_DEPENDENCIES = libmpc-tests.la $(top_builddir)/src/libmpc.la
+tui_ui_sub_SOURCES = tui_ui_sub.c
+tui_ui_sub_OBJECTS = tui_ui_sub.$(OBJEXT)
+tui_ui_sub_LDADD = $(LDADD)
+tui_ui_sub_DEPENDENCIES = libmpc-tests.la \
+ $(top_builddir)/src/libmpc.la
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libmpc_tests_la_SOURCES) tabs.c tacos.c tacosh.c tadd.c \
+ tadd_fr.c tadd_si.c tadd_ui.c targ.c tasin.c tasinh.c tatan.c \
+ tatanh.c tconj.c tcos.c tcosh.c tdiv.c tdiv_2si.c tdiv_2ui.c \
+ tdiv_fr.c tdiv_ui.c texp.c tfma.c tfr_div.c tfr_sub.c \
+ tget_version.c timag.c tio_str.c tlog.c tlog10.c tmul.c \
+ tmul_2si.c tmul_2ui.c tmul_fr.c tmul_i.c tmul_si.c tmul_ui.c \
+ tneg.c tnorm.c tpow.c tpow_d.c tpow_fr.c tpow_ld.c tpow_si.c \
+ tpow_ui.c tpow_z.c tprec.c tproj.c treal.c treimref.c tset.c \
+ tsin.c tsin_cos.c tsinh.c tsqr.c tsqrt.c tstrtoc.c tsub.c \
+ tsub_fr.c tsub_ui.c tswap.c ttan.c ttanh.c tui_div.c \
+ tui_ui_sub.c
+DIST_SOURCES = $(libmpc_tests_la_SOURCES) tabs.c tacos.c tacosh.c \
+ tadd.c tadd_fr.c tadd_si.c tadd_ui.c targ.c tasin.c tasinh.c \
+ tatan.c tatanh.c tconj.c tcos.c tcosh.c tdiv.c tdiv_2si.c \
+ tdiv_2ui.c tdiv_fr.c tdiv_ui.c texp.c tfma.c tfr_div.c \
+ tfr_sub.c tget_version.c timag.c tio_str.c tlog.c tlog10.c \
+ tmul.c tmul_2si.c tmul_2ui.c tmul_fr.c tmul_i.c tmul_si.c \
+ tmul_ui.c tneg.c tnorm.c tpow.c tpow_d.c tpow_fr.c tpow_ld.c \
+ tpow_si.c tpow_ui.c tpow_z.c tprec.c tproj.c treal.c \
+ treimref.c tset.c tsin.c tsin_cos.c tsinh.c tsqr.c tsqrt.c \
+ tstrtoc.c tsub.c tsub_fr.c tsub_ui.c tswap.c ttan.c ttanh.c \
+ tui_div.c tui_ui_sub.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+ $(top_srcdir)/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GCC_VERSION = @GCC_VERSION@
+GITVERSION = @GITVERSION@
+GREP = @GREP@
+HASGIT = @HASGIT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MPC_LDFLAGS = @MPC_LDFLAGS@
+MPC_LOG_H = @MPC_LOG_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VALGRIND = @VALGRIND@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = -I$(top_srcdir)/src
+LDADD = libmpc-tests.la $(top_builddir)/src/libmpc.la
+# let libtool create an executable instead of a shell script
+# useful for tests with valgrind
+AM_LDFLAGS = -no-install
+# LOADLIBES (documented in the "GNU make" manual and equivalent to LDLIBS)
+# enables to compile a program foo.c in the test directory by simply doing
+# "make foo".
+LOADLIBES = $(DEFS) -I$(top_srcdir)/src -I$(top_builddir) $(CPPFLAGS) $(CFLAGS) -L$(top_builddir)/tests/.libs -lmpc-tests -lmpc -lm $(LIBS)
+check_LTLIBRARIES = libmpc-tests.la
+libmpc_tests_la_SOURCES = mpc-tests.h random.c tgeneric.c read_data.c \
+comparisons.c
+
+EXTRA_DIST = abs.dat acos.dat acosh.dat asin.dat asinh.dat atan.dat atanh.dat \
+add.dat add_fr.dat arg.dat conj.dat cos.dat cosh.dat div.dat div_fr.dat \
+exp.dat fma.dat fr_div.dat fr_sub.dat inp_str.dat log.dat log10.dat mul.dat \
+mul_fr.dat neg.dat norm.dat pow.dat pow_fr.dat pow_si.dat pow_ui.dat proj.dat \
+sin.dat sinh.dat sqr.dat sqrt.dat strtoc.dat sub.dat sub_fr.dat tan.dat \
+tanh.dat
+
+TESTS_ENVIRONMENT = $(VALGRIND)
+TESTS = $(check_PROGRAMS)
+CLEANFILES = mpc_test
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkLTLIBRARIES:
+ -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES)
+ @list='$(check_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+libmpc-tests.la: $(libmpc_tests_la_OBJECTS) $(libmpc_tests_la_DEPENDENCIES) $(EXTRA_libmpc_tests_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(libmpc_tests_la_OBJECTS) $(libmpc_tests_la_LIBADD) $(LIBS)
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+tabs$(EXEEXT): $(tabs_OBJECTS) $(tabs_DEPENDENCIES) $(EXTRA_tabs_DEPENDENCIES)
+ @rm -f tabs$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tabs_OBJECTS) $(tabs_LDADD) $(LIBS)
+
+tacos$(EXEEXT): $(tacos_OBJECTS) $(tacos_DEPENDENCIES) $(EXTRA_tacos_DEPENDENCIES)
+ @rm -f tacos$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tacos_OBJECTS) $(tacos_LDADD) $(LIBS)
+
+tacosh$(EXEEXT): $(tacosh_OBJECTS) $(tacosh_DEPENDENCIES) $(EXTRA_tacosh_DEPENDENCIES)
+ @rm -f tacosh$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tacosh_OBJECTS) $(tacosh_LDADD) $(LIBS)
+
+tadd$(EXEEXT): $(tadd_OBJECTS) $(tadd_DEPENDENCIES) $(EXTRA_tadd_DEPENDENCIES)
+ @rm -f tadd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tadd_OBJECTS) $(tadd_LDADD) $(LIBS)
+
+tadd_fr$(EXEEXT): $(tadd_fr_OBJECTS) $(tadd_fr_DEPENDENCIES) $(EXTRA_tadd_fr_DEPENDENCIES)
+ @rm -f tadd_fr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tadd_fr_OBJECTS) $(tadd_fr_LDADD) $(LIBS)
+
+tadd_si$(EXEEXT): $(tadd_si_OBJECTS) $(tadd_si_DEPENDENCIES) $(EXTRA_tadd_si_DEPENDENCIES)
+ @rm -f tadd_si$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tadd_si_OBJECTS) $(tadd_si_LDADD) $(LIBS)
+
+tadd_ui$(EXEEXT): $(tadd_ui_OBJECTS) $(tadd_ui_DEPENDENCIES) $(EXTRA_tadd_ui_DEPENDENCIES)
+ @rm -f tadd_ui$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tadd_ui_OBJECTS) $(tadd_ui_LDADD) $(LIBS)
+
+targ$(EXEEXT): $(targ_OBJECTS) $(targ_DEPENDENCIES) $(EXTRA_targ_DEPENDENCIES)
+ @rm -f targ$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(targ_OBJECTS) $(targ_LDADD) $(LIBS)
+
+tasin$(EXEEXT): $(tasin_OBJECTS) $(tasin_DEPENDENCIES) $(EXTRA_tasin_DEPENDENCIES)
+ @rm -f tasin$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tasin_OBJECTS) $(tasin_LDADD) $(LIBS)
+
+tasinh$(EXEEXT): $(tasinh_OBJECTS) $(tasinh_DEPENDENCIES) $(EXTRA_tasinh_DEPENDENCIES)
+ @rm -f tasinh$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tasinh_OBJECTS) $(tasinh_LDADD) $(LIBS)
+
+tatan$(EXEEXT): $(tatan_OBJECTS) $(tatan_DEPENDENCIES) $(EXTRA_tatan_DEPENDENCIES)
+ @rm -f tatan$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tatan_OBJECTS) $(tatan_LDADD) $(LIBS)
+
+tatanh$(EXEEXT): $(tatanh_OBJECTS) $(tatanh_DEPENDENCIES) $(EXTRA_tatanh_DEPENDENCIES)
+ @rm -f tatanh$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tatanh_OBJECTS) $(tatanh_LDADD) $(LIBS)
+
+tconj$(EXEEXT): $(tconj_OBJECTS) $(tconj_DEPENDENCIES) $(EXTRA_tconj_DEPENDENCIES)
+ @rm -f tconj$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tconj_OBJECTS) $(tconj_LDADD) $(LIBS)
+
+tcos$(EXEEXT): $(tcos_OBJECTS) $(tcos_DEPENDENCIES) $(EXTRA_tcos_DEPENDENCIES)
+ @rm -f tcos$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tcos_OBJECTS) $(tcos_LDADD) $(LIBS)
+
+tcosh$(EXEEXT): $(tcosh_OBJECTS) $(tcosh_DEPENDENCIES) $(EXTRA_tcosh_DEPENDENCIES)
+ @rm -f tcosh$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tcosh_OBJECTS) $(tcosh_LDADD) $(LIBS)
+
+tdiv$(EXEEXT): $(tdiv_OBJECTS) $(tdiv_DEPENDENCIES) $(EXTRA_tdiv_DEPENDENCIES)
+ @rm -f tdiv$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tdiv_OBJECTS) $(tdiv_LDADD) $(LIBS)
+
+tdiv_2si$(EXEEXT): $(tdiv_2si_OBJECTS) $(tdiv_2si_DEPENDENCIES) $(EXTRA_tdiv_2si_DEPENDENCIES)
+ @rm -f tdiv_2si$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tdiv_2si_OBJECTS) $(tdiv_2si_LDADD) $(LIBS)
+
+tdiv_2ui$(EXEEXT): $(tdiv_2ui_OBJECTS) $(tdiv_2ui_DEPENDENCIES) $(EXTRA_tdiv_2ui_DEPENDENCIES)
+ @rm -f tdiv_2ui$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tdiv_2ui_OBJECTS) $(tdiv_2ui_LDADD) $(LIBS)
+
+tdiv_fr$(EXEEXT): $(tdiv_fr_OBJECTS) $(tdiv_fr_DEPENDENCIES) $(EXTRA_tdiv_fr_DEPENDENCIES)
+ @rm -f tdiv_fr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tdiv_fr_OBJECTS) $(tdiv_fr_LDADD) $(LIBS)
+
+tdiv_ui$(EXEEXT): $(tdiv_ui_OBJECTS) $(tdiv_ui_DEPENDENCIES) $(EXTRA_tdiv_ui_DEPENDENCIES)
+ @rm -f tdiv_ui$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tdiv_ui_OBJECTS) $(tdiv_ui_LDADD) $(LIBS)
+
+texp$(EXEEXT): $(texp_OBJECTS) $(texp_DEPENDENCIES) $(EXTRA_texp_DEPENDENCIES)
+ @rm -f texp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(texp_OBJECTS) $(texp_LDADD) $(LIBS)
+
+tfma$(EXEEXT): $(tfma_OBJECTS) $(tfma_DEPENDENCIES) $(EXTRA_tfma_DEPENDENCIES)
+ @rm -f tfma$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tfma_OBJECTS) $(tfma_LDADD) $(LIBS)
+
+tfr_div$(EXEEXT): $(tfr_div_OBJECTS) $(tfr_div_DEPENDENCIES) $(EXTRA_tfr_div_DEPENDENCIES)
+ @rm -f tfr_div$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tfr_div_OBJECTS) $(tfr_div_LDADD) $(LIBS)
+
+tfr_sub$(EXEEXT): $(tfr_sub_OBJECTS) $(tfr_sub_DEPENDENCIES) $(EXTRA_tfr_sub_DEPENDENCIES)
+ @rm -f tfr_sub$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tfr_sub_OBJECTS) $(tfr_sub_LDADD) $(LIBS)
+
+tget_version$(EXEEXT): $(tget_version_OBJECTS) $(tget_version_DEPENDENCIES) $(EXTRA_tget_version_DEPENDENCIES)
+ @rm -f tget_version$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tget_version_OBJECTS) $(tget_version_LDADD) $(LIBS)
+
+timag$(EXEEXT): $(timag_OBJECTS) $(timag_DEPENDENCIES) $(EXTRA_timag_DEPENDENCIES)
+ @rm -f timag$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(timag_OBJECTS) $(timag_LDADD) $(LIBS)
+
+tio_str$(EXEEXT): $(tio_str_OBJECTS) $(tio_str_DEPENDENCIES) $(EXTRA_tio_str_DEPENDENCIES)
+ @rm -f tio_str$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tio_str_OBJECTS) $(tio_str_LDADD) $(LIBS)
+
+tlog$(EXEEXT): $(tlog_OBJECTS) $(tlog_DEPENDENCIES) $(EXTRA_tlog_DEPENDENCIES)
+ @rm -f tlog$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tlog_OBJECTS) $(tlog_LDADD) $(LIBS)
+
+tlog10$(EXEEXT): $(tlog10_OBJECTS) $(tlog10_DEPENDENCIES) $(EXTRA_tlog10_DEPENDENCIES)
+ @rm -f tlog10$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tlog10_OBJECTS) $(tlog10_LDADD) $(LIBS)
+
+tmul$(EXEEXT): $(tmul_OBJECTS) $(tmul_DEPENDENCIES) $(EXTRA_tmul_DEPENDENCIES)
+ @rm -f tmul$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tmul_OBJECTS) $(tmul_LDADD) $(LIBS)
+
+tmul_2si$(EXEEXT): $(tmul_2si_OBJECTS) $(tmul_2si_DEPENDENCIES) $(EXTRA_tmul_2si_DEPENDENCIES)
+ @rm -f tmul_2si$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tmul_2si_OBJECTS) $(tmul_2si_LDADD) $(LIBS)
+
+tmul_2ui$(EXEEXT): $(tmul_2ui_OBJECTS) $(tmul_2ui_DEPENDENCIES) $(EXTRA_tmul_2ui_DEPENDENCIES)
+ @rm -f tmul_2ui$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tmul_2ui_OBJECTS) $(tmul_2ui_LDADD) $(LIBS)
+
+tmul_fr$(EXEEXT): $(tmul_fr_OBJECTS) $(tmul_fr_DEPENDENCIES) $(EXTRA_tmul_fr_DEPENDENCIES)
+ @rm -f tmul_fr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tmul_fr_OBJECTS) $(tmul_fr_LDADD) $(LIBS)
+
+tmul_i$(EXEEXT): $(tmul_i_OBJECTS) $(tmul_i_DEPENDENCIES) $(EXTRA_tmul_i_DEPENDENCIES)
+ @rm -f tmul_i$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tmul_i_OBJECTS) $(tmul_i_LDADD) $(LIBS)
+
+tmul_si$(EXEEXT): $(tmul_si_OBJECTS) $(tmul_si_DEPENDENCIES) $(EXTRA_tmul_si_DEPENDENCIES)
+ @rm -f tmul_si$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tmul_si_OBJECTS) $(tmul_si_LDADD) $(LIBS)
+
+tmul_ui$(EXEEXT): $(tmul_ui_OBJECTS) $(tmul_ui_DEPENDENCIES) $(EXTRA_tmul_ui_DEPENDENCIES)
+ @rm -f tmul_ui$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tmul_ui_OBJECTS) $(tmul_ui_LDADD) $(LIBS)
+
+tneg$(EXEEXT): $(tneg_OBJECTS) $(tneg_DEPENDENCIES) $(EXTRA_tneg_DEPENDENCIES)
+ @rm -f tneg$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tneg_OBJECTS) $(tneg_LDADD) $(LIBS)
+
+tnorm$(EXEEXT): $(tnorm_OBJECTS) $(tnorm_DEPENDENCIES) $(EXTRA_tnorm_DEPENDENCIES)
+ @rm -f tnorm$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tnorm_OBJECTS) $(tnorm_LDADD) $(LIBS)
+
+tpow$(EXEEXT): $(tpow_OBJECTS) $(tpow_DEPENDENCIES) $(EXTRA_tpow_DEPENDENCIES)
+ @rm -f tpow$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tpow_OBJECTS) $(tpow_LDADD) $(LIBS)
+
+tpow_d$(EXEEXT): $(tpow_d_OBJECTS) $(tpow_d_DEPENDENCIES) $(EXTRA_tpow_d_DEPENDENCIES)
+ @rm -f tpow_d$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tpow_d_OBJECTS) $(tpow_d_LDADD) $(LIBS)
+
+tpow_fr$(EXEEXT): $(tpow_fr_OBJECTS) $(tpow_fr_DEPENDENCIES) $(EXTRA_tpow_fr_DEPENDENCIES)
+ @rm -f tpow_fr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tpow_fr_OBJECTS) $(tpow_fr_LDADD) $(LIBS)
+
+tpow_ld$(EXEEXT): $(tpow_ld_OBJECTS) $(tpow_ld_DEPENDENCIES) $(EXTRA_tpow_ld_DEPENDENCIES)
+ @rm -f tpow_ld$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tpow_ld_OBJECTS) $(tpow_ld_LDADD) $(LIBS)
+
+tpow_si$(EXEEXT): $(tpow_si_OBJECTS) $(tpow_si_DEPENDENCIES) $(EXTRA_tpow_si_DEPENDENCIES)
+ @rm -f tpow_si$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tpow_si_OBJECTS) $(tpow_si_LDADD) $(LIBS)
+
+tpow_ui$(EXEEXT): $(tpow_ui_OBJECTS) $(tpow_ui_DEPENDENCIES) $(EXTRA_tpow_ui_DEPENDENCIES)
+ @rm -f tpow_ui$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tpow_ui_OBJECTS) $(tpow_ui_LDADD) $(LIBS)
+
+tpow_z$(EXEEXT): $(tpow_z_OBJECTS) $(tpow_z_DEPENDENCIES) $(EXTRA_tpow_z_DEPENDENCIES)
+ @rm -f tpow_z$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tpow_z_OBJECTS) $(tpow_z_LDADD) $(LIBS)
+
+tprec$(EXEEXT): $(tprec_OBJECTS) $(tprec_DEPENDENCIES) $(EXTRA_tprec_DEPENDENCIES)
+ @rm -f tprec$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tprec_OBJECTS) $(tprec_LDADD) $(LIBS)
+
+tproj$(EXEEXT): $(tproj_OBJECTS) $(tproj_DEPENDENCIES) $(EXTRA_tproj_DEPENDENCIES)
+ @rm -f tproj$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tproj_OBJECTS) $(tproj_LDADD) $(LIBS)
+
+treal$(EXEEXT): $(treal_OBJECTS) $(treal_DEPENDENCIES) $(EXTRA_treal_DEPENDENCIES)
+ @rm -f treal$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(treal_OBJECTS) $(treal_LDADD) $(LIBS)
+
+treimref$(EXEEXT): $(treimref_OBJECTS) $(treimref_DEPENDENCIES) $(EXTRA_treimref_DEPENDENCIES)
+ @rm -f treimref$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(treimref_OBJECTS) $(treimref_LDADD) $(LIBS)
+
+tset$(EXEEXT): $(tset_OBJECTS) $(tset_DEPENDENCIES) $(EXTRA_tset_DEPENDENCIES)
+ @rm -f tset$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tset_OBJECTS) $(tset_LDADD) $(LIBS)
+
+tsin$(EXEEXT): $(tsin_OBJECTS) $(tsin_DEPENDENCIES) $(EXTRA_tsin_DEPENDENCIES)
+ @rm -f tsin$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tsin_OBJECTS) $(tsin_LDADD) $(LIBS)
+
+tsin_cos$(EXEEXT): $(tsin_cos_OBJECTS) $(tsin_cos_DEPENDENCIES) $(EXTRA_tsin_cos_DEPENDENCIES)
+ @rm -f tsin_cos$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tsin_cos_OBJECTS) $(tsin_cos_LDADD) $(LIBS)
+
+tsinh$(EXEEXT): $(tsinh_OBJECTS) $(tsinh_DEPENDENCIES) $(EXTRA_tsinh_DEPENDENCIES)
+ @rm -f tsinh$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tsinh_OBJECTS) $(tsinh_LDADD) $(LIBS)
+
+tsqr$(EXEEXT): $(tsqr_OBJECTS) $(tsqr_DEPENDENCIES) $(EXTRA_tsqr_DEPENDENCIES)
+ @rm -f tsqr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tsqr_OBJECTS) $(tsqr_LDADD) $(LIBS)
+
+tsqrt$(EXEEXT): $(tsqrt_OBJECTS) $(tsqrt_DEPENDENCIES) $(EXTRA_tsqrt_DEPENDENCIES)
+ @rm -f tsqrt$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tsqrt_OBJECTS) $(tsqrt_LDADD) $(LIBS)
+
+tstrtoc$(EXEEXT): $(tstrtoc_OBJECTS) $(tstrtoc_DEPENDENCIES) $(EXTRA_tstrtoc_DEPENDENCIES)
+ @rm -f tstrtoc$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tstrtoc_OBJECTS) $(tstrtoc_LDADD) $(LIBS)
+
+tsub$(EXEEXT): $(tsub_OBJECTS) $(tsub_DEPENDENCIES) $(EXTRA_tsub_DEPENDENCIES)
+ @rm -f tsub$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tsub_OBJECTS) $(tsub_LDADD) $(LIBS)
+
+tsub_fr$(EXEEXT): $(tsub_fr_OBJECTS) $(tsub_fr_DEPENDENCIES) $(EXTRA_tsub_fr_DEPENDENCIES)
+ @rm -f tsub_fr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tsub_fr_OBJECTS) $(tsub_fr_LDADD) $(LIBS)
+
+tsub_ui$(EXEEXT): $(tsub_ui_OBJECTS) $(tsub_ui_DEPENDENCIES) $(EXTRA_tsub_ui_DEPENDENCIES)
+ @rm -f tsub_ui$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tsub_ui_OBJECTS) $(tsub_ui_LDADD) $(LIBS)
+
+tswap$(EXEEXT): $(tswap_OBJECTS) $(tswap_DEPENDENCIES) $(EXTRA_tswap_DEPENDENCIES)
+ @rm -f tswap$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tswap_OBJECTS) $(tswap_LDADD) $(LIBS)
+
+ttan$(EXEEXT): $(ttan_OBJECTS) $(ttan_DEPENDENCIES) $(EXTRA_ttan_DEPENDENCIES)
+ @rm -f ttan$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ttan_OBJECTS) $(ttan_LDADD) $(LIBS)
+
+ttanh$(EXEEXT): $(ttanh_OBJECTS) $(ttanh_DEPENDENCIES) $(EXTRA_ttanh_DEPENDENCIES)
+ @rm -f ttanh$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ttanh_OBJECTS) $(ttanh_LDADD) $(LIBS)
+
+tui_div$(EXEEXT): $(tui_div_OBJECTS) $(tui_div_DEPENDENCIES) $(EXTRA_tui_div_DEPENDENCIES)
+ @rm -f tui_div$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tui_div_OBJECTS) $(tui_div_LDADD) $(LIBS)
+
+tui_ui_sub$(EXEEXT): $(tui_ui_sub_OBJECTS) $(tui_ui_sub_DEPENDENCIES) $(EXTRA_tui_ui_sub_DEPENDENCIES)
+ @rm -f tui_ui_sub$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tui_ui_sub_OBJECTS) $(tui_ui_sub_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comparisons.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read_data.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tacos.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tacosh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tadd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tadd_fr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tadd_si.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tadd_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/targ.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tasin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tasinh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tatan.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tatanh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tconj.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcos.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcosh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tdiv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tdiv_2si.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tdiv_2ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tdiv_fr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tdiv_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tfma.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tfr_div.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tfr_sub.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tgeneric.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tget_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timag.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tio_str.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlog10.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmul_2si.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmul_2ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmul_fr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmul_i.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmul_si.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmul_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tneg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnorm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpow.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpow_d.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpow_fr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpow_ld.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpow_si.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpow_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpow_z.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tprec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tproj.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treimref.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tset.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsin_cos.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsinh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsqr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsqrt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tstrtoc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsub.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsub_fr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsub_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tswap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttan.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttanh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tui_div.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tui_ui_sub.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all $(check_LTLIBRARIES) $(check_PROGRAMS)
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+tabs.log: tabs$(EXEEXT)
+ @p='tabs$(EXEEXT)'; \
+ b='tabs'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tacos.log: tacos$(EXEEXT)
+ @p='tacos$(EXEEXT)'; \
+ b='tacos'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tacosh.log: tacosh$(EXEEXT)
+ @p='tacosh$(EXEEXT)'; \
+ b='tacosh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tadd.log: tadd$(EXEEXT)
+ @p='tadd$(EXEEXT)'; \
+ b='tadd'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tadd_fr.log: tadd_fr$(EXEEXT)
+ @p='tadd_fr$(EXEEXT)'; \
+ b='tadd_fr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tadd_si.log: tadd_si$(EXEEXT)
+ @p='tadd_si$(EXEEXT)'; \
+ b='tadd_si'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tadd_ui.log: tadd_ui$(EXEEXT)
+ @p='tadd_ui$(EXEEXT)'; \
+ b='tadd_ui'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+targ.log: targ$(EXEEXT)
+ @p='targ$(EXEEXT)'; \
+ b='targ'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tasin.log: tasin$(EXEEXT)
+ @p='tasin$(EXEEXT)'; \
+ b='tasin'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tasinh.log: tasinh$(EXEEXT)
+ @p='tasinh$(EXEEXT)'; \
+ b='tasinh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tatan.log: tatan$(EXEEXT)
+ @p='tatan$(EXEEXT)'; \
+ b='tatan'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tatanh.log: tatanh$(EXEEXT)
+ @p='tatanh$(EXEEXT)'; \
+ b='tatanh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tconj.log: tconj$(EXEEXT)
+ @p='tconj$(EXEEXT)'; \
+ b='tconj'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tcos.log: tcos$(EXEEXT)
+ @p='tcos$(EXEEXT)'; \
+ b='tcos'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tcosh.log: tcosh$(EXEEXT)
+ @p='tcosh$(EXEEXT)'; \
+ b='tcosh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tdiv.log: tdiv$(EXEEXT)
+ @p='tdiv$(EXEEXT)'; \
+ b='tdiv'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tdiv_2si.log: tdiv_2si$(EXEEXT)
+ @p='tdiv_2si$(EXEEXT)'; \
+ b='tdiv_2si'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tdiv_2ui.log: tdiv_2ui$(EXEEXT)
+ @p='tdiv_2ui$(EXEEXT)'; \
+ b='tdiv_2ui'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tdiv_fr.log: tdiv_fr$(EXEEXT)
+ @p='tdiv_fr$(EXEEXT)'; \
+ b='tdiv_fr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tdiv_ui.log: tdiv_ui$(EXEEXT)
+ @p='tdiv_ui$(EXEEXT)'; \
+ b='tdiv_ui'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+texp.log: texp$(EXEEXT)
+ @p='texp$(EXEEXT)'; \
+ b='texp'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tfma.log: tfma$(EXEEXT)
+ @p='tfma$(EXEEXT)'; \
+ b='tfma'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tfr_div.log: tfr_div$(EXEEXT)
+ @p='tfr_div$(EXEEXT)'; \
+ b='tfr_div'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tfr_sub.log: tfr_sub$(EXEEXT)
+ @p='tfr_sub$(EXEEXT)'; \
+ b='tfr_sub'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+timag.log: timag$(EXEEXT)
+ @p='timag$(EXEEXT)'; \
+ b='timag'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tio_str.log: tio_str$(EXEEXT)
+ @p='tio_str$(EXEEXT)'; \
+ b='tio_str'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tlog.log: tlog$(EXEEXT)
+ @p='tlog$(EXEEXT)'; \
+ b='tlog'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tlog10.log: tlog10$(EXEEXT)
+ @p='tlog10$(EXEEXT)'; \
+ b='tlog10'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tmul.log: tmul$(EXEEXT)
+ @p='tmul$(EXEEXT)'; \
+ b='tmul'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tmul_2si.log: tmul_2si$(EXEEXT)
+ @p='tmul_2si$(EXEEXT)'; \
+ b='tmul_2si'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tmul_2ui.log: tmul_2ui$(EXEEXT)
+ @p='tmul_2ui$(EXEEXT)'; \
+ b='tmul_2ui'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tmul_fr.log: tmul_fr$(EXEEXT)
+ @p='tmul_fr$(EXEEXT)'; \
+ b='tmul_fr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tmul_i.log: tmul_i$(EXEEXT)
+ @p='tmul_i$(EXEEXT)'; \
+ b='tmul_i'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tmul_si.log: tmul_si$(EXEEXT)
+ @p='tmul_si$(EXEEXT)'; \
+ b='tmul_si'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tmul_ui.log: tmul_ui$(EXEEXT)
+ @p='tmul_ui$(EXEEXT)'; \
+ b='tmul_ui'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tneg.log: tneg$(EXEEXT)
+ @p='tneg$(EXEEXT)'; \
+ b='tneg'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tnorm.log: tnorm$(EXEEXT)
+ @p='tnorm$(EXEEXT)'; \
+ b='tnorm'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tpow.log: tpow$(EXEEXT)
+ @p='tpow$(EXEEXT)'; \
+ b='tpow'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tpow_ld.log: tpow_ld$(EXEEXT)
+ @p='tpow_ld$(EXEEXT)'; \
+ b='tpow_ld'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tpow_d.log: tpow_d$(EXEEXT)
+ @p='tpow_d$(EXEEXT)'; \
+ b='tpow_d'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tpow_fr.log: tpow_fr$(EXEEXT)
+ @p='tpow_fr$(EXEEXT)'; \
+ b='tpow_fr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tpow_si.log: tpow_si$(EXEEXT)
+ @p='tpow_si$(EXEEXT)'; \
+ b='tpow_si'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tpow_ui.log: tpow_ui$(EXEEXT)
+ @p='tpow_ui$(EXEEXT)'; \
+ b='tpow_ui'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tpow_z.log: tpow_z$(EXEEXT)
+ @p='tpow_z$(EXEEXT)'; \
+ b='tpow_z'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tprec.log: tprec$(EXEEXT)
+ @p='tprec$(EXEEXT)'; \
+ b='tprec'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tproj.log: tproj$(EXEEXT)
+ @p='tproj$(EXEEXT)'; \
+ b='tproj'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+treal.log: treal$(EXEEXT)
+ @p='treal$(EXEEXT)'; \
+ b='treal'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+treimref.log: treimref$(EXEEXT)
+ @p='treimref$(EXEEXT)'; \
+ b='treimref'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tset.log: tset$(EXEEXT)
+ @p='tset$(EXEEXT)'; \
+ b='tset'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tsin.log: tsin$(EXEEXT)
+ @p='tsin$(EXEEXT)'; \
+ b='tsin'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tsin_cos.log: tsin_cos$(EXEEXT)
+ @p='tsin_cos$(EXEEXT)'; \
+ b='tsin_cos'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tsinh.log: tsinh$(EXEEXT)
+ @p='tsinh$(EXEEXT)'; \
+ b='tsinh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tsqr.log: tsqr$(EXEEXT)
+ @p='tsqr$(EXEEXT)'; \
+ b='tsqr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tsqrt.log: tsqrt$(EXEEXT)
+ @p='tsqrt$(EXEEXT)'; \
+ b='tsqrt'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tstrtoc.log: tstrtoc$(EXEEXT)
+ @p='tstrtoc$(EXEEXT)'; \
+ b='tstrtoc'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tsub.log: tsub$(EXEEXT)
+ @p='tsub$(EXEEXT)'; \
+ b='tsub'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tsub_fr.log: tsub_fr$(EXEEXT)
+ @p='tsub_fr$(EXEEXT)'; \
+ b='tsub_fr'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tsub_ui.log: tsub_ui$(EXEEXT)
+ @p='tsub_ui$(EXEEXT)'; \
+ b='tsub_ui'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tswap.log: tswap$(EXEEXT)
+ @p='tswap$(EXEEXT)'; \
+ b='tswap'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+ttan.log: ttan$(EXEEXT)
+ @p='ttan$(EXEEXT)'; \
+ b='ttan'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+ttanh.log: ttanh$(EXEEXT)
+ @p='ttanh$(EXEEXT)'; \
+ b='ttanh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tui_div.log: tui_div$(EXEEXT)
+ @p='tui_div$(EXEEXT)'; \
+ b='tui_div'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tui_ui_sub.log: tui_ui_sub$(EXEEXT)
+ @p='tui_ui_sub$(EXEEXT)'; \
+ b='tui_ui_sub'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+tget_version.log: tget_version$(EXEEXT)
+ @p='tget_version$(EXEEXT)'; \
+ b='tget_version'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \
+ clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+ clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \
+ clean-libtool cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am recheck tags tags-am uninstall \
+ uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/mpc/tests/abs.dat b/mpc/tests/abs.dat
new file mode 100644
index 0000000000..19098683cd
--- /dev/null
+++ b/mpc/tests/abs.dat
@@ -0,0 +1,84 @@
+# Data file for mpc_abs.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX PREC_ROP ROP PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND
+#
+# where op = op_re + i * op_im,
+# rop is ROP rounded to nearest to the precision of PREC_ROP
+# op_re is OP_RE rounded to nearest to the precision of PREC_OP_RE
+# op_im is OP_IM rounded to nearest to the precision of PREC_OP_IM
+# ROP is checked against abs(op) rounded to the precision PREC_ROP
+# in the direction RND
+# INEX is the ternary value with the following notation:
+# "?" ternary value not checked
+# "+" if ROP is greater than the exact mathematical result
+# "0" if ROP is exactly the mathematical result
+# "-" if ROP is less than the exact mathematical result
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
+0 53 +inf 53 -inf 53 -inf N
+0 53 +inf 53 -inf 53 -1 N
+0 53 +inf 53 -inf 53 -0 N
+0 53 +inf 53 -inf 53 +0 N
+0 53 +inf 53 -inf 53 +1 N
+0 53 +inf 53 -inf 53 +inf N
+0 53 +inf 53 -inf 53 nan N
+0 53 +inf 53 -1 53 -inf N
+0 53 +inf 53 -1 53 +inf N
+0 53 nan 53 -1 53 nan N
+0 53 +inf 53 -0 53 -inf N
+0 53 +0 53 -0 53 -0 N
+0 53 +0 53 -0 53 +0 N
+0 53 +inf 53 -0 53 +inf N
+0 53 nan 53 -0 53 nan N
+0 53 +inf 53 +0 53 -inf N
+0 53 +0 53 +0 53 -0 N
+0 53 +0 53 +0 53 +0 N
+0 53 +inf 53 +0 53 +inf N
+0 53 nan 53 +0 53 nan N
+0 53 +inf 53 +1 53 -inf N
+0 53 +inf 53 +1 53 +inf N
+0 53 nan 53 +1 53 nan N
+0 53 +inf 53 +inf 53 -inf N
+0 53 +inf 53 +inf 53 -1 N
+0 53 +inf 53 +inf 53 -0 N
+0 53 +inf 53 +inf 53 +0 N
+0 53 +inf 53 +inf 53 +1 N
+0 53 +inf 53 +inf 53 +inf N
+0 53 +inf 53 +inf 53 nan N
+0 53 +inf 53 nan 53 -inf N
+0 53 nan 53 nan 53 -1 N
+0 53 nan 53 nan 53 -0 N
+0 53 nan 53 nan 53 +0 N
+0 53 nan 53 nan 53 +1 N
+0 53 +inf 53 nan 53 +inf N
+0 53 nan 53 nan 53 nan N
+
diff --git a/mpc/tests/acos.dat b/mpc/tests/acos.dat
new file mode 100644
index 0000000000..e5956abb5e
--- /dev/null
+++ b/mpc/tests/acos.dat
@@ -0,0 +1,127 @@
+# Data file for mpc_acos.
+#
+# Copyright (C) INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND_RE RND_IM
+#
+# where op = op_re + i * op_im, rop = rop_re + i * rop_im,
+# rop_re is ROP_RE rounded to nearest to the precision of PREC_ROP_RE
+# rop_im is ROP_IM rounded to nearest to the precision of PREC_ROP_IM
+# op_re is OP_RE rounded to nearest to the precision of PREC_OP_RE
+# op_im is OP_IM rounded to nearest to the precision of PREC_OP_IM
+# ROP_RE is checked against Re(acos op) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(acos op) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
+- 0 53 0x12D97C7F3321D2p-51 53 +inf 53 -inf 53 -inf N N
+- 0 53 0x1921FB54442D18p-51 53 +inf 53 -inf 53 -1 N N
+- 0 53 0x1921FB54442D18p-51 53 +inf 53 -inf 53 -0 N N
+- 0 53 0x1921FB54442D18p-51 53 -inf 53 -inf 53 +0 N N
+- 0 53 0x1921FB54442D18p-51 53 -inf 53 -inf 53 +1 N N
+- 0 53 0x12D97C7F3321D2p-51 53 -inf 53 -inf 53 +inf N N
+0 0 53 nan 53 inf 53 -inf 53 nan N N
+- 0 53 0x1921FB54442D18p-52 53 +inf 53 -6 53 -inf N N
+- 0 53 0x1921FB54442D18p-52 53 -inf 53 -6 53 +inf N N
+0 0 53 nan 53 nan 53 -6 53 nan N N
+- 0 53 0x1921FB54442D18p-52 53 +inf 53 -0.5 53 -inf N N
+- 0 53 0x1921FB54442D18p-52 53 -inf 53 -0.5 53 +inf N N
+0 0 53 nan 53 nan 53 -0.5 53 nan N N
+- 0 53 0x1921FB54442D18p-52 53 +inf 53 -0 53 -inf N N
+- 0 53 0x1921FB54442D18p-52 53 +0 53 -0 53 -0 N N
+- 0 53 0x1921FB54442D18p-52 53 -0 53 -0 53 +0 N N
+- 0 53 0x1921FB54442D18p-52 53 -inf 53 -0 53 +inf N N
+- 0 53 0x1921FB54442D18p-52 53 nan 53 -0 53 nan N N
+- 0 53 0x1921FB54442D18p-52 53 +inf 53 +0 53 -inf N N
+- 0 53 0x1921FB54442D18p-52 53 +0 53 +0 53 -0 N N
+- 0 53 0x1921FB54442D18p-52 53 -0 53 +0 53 +0 N N
+- 0 53 0x1921FB54442D18p-52 53 -inf 53 +0 53 +inf N N
+- 0 53 0x1921FB54442D18p-52 53 nan 53 +0 53 nan N N
+- 0 53 0x1921FB54442D18p-52 53 +inf 53 +0.5 53 -inf N N
+- 0 53 0x1921FB54442D18p-52 53 -inf 53 +0.5 53 +inf N N
+0 0 53 nan 53 nan 53 +0.5 53 nan N N
+- 0 53 0x1921FB54442D18p-52 53 +inf 53 +6 53 -inf N N
+- 0 53 0x1921FB54442D18p-52 53 -inf 53 +6 53 +inf N N
+0 0 53 nan 53 nan 53 +6 53 nan N N
+- 0 53 0x1921FB54442D18p-53 53 +inf 53 +inf 53 -inf N N
+0 0 53 +0 53 +inf 53 +inf 53 -1 N N
+0 0 53 +0 53 +inf 53 +inf 53 -0 N N
+0 0 53 +0 53 -inf 53 +inf 53 +0 N N
+0 0 53 +0 53 -inf 53 +inf 53 +1 N N
+- 0 53 0x1921FB54442D18p-53 53 -inf 53 +inf 53 +inf N N
+0 0 53 nan 53 inf 53 +inf 53 nan N N
+0 0 53 nan 53 +inf 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 nan 53 nan 53 -0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 nan 53 -inf 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
+- + 53 0x1921FB54442D18p-51 53 0x13D2B7539DBA4Cp-51 53 -6 53 -0 N N
+- - 53 0x1921FB54442D18p-51 53 -0x13D2B7539DBA4Cp-51 53 -6 53 +0 N N
+- + 53 0x1921FB54442D18p-51 53 0x15124271980435p-52 53 -2 53 -0 N N
+- - 53 0x1921FB54442D18p-51 53 -0x15124271980435p-52 53 -2 53 +0 N N
+- 0 53 0x1921FB54442D18p-51 53 +0 53 -1 53 -0 N N
+- 0 53 0x1921FB54442D18p-51 53 -0 53 -1 53 +0 N N
++ 0 53 0x10C152382D7366p-51 53 +0 53 -0.5 53 -0 N N
++ 0 53 0x10C152382D7366p-51 53 -0 53 -0.5 53 +0 N N
++ 0 53 0x10C152382D7366p-52 53 -0 53 +0.5 53 +0 N N
++ 0 53 0x10C152382D7366p-52 53 +0 53 +0.5 53 -0 N N
+0 0 53 +0 53 -0 53 +1 53 +0 N N
+0 0 53 +0 53 +0 53 +1 53 -0 N N
+0 - 53 +0 53 -0x15124271980435p-52 53 +2 53 +0 N N
+0 + 53 +0 53 0x15124271980435p-52 53 +2 53 -0 N N
+0 - 53 +0 53 -0x13D2B7539DBA4Cp-51 53 +6 53 +0 N N
+0 + 53 +0 53 0x13D2B7539DBA4Cp-51 53 +6 53 -0 N N
+
+# pure imaginary argument
+- + 53 0x1921FB54442D18p-52 53 0x1D185B507EDC0Ep-52 53 -0 53 -3 N N
+- + 53 0x1921FB54442D18p-52 53 0x1D185B507EDC0Ep-52 53 +0 53 -3 N N
+- + 53 0x1921FB54442D18p-52 53 0x1FACFB2399E637p-55 53 -0 53 -.25 N N
+- + 53 0x1921FB54442D18p-52 53 0x1FACFB2399E637p-55 53 +0 53 -.25 N N
+- - 53 0x1921FB54442D18p-52 53 -0x1FACFB2399E637p-55 53 -0 53 +.25 N N
+- - 53 0x1921FB54442D18p-52 53 -0x1FACFB2399E637p-55 53 +0 53 +.25 N N
+- - 53 0x1921FB54442D18p-52 53 -0x1D185B507EDC0Ep-52 53 -0 53 +3 N N
+- - 53 0x1921FB54442D18p-52 53 -0x1D185B507EDC0Ep-52 53 +0 53 +3 N N
+
+# regular argument for various precisions
+- + 2 0.5 2 -1 2 2 2 1 N Z
++ + 9 0x5Dp-6 9 0x9Fp-5 9 8.5 9 -71 N U
++ + 2 0x3p-9 2 1.5 2 2 2 -0x1p-7 U N
++ - 53 0x74C141310E695p-53 53 -0x1D6D2CFA9F3F11p-52 53 0x3243F6A8885A3p-48 53 0x162E42FEFA39EFp-53 N N
diff --git a/mpc/tests/acosh.dat b/mpc/tests/acosh.dat
new file mode 100644
index 0000000000..2a5d62b447
--- /dev/null
+++ b/mpc/tests/acosh.dat
@@ -0,0 +1,121 @@
+# Data file for mpc_acosh.
+#
+# Copyright (C) 2009 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND_RE RND_IM
+#
+# where op = op_re + i * op_im, rop = rop_re + i * rop_im,
+# rop_re is ROP_RE rounded to nearest to the precision of PREC_ROP_RE
+# rop_im is ROP_IM rounded to nearest to the precision of PREC_ROP_IM
+# op_re is OP_RE rounded to nearest to the precision of PREC_OP_RE
+# op_im is OP_IM rounded to nearest to the precision of PREC_OP_IM
+# ROP_RE is checked against Re(acos op) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(acos op) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
+0 + 53 +inf 53 -0x12D97C7F3321D2p-51 53 -inf 53 -inf N N
+0 + 53 +inf 53 -0x1921FB54442D18p-51 53 -inf 53 -1 N N
+0 + 53 +inf 53 -0x1921FB54442D18p-51 53 -inf 53 -0 N N
+0 - 53 +inf 53 0x1921FB54442D18p-51 53 -inf 53 +0 N N
+0 - 53 +inf 53 0x1921FB54442D18p-51 53 -inf 53 +1 N N
+0 - 53 +inf 53 0x12D97C7F3321D2p-51 53 -inf 53 +inf N N
+0 0 53 +inf 53 nan 53 -inf 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-52 53 -6 53 -inf N N
+0 - 53 +inf 53 0x1921FB54442D18p-52 53 -6 53 +inf N N
+0 0 53 nan 53 nan 53 -6 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-52 53 -0.5 53 -inf N N
+0 - 53 +inf 53 0x1921FB54442D18p-52 53 -0.5 53 +inf N N
+0 0 53 nan 53 nan 53 -0.5 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-52 53 -0 53 -inf N N
+0 + 53 +0 53 -0x1921FB54442D18p-52 53 -0 53 -0 N N
+0 - 53 +0 53 0x1921FB54442D18p-52 53 -0 53 +0 N N
+0 - 53 +inf 53 0x1921FB54442D18p-52 53 -0 53 +inf N N
+0 0 53 nan 53 nan 53 -0 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-52 53 +0 53 -inf N N
+0 + 53 +0 53 -0x1921FB54442D18p-52 53 +0 53 -0 N N
+0 - 53 +0 53 0x1921FB54442D18p-52 53 +0 53 +0 N N
+0 - 53 +inf 53 0x1921FB54442D18p-52 53 +0 53 +inf N N
+0 0 53 nan 53 nan 53 +0 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-52 53 +6 53 -inf N N
+0 - 53 +inf 53 0x1921FB54442D18p-52 53 +6 53 +inf N N
+0 0 53 nan 53 nan 53 +6 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-53 53 +inf 53 -inf N N
+0 0 53 +inf 53 -0 53 +inf 53 -1 N N
+0 0 53 +inf 53 -0 53 +inf 53 -0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +1 N N
+0 - 53 +inf 53 0x1921FB54442D18p-53 53 +inf 53 +inf N N
+0 0 53 +inf 53 nan 53 +inf 53 nan N N
+0 0 53 +inf 53 nan 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 nan 53 nan 53 -0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 +inf 53 nan 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
++ + 53 0x1C34366179D427p-51 53 -0x1921FB54442D18p-51 53 -17 53 -0 N N
++ - 53 0x1C34366179D427p-51 53 0x1921FB54442D18p-51 53 -17 53 +0 N N
+0 + 53 +0 53 -0x1921FB54442D18p-51 53 -1 53 -0 N N
+0 - 53 +0 53 0x1921FB54442D18p-51 53 -1 53 +0 N N
+0 - 53 +0 53 -0x10C152382D7366p-51 53 -0.5 53 -0 N N
+0 + 53 +0 53 0x10C152382D7366p-51 53 -0.5 53 +0 N N
+0 - 53 +0 53 -0x10C152382D7366p-52 53 +0.5 53 -0 N N
+0 + 53 +0 53 0x10C152382D7366p-52 53 +0.5 53 +0 N N
+0 0 53 +0 53 -0 53 +1 53 -0 N N
+0 0 53 +0 53 +0 53 +1 53 +0 N N
++ 0 53 0x1C34366179D427p-51 53 -0 53 +17 53 -0 N N
++ 0 53 0x1C34366179D427p-51 53 +0 53 +17 53 +0 N N
+
+# pure imaginary argument
+- + 53 0x1C37C174A83DEDp-51 53 -0x1921FB54442D18p-52 53 -0 53 -17 N N
+- + 53 0x1C37C174A83DEDp-51 53 -0x1921FB54442D18p-52 53 +0 53 -17 N N
++ + 53 0x1C34366179D427p-53 53 -0x1921FB54442D18p-52 53 -0 53 -1 N N
++ + 53 0x1C34366179D427p-53 53 -0x1921FB54442D18p-52 53 +0 53 -1 N N
++ + 53 0x1ECC2CAEC5160Ap-54 53 -0x1921FB54442D18p-52 53 -0 53 -0.5 N N
++ + 53 0x1ECC2CAEC5160Ap-54 53 -0x1921FB54442D18p-52 53 +0 53 -0.5 N N
++ - 53 0x1ECC2CAEC5160Ap-54 53 0x1921FB54442D18p-52 53 -0 53 +0.5 N N
++ - 53 0x1ECC2CAEC5160Ap-54 53 0x1921FB54442D18p-52 53 +0 53 +0.5 N N
++ - 53 0x1C34366179D427p-53 53 0x1921FB54442D18p-52 53 -0 53 +1 N N
++ - 53 0x1C34366179D427p-53 53 0x1921FB54442D18p-52 53 +0 53 +1 N N
+- - 53 0x1C37C174A83DEDp-51 53 0x1921FB54442D18p-52 53 -0 53 +17 N N
+- - 53 0x1C37C174A83DEDp-51 53 0x1921FB54442D18p-52 53 +0 53 +17 N N
+
+# IEEE-754 double precision
++ + 53 0x1D6D2CFA9F3F11p-52 53 0x74C141310E695p-53 53 0x3243F6A8885A3p-48 53 0x162E42FEFA39EFp-53 N N
diff --git a/mpc/tests/add.dat b/mpc/tests/add.dat
new file mode 100644
index 0000000000..73779f69e8
--- /dev/null
+++ b/mpc/tests/add.dat
@@ -0,0 +1,115 @@
+# Data file for mpc_add.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP1_RE OP1_RE PREC_OP1_IM OP1_IM PREC_OP2_RE OP2_RE PREC_OP2_IM OP2_IM RND_RE RND_IM
+#
+# where op1 = op1_re + i * op1_im, op2 = op2_re + i * op2_im, rop = rop_re + i * rop_im,
+# The data are read from the file and stored in variables op1, op2, rop using
+# rounding to nearest when needed, for instance: rop_re is ROP_RE rounded to
+# nearest to the precision of PREC_ROP_RE.
+# ROP_RE is checked against Re(op1 + op2) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(op1 + op2) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
+0 0 53 -inf 53 -inf 53 -inf 53 -inf 53 -inf 53 -inf N Z
+0 0 53 -inf 53 nan 53 -inf 53 +inf 53 +1 53 -inf Z U
+0 0 53 +inf 53 -inf 53 +inf 53 -inf 53 +inf 53 +0 U D
+0 0 53 +inf 53 +inf 53 +inf 53 +inf 53 -0 53 -1 D N
+0 0 53 -inf 53 -inf 53 -inf 53 -inf 53 -0 53 -1 N U
+0 0 53 nan 53 nan 53 -inf 53 +inf 53 +inf 53 nan Z D # check this is true in ISO C99
+0 0 53 nan 53 -inf 53 +inf 53 -inf 53 nan 53 -1 U N
+0 0 53 +inf 53 nan 53 +inf 53 +inf 53 -0 53 nan D Z
+0 0 53 nan 53 nan 53 -inf 53 -inf 53 nan 53 nan N D
+
+0 0 53 +inf 53 -inf 53 -1 53 -inf 53 +inf 53 -1 N D
+0 0 53 nan 53 +1 53 -inf 53 +1 53 +inf 53 -0 Z N
+0 0 53 +1 53 -inf 53 +1 53 -inf 53 -0 53 +1 U Z
+0 0 53 +inf 53 +1 53 +inf 53 +1 53 -0 53 -0 D U
+0 0 53 +inf 53 nan 53 -1 53 -inf 53 +inf 53 nan N N
+0 0 53 nan 53 +2 53 -inf 53 +1 53 nan 53 +1 Z Z
+0 0 53 +1 53 nan 53 +1 53 -inf 53 -0 53 nan U U # check this
+0 0 53 nan 53 nan 53 +inf 53 +1 53 nan 53 nan D D
+
+0 0 53 -0 53 nan 53 -0 53 -inf 53 +0 53 +inf D D
+0 0 53 -inf 53 +0 53 -inf 53 +0 53 +1 53 -0 N Z
+0 0 53 +0 53 -inf 53 +0 53 -inf 53 -0 53 -0 Z U
+0 0 53 nan 53 nan 53 +inf 53 +0 53 -inf 53 nan U D # check
+0 0 53 nan 53 -inf 53 -0 53 -inf 53 nan 53 -1 D N
+0 0 53 -inf 53 nan 53 -inf 53 +0 53 +0 53 nan N U
+0 0 53 nan 53 nan 53 +0 53 -inf 53 nan 53 nan Z D
+
+0 0 53 +0 53 -0 53 +0 53 +1 53 -0 53 -1 Z D
+0 0 53 -1 53 -0 53 -1 53 -0 53 +0 53 -0 U N
+0 0 53 nan 53 +inf 53 -0 53 +1 53 nan 53 +inf D Z
+0 0 53 +0 53 nan 53 +1 53 -0 53 -1 53 nan N D
+0 0 53 nan 53 +1 53 +0 53 +1 53 nan 53 -0 Z N
+0 0 53 nan 53 nan 53 -1 53 -0 53 nan 53 nan U Z
+
+0 0 53 +0 53 +0 53 -0 53 +0 53 +0 53 -0 U Z
+0 0 53 nan 53 -inf 53 +0 53 -0 53 nan 53 -inf D U
+0 0 53 -1 53 nan 53 +0 53 +0 53 -1 53 nan N N
+0 0 53 nan 53 -0 53 -0 53 -0 53 nan 53 -0 Z Z
+0 0 53 nan 53 nan 53 -0 53 +0 53 nan 53 nan U U
+
+0 0 53 nan 53 nan 53 nan 53 -inf 53 nan 53 +inf U U # check
+0 0 53 +inf 53 nan 53 +inf 53 nan 53 -1 53 nan D D
+0 0 53 nan 53 -inf 53 nan 53 -inf 53 nan 53 -0 N Z
+0 0 53 nan 53 nan 53 -inf 53 nan 53 nan 53 nan Z U # check
+
+0 0 53 nan 53 nan 53 +1 53 nan 53 nan 53 -1 Z U
+0 0 53 nan 53 nan 53 nan 53 +1 53 -0 53 nan U D
+0 0 53 nan 53 nan 53 -1 53 nan 53 nan 53 nan D N
+
+0 0 53 nan 53 nan 53 nan 53 +0 53 +0 53 nan D N
+0 0 53 nan 53 nan 53 +0 53 nan 53 nan 53 nan N U
+
+0 0 53 nan 53 nan 53 nan 53 nan 53 nan 53 nan N U
+
+# pure real argument
++ 0 53 0x10000000000001p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-105 53 -0 N N
+- 0 53 0x10000000000000p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-105 53 -0 Z Z
++ 0 53 0x10000000000001p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-105 53 -0 U U
+- 0 53 0x10000000000000p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-105 53 -0 D D
+
+# pure imaginary argument
+0 + 53 -0 53 0x10000000000001p-52 53 -0 53 0x10000000000001p-105 53 -0 53 +1 N N
+0 - 53 +0 53 0x10000000000000p-52 53 +0 53 0x10000000000001p-105 53 -0 53 +1 Z Z
+0 + 53 +0 53 0x10000000000001p-52 53 +0 53 0x10000000000001p-105 53 -0 53 +1 U U
+0 - 53 -0 53 0x10000000000000p-52 53 -0 53 0x10000000000001p-105 53 -0 53 +1 D D
+
diff --git a/mpc/tests/add_fr.dat b/mpc/tests/add_fr.dat
new file mode 100644
index 0000000000..a07110c07c
--- /dev/null
+++ b/mpc/tests/add_fr.dat
@@ -0,0 +1,122 @@
+# Data file for mpc_add_fr.
+#
+# Copyright (C) 2008, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP1_RE OP1_RE PREC_OP1_IM OP1_IM PREC_OP2 OP2 RND_RE RND_IM
+#
+# where op1 = op1_re + i * op1_im, rop = rop_re + i * rop_im,
+# The data are read from the file and stored in variables op1, op2, rop using
+# rounding to nearest when needed, for instance: rop_re is ROP_RE rounded to
+# nearest to the precision of PREC_ROP_RE.
+# ROP_RE is checked against Re(op1 + op2) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(op1) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
+0 0 53 -inf 53 -inf 53 -inf 53 -inf 53 -inf N Z
+0 0 53 -inf 53 +inf 53 -inf 53 +inf 53 -1 Z U
+0 0 53 -inf 53 -0 53 -inf 53 -0 53 -0 U D
+0 0 53 -inf 53 +0 53 -inf 53 +0 53 +0 D N
+0 0 53 -inf 53 -1 53 -inf 53 -1 53 +1 N U
+0 0 53 nan 53 +1 53 -inf 53 +1 53 +inf Z D
+0 0 53 nan 53 nan 53 -inf 53 nan 53 nan U N
+
+0 0 53 -inf 53 +inf 53 -1 53 +inf 53 -inf N Z
+0 0 53 -2 53 -0 53 -1 53 -0 53 -1 Z U
+0 0 53 -1 53 +0 53 -1 53 +0 53 -0 U D
+0 0 53 -1 53 -1 53 -1 53 -1 53 +0 D N
+0 0 53 +0 53 +1 53 -1 53 +1 53 +1 N U
+0 0 53 +inf 53 nan 53 -1 53 nan 53 +inf Z D
+0 0 53 nan 53 -inf 53 -1 53 -inf 53 nan U N
+
+0 0 53 -inf 53 -0 53 -0 53 -0 53 -inf N Z
+0 0 53 -1 53 +0 53 -0 53 +0 53 -1 Z U
+0 0 53 -0 53 -1 53 -0 53 -1 53 -0 U D
+0 0 53 -0 53 +1 53 -0 53 +1 53 +0 D N
+0 0 53 +1 53 nan 53 -0 53 nan 53 +1 N U
+0 0 53 +inf 53 -inf 53 -0 53 -inf 53 +inf Z D
+0 0 53 nan 53 +inf 53 -0 53 +inf 53 nan U N
+
+0 0 53 -inf 53 +0 53 +0 53 +0 53 -inf N Z
+0 0 53 -1 53 -1 53 +0 53 -1 53 -1 Z U
+0 0 53 +0 53 +1 53 +0 53 +1 53 -0 U D
+0 0 53 +0 53 nan 53 +0 53 nan 53 +0 D N
+0 0 53 +1 53 -inf 53 +0 53 -inf 53 +1 N U
+0 0 53 +inf 53 +inf 53 +0 53 +inf 53 +inf Z D
+0 0 53 nan 53 -0 53 +0 53 -0 53 nan U N
+
+0 0 53 -inf 53 -1 53 +1 53 -1 53 -inf N Z
+0 0 53 +0 53 +1 53 +1 53 +1 53 -1 Z U
+0 0 53 +1 53 nan 53 +1 53 nan 53 -0 U D
+0 0 53 +1 53 -inf 53 +1 53 -inf 53 +0 D N
+0 0 53 +2 53 +inf 53 +1 53 +inf 53 +1 N U
+0 0 53 +inf 53 -0 53 +1 53 -0 53 +inf Z D
+0 0 53 nan 53 +0 53 +1 53 +0 53 nan U N
+
+0 0 53 nan 53 +1 53 +inf 53 +1 53 -inf N Z
+0 0 53 +inf 53 nan 53 +inf 53 nan 53 -1 Z U
+0 0 53 +inf 53 -inf 53 +inf 53 -inf 53 -0 U D
+0 0 53 +inf 53 +inf 53 +inf 53 +inf 53 +0 D N
+0 0 53 +inf 53 -0 53 +inf 53 -0 53 +1 N U
+0 0 53 +inf 53 +0 53 +inf 53 +0 53 +inf Z D
+0 0 53 nan 53 -1 53 +inf 53 -1 53 nan U N
+
+0 0 53 nan 53 nan 53 nan 53 nan 53 -inf N Z
+0 0 53 nan 53 -inf 53 nan 53 -inf 53 -1 Z U
+0 0 53 nan 53 +inf 53 nan 53 +inf 53 -0 U D
+0 0 53 nan 53 -0 53 nan 53 -0 53 +0 D N
+0 0 53 nan 53 +0 53 nan 53 +0 53 +1 N U
+0 0 53 nan 53 -1 53 nan 53 -1 53 +inf Z D
+0 0 53 nan 53 +1 53 nan 53 +1 53 nan U N
+
+# pure real argument
+- 0 53 0x10000000000000p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-106 N N
++ 0 53 0x10000000000001p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-105 N N
+- 0 53 0x10000000000001p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-104 N N
+- 0 53 0x10000000000000p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-105 Z Z
++ 0 53 0x10000000000001p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-105 U U
+- 0 53 0x10000000000000p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-105 D D
+
+# pure imaginary argument
+0 0 53 +1 53 +1 53 -0 53 1 53 +1 N N
+0 0 53 +1 53 +1 53 +0 53 1 53 +1 Z Z
+0 0 53 +1 53 +1 53 +0 53 1 53 +1 U U
+0 0 53 +1 53 +1 53 -0 53 1 53 +1 D D
+
+# non-zero return values for imaginary part
+0 + 2 0 2 8 3 0 3 7 3 0 N N
+0 - 2 0 2 4 3 0 3 5 3 0 N N
diff --git a/mpc/tests/arg.dat b/mpc/tests/arg.dat
new file mode 100644
index 0000000000..55e151ddc5
--- /dev/null
+++ b/mpc/tests/arg.dat
@@ -0,0 +1,74 @@
+# Data file for mpc_arg.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX PREC_ROP ROP PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND
+#
+# where op = op_re + i * op_im.
+# See abs.dat for other details.
+
+# special values (following ISO C99 standard)
++ 53 -0x96CBE3F9990E9p-50 53 -inf 53 -inf N
++ 53 -0x3243F6A8885A3p-48 53 -inf 53 -1 N
++ 53 -0x3243F6A8885A3p-48 53 -inf 53 -0 N
+- 53 +0x3243F6A8885A3p-48 53 -inf 53 +0 N
+- 53 +0x3243F6A8885A3p-48 53 -inf 53 +1 N
+- 53 +0x96CBE3F9990E9p-50 53 -inf 53 +inf N
+0 53 nan 53 -inf 53 nan N
++ 53 -0x3243F6A8885A3p-49 53 -1 53 -inf N
++ 53 -0x3243F6A8885A3p-48 53 -1 53 -0 N
+- 53 +0x3243F6A8885A3p-48 53 -1 53 +0 N
+- 53 +0x3243F6A8885A3p-49 53 -1 53 +inf N
+0 53 nan 53 -1 53 nan N
++ 53 -0x3243F6A8885A3p-49 53 -0 53 -inf N
++ 53 -0x3243F6A8885A3p-49 53 -0 53 -1 N
++ 53 -0x3243F6A8885A3p-48 53 -0 53 -0 N
+- 53 +0x3243F6A8885A3p-48 53 -0 53 +0 N
+- 53 +0x3243F6A8885A3p-49 53 -0 53 +1 N
+- 53 +0x3243F6A8885A3p-49 53 -0 53 +inf N
+0 53 nan 53 -0 53 nan N
++ 53 -0x3243F6A8885A3p-49 53 +0 53 -inf N
++ 53 -0x3243F6A8885A3p-49 53 +0 53 -1 N
+0 53 -0 53 +0 53 -0 N
+0 53 +0 53 +0 53 +0 N
+- 53 +0x3243F6A8885A3p-49 53 +0 53 +1 N
+- 53 +0x3243F6A8885A3p-49 53 +0 53 +inf N
+0 53 nan 53 +0 53 nan N
++ 53 -0x3243F6A8885A3p-49 53 +1 53 -inf N
+0 53 -0 53 +1 53 -0 N
+0 53 +0 53 +1 53 +0 N
+- 53 +0x3243F6A8885A3p-49 53 +1 53 +inf N
+0 53 nan 53 +1 53 nan N
++ 53 -0x3243F6A8885A3p-50 53 +inf 53 -inf N
+0 53 -0 53 +inf 53 -1 N
+0 53 -0 53 +inf 53 -0 N
+0 53 +0 53 +inf 53 +0 N
+0 53 +0 53 +inf 53 +1 N
+- 53 +0x3243F6A8885A3p-50 53 +inf 53 +inf N
+0 53 nan 53 +inf 53 nan N
+0 53 nan 53 nan 53 -inf N
+0 53 nan 53 nan 53 -1 N
+0 53 nan 53 nan 53 -0 N
+0 53 nan 53 nan 53 +0 N
+0 53 nan 53 nan 53 +1 N
+0 53 nan 53 nan 53 +inf N
+0 53 nan 53 nan 53 nan N
+
diff --git a/mpc/tests/asin.dat b/mpc/tests/asin.dat
new file mode 100644
index 0000000000..9793fcc1c1
--- /dev/null
+++ b/mpc/tests/asin.dat
@@ -0,0 +1,126 @@
+# Data file for mpc_asin.
+#
+# Copyright (C) 2009 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND_RE RND_IM
+#
+# where op = op_re + i * op_im, rop = rop_re + i * rop_im,
+# rop_re is ROP_RE rounded to nearest to the precision of PREC_ROP_RE
+# rop_im is ROP_IM rounded to nearest to the precision of PREC_ROP_IM
+# op_re is OP_RE rounded to nearest to the precision of PREC_OP_RE
+# op_im is OP_IM rounded to nearest to the precision of PREC_OP_IM
+# ROP_RE is checked against Re(asin op) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(asin op) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
++ 0 53 -0x1921FB54442D18p-53 53 -inf 53 -inf 53 -inf N N
++ 0 53 -0x1921FB54442D18p-52 53 -inf 53 -inf 53 -1 N N
++ 0 53 -0x1921FB54442D18p-52 53 -inf 53 -inf 53 -0 N N
++ 0 53 -0x1921FB54442D18p-52 53 +inf 53 -inf 53 +0 N N
++ 0 53 -0x1921FB54442D18p-52 53 +inf 53 -inf 53 +1 N N
++ 0 53 -0x1921FB54442D18p-53 53 +inf 53 -inf 53 +inf N N
+0 0 53 nan 53 inf 53 -inf 53 nan N N
+0 0 53 -0 53 -inf 53 -6 53 -inf N N
+0 0 53 -0 53 +inf 53 -6 53 +inf N N
+0 0 53 nan 53 nan 53 -6 53 nan N N
+0 0 53 -0 53 -inf 53 -0.5 53 -inf N N
+0 0 53 -0 53 +inf 53 -0.5 53 +inf N N
+0 0 53 nan 53 nan 53 -0.5 53 nan N N
+0 0 53 -0 53 -inf 53 -0 53 -inf N N
+0 0 53 -0 53 -0 53 -0 53 -0 N N
+0 0 53 -0 53 +0 53 -0 53 +0 N N
+0 0 53 -0 53 +inf 53 -0 53 +inf N N
+0 0 53 -0 53 nan 53 -0 53 nan N N
+0 0 53 +0 53 -inf 53 +0 53 -inf N N
+0 0 53 +0 53 -0 53 +0 53 -0 N N
+0 0 53 +0 53 +0 53 +0 53 +0 N N
+0 0 53 +0 53 +inf 53 +0 53 +inf N N
+0 0 53 +0 53 nan 53 +0 53 nan N N
+0 0 53 +0 53 -inf 53 +0.5 53 -inf N N
+0 0 53 +0 53 +inf 53 +0.5 53 +inf N N
+0 0 53 nan 53 nan 53 +0.5 53 nan N N
+0 0 53 +0 53 -inf 53 +6 53 -inf N N
+0 0 53 +0 53 +inf 53 +6 53 +inf N N
+0 0 53 nan 53 nan 53 +6 53 nan N N
+- 0 53 0x1921FB54442D18p-53 53 -inf 53 +inf 53 -inf N N
+- 0 53 0x1921FB54442D18p-52 53 -inf 53 +inf 53 -1 N N
+- 0 53 0x1921FB54442D18p-52 53 -inf 53 +inf 53 -0 N N
+- 0 53 0x1921FB54442D18p-52 53 +inf 53 +inf 53 +0 N N
+- 0 53 0x1921FB54442D18p-52 53 +inf 53 +inf 53 +1 N N
+- 0 53 0x1921FB54442D18p-53 53 +inf 53 +inf 53 +inf N N
+0 0 53 nan 53 inf 53 +inf 53 nan N N
+0 0 53 nan 53 -inf 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 nan 53 nan 53 -0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 nan 53 +inf 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
++ - 53 -0x1921FB54442D18p-52 53 -0x1ECC2CAEC5160Ap-53 53 -1.5 53 -0 N N
++ + 53 -0x1921FB54442D18p-52 53 0x1ECC2CAEC5160Ap-53 53 -1.5 53 +0 N N
++ 0 53 -0x1921FB54442D18p-52 53 -0 53 -1 53 -0 N N
++ 0 53 -0x1921FB54442D18p-52 53 +0 53 -1 53 +0 N N
+- 0 53 -0x10C152382D7366p-53 53 -0 53 -0.5 53 -0 N N
+- 0 53 -0x10C152382D7366p-53 53 +0 53 -0.5 53 +0 N N
++ 0 53 0x10C152382D7366p-53 53 -0 53 +0.5 53 -0 N N
++ 0 53 0x10C152382D7366p-53 53 +0 53 +0.5 53 +0 N N
+- 0 53 0x1921FB54442D18p-52 53 -0 53 +1 53 -0 N N
+- 0 53 0x1921FB54442D18p-52 53 +0 53 +1 53 +0 N N
+- - 53 0x1921FB54442D18p-52 53 -0x1ECC2CAEC5160Ap-53 53 +1.5 53 -0 N N
+- + 53 0x1921FB54442D18p-52 53 0x1ECC2CAEC5160Ap-53 53 +1.5 53 +0 N N
+
+# pure imaginary argument
+0 + 53 -0 53 -0x131DC0090B63D8p-52 53 -0 53 -1.5 N N
+0 + 53 +0 53 -0x131DC0090B63D8p-52 53 +0 53 -1.5 N N
+0 - 53 -0 53 -0x1C34366179D427p-53 53 -0 53 -1 N N
+0 - 53 +0 53 -0x1C34366179D427p-53 53 +0 53 -1 N N
+0 - 53 -0 53 -0x1ECC2CAEC5160Ap-54 53 -0 53 -0.5 N N
+0 - 53 +0 53 -0x1ECC2CAEC5160Ap-54 53 +0 53 -0.5 N N
+0 + 53 -0 53 0x1ECC2CAEC5160Ap-54 53 -0 53 +0.5 N N
+0 + 53 +0 53 0x1ECC2CAEC5160Ap-54 53 +0 53 +0.5 N N
+0 + 53 -0 53 0x1C34366179D427p-53 53 -0 53 +1 N N
+0 + 53 +0 53 0x1C34366179D427p-53 53 +0 53 +1 N N
+0 - 53 -0 53 0x131DC0090B63D8p-52 53 -0 53 +1.5 N N
+0 - 53 +0 53 0x131DC0090B63D8p-52 53 +0 53 +1.5 N N
+
+# IEEE-754 double precision and other precisions
++ - 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
diff --git a/mpc/tests/asinh.dat b/mpc/tests/asinh.dat
new file mode 100644
index 0000000000..e9daf992eb
--- /dev/null
+++ b/mpc/tests/asinh.dat
@@ -0,0 +1,120 @@
+# Data file for mpc_asinh.
+#
+# Copyright (C) 2009 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND_RE RND_IM
+#
+# where op = op_re + i * op_im, rop = rop_re + i * rop_im,
+# rop_re is ROP_RE rounded to nearest to the precision of PREC_ROP_RE
+# rop_im is ROP_IM rounded to nearest to the precision of PREC_ROP_IM
+# op_re is OP_RE rounded to nearest to the precision of PREC_OP_RE
+# op_im is OP_IM rounded to nearest to the precision of PREC_OP_IM
+# ROP_RE is checked against Re(asin op) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(asin op) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
+0 + 53 -inf 53 -0x1921FB54442D18p-53 53 -inf 53 -inf N N
+0 0 53 -inf 53 -0 53 -inf 53 -1 N N
+0 0 53 -inf 53 -0 53 -inf 53 -0 N N
+0 0 53 -inf 53 +0 53 -inf 53 +0 N N
+0 0 53 -inf 53 +0 53 -inf 53 +1 N N
+0 - 53 -inf 53 0x1921FB54442D18p-53 53 -inf 53 +inf N N
+0 0 53 -inf 53 nan 53 -inf 53 nan N N
+0 + 53 -inf 53 -0x1921FB54442D18p-52 53 -6 53 -inf N N
+0 - 53 -inf 53 0x1921FB54442D18p-52 53 -6 53 +inf N N
+0 0 53 nan 53 nan 53 -6 53 nan N N
+0 + 53 -inf 53 -0x1921FB54442D18p-52 53 -0 53 -inf N N
+0 0 53 -0 53 -0 53 -0 53 -0 N N
+0 0 53 -0 53 +0 53 -0 53 +0 N N
+0 - 53 -inf 53 0x1921FB54442D18p-52 53 -0 53 +inf N N
+0 0 53 nan 53 nan 53 -0 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-52 53 +0 53 -inf N N
+0 0 53 +0 53 -0 53 +0 53 -0 N N
+0 0 53 +0 53 +0 53 +0 53 +0 N N
+0 - 53 +inf 53 0x1921FB54442D18p-52 53 +0 53 +inf N N
+0 0 53 nan 53 nan 53 +0 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-52 53 +6 53 -inf N N
+0 - 53 +inf 53 0x1921FB54442D18p-52 53 +6 53 +inf N N
+0 0 53 nan 53 nan 53 +6 53 nan N N
+0 + 53 +inf 53 -0x1921FB54442D18p-53 53 +inf 53 -inf N N
+0 0 53 +inf 53 -0 53 +inf 53 -1 N N
+0 0 53 +inf 53 -0 53 +inf 53 -0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +1 N N
+0 - 53 +inf 53 0x1921FB54442D18p-53 53 +inf 53 +inf N N
+0 0 53 +inf 53 nan 53 +inf 53 nan N N
+0 0 53 inf 53 nan 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 -0 53 nan 53 -0 N N
+0 0 53 nan 53 +0 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 inf 53 nan 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
++ 0 53 -0x131DC0090B63D8p-52 53 -0 53 -1.5 53 -0 N N
++ 0 53 -0x131DC0090B63D8p-52 53 +0 53 -1.5 53 +0 N N
+- 0 53 -0x1C34366179D427p-53 53 -0 53 -1 53 -0 N N
+- 0 53 -0x1C34366179D427p-53 53 +0 53 -1 53 +0 N N
+- 0 53 -0x1ECC2CAEC5160Ap-54 53 -0 53 -0.5 53 -0 N N
+- 0 53 -0x1ECC2CAEC5160Ap-54 53 +0 53 -0.5 53 +0 N N
++ 0 53 0x1ECC2CAEC5160Ap-54 53 -0 53 +0.5 53 -0 N N
++ 0 53 0x1ECC2CAEC5160Ap-54 53 +0 53 +0.5 53 +0 N N
++ 0 53 0x1C34366179D427p-53 53 -0 53 +1 53 -0 N N
++ 0 53 0x1C34366179D427p-53 53 +0 53 +1 53 +0 N N
+- 0 53 0x131DC0090B63D8p-52 53 -0 53 +1.5 53 -0 N N
+- 0 53 0x131DC0090B63D8p-52 53 +0 53 +1.5 53 +0 N N
+
+# pure imaginary argument
+- + 53 -0x1ECC2CAEC5160Ap-53 53 -0x1921FB54442D18p-52 53 -0 53 -1.5 N N
++ + 53 0x1ECC2CAEC5160Ap-53 53 -0x1921FB54442D18p-52 53 +0 53 -1.5 N N
+0 + 53 -0 53 -0x1921FB54442D18p-52 53 -0 53 -1 N N
+0 + 53 +0 53 -0x1921FB54442D18p-52 53 +0 53 -1 N N
+0 - 53 -0 53 -0x10C152382D7366p-53 53 -0 53 -0.5 N N
+0 - 53 +0 53 -0x10C152382D7366p-53 53 +0 53 -0.5 N N
+0 + 53 -0 53 0x10C152382D7366p-53 53 -0 53 +0.5 N N
+0 + 53 +0 53 0x10C152382D7366p-53 53 +0 53 +0.5 N N
+0 - 53 -0 53 0x1921FB54442D18p-52 53 -0 53 +1 N N
+0 - 53 +0 53 0x1921FB54442D18p-52 53 +0 53 +1 N N
+- - 53 -0x1ECC2CAEC5160Ap-53 53 0x1921FB54442D18p-52 53 -0 53 +1.5 N N
++ - 53 0x1ECC2CAEC5160Ap-53 53 0x1921FB54442D18p-52 53 +0 53 +1.5 N N
+
+# regular arguments
++ + 53 0x1E20C7792ECE6Bp-52 53 0x3526776219EEBp-52 53 0x3243F6A8885A3p-48 53 0x162E42FEFA39EFp-53 N N
+
+
diff --git a/mpc/tests/atan.dat b/mpc/tests/atan.dat
new file mode 100644
index 0000000000..871f7068a0
--- /dev/null
+++ b/mpc/tests/atan.dat
@@ -0,0 +1,148 @@
+# Data file for mpc_atan.
+#
+# Copyright (C) 2009, 2012, 2013 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND_RE RND_IM
+#
+# where op = op_re + i * op_im, rop = rop_re + i * rop_im,
+# rop_re is ROP_RE rounded to nearest to the precision of PREC_ROP_RE
+# rop_im is ROP_IM rounded to nearest to the precision of PREC_ROP_IM
+# op_re is OP_RE rounded to nearest to the precision of PREC_OP_RE
+# op_im is OP_IM rounded to nearest to the precision of PREC_OP_IM
+# ROP_RE is checked against Re(atan op) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(atan op) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
++ 0 53 -0x1921FB54442D18p-52 53 -0 53 -inf 53 -inf N N
++ 0 53 -0x1921FB54442D18p-52 53 -0 53 -inf 53 -1 N N
++ 0 53 -0x1921FB54442D18p-52 53 -0 53 -inf 53 -0 N N
++ 0 53 -0x1921FB54442D18p-52 53 +0 53 -inf 53 +0 N N
++ 0 53 -0x1921FB54442D18p-52 53 +0 53 -inf 53 +1 N N
++ 0 53 -0x1921FB54442D18p-52 53 +0 53 -inf 53 +inf N N
++ 0 53 -0x1921FB54442D18p-52 53 0 53 -inf 53 nan N N
++ 0 53 -0x1921FB54442D18p-52 53 -0 53 -6 53 -inf N N
++ 0 53 -0x1921FB54442D18p-52 53 +0 53 -6 53 +inf N N
+0 0 53 nan 53 nan 53 -6 53 nan N N
++ 0 53 -0x1921FB54442D18p-52 53 -0 53 -0 53 -inf N N
+0 0 53 -0 53 -0 53 -0 53 -0 N N
+0 0 53 -0 53 +0 53 -0 53 +0 N N
++ 0 53 -0x1921FB54442D18p-52 53 +0 53 -0 53 +inf N N
+0 0 53 nan 53 nan 53 -0 53 nan N N
+- 0 53 +0x1921FB54442D18p-52 53 -0 53 +0 53 -inf N N
+0 0 53 +0 53 -0 53 +0 53 -0 N N
+0 0 53 +0 53 +0 53 +0 53 +0 N N
+- 0 53 +0x1921FB54442D18p-52 53 +0 53 +0 53 +inf N N
+0 0 53 nan 53 nan 53 +0 53 nan N N
+- 0 53 +0x1921FB54442D18p-52 53 -0 53 +6 53 -inf N N
+- 0 53 +0x1921FB54442D18p-52 53 +0 53 +6 53 +inf N N
+0 0 53 nan 53 nan 53 +6 53 nan N N
+- 0 53 +0x1921FB54442D18p-52 53 -0 53 +inf 53 -inf N N
+- 0 53 +0x1921FB54442D18p-52 53 -0 53 +inf 53 -1 N N
+- 0 53 +0x1921FB54442D18p-52 53 -0 53 +inf 53 -0 N N
+- 0 53 +0x1921FB54442D18p-52 53 +0 53 +inf 53 +0 N N
+- 0 53 +0x1921FB54442D18p-52 53 +0 53 +inf 53 +1 N N
+- 0 53 +0x1921FB54442D18p-52 53 +0 53 +inf 53 +inf N N
+- 0 53 +0x1921FB54442D18p-52 53 0 53 +inf 53 nan N N
+0 0 53 nan 53 -0 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 -0 53 nan 53 -0 N N
+0 0 53 nan 53 +0 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 nan 53 +0 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
+- 0 53 -0x16DCC57BB565FDp-52 53 -0 53 -7 53 -0 N N
+- 0 53 -0x16DCC57BB565FDp-52 53 +0 53 -7 53 +0 N N
++ 0 53 -0x1F730BD281F69Bp-53 53 -0 53 -1.5 53 -0 N N
++ 0 53 -0x1F730BD281F69Bp-53 53 +0 53 -1.5 53 +0 N N
++ 0 53 -0x1921FB54442D18p-53 53 -0 53 -1 53 -0 N N
++ 0 53 -0x1921FB54442D18p-53 53 +0 53 -1 53 +0 N N
+- 0 53 -0x1700A7C5784634p-53 53 -0 53 -0.875 53 -0 N N
+- 0 53 -0x1700A7C5784634p-53 53 +0 53 -0.875 53 +0 N N
+- 0 53 -0x1FD5BA9AAC2F6Ep-56 53 -0 53 -0.125 53 -0 N N
+- 0 53 -0x1FD5BA9AAC2F6Ep-56 53 +0 53 -0.125 53 +0 N N
++ 0 53 +0x1FD5BA9AAC2F6Ep-56 53 +0 53 +0.125 53 +0 N N
++ 0 53 +0x1FD5BA9AAC2F6Ep-56 53 -0 53 +0.125 53 -0 N N
++ 0 53 +0x1700A7C5784634p-53 53 +0 53 +0.875 53 +0 N N
++ 0 53 +0x1700A7C5784634p-53 53 -0 53 +0.875 53 -0 N N
+- 0 53 +0x1921FB54442D18p-53 53 +0 53 +1 53 +0 N N
+- 0 53 +0x1921FB54442D18p-53 53 -0 53 +1 53 -0 N N
+- 0 53 +0x1F730BD281F69Bp-53 53 +0 53 +1.5 53 +0 N N
+- 0 53 +0x1F730BD281F69Bp-53 53 -0 53 +1.5 53 -0 N N
++ 0 53 +0x16DCC57BB565FDp-52 53 +0 53 +7 53 +0 N N
++ 0 53 +0x16DCC57BB565FDp-52 53 -0 53 +7 53 -0 N N
+
+# pure imaginary argument
++ + 53 -0x1921FB54442D18p-52 53 -0x1269621134DB92p-55 53 -0 53 -7 N N
+- + 53 +0x1921FB54442D18p-52 53 -0x1269621134DB92p-55 53 +0 53 -7 N N
++ + 53 -0x1921FB54442D18p-52 53 -0x19C041F7ED8D33p-53 53 -0 53 -1.5 N N
+- + 53 +0x1921FB54442D18p-52 53 -0x19C041F7ED8D33p-53 53 +0 53 -1.5 N N
+0 0 53 -0 53 -inf 53 -0 53 -1 N N
+0 0 53 +0 53 -inf 53 +0 53 -1 N N
+0 + 53 -0 53 -0x15AA16394D481Fp-52 53 -0 53 -0.875 N N
+0 + 53 +0 53 -0x15AA16394D481Fp-52 53 +0 53 -0.875 N N
+0 + 53 -0 53 -0x1015891C9EAEF7p-55 53 -0 53 -0.125 N N
+0 + 53 +0 53 -0x1015891C9EAEF7p-55 53 +0 53 -0.125 N N
+0 - 53 +0 53 +0x1015891C9EAEF7p-55 53 +0 53 +0.125 N N
+0 - 53 -0 53 +0x1015891C9EAEF7p-55 53 -0 53 +0.125 N N
+0 - 53 +0 53 +0x15AA16394D481Fp-52 53 +0 53 +0.875 N N
+0 - 53 -0 53 +0x15AA16394D481Fp-52 53 -0 53 +0.875 N N
+0 0 53 +0 53 +inf 53 +0 53 +1 N N
+0 0 53 -0 53 +inf 53 -0 53 +1 N N
+- - 53 +0x1921FB54442D18p-52 53 +0x19C041F7ED8D33p-53 53 +0 53 +1.5 N N
++ - 53 -0x1921FB54442D18p-52 53 +0x19C041F7ED8D33p-53 53 -0 53 +1.5 N N
+- - 53 +0x1921FB54442D18p-52 53 +0x1269621134DB92p-55 53 +0 53 +7 N N
++ - 53 -0x1921FB54442D18p-52 53 +0x1269621134DB92p-55 53 -0 53 +7 N N
+0 + 53 +0 53 0x1FFFFFFFFFFF82p-52 53 +0 53 0x1ED9505E1BC3C2p-53 N N
++ - 512 0x6487ED5110B4611A62633145C06E0E68948127044533E63A0105DF531D89CD9128A5043CC71A026EF7CA8CD9E69D218D98158536F92F8A1BA7F09AB6B6A8E123p-510 512 0x5D137113B914461DA3202D77346EE4980DA5FD0BAD68F5A7928DCA9F632750D9BFFA00654C523929F15DED554EC6BC476DB2C46FA433E569227085E0BDEA86FFp-509 512 0 512 0x1018734E311AB77B710F9212969B3C86E8F388BB7DA5BAF74ADE078F43D96456D088C8A0B2A370159DFB8D4A4BC51BCDA91F2DCD01B2EC610C62AA33FAD1688p-504 N Z
++ - 12 0xC91p-11 12 0x6F1p-50 12 +0 12 0x9380000000 N N
+
+# general inputs
++ - 72 0x91EA521228BFC46ACAp-118 72 -0x9E96A01DBAD6470974p-73 72 0x84C3E02A5C6DEE8410p-118 72 -0x99B43C52A95A21C220p-73 U N
+- - 72 0x91EA521228BFC46AC9p-118 72 -0x9E96A01DBAD6470974p-73 72 0x84C3E02A5C6DEE8410p-118 72 -0x99B43C52A95A21C220p-73 D D
+- + 72 0x91EA521228BFC46AC9p-118 72 -0x9E96A01DBAD6470973p-73 72 0x84C3E02A5C6DEE8410p-118 72 -0x99B43C52A95A21C220p-73 D U
++ + 72 0x91EA521228BFC46ACAp-118 72 0x9E96A01DBAD6470974p-73 72 0x84C3E02A5C6DEE8410p-118 72 0x99B43C52A95A21C220p-73 U N
+- + 72 0x91EA521228BFC46AC9p-118 72 0x9E96A01DBAD6470974p-73 72 0x84C3E02A5C6DEE8410p-118 72 0x99B43C52A95A21C220p-73 D U
+- - 72 0x91EA521228BFC46AC9p-118 72 0x9E96A01DBAD6470973p-73 72 0x84C3E02A5C6DEE8410p-118 72 0x99B43C52A95A21C220p-73 D D
++ - 156 -0xC90FDAA22167B20DB08A0C3B1FF415CABE49624p-155 156 0xEA84E971BD52E49CCEE036E303D5ECB2D9D9B9Ap-222 156 -0xF0CE58073F866A53F25DB85DE8D503FBDD81051p-109 156 0xCF81D7C76BB9754A52056CB0F144B0C6700CC8Cp-128 N N
+- - 2 0.75 2 -3 2 0x1p-7 2 -1 N N
+- + 2 0.75 2 3 2 0x1p-7 2 1 N N
+
+# improve test coverage
++ - 57 -0x1.921fb54442d184 57 -0x8.a7e33db93ecf18@-34 57 -0xa.529626a89a1960@23 57 -0x3.9a5472b5709e74@14 N N
diff --git a/mpc/tests/atanh.dat b/mpc/tests/atanh.dat
new file mode 100644
index 0000000000..c6517a8829
--- /dev/null
+++ b/mpc/tests/atanh.dat
@@ -0,0 +1,112 @@
+# Data file for mpc_atanh.
+#
+# Copyright (C) 2009, 2013 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND_RE RND_IM
+#
+# where op = op_re + i * op_im, rop = rop_re + i * rop_im,
+# rop_re is ROP_RE rounded to nearest to the precision of PREC_ROP_RE
+# rop_im is ROP_IM rounded to nearest to the precision of PREC_ROP_IM
+# op_re is OP_RE rounded to nearest to the precision of PREC_OP_RE
+# op_im is OP_IM rounded to nearest to the precision of PREC_OP_IM
+# ROP_RE is checked against Re(atan op) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(atan op) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
+0 + 53 -0 53 -0x1921FB54442D18p-52 53 -inf 53 -inf N N
+0 + 53 -0 53 -0x1921FB54442D18p-52 53 -inf 53 -1 N N
+0 + 53 -0 53 -0x1921FB54442D18p-52 53 -inf 53 -0 N N
+0 - 53 -0 53 +0x1921FB54442D18p-52 53 -inf 53 +0 N N
+0 - 53 -0 53 +0x1921FB54442D18p-52 53 -inf 53 +1 N N
+0 - 53 -0 53 +0x1921FB54442D18p-52 53 -inf 53 +inf N N
+0 0 53 -0 53 nan 53 -inf 53 nan N N
+0 + 53 -0 53 -0x1921FB54442D18p-52 53 -6 53 -inf N N
+0 - 53 -0 53 +0x1921FB54442D18p-52 53 -6 53 +inf N N
+0 0 53 nan 53 nan 53 -6 53 nan N N
+0 + 53 -0 53 -0x1921FB54442D18p-52 53 -0 53 -inf N N
+0 0 53 -0 53 -0 53 -0 53 -0 N N
+0 0 53 -0 53 +0 53 -0 53 +0 N N
+0 - 53 -0 53 +0x1921FB54442D18p-52 53 -0 53 +inf N N
+0 0 53 -0 53 nan 53 -0 53 nan N N
+0 + 53 +0 53 -0x1921FB54442D18p-52 53 +0 53 -inf N N
+0 0 53 +0 53 -0 53 +0 53 -0 N N
+0 0 53 +0 53 +0 53 +0 53 +0 N N
+0 - 53 +0 53 +0x1921FB54442D18p-52 53 +0 53 +inf N N
+0 0 53 +0 53 nan 53 +0 53 nan N N
+0 + 53 +0 53 -0x1921FB54442D18p-52 53 +6 53 -inf N N
+0 - 53 +0 53 +0x1921FB54442D18p-52 53 +6 53 +inf N N
+0 0 53 nan 53 nan 53 +6 53 nan N N
+0 + 53 +0 53 -0x1921FB54442D18p-52 53 +inf 53 -inf N N
+0 + 53 +0 53 -0x1921FB54442D18p-52 53 +inf 53 -1 N N
+0 + 53 +0 53 -0x1921FB54442D18p-52 53 +inf 53 -0 N N
+0 - 53 +0 53 +0x1921FB54442D18p-52 53 +inf 53 +0 N N
+0 - 53 +0 53 +0x1921FB54442D18p-52 53 +inf 53 +1 N N
+0 - 53 +0 53 +0x1921FB54442D18p-52 53 +inf 53 +inf N N
+0 0 53 +0 53 nan 53 +inf 53 nan N N
+0 + 53 0 53 -0x1921FB54442D18p-52 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 nan 53 nan 53 -0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 - 53 0 53 +0x1921FB54442D18p-52 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+0 0 53 +inf 53 +0 53 1 53 +0 N N
+
+# pure real argument
+- + 53 -0x1E27076E2AF2E6p-57 53 -0x1921FB54442D18p-52 53 -17 53 -0 N N
+- - 53 -0x1E27076E2AF2E6p-57 53 +0x1921FB54442D18p-52 53 -17 53 +0 N N
++ + 53 +0x1E27076E2AF2E6p-57 53 -0x1921FB54442D18p-52 53 +17 53 -0 N N
++ - 53 +0x1E27076E2AF2E6p-57 53 +0x1921FB54442D18p-52 53 +17 53 +0 N N
++ 0 53 -0x1F2272AE325A57p-53 53 -0 53 -.75 53 -0 N N
++ 0 53 -0x1F2272AE325A57p-53 53 +0 53 -.75 53 +0 N N
+- 0 53 +0x1F2272AE325A57p-53 53 -0 53 +.75 53 -0 N N
+- 0 53 +0x1F2272AE325A57p-53 53 +0 53 +.75 53 +0 N N
+- + 12 0x6F1p-50 12 0xC91p-11 12 0x9380000000 12 +0 N N
+
+# pure imaginary argument
+0 - 53 -0 53 -0x167D8863BC99BDp-52 53 -0 53 -6 N N
+0 - 53 +0 53 -0x167D8863BC99BDp-52 53 +0 53 -6 N N
+0 + 53 -0 53 +0x167D8863BC99BDp-52 53 -0 53 +6 N N
+0 + 53 +0 53 +0x167D8863BC99BDp-52 53 +0 53 +6 N N
+0 + 53 -0 53 -0x1F5B75F92C80DDp-55 53 -0 53 -.25 N N
+0 + 53 +0 53 -0x1F5B75F92C80DDp-55 53 +0 53 -.25 N N
+0 - 53 -0 53 +0x1F5B75F92C80DDp-55 53 -0 53 +.25 N N
+0 - 53 +0 53 +0x1F5B75F92C80DDp-55 53 +0 53 +.25 N N
+
+# IEEE-754 double precision
+- + 53 0x13F3F785301CE9p-54 53 0xBFA43C2A868B3p-51 53 0x3243F6A8885A3p-48 53 0x162E42FEFA39EFp-53 N N
diff --git a/mpc/tests/comparisons.c b/mpc/tests/comparisons.c
new file mode 100644
index 0000000000..d10c878450
--- /dev/null
+++ b/mpc/tests/comparisons.c
@@ -0,0 +1,45 @@
+/* comparisons.c -- Comparison functions.
+
+Copyright (C) 2008, 2009, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+/* comparisons, see description in mpc-tests.h */
+int
+same_mpfr_value (mpfr_ptr got, mpfr_ptr ref, int known_sign)
+{
+ /* The sign of zeroes and infinities is checked only when
+ known_sign is true. */
+ if (mpfr_nan_p (got))
+ return mpfr_nan_p (ref);
+ if (mpfr_inf_p (got))
+ return mpfr_inf_p (ref) &&
+ (!known_sign || mpfr_signbit (got) == mpfr_signbit (ref));
+ if (mpfr_zero_p (got))
+ return mpfr_zero_p (ref) &&
+ (!known_sign || mpfr_signbit (got) == mpfr_signbit (ref));
+ return mpfr_cmp (got, ref) == 0;
+}
+
+int
+same_mpc_value (mpc_ptr got, mpc_ptr ref, known_signs_t known_signs)
+{
+ return same_mpfr_value (mpc_realref (got), mpc_realref (ref), known_signs.re)
+ && same_mpfr_value (mpc_imagref (got), mpc_imagref (ref), known_signs.im);
+}
diff --git a/mpc/tests/conj.dat b/mpc/tests/conj.dat
new file mode 100644
index 0000000000..ecc249b48e
--- /dev/null
+++ b/mpc/tests/conj.dat
@@ -0,0 +1,114 @@
+# Data file for mpc_conj.
+#
+# Copyright (C) 2008, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM 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)
+0 0 53 -inf 53 +inf 53 -inf 53 -inf N N
+0 0 53 -inf 53 +1 53 -inf 53 -1 N N
+0 0 53 -inf 53 +0 53 -inf 53 -0 N N
+0 0 53 -inf 53 -0 53 -inf 53 +0 N N
+0 0 53 -inf 53 -1 53 -inf 53 +1 N N
+0 0 53 -inf 53 -inf 53 -inf 53 +inf N N
+0 0 53 -inf 53 nan 53 -inf 53 nan N N
+0 0 53 -1 53 +inf 53 -1 53 -inf N N
+0 0 53 -1 53 +0 53 -1 53 -0 N N
+0 0 53 -1 53 -0 53 -1 53 +0 N N
+0 0 53 -1 53 -inf 53 -1 53 +inf N N
+0 0 53 -1 53 nan 53 -1 53 nan N N
+0 0 53 -0 53 +inf 53 -0 53 -inf N N
+0 0 53 -0 53 +1 53 -0 53 -1 N N
+0 0 53 -0 53 +0 53 -0 53 -0 N N
+0 0 53 -0 53 -0 53 -0 53 +0 N N
+0 0 53 -0 53 -1 53 -0 53 +1 N N
+0 0 53 -0 53 -inf 53 -0 53 +inf N N
+0 0 53 -0 53 nan 53 -0 53 nan N N
+0 0 53 +0 53 +inf 53 +0 53 -inf N N
+0 0 53 +0 53 +1 53 +0 53 -1 N N
+0 0 53 +0 53 +0 53 +0 53 -0 N N
+0 0 53 +0 53 -0 53 +0 53 +0 N N
+0 0 53 +0 53 -1 53 +0 53 +1 N N
+0 0 53 +0 53 -inf 53 +0 53 +inf N N
+0 0 53 +0 53 nan 53 +0 53 nan N N
+0 0 53 +1 53 +inf 53 +1 53 -inf N N
+0 0 53 +1 53 +0 53 +1 53 -0 N N
+0 0 53 +1 53 -0 53 +1 53 +0 N N
+0 0 53 +1 53 -inf 53 +1 53 +inf N N
+0 0 53 +1 53 nan 53 +1 53 nan N N
+0 0 53 +inf 53 +inf 53 +inf 53 -inf N N
+0 0 53 +inf 53 +1 53 +inf 53 -1 N N
+0 0 53 +inf 53 +0 53 +inf 53 -0 N N
+0 0 53 +inf 53 -0 53 +inf 53 +0 N N
+0 0 53 +inf 53 -1 53 +inf 53 +1 N N
+0 0 53 +inf 53 -inf 53 +inf 53 +inf N N
+0 0 53 +inf 53 nan 53 +inf 53 nan N N
+0 0 53 nan 53 +inf 53 nan 53 -inf N N
+0 0 53 nan 53 +1 53 nan 53 -1 N N
+0 0 53 nan 53 +0 53 nan 53 -0 N N
+0 0 53 nan 53 -0 53 nan 53 +0 N N
+0 0 53 nan 53 -1 53 nan 53 +1 N N
+0 0 53 nan 53 -inf 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
+0 0 53 0x123456789abcdep+52 2 -0 53 0x123456789abcdep+52 17 +0 N N
+0 0 53 -0x123456789abcdep+52 3 -0 54 -0x123456789abcdep+52 16 +0 Z N
+0 0 53 0x123456789abcdep+52 4 +0 55 0x123456789abcdep+52 15 -0 U N
+0 0 53 -0x123456789abcdep+52 5 +0 56 -0x123456789abcdep+52 14 -0 D N
+0 0 53 0x123456789abcdep+52 6 -0 57 0x123456789abcdep+52 13 +0 Z Z
+0 0 53 -0x123456789abcdep+52 7 -0 58 -0x123456789abcdep+52 12 +0 U Z
+0 0 53 0x123456789abcdep+52 8 +0 59 0x123456789abcdep+52 11 -0 D Z
+0 0 53 -0x123456789abcdep+52 9 +0 60 -0x123456789abcdep+52 10 -0 N Z
+0 0 53 0x123456789abcdep+52 10 -0 61 0x123456789abcdep+52 9 +0 U U
+0 0 53 -0x123456789abcdep+52 11 -0 62 -0x123456789abcdep+52 8 +0 D U
+0 0 53 0x123456789abcdep+52 12 +0 63 0x123456789abcdep+52 7 -0 N U
+0 0 53 -0x123456789abcdep+52 13 +0 64 -0x123456789abcdep+52 6 -0 Z U
+0 0 53 0x123456789abcdep+52 14 -0 65 0x123456789abcdep+52 5 +0 D D
+0 0 53 -0x123456789abcdep+52 15 -0 66 -0x123456789abcdep+52 4 +0 N D
+0 0 53 0x123456789abcdep+52 16 +0 67 0x123456789abcdep+52 3 -0 Z D
+0 0 53 -0x123456789abcdep+52 17 +0 68 -0x123456789abcdep+52 2 -0 U D
+
+# pure imaginary argument
+0 0 53 +0 53 -0x123456789abcdep+52 53 +0 53 0x123456789abcdep+52 N N
+0 0 53 -0 53 -0x123456789abcdep+52 51 -0 54 0x123456789abcdep+52 Z N
+0 0 53 +0 53 0x123456789abcdep+52 49 +0 55 -0x123456789abcdep+52 U N
+0 0 53 -0 53 0x123456789abcdep+52 47 -0 56 -0x123456789abcdep+52 D N
+0 0 53 +0 53 -0x123456789abcdep+52 45 +0 57 0x123456789abcdep+52 Z Z
+0 0 53 -0 53 -0x123456789abcdep+52 43 -0 58 0x123456789abcdep+52 U Z
+0 0 53 +0 53 0x123456789abcdep+52 41 +0 59 -0x123456789abcdep+52 D Z
+0 0 53 -0 53 0x123456789abcdep+52 39 -0 60 -0x123456789abcdep+52 N Z
+0 0 53 +0 53 -0x123456789abcdep+52 37 +0 61 0x123456789abcdep+52 U U
+0 0 53 -0 53 -0x123456789abcdep+52 35 -0 62 0x123456789abcdep+52 D U
+0 0 53 +0 53 0x123456789abcdep+52 33 +0 63 -0x123456789abcdep+52 N U
+0 0 53 -0 53 0x123456789abcdep+52 31 -0 64 -0x123456789abcdep+52 Z U
+0 0 53 +0 53 -0x123456789abcdep+52 29 +0 65 0x123456789abcdep+52 D D
+0 0 53 -0 53 -0x123456789abcdep+52 27 -0 66 0x123456789abcdep+52 N D
+0 0 53 +0 53 0x123456789abcdep+52 25 +0 67 -0x123456789abcdep+52 Z D
+0 0 53 -0 53 0x123456789abcdep+52 23 -0 68 -0x123456789abcdep+52 U D
+
+# non-exact return values
+- - 2 4 2 -8 3 5 3 7 N N
+- + 2 4 2 -6 3 5 3 7 D U
++ - 2 6 2 -8 3 5 3 7 U D
+- + 2 4 2 -6 3 5 3 7 Z Z
diff --git a/mpc/tests/cos.dat b/mpc/tests/cos.dat
new file mode 100644
index 0000000000..739409fa4c
--- /dev/null
+++ b/mpc/tests/cos.dat
@@ -0,0 +1,85 @@
+# Data file for mpc_cos.
+#
+# Copyright (C) 2008, 2010 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see sin.dat.
+
+# special values (following ISO C99 standard)
+0 0 7 inf 7 NaN 7 -inf 7 -inf N N
+0 0 7 NaN 7 NaN 7 -inf 7 -1 N N
+0 0 7 NaN 7 0 7 -inf 7 -0 N N
+0 0 7 NaN 7 0 7 -inf 7 +0 N N
+0 0 7 NaN 7 NaN 7 -inf 7 1 N N
+0 0 7 inf 7 NaN 7 -inf 7 +inf N N
+0 0 7 NaN 7 NaN 7 -inf 7 NaN N N
+0 0 7 +inf 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 +inf 7 -1 7 +inf N N
+0 0 7 NaN 7 NaN 7 -1 7 NaN N N
+0 0 7 +inf 7 -0 7 -0 7 -inf N N
+0 0 7 1 7 -0 7 -0 7 -0 N N
+0 0 7 1 7 +0 7 -0 7 +0 N N
+0 0 7 +inf 7 +0 7 -0 7 +inf N N
+0 0 7 NaN 7 0 7 -0 7 NaN N N
+0 0 7 +inf 7 +0 7 +0 7 -inf N N
+0 0 7 1 7 +0 7 +0 7 -0 N N
+0 0 7 1 7 -0 7 +0 7 +0 N N
+0 0 7 +inf 7 -0 7 +0 7 +inf N N
+0 0 7 NaN 7 0 7 +0 7 NaN N N
+0 0 7 +inf 7 +inf 7 1 7 -inf N N
+0 0 7 +inf 7 -inf 7 1 7 +inf N N
+0 0 7 NaN 7 NaN 7 1 7 NaN N N
+0 0 7 inf 7 NaN 7 +inf 7 -inf N N
+0 0 7 NaN 7 NaN 7 +inf 7 -1 N N
+0 0 7 NaN 7 0 7 +inf 7 -0 N N
+0 0 7 NaN 7 0 7 +inf 7 +0 N N
+0 0 7 NaN 7 NaN 7 +inf 7 1 N N
+0 0 7 inf 7 NaN 7 +inf 7 +inf N N
+0 0 7 NaN 7 NaN 7 +inf 7 NaN N N
+0 0 7 +inf 7 NaN 7 NaN 7 -inf N N
+0 0 7 NaN 7 NaN 7 NaN 7 -1 N N
+0 0 7 NaN 7 0 7 NaN 7 -0 N N
+0 0 7 NaN 7 0 7 NaN 7 +0 N N
+0 0 7 NaN 7 NaN 7 NaN 7 1 N N
+0 0 7 +inf 7 NaN 7 NaN 7 +inf N N
+0 0 7 NaN 7 NaN 7 NaN 7 NaN N N
+
+# purely real argument
+- 0 50 0x8a51407da8344p-52 50 -0 7 -1 7 -0 N N
+- 0 50 0x8a51407da8344p-52 50 +0 7 -1 7 +0 N N
+- 0 50 0x8a51407da8344p-52 50 +0 7 1 7 -0 N N
+- 0 50 0x8a51407da8344p-52 50 -0 7 1 7 +0 N N
+
+# purely imaginary argument
+- 0 50 0x18b07551d9f55p-48 50 -0 7 -0 7 -1 N N
+- 0 50 0x18b07551d9f55p-48 50 +0 7 -0 7 1 N N
+- 0 50 0x18b07551d9f55p-48 50 +0 7 +0 7 -1 N N
+- 0 50 0x18b07551d9f55p-48 50 -0 7 +0 7 1 N N
+
+# values with +1 and -1
+- + 50 0xd56f54b7a1accp-52 50 -0xfd28666957478p-52 7 -1 7 -1 N N
+- - 50 0xd56f54b7a1accp-52 50 0xfd28666957478p-52 7 -1 7 1 N N
+- - 50 0xd56f54b7a1accp-52 50 0xfd28666957478p-52 7 1 7 -1 N N
+- + 50 0xd56f54b7a1accp-52 50 -0xfd28666957478p-52 7 1 7 1 N N
+
+# IEEE-754 double precision
++ 0 53 514 53 -0 53 +0 53 0x1BBDD1808C59A3p-50 N N
+- 0 53 0x100FFFFFFFFFFFp-43 53 -0 53 +0 53 0x1BBDD1808C59A3p-50 D D
+
+# huge values
+- + 53 -inf 53 +inf 53 0x4580CBF242683p-3 53 -0x1B3E8A3660D279p-3 N N
++ + 53 +inf 53 +inf 53 -0x1B3E8A3660D279p-3 53 0x4580CBF242683p-3 N N
diff --git a/mpc/tests/cosh.dat b/mpc/tests/cosh.dat
new file mode 100644
index 0000000000..7a766a3f65
--- /dev/null
+++ b/mpc/tests/cosh.dat
@@ -0,0 +1,133 @@
+# Data test file for mpc_cosh.
+#
+# Copyright (C) 2008, 2010 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+
+# See file sin.dat for the format description.
+
+# Special values, following ISO C99 standard, Annex G,
+# more precisely Section G.6.2.4 "The ccosh functions".
+
+# Rule [conj]: cosh(conj(z)) = conj(cosh(z))
+# Rule [even]: cosh(-z) = cosh(z)
+
+# cosh(+0 + i*0) = 1 + i*0
+0 0 2 1 2 +0 2 +0 2 +0 N N
+# [conj]: cosh(+0 - i*0) = 1 - i*0
+0 0 2 1 2 -0 2 +0 2 -0 N N
+# [even]: cosh(-0 - i*0) = 1 + i*0
+0 0 2 1 2 +0 2 -0 2 -0 N N
+# [even+conj]: cosh(-0 + i*0) = 1 - i*0
+0 0 2 1 2 -0 2 -0 2 +0 N N
+
+# cosh(+0 + i*inf) = nan + i*0 (C99 says that the sign of the imaginary part
+# is left unspecified)
+0 0 2 nan 2 0 2 +0 2 +inf N N
+# [conj]: cosh(+0 - i*inf) = nan - i*0
+0 0 2 nan 2 0 2 +0 2 -inf N N
+# [even]: cosh(-0 - i*inf) = nan + i*0
+0 0 2 nan 2 0 2 -0 2 -inf N N
+# [even+conj]: cosh(-0 + i*inf) = nan - i*0
+0 0 2 nan 2 0 2 -0 2 +inf N N
+
+# cosh(+0 +i*nan) = nan + i*0 (C99 says that the sign of the imaginary part
+# is left unspecified)
+0 0 2 nan 2 0 2 +0 2 nan N N
+# [even]: cosh(-0 + i*nan) = nan + i*0
+0 0 2 nan 2 0 2 -0 2 nan N N
+
+# cosh(x + i*inf) = nan + i*nan for finite nonzero x
+0 0 2 nan 2 nan 2 1 2 inf N N
+0 0 2 nan 2 nan 2 -1 2 inf N N
+# [conj]: cosh(x - i*inf) = nan + i*nan
+0 0 2 nan 2 nan 2 1 2 -inf N N
+0 0 2 nan 2 nan 2 -1 2 -inf N N
+# [even] and [even+conj] are already considered for x=-1 < 0
+
+# cosh(x + i*nan) = nan + i*nan for finite nonzero x
+0 0 2 nan 2 nan 2 1 2 nan N N
+0 0 2 nan 2 nan 2 -1 2 nan N N
+# [conj] makes no sense since nan has no sign
+# [even] is already considered for x=-1 < 0
+
+# cosh(+inf + i*0) = +inf + i*0
+0 0 2 +inf 2 +0 2 +inf 2 +0 N N
+# [conj]: cosh(+inf - i*0) = +inf - i*0
+0 0 2 +inf 2 -0 2 +inf 2 -0 N N
+# [even]: cosh(-inf - i*0) = +inf + i*0
+0 0 2 +inf 2 +0 2 -inf 2 -0 N N
+# [even+conj]: cosh(-inf + i*0) = +inf - i*0
+0 0 2 +inf 2 -0 2 -inf 2 +0 N N
+
+# cosh(+inf + i*y) = +inf * (cos(y) + i*sin(y)) for finite non-zero y
+0 0 2 +inf 2 +inf 2 +inf 2 1 N N
+0 0 2 -inf 2 +inf 2 +inf 2 2 N N
+0 0 2 -inf 2 -inf 2 +inf 2 4 N N
+0 0 2 +inf 2 -inf 2 +inf 2 1024 N N
+# [conj]
+0 0 2 +inf 2 -inf 2 +inf 2 -1 N N
+0 0 2 -inf 2 -inf 2 +inf 2 -2 N N
+0 0 2 -inf 2 +inf 2 +inf 2 -4 N N
+0 0 2 +inf 2 +inf 2 +inf 2 -1024 N N
+# [even]
+0 0 2 +inf 2 +inf 2 -inf 2 -1 N N
+0 0 2 -inf 2 +inf 2 -inf 2 -2 N N
+0 0 2 -inf 2 -inf 2 -inf 2 -4 N N
+0 0 2 +inf 2 -inf 2 -inf 2 -1024 N N
+# [even+conj]
+0 0 2 +inf 2 -inf 2 -inf 2 1 N N
+0 0 2 -inf 2 -inf 2 -inf 2 2 N N
+0 0 2 -inf 2 +inf 2 -inf 2 4 N N
+0 0 2 +inf 2 +inf 2 -inf 2 1024 N N
+
+# cosh(+inf + i*inf) = +inf + i*nan (C99 leaves unspecified the sign of the
+# real part)
+0 0 2 inf 2 nan 2 +inf 2 +inf N N
+# [conj]: cosh(+inf - i*inf) = +inf + i*nan
+0 0 2 inf 2 nan 2 +inf 2 -inf N N
+# [even]: cosh(-inf - i*inf) = +inf + i*nan
+0 0 2 inf 2 nan 2 -inf 2 -inf N N
+# [even+conj]: cosh(-inf + i*inf) = +inf + i*nan
+0 0 2 inf 2 nan 2 -inf 2 +inf N N
+
+# cosh(+inf + i*nan) = +inf + i*nan
+0 0 2 +inf 2 nan 2 +inf 2 nan N N
+# [conj] makes no sense since NaN has no sign
+# [even]: cosh(-inf + i*nan) = +inf + i*nan
+0 0 2 +inf 2 nan 2 -inf 2 nan N N
+
+# cosh(nan + i*0) = nan - i*0 (C99 leaves unspecified the sign of the
+# imaginary part)
+0 0 2 nan 2 0 2 nan 2 +0 N N
+# [conj]: cosh(nan - i*0) = nan + i*0
+0 0 2 nan 2 0 2 nan 2 -0 N N
+
+# cosh(nan + i*y) = nan + i*nan for all nonzero y (including +/-inf)
+0 0 2 nan 2 nan 2 nan 2 1 N N
+0 0 2 nan 2 nan 2 nan 2 -1 N N
+0 0 2 nan 2 nan 2 nan 2 +inf N N
+0 0 2 nan 2 nan 2 nan 2 -inf N N
+
+# cosh(nan + i*nan) = nan + i*nan
+0 0 2 nan 2 nan 2 nan 2 nan N N
+
++ + 53 0x10000000000001p-53 53 0x10000000000001p-52 53 0x1DA2E1BD2C9EBCp-53 53 0x138AADEA15829Fp-52 N N
+
+
+# huge values
++ - 53 +inf 53 -inf 53 0x4580CBF242683p-3 53 -0x1B3E8A3660D279p-3 N N
+- - 53 -inf 53 -inf 53 -0x1B3E8A3660D279p-3 53 0x4580CBF242683p-3 N N
diff --git a/mpc/tests/div.dat b/mpc/tests/div.dat
new file mode 100644
index 0000000000..6f5e6009c7
--- /dev/null
+++ b/mpc/tests/div.dat
@@ -0,0 +1,2486 @@
+# Data file for mpc_div.
+#
+# Copyright (C) 2008, 2009, 2010, 2011, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see add.dat.
+
+# special values
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 nan 7 -inf 7 -inf 7 -1 7 -1 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -inf 7 -1 7 -0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -inf 7 -1 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 -inf 7 -0 7 -1 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -inf 7 -0 7 -0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 -inf 7 +0 7 -1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 +0 7 -0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 1 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 -inf 7 1 7 -1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 1 7 -0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 nan 7 -inf 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -1 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 -1 7 -1 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 -1 7 -1 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 -1 7 -1 7 +0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -1 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 -1 7 -0 7 -1 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -1 7 -0 7 -0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -1 7 -0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 -1 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 -1 7 +0 7 -1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -1 7 +0 7 -0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -1 7 +0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 -1 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 -1 7 1 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 -1 7 1 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 -1 7 1 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 -1 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -1 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 -0 7 -1 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 -0 7 -1 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 -0 7 -1 7 +0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -0 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 -0 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 -0 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 -0 7 -0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 -0 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 -0 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 -0 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 -0 7 +0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 -0 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 -0 7 1 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 -0 7 1 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 -0 7 1 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 -0 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -1 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 +0 7 -1 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 +0 7 -1 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 +0 7 -1 7 +0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 +0 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 +0 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 +0 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 +0 7 -0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 +0 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 +0 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 +0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 +0 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 +0 7 1 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 1 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 1 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +0 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -1 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 1 7 -1 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 1 7 -1 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 1 7 -1 7 +0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 1 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 1 7 -0 7 -1 N N
+0 0 7 +inf 7 -inf 7 -inf 7 1 7 -0 7 -0 N N
+0 0 7 +inf 7 -inf 7 -inf 7 1 7 -0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 1 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 1 7 +0 7 -1 N N
+0 0 7 -inf 7 +inf 7 -inf 7 1 7 +0 7 -0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 1 7 +0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 1 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 1 7 1 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 1 7 1 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 1 7 1 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 1 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -1 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 +inf 7 -1 7 -1 N N
+0 0 7 +inf 7 -inf 7 -inf 7 +inf 7 -1 7 -0 N N
+0 0 7 +inf 7 -inf 7 -inf 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 nan 7 -inf 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 +inf 7 -0 7 -1 N N
+0 0 7 +inf 7 -inf 7 -inf 7 +inf 7 -0 7 -0 N N
+0 0 7 +inf 7 -inf 7 -inf 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 +inf 7 +0 7 -1 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 +0 7 -0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 1 7 -inf N N
+0 0 7 -inf 7 nan 7 -inf 7 +inf 7 1 7 -1 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 1 7 -0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 1 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -1 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 nan 7 -1 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 nan 7 -1 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 nan 7 -1 7 +0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 nan 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 nan 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 nan 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 nan 7 1 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 1 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 1 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 nan 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 +inf 7 -1 7 -inf 7 -1 7 -1 N N
+0 0 7 nan 7 +inf 7 -1 7 -inf 7 -1 7 -0 N N
+0 0 7 nan 7 +inf 7 -1 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 +inf 7 -1 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 nan 7 -1 7 -inf 7 -0 7 -1 N N
+0 0 7 +inf 7 +inf 7 -1 7 -inf 7 -0 7 -0 N N
+0 0 7 +inf 7 +inf 7 -1 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 nan 7 -1 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 nan 7 -1 7 -inf 7 +0 7 -1 N N
+0 0 7 -inf 7 -inf 7 -1 7 -inf 7 +0 7 -0 N N
+0 0 7 -inf 7 -inf 7 -1 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 nan 7 -1 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 1 7 -inf N N
+0 0 7 +inf 7 -inf 7 -1 7 -inf 7 1 7 -1 N N
+0 0 7 nan 7 -inf 7 -1 7 -inf 7 1 7 -0 N N
+0 0 7 nan 7 -inf 7 -1 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 -inf 7 -1 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan 7 nan N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -inf 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -inf 7 -1 N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -inf 7 -0 N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -inf 7 +0 N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -inf 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -inf 7 +inf N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -inf 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -1 7 -1 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 -1 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -1 7 -0 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 -0 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -1 7 +0 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 +0 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -1 7 1 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 1 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -1 7 +inf 7 -inf N N
+0 0 7 -0 7 -0 7 -1 7 -1 7 +inf 7 -1 N N
+0 0 7 -0 7 -0 7 -1 7 -1 7 +inf 7 -0 N N
+0 0 7 -0 7 -0 7 -1 7 -1 7 +inf 7 +0 N N
+0 0 7 -0 7 -0 7 -1 7 -1 7 +inf 7 1 N N
+0 0 7 -0 7 +0 7 -1 7 -1 7 +inf 7 +inf N N
+0 0 7 -0 7 -0 7 -1 7 -1 7 +inf 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 nan 7 1 N N
+0 0 7 -0 7 +0 7 -1 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 nan 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -0 7 -inf 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -inf 7 -1 N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -inf 7 -0 N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -inf 7 +0 N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -inf 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -inf 7 +inf N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -inf 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -0 7 -1 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 -1 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -0 7 -0 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 -0 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -0 7 +0 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 +0 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -0 7 1 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 1 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 -0 7 +inf 7 -inf N N
+0 0 7 -0 7 -0 7 -1 7 -0 7 +inf 7 -1 N N
+0 0 7 -0 7 -0 7 -1 7 -0 7 +inf 7 -0 N N
+0 0 7 -0 7 +0 7 -1 7 -0 7 +inf 7 +0 N N
+0 0 7 -0 7 +0 7 -1 7 -0 7 +inf 7 1 N N
+0 0 7 -0 7 +0 7 -1 7 -0 7 +inf 7 +inf N N
+0 0 7 -0 7 +0 7 -1 7 -0 7 +inf 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 nan 7 1 N N
+0 0 7 -0 7 +0 7 -1 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 nan 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 +0 7 -inf 7 -inf N N
+0 0 7 +0 7 -0 7 -1 7 +0 7 -inf 7 -1 N N
+0 0 7 +0 7 -0 7 -1 7 +0 7 -inf 7 -0 N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 -inf 7 +0 N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 -inf 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 -inf 7 +inf N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 -inf 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 +0 7 -1 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 -1 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 +0 7 -0 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 -0 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 +0 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 +0 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 +0 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 1 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 +0 7 +inf 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 +0 7 +inf 7 -1 N N
+0 0 7 -0 7 +0 7 -1 7 +0 7 +inf 7 -0 N N
+0 0 7 -0 7 +0 7 -1 7 +0 7 +inf 7 +0 N N
+0 0 7 -0 7 +0 7 -1 7 +0 7 +inf 7 1 N N
+0 0 7 -0 7 +0 7 -1 7 +0 7 +inf 7 +inf N N
+0 0 7 -0 7 +0 7 -1 7 +0 7 +inf 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 nan 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 1 7 -inf 7 -inf N N
+0 0 7 +0 7 -0 7 -1 7 1 7 -inf 7 -1 N N
+0 0 7 +0 7 -0 7 -1 7 1 7 -inf 7 -0 N N
+0 0 7 +0 7 -0 7 -1 7 1 7 -inf 7 +0 N N
+0 0 7 +0 7 -0 7 -1 7 1 7 -inf 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 1 7 -inf 7 +inf N N
+0 0 7 +0 7 -0 7 -1 7 1 7 -inf 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 1 7 -1 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 -1 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 1 7 -0 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 -0 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 1 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 +0 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 1 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 1 7 nan N N
+0 0 7 -0 7 +0 7 -1 7 1 7 +inf 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 1 7 +inf 7 -1 N N
+0 0 7 -0 7 +0 7 -1 7 1 7 +inf 7 -0 N N
+0 0 7 -0 7 +0 7 -1 7 1 7 +inf 7 +0 N N
+0 0 7 -0 7 +0 7 -1 7 1 7 +inf 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 1 7 +inf 7 +inf N N
+0 0 7 -0 7 +0 7 -1 7 1 7 +inf 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 1 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -1 7 +inf 7 -1 7 -1 N N
+0 0 7 nan 7 -inf 7 -1 7 +inf 7 -1 7 -0 N N
+0 0 7 nan 7 -inf 7 -1 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -inf 7 -1 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 nan 7 -1 7 +inf 7 -0 7 -1 N N
+0 0 7 +inf 7 -inf 7 -1 7 +inf 7 -0 7 -0 N N
+0 0 7 +inf 7 -inf 7 -1 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 nan 7 -1 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 nan 7 -1 7 +inf 7 +0 7 -1 N N
+0 0 7 -inf 7 +inf 7 -1 7 +inf 7 +0 7 -0 N N
+0 0 7 -inf 7 +inf 7 -1 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 nan 7 -1 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 1 7 -inf N N
+0 0 7 -inf 7 +inf 7 -1 7 +inf 7 1 7 -1 N N
+0 0 7 nan 7 +inf 7 -1 7 +inf 7 1 7 -0 N N
+0 0 7 nan 7 +inf 7 -1 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 +inf 7 -1 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -1 7 nan 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 -1 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 -1 7 nan 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -1 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 +inf 7 -0 7 -inf 7 -1 7 -1 N N
+0 0 7 nan 7 +inf 7 -0 7 -inf 7 -1 7 -0 N N
+0 0 7 nan 7 +inf 7 -0 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 +inf 7 -0 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 nan 7 -0 7 -inf 7 -0 7 -1 N N
+0 0 7 nan 7 +inf 7 -0 7 -inf 7 -0 7 -0 N N
+0 0 7 nan 7 +inf 7 -0 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 nan 7 -0 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 nan 7 -0 7 -inf 7 +0 7 -1 N N
+0 0 7 nan 7 -inf 7 -0 7 -inf 7 +0 7 -0 N N
+0 0 7 nan 7 -inf 7 -0 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 nan 7 -0 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 1 7 -inf N N
+0 0 7 +inf 7 -inf 7 -0 7 -inf 7 1 7 -1 N N
+0 0 7 nan 7 -inf 7 -0 7 -inf 7 1 7 -0 N N
+0 0 7 nan 7 -inf 7 -0 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 -inf 7 -0 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan 7 nan N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -inf 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -inf 7 -1 N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -inf 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -inf 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -inf 7 1 N N
+0 0 7 -0 7 +0 7 -0 7 -1 7 -inf 7 +inf N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -inf 7 nan N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -1 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 -1 7 nan N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -0 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 -0 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -1 7 +0 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 +0 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -1 7 1 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 1 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -1 7 +inf 7 -inf N N
+0 0 7 +0 7 -0 7 -0 7 -1 7 +inf 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 -1 7 +inf 7 -0 N N
+0 0 7 -0 7 -0 7 -0 7 -1 7 +inf 7 +0 N N
+0 0 7 -0 7 -0 7 -0 7 -1 7 +inf 7 1 N N
+0 0 7 -0 7 -0 7 -0 7 -1 7 +inf 7 +inf N N
+0 0 7 -0 7 -0 7 -0 7 -1 7 +inf 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 nan 7 1 N N
+0 0 7 -0 7 +0 7 -0 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 nan 7 nan N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -inf 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -inf 7 -1 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -inf 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -inf 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -inf 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -inf 7 +inf N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -inf 7 nan N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -1 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 -1 7 nan N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -0 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 -0 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 +0 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 +0 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 1 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 1 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 +inf 7 -inf N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 +inf 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 +inf 7 -0 N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 +inf 7 +0 N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 +inf 7 1 N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 +inf 7 +inf N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 +inf 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 nan 7 1 N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 nan 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -inf 7 -inf N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -inf 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -inf 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -inf 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -inf 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -inf 7 +inf N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -inf 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -1 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 -1 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -0 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 -0 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 +0 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 1 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 +inf 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 +inf 7 -1 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 +inf 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 +inf 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 nan 7 nan N N
+0 0 7 -0 7 -0 7 -0 7 1 7 -inf 7 -inf N N
+0 0 7 +0 7 -0 7 -0 7 1 7 -inf 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 1 7 -inf 7 -0 N N
+0 0 7 +0 7 -0 7 -0 7 1 7 -inf 7 +0 N N
+0 0 7 +0 7 -0 7 -0 7 1 7 -inf 7 1 N N
+0 0 7 +0 7 -0 7 -0 7 1 7 -inf 7 +inf N N
+0 0 7 +0 7 -0 7 -0 7 1 7 -inf 7 nan N N
+0 0 7 -0 7 -0 7 -0 7 1 7 -1 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 -1 7 nan N N
+0 0 7 -0 7 -0 7 -0 7 1 7 -0 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 -0 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 1 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 +0 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 1 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 1 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 1 7 +inf 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 1 7 +inf 7 -1 N N
+0 0 7 -0 7 +0 7 -0 7 1 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 1 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 1 7 +inf 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 1 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 -0 7 1 7 +inf 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 1 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -0 7 +inf 7 -1 7 -1 N N
+0 0 7 nan 7 -inf 7 -0 7 +inf 7 -1 7 -0 N N
+0 0 7 nan 7 -inf 7 -0 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -inf 7 -0 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 nan 7 -0 7 +inf 7 -0 7 -1 N N
+0 0 7 nan 7 -inf 7 -0 7 +inf 7 -0 7 -0 N N
+0 0 7 nan 7 -inf 7 -0 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 nan 7 -0 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 nan 7 -0 7 +inf 7 +0 7 -1 N N
+0 0 7 nan 7 +inf 7 -0 7 +inf 7 +0 7 -0 N N
+0 0 7 nan 7 +inf 7 -0 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 nan 7 -0 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 1 7 -inf N N
+0 0 7 -inf 7 +inf 7 -0 7 +inf 7 1 7 -1 N N
+0 0 7 nan 7 +inf 7 -0 7 +inf 7 1 7 -0 N N
+0 0 7 nan 7 +inf 7 -0 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 +inf 7 -0 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 +inf 7 +0 7 -inf 7 -1 7 -1 N N
+0 0 7 nan 7 +inf 7 +0 7 -inf 7 -1 7 -0 N N
+0 0 7 nan 7 +inf 7 +0 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 +inf 7 +0 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 nan 7 +0 7 -inf 7 -0 7 -1 N N
+0 0 7 nan 7 +inf 7 +0 7 -inf 7 -0 7 -0 N N
+0 0 7 nan 7 +inf 7 +0 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 nan 7 +0 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 nan 7 +0 7 -inf 7 +0 7 -1 N N
+0 0 7 nan 7 -inf 7 +0 7 -inf 7 +0 7 -0 N N
+0 0 7 nan 7 -inf 7 +0 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 nan 7 +0 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 1 7 -inf N N
+0 0 7 +inf 7 -inf 7 +0 7 -inf 7 1 7 -1 N N
+0 0 7 nan 7 -inf 7 +0 7 -inf 7 1 7 -0 N N
+0 0 7 nan 7 -inf 7 +0 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 -inf 7 +0 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -1 7 -inf 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 -1 7 -inf 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 -1 7 -inf 7 -0 N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -inf 7 +0 N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -inf 7 1 N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -inf 7 +inf N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -inf 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -1 7 -1 7 -inf N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 -1 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -1 7 -0 7 -inf N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 -0 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -1 7 +0 7 -inf N N
+0 0 7 -0 7 -0 7 +0 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 +0 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -1 7 1 7 -inf N N
+0 0 7 -0 7 -0 7 +0 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 1 7 nan N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +inf 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +inf 7 -1 N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +inf 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +inf 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +inf 7 1 N N
+0 0 7 -0 7 -0 7 +0 7 -1 7 +inf 7 +inf N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +inf 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 nan 7 1 N N
+0 0 7 -0 7 -0 7 +0 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 nan 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -inf 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -inf 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -inf 7 -0 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -inf 7 +0 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -inf 7 1 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -inf 7 +inf N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -inf 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -1 7 -inf N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 -1 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -0 7 -inf N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 -0 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 +0 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 +0 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 1 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 1 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 +inf 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 +inf 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 +inf 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +inf 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +inf 7 1 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +inf 7 +inf N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +inf 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 nan 7 1 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 nan 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 +0 7 -inf 7 -inf N N
+0 0 7 -0 7 +0 7 +0 7 +0 7 -inf 7 -1 N N
+0 0 7 -0 7 +0 7 +0 7 +0 7 -inf 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -inf 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -inf 7 1 N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -inf 7 +inf N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -inf 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 +0 7 -1 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 -1 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 +0 7 -0 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 -0 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 +0 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 1 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 nan 7 nan N N
+0 0 7 -0 7 -0 7 +0 7 1 7 -inf 7 -inf N N
+0 0 7 -0 7 -0 7 +0 7 1 7 -inf 7 -1 N N
+0 0 7 -0 7 -0 7 +0 7 1 7 -inf 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 1 7 -inf 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 1 7 -inf 7 1 N N
+0 0 7 +0 7 -0 7 +0 7 1 7 -inf 7 +inf N N
+0 0 7 +0 7 -0 7 +0 7 1 7 -inf 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 1 7 -1 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 -1 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 1 7 -0 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 -0 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 1 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 +0 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 1 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 1 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 1 7 +inf 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +inf 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +inf 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +inf 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 1 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 -inf 7 +0 7 +inf 7 -1 7 -1 N N
+0 0 7 nan 7 -inf 7 +0 7 +inf 7 -1 7 -0 N N
+0 0 7 nan 7 -inf 7 +0 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -inf 7 +0 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 nan 7 +0 7 +inf 7 -0 7 -1 N N
+0 0 7 nan 7 -inf 7 +0 7 +inf 7 -0 7 -0 N N
+0 0 7 nan 7 -inf 7 +0 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 nan 7 +0 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 nan 7 +0 7 +inf 7 +0 7 -1 N N
+0 0 7 nan 7 +inf 7 +0 7 +inf 7 +0 7 -0 N N
+0 0 7 nan 7 +inf 7 +0 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 nan 7 +0 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 1 7 -inf N N
+0 0 7 -inf 7 +inf 7 +0 7 +inf 7 1 7 -1 N N
+0 0 7 nan 7 +inf 7 +0 7 +inf 7 1 7 -0 N N
+0 0 7 nan 7 +inf 7 +0 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 +inf 7 +0 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 +inf 7 1 7 -inf 7 -1 7 -1 N N
+0 0 7 nan 7 +inf 7 1 7 -inf 7 -1 7 -0 N N
+0 0 7 nan 7 +inf 7 1 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 +inf 7 1 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 nan 7 1 7 -inf 7 -0 7 -1 N N
+0 0 7 -inf 7 +inf 7 1 7 -inf 7 -0 7 -0 N N
+0 0 7 -inf 7 +inf 7 1 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 nan 7 1 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 nan 7 1 7 -inf 7 +0 7 -1 N N
+0 0 7 +inf 7 -inf 7 1 7 -inf 7 +0 7 -0 N N
+0 0 7 +inf 7 -inf 7 1 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 nan 7 1 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 1 7 -inf N N
+0 0 7 +inf 7 -inf 7 1 7 -inf 7 1 7 -1 N N
+0 0 7 nan 7 -inf 7 1 7 -inf 7 1 7 -0 N N
+0 0 7 nan 7 -inf 7 1 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 -inf 7 1 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -1 7 -inf 7 -inf N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -inf 7 -1 N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -inf 7 -0 N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -inf 7 +0 N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -inf 7 1 N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -inf 7 +inf N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -inf 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -1 7 -1 7 -inf N N
+0 0 7 -0 7 -0 7 1 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 -1 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -1 7 -0 7 -inf N N
+0 0 7 -0 7 -0 7 1 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 -0 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -1 7 +0 7 -inf N N
+0 0 7 -0 7 -0 7 1 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 +0 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -1 7 1 7 -inf N N
+0 0 7 -0 7 -0 7 1 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 1 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -1 7 +inf 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +inf 7 -1 N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +inf 7 -0 N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +inf 7 +0 N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +inf 7 1 N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +inf 7 +inf N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +inf 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 -1 7 nan 7 1 N N
+0 0 7 -0 7 -0 7 1 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 nan 7 nan N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -inf 7 -inf N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -inf 7 -1 N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -inf 7 -0 N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -inf 7 +0 N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -inf 7 1 N N
+0 0 7 -0 7 -0 7 1 7 -0 7 -inf 7 +inf N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -inf 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -0 7 -1 7 -inf N N
+0 0 7 -0 7 -0 7 1 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 -1 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -0 7 -0 7 -inf N N
+0 0 7 -0 7 -0 7 1 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 -0 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -0 7 +0 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 +0 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -0 7 1 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 1 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -0 7 +inf 7 -inf N N
+0 0 7 +0 7 +0 7 1 7 -0 7 +inf 7 -1 N N
+0 0 7 +0 7 +0 7 1 7 -0 7 +inf 7 -0 N N
+0 0 7 +0 7 -0 7 1 7 -0 7 +inf 7 +0 N N
+0 0 7 +0 7 -0 7 1 7 -0 7 +inf 7 1 N N
+0 0 7 +0 7 -0 7 1 7 -0 7 +inf 7 +inf N N
+0 0 7 +0 7 -0 7 1 7 -0 7 +inf 7 nan N N
+0 0 7 +0 7 +0 7 1 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 -0 7 nan 7 1 N N
+0 0 7 +0 7 -0 7 1 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 nan 7 nan N N
+0 0 7 -0 7 +0 7 1 7 +0 7 -inf 7 -inf N N
+0 0 7 -0 7 +0 7 1 7 +0 7 -inf 7 -1 N N
+0 0 7 -0 7 +0 7 1 7 +0 7 -inf 7 -0 N N
+0 0 7 -0 7 -0 7 1 7 +0 7 -inf 7 +0 N N
+0 0 7 -0 7 -0 7 1 7 +0 7 -inf 7 1 N N
+0 0 7 -0 7 -0 7 1 7 +0 7 -inf 7 +inf N N
+0 0 7 -0 7 -0 7 1 7 +0 7 -inf 7 nan N N
+0 0 7 -0 7 +0 7 1 7 +0 7 -1 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 -1 7 nan N N
+0 0 7 -0 7 +0 7 1 7 +0 7 -0 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 -0 7 nan N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +0 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 +0 7 nan N N
+0 0 7 +0 7 +0 7 1 7 +0 7 1 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 1 7 nan N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +inf 7 -inf N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +inf 7 -1 N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +inf 7 1 N N
+0 0 7 +0 7 -0 7 1 7 +0 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +inf 7 nan N N
+0 0 7 +0 7 +0 7 1 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 +0 7 nan 7 1 N N
+0 0 7 +0 7 -0 7 1 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 nan 7 nan N N
+0 0 7 -0 7 +0 7 1 7 1 7 -inf 7 -inf N N
+0 0 7 -0 7 -0 7 1 7 1 7 -inf 7 -1 N N
+0 0 7 -0 7 -0 7 1 7 1 7 -inf 7 -0 N N
+0 0 7 -0 7 -0 7 1 7 1 7 -inf 7 +0 N N
+0 0 7 -0 7 -0 7 1 7 1 7 -inf 7 1 N N
+0 0 7 +0 7 -0 7 1 7 1 7 -inf 7 +inf N N
+0 0 7 -0 7 -0 7 1 7 1 7 -inf 7 nan N N
+0 0 7 -0 7 +0 7 1 7 1 7 -1 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 -1 7 nan N N
+0 0 7 -0 7 +0 7 1 7 1 7 -0 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 -0 7 nan N N
+0 0 7 -0 7 +0 7 1 7 1 7 +0 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 +0 7 nan N N
+0 0 7 -0 7 +0 7 1 7 1 7 1 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 1 7 nan N N
+0 0 7 +0 7 +0 7 1 7 1 7 +inf 7 -inf N N
+0 0 7 +0 7 +0 7 1 7 1 7 +inf 7 -1 N N
+0 0 7 +0 7 +0 7 1 7 1 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 1 7 1 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 1 7 1 7 +inf 7 1 N N
+0 0 7 +0 7 +0 7 1 7 1 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 1 7 1 7 +inf 7 nan N N
+0 0 7 -0 7 +0 7 1 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 1 7 nan 7 1 N N
+0 0 7 +0 7 -0 7 1 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 -inf 7 1 7 +inf 7 -1 7 -1 N N
+0 0 7 nan 7 -inf 7 1 7 +inf 7 -1 7 -0 N N
+0 0 7 nan 7 -inf 7 1 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -inf 7 1 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 nan 7 1 7 +inf 7 -0 7 -1 N N
+0 0 7 -inf 7 -inf 7 1 7 +inf 7 -0 7 -0 N N
+0 0 7 -inf 7 -inf 7 1 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 nan 7 1 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 nan 7 1 7 +inf 7 +0 7 -1 N N
+0 0 7 +inf 7 +inf 7 1 7 +inf 7 +0 7 -0 N N
+0 0 7 +inf 7 +inf 7 1 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 nan 7 1 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 1 7 -inf N N
+0 0 7 -inf 7 +inf 7 1 7 +inf 7 1 7 -1 N N
+0 0 7 nan 7 +inf 7 1 7 +inf 7 1 7 -0 N N
+0 0 7 nan 7 +inf 7 1 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 +inf 7 1 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 1 7 nan 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 1 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 1 7 nan 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 1 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 1 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 1 7 1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -1 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 -inf 7 -1 7 -1 N N
+0 0 7 -inf 7 +inf 7 +inf 7 -inf 7 -1 7 -0 N N
+0 0 7 -inf 7 +inf 7 +inf 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 nan 7 +inf 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 -inf 7 -0 7 -1 N N
+0 0 7 -inf 7 +inf 7 +inf 7 -inf 7 -0 7 -0 N N
+0 0 7 -inf 7 +inf 7 +inf 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 -inf 7 +0 7 -1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 +0 7 -0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 1 7 -inf N N
+0 0 7 +inf 7 nan 7 +inf 7 -inf 7 1 7 -1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 1 7 -0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 1 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -1 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 -1 7 -1 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 -1 7 -1 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 -1 7 -1 7 +0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 -1 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 -1 7 -0 7 -1 N N
+0 0 7 -inf 7 +inf 7 +inf 7 -1 7 -0 7 -0 N N
+0 0 7 -inf 7 +inf 7 +inf 7 -1 7 -0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 -1 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 -1 7 +0 7 -1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -1 7 +0 7 -0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -1 7 +0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 -1 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 1 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 -1 7 1 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 -1 7 1 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 -1 7 1 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -1 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -1 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 -0 7 -1 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 -0 7 -1 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 -0 7 -1 7 +0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 -0 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 -0 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 -0 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 -0 7 -0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 -0 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 -0 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 -0 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 -0 7 +0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 -0 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 1 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 -0 7 1 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 -0 7 1 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 -0 7 1 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -0 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -1 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 +0 7 -1 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 +0 7 -1 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 +0 7 -1 7 +0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 +0 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 +0 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 +0 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 +0 7 -0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 +0 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 +0 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 +0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 +0 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 1 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 +0 7 1 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 1 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 1 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 +0 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -1 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 1 7 -1 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 1 7 -1 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 1 7 -1 7 +0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 1 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 1 7 -0 7 -1 N N
+0 0 7 -inf 7 -inf 7 +inf 7 1 7 -0 7 -0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 1 7 -0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 1 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 1 7 +0 7 -1 N N
+0 0 7 +inf 7 +inf 7 +inf 7 1 7 +0 7 -0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 1 7 +0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 1 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 1 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 1 7 1 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 1 7 1 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 1 7 1 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 1 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 nan 7 +inf 7 +inf 7 -1 7 -1 N N
+0 0 7 -inf 7 -inf 7 +inf 7 +inf 7 -1 7 -0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 +inf 7 -1 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 +inf 7 -0 7 -1 N N
+0 0 7 -inf 7 -inf 7 +inf 7 +inf 7 -0 7 -0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 +inf 7 +0 7 -1 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 +0 7 -0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 1 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 +inf 7 1 7 -1 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 1 7 -0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 nan 7 +inf 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -1 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 nan 7 -1 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 nan 7 -1 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 nan 7 -1 7 +0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 nan 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 nan 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 nan 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 1 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 nan 7 1 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 1 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 1 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 nan 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 +inf 7 nan 7 -inf 7 -1 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -1 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 +inf 7 nan 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 nan 7 nan 7 -inf 7 -0 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -0 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 nan 7 nan 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 nan 7 nan 7 -inf 7 +0 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 +0 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 nan 7 nan 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 1 7 -inf N N
+0 0 7 +inf 7 -inf 7 nan 7 -inf 7 1 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 1 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 -inf 7 nan 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -0 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 -1 7 -0 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 -1 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +0 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 -1 7 +0 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 -1 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -0 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 1 7 -0 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 1 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +0 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 1 7 +0 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 1 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 1 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 -inf 7 nan 7 +inf 7 -1 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 -1 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -inf 7 nan 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 nan 7 nan 7 +inf 7 -0 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 -0 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 nan 7 nan 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 nan 7 nan 7 +inf 7 +0 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 +0 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 nan 7 nan 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 1 7 -inf N N
+0 0 7 -inf 7 +inf 7 nan 7 +inf 7 1 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 1 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 +inf 7 nan 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan 7 nan N N
+
+# finite values
+0 0 7 1 7 +0 7 -1 7 -1 7 -1 7 -1 N N
+0 0 7 1 7 1 7 -1 7 -1 7 -1 7 -0 N N
+0 0 7 1 7 1 7 -1 7 -1 7 -1 7 +0 N N
+0 0 7 +0 7 1 7 -1 7 -1 7 -1 7 1 N N
+0 0 7 1 7 -1 7 -1 7 -1 7 -0 7 -1 N N
+0 0 7 +inf 7 +inf 7 -1 7 -1 7 -0 7 -0 N N
+0 0 7 +inf 7 +inf 7 -1 7 -1 7 -0 7 +0 N N
+0 0 7 -1 7 1 7 -1 7 -1 7 -0 7 1 N N
+0 0 7 1 7 -1 7 -1 7 -1 7 +0 7 -1 N N
+0 0 7 -inf 7 -inf 7 -1 7 -1 7 +0 7 -0 N N
+0 0 7 -inf 7 -inf 7 -1 7 -1 7 +0 7 +0 N N
+0 0 7 -1 7 1 7 -1 7 -1 7 +0 7 1 N N
+0 0 7 +0 7 -1 7 -1 7 -1 7 1 7 -1 N N
+0 0 7 -1 7 -1 7 -1 7 -1 7 1 7 -0 N N
+0 0 7 -1 7 -1 7 -1 7 -1 7 1 7 +0 N N
+0 0 7 -1 7 +0 7 -1 7 -1 7 1 7 1 N N
+0 0 7 0.5 7 -0.5 7 -1 7 -0 7 -1 7 -1 N N
+0 0 7 1 7 +0 7 -1 7 -0 7 -1 7 -0 N N
+0 0 7 1 7 +0 7 -1 7 -0 7 -1 7 +0 N N
+0 0 7 0.5 7 0.5 7 -1 7 -0 7 -1 7 1 N N
+0 0 7 +0 7 -1 7 -1 7 -0 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -1 7 -0 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 -1 7 -0 7 -0 7 +0 N N
+0 0 7 +0 7 1 7 -1 7 -0 7 -0 7 1 N N
+0 0 7 +0 7 -1 7 -1 7 -0 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 -1 7 -0 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -1 7 -0 7 +0 7 +0 N N
+0 0 7 -0 7 1 7 -1 7 -0 7 +0 7 1 N N
+0 0 7 -0.5 7 -0.5 7 -1 7 -0 7 1 7 -1 N N
+0 0 7 -1 7 -0 7 -1 7 -0 7 1 7 -0 N N
+0 0 7 -1 7 +0 7 -1 7 -0 7 1 7 +0 N N
+0 0 7 -0.5 7 0.5 7 -1 7 -0 7 1 7 1 N N
+0 0 7 0.5 7 -0.5 7 -1 7 +0 7 -1 7 -1 N N
+0 0 7 1 7 -0 7 -1 7 +0 7 -1 7 -0 N N
+0 0 7 1 7 +0 7 -1 7 +0 7 -1 7 +0 N N
+0 0 7 0.5 7 0.5 7 -1 7 +0 7 -1 7 1 N N
+0 0 7 +0 7 -1 7 -1 7 +0 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -1 7 +0 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 -1 7 +0 7 -0 7 +0 N N
+0 0 7 +0 7 1 7 -1 7 +0 7 -0 7 1 N N
+0 0 7 -0 7 -1 7 -1 7 +0 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 -1 7 +0 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -1 7 +0 7 +0 7 +0 N N
+0 0 7 +0 7 1 7 -1 7 +0 7 +0 7 1 N N
+0 0 7 -0.5 7 -0.5 7 -1 7 +0 7 1 7 -1 N N
+0 0 7 -1 7 +0 7 -1 7 +0 7 1 7 -0 N N
+0 0 7 -1 7 +0 7 -1 7 +0 7 1 7 +0 N N
+0 0 7 -0.5 7 0.5 7 -1 7 +0 7 1 7 1 N N
+0 0 7 +0 7 -1 7 -1 7 1 7 -1 7 -1 N N
+0 0 7 1 7 -1 7 -1 7 1 7 -1 7 -0 N N
+0 0 7 1 7 -1 7 -1 7 1 7 -1 7 +0 N N
+0 0 7 1 7 +0 7 -1 7 1 7 -1 7 1 N N
+0 0 7 -1 7 -1 7 -1 7 1 7 -0 7 -1 N N
+0 0 7 +inf 7 -inf 7 -1 7 1 7 -0 7 -0 N N
+0 0 7 +inf 7 -inf 7 -1 7 1 7 -0 7 +0 N N
+0 0 7 1 7 1 7 -1 7 1 7 -0 7 1 N N
+0 0 7 -1 7 -1 7 -1 7 1 7 +0 7 -1 N N
+0 0 7 -inf 7 +inf 7 -1 7 1 7 +0 7 -0 N N
+0 0 7 -inf 7 +inf 7 -1 7 1 7 +0 7 +0 N N
+0 0 7 1 7 1 7 -1 7 1 7 +0 7 1 N N
+0 0 7 -1 7 +0 7 -1 7 1 7 1 7 -1 N N
+0 0 7 -1 7 1 7 -1 7 1 7 1 7 -0 N N
+0 0 7 -1 7 1 7 -1 7 1 7 1 7 +0 N N
+0 0 7 +0 7 1 7 -1 7 1 7 1 7 1 N N
+0 0 7 0.5 7 0.5 7 -0 7 -1 7 -1 7 -1 N N
+0 0 7 +0 7 1 7 -0 7 -1 7 -1 7 -0 N N
+0 0 7 +0 7 1 7 -0 7 -1 7 -1 7 +0 N N
+0 0 7 -0.5 7 0.5 7 -0 7 -1 7 -1 7 1 N N
+0 0 7 1 7 +0 7 -0 7 -1 7 -0 7 -1 N N
+0 0 7 nan 7 +inf 7 -0 7 -1 7 -0 7 -0 N N
+0 0 7 nan 7 +inf 7 -0 7 -1 7 -0 7 +0 N N
+0 0 7 -1 7 +0 7 -0 7 -1 7 -0 7 1 N N
+0 0 7 1 7 -0 7 -0 7 -1 7 +0 7 -1 N N
+0 0 7 nan 7 -inf 7 -0 7 -1 7 +0 7 -0 N N
+0 0 7 nan 7 -inf 7 -0 7 -1 7 +0 7 +0 N N
+0 0 7 -1 7 +0 7 -0 7 -1 7 +0 7 1 N N
+0 0 7 0.5 7 -0.5 7 -0 7 -1 7 1 7 -1 N N
+0 0 7 +0 7 -1 7 -0 7 -1 7 1 7 -0 N N
+0 0 7 -0 7 -1 7 -0 7 -1 7 1 7 +0 N N
+0 0 7 -0.5 7 -0.5 7 -0 7 -1 7 1 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -1 7 -1 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -1 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -1 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -1 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 -0 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -0 7 1 N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 +0 7 +0 N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 +0 7 1 N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 1 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 1 7 -0 N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 1 7 +0 N N
+0 0 7 -0 7 +0 7 -0 7 -0 7 1 7 1 N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -1 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -1 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -1 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -1 7 1 N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 -0 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 -0 7 1 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 +0 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 +0 7 1 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 1 7 -1 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 1 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 1 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 1 7 1 N N
+0 0 7 -0.5 7 -0.5 7 -0 7 1 7 -1 7 -1 N N
+0 0 7 +0 7 -1 7 -0 7 1 7 -1 7 -0 N N
+0 0 7 +0 7 -1 7 -0 7 1 7 -1 7 +0 N N
+0 0 7 0.5 7 -0.5 7 -0 7 1 7 -1 7 1 N N
+0 0 7 -1 7 -0 7 -0 7 1 7 -0 7 -1 N N
+0 0 7 nan 7 -inf 7 -0 7 1 7 -0 7 -0 N N
+0 0 7 nan 7 -inf 7 -0 7 1 7 -0 7 +0 N N
+0 0 7 1 7 +0 7 -0 7 1 7 -0 7 1 N N
+0 0 7 -1 7 +0 7 -0 7 1 7 +0 7 -1 N N
+0 0 7 nan 7 +inf 7 -0 7 1 7 +0 7 -0 N N
+0 0 7 nan 7 +inf 7 -0 7 1 7 +0 7 +0 N N
+0 0 7 1 7 +0 7 -0 7 1 7 +0 7 1 N N
+0 0 7 -0.5 7 0.5 7 -0 7 1 7 1 7 -1 N N
+0 0 7 -0 7 1 7 -0 7 1 7 1 7 -0 N N
+0 0 7 +0 7 1 7 -0 7 1 7 1 7 +0 N N
+0 0 7 0.5 7 0.5 7 -0 7 1 7 1 7 1 N N
+0 0 7 0.5 7 0.5 7 +0 7 -1 7 -1 7 -1 N N
+0 0 7 +0 7 1 7 +0 7 -1 7 -1 7 -0 N N
+0 0 7 -0 7 1 7 +0 7 -1 7 -1 7 +0 N N
+0 0 7 -0.5 7 0.5 7 +0 7 -1 7 -1 7 1 N N
+0 0 7 1 7 +0 7 +0 7 -1 7 -0 7 -1 N N
+0 0 7 nan 7 +inf 7 +0 7 -1 7 -0 7 -0 N N
+0 0 7 nan 7 +inf 7 +0 7 -1 7 -0 7 +0 N N
+0 0 7 -1 7 +0 7 +0 7 -1 7 -0 7 1 N N
+0 0 7 1 7 +0 7 +0 7 -1 7 +0 7 -1 N N
+0 0 7 nan 7 -inf 7 +0 7 -1 7 +0 7 -0 N N
+0 0 7 nan 7 -inf 7 +0 7 -1 7 +0 7 +0 N N
+0 0 7 -1 7 -0 7 +0 7 -1 7 +0 7 1 N N
+0 0 7 0.5 7 -0.5 7 +0 7 -1 7 1 7 -1 N N
+0 0 7 +0 7 -1 7 +0 7 -1 7 1 7 -0 N N
+0 0 7 +0 7 -1 7 +0 7 -1 7 1 7 +0 N N
+0 0 7 -0.5 7 -0.5 7 +0 7 -1 7 1 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -1 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -1 7 -0 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -1 7 +0 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -1 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 -0 7 +0 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -0 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 +0 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +0 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 1 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 1 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 1 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 1 7 1 N N
+0 0 7 -0 7 +0 7 +0 7 +0 7 -1 7 -1 N N
+0 0 7 -0 7 +0 7 +0 7 +0 7 -1 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -1 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -1 7 1 N N
+0 0 7 -0 7 +0 7 +0 7 +0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 -0 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 +0 7 -0 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 +0 7 +0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +0 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 7 +0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 7 1 N N
+0 0 7 -0.5 7 -0.5 7 +0 7 1 7 -1 7 -1 N N
+0 0 7 -0 7 -1 7 +0 7 1 7 -1 7 -0 N N
+0 0 7 +0 7 -1 7 +0 7 1 7 -1 7 +0 N N
+0 0 7 0.5 7 -0.5 7 +0 7 1 7 -1 7 1 N N
+0 0 7 -1 7 +0 7 +0 7 1 7 -0 7 -1 N N
+0 0 7 nan 7 -inf 7 +0 7 1 7 -0 7 -0 N N
+0 0 7 nan 7 -inf 7 +0 7 1 7 -0 7 +0 N N
+0 0 7 1 7 -0 7 +0 7 1 7 -0 7 1 N N
+0 0 7 -1 7 +0 7 +0 7 1 7 +0 7 -1 N N
+0 0 7 nan 7 +inf 7 +0 7 1 7 +0 7 -0 N N
+0 0 7 nan 7 +inf 7 +0 7 1 7 +0 7 +0 N N
+0 0 7 1 7 +0 7 +0 7 1 7 +0 7 1 N N
+0 0 7 -0.5 7 0.5 7 +0 7 1 7 1 7 -1 N N
+0 0 7 +0 7 1 7 +0 7 1 7 1 7 -0 N N
+0 0 7 +0 7 1 7 +0 7 1 7 1 7 +0 N N
+0 0 7 0.5 7 0.5 7 +0 7 1 7 1 7 1 N N
+0 0 7 +0 7 1 7 1 7 -1 7 -1 7 -1 N N
+0 0 7 -1 7 1 7 1 7 -1 7 -1 7 -0 N N
+0 0 7 -1 7 1 7 1 7 -1 7 -1 7 +0 N N
+0 0 7 -1 7 +0 7 1 7 -1 7 -1 7 1 N N
+0 0 7 1 7 1 7 1 7 -1 7 -0 7 -1 N N
+0 0 7 -inf 7 +inf 7 1 7 -1 7 -0 7 -0 N N
+0 0 7 -inf 7 +inf 7 1 7 -1 7 -0 7 +0 N N
+0 0 7 -1 7 -1 7 1 7 -1 7 -0 7 1 N N
+0 0 7 1 7 1 7 1 7 -1 7 +0 7 -1 N N
+0 0 7 +inf 7 -inf 7 1 7 -1 7 +0 7 -0 N N
+0 0 7 +inf 7 -inf 7 1 7 -1 7 +0 7 +0 N N
+0 0 7 -1 7 -1 7 1 7 -1 7 +0 7 1 N N
+0 0 7 1 7 +0 7 1 7 -1 7 1 7 -1 N N
+0 0 7 1 7 -1 7 1 7 -1 7 1 7 -0 N N
+0 0 7 1 7 -1 7 1 7 -1 7 1 7 +0 N N
+0 0 7 +0 7 -1 7 1 7 -1 7 1 7 1 N N
+0 0 7 -0.5 7 0.5 7 1 7 -0 7 -1 7 -1 N N
+0 0 7 -1 7 +0 7 1 7 -0 7 -1 7 -0 N N
+0 0 7 -1 7 +0 7 1 7 -0 7 -1 7 +0 N N
+0 0 7 -0.5 7 -0.5 7 1 7 -0 7 -1 7 1 N N
+0 0 7 +0 7 1 7 1 7 -0 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 1 7 -0 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 1 7 -0 7 -0 7 +0 N N
+0 0 7 -0 7 -1 7 1 7 -0 7 -0 7 1 N N
+0 0 7 +0 7 1 7 1 7 -0 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 1 7 -0 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 1 7 -0 7 +0 7 +0 N N
+0 0 7 +0 7 -1 7 1 7 -0 7 +0 7 1 N N
+0 0 7 0.5 7 0.5 7 1 7 -0 7 1 7 -1 N N
+0 0 7 1 7 +0 7 1 7 -0 7 1 7 -0 N N
+0 0 7 1 7 -0 7 1 7 -0 7 1 7 +0 N N
+0 0 7 0.5 7 -0.5 7 1 7 -0 7 1 7 1 N N
+0 0 7 -0.5 7 0.5 7 1 7 +0 7 -1 7 -1 N N
+0 0 7 -1 7 +0 7 1 7 +0 7 -1 7 -0 N N
+0 0 7 -1 7 -0 7 1 7 +0 7 -1 7 +0 N N
+0 0 7 -0.5 7 -0.5 7 1 7 +0 7 -1 7 1 N N
+0 0 7 -0 7 1 7 1 7 +0 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 1 7 +0 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 1 7 +0 7 -0 7 +0 N N
+0 0 7 +0 7 -1 7 1 7 +0 7 -0 7 1 N N
+0 0 7 +0 7 1 7 1 7 +0 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 1 7 +0 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 1 7 +0 7 +0 7 +0 N N
+0 0 7 +0 7 -1 7 1 7 +0 7 +0 7 1 N N
+0 0 7 0.5 7 0.5 7 1 7 +0 7 1 7 -1 N N
+0 0 7 1 7 +0 7 1 7 +0 7 1 7 -0 N N
+0 0 7 1 7 +0 7 1 7 +0 7 1 7 +0 N N
+0 0 7 0.5 7 -0.5 7 1 7 +0 7 1 7 1 N N
+0 0 7 -1 7 +0 7 1 7 1 7 -1 7 -1 N N
+0 0 7 -1 7 -1 7 1 7 1 7 -1 7 -0 N N
+0 0 7 -1 7 -1 7 1 7 1 7 -1 7 +0 N N
+0 0 7 +0 7 -1 7 1 7 1 7 -1 7 1 N N
+0 0 7 -1 7 1 7 1 7 1 7 -0 7 -1 N N
+0 0 7 -inf 7 -inf 7 1 7 1 7 -0 7 -0 N N
+0 0 7 -inf 7 -inf 7 1 7 1 7 -0 7 +0 N N
+0 0 7 1 7 -1 7 1 7 1 7 -0 7 1 N N
+0 0 7 -1 7 1 7 1 7 1 7 +0 7 -1 N N
+0 0 7 +inf 7 +inf 7 1 7 1 7 +0 7 -0 N N
+0 0 7 +inf 7 +inf 7 1 7 1 7 +0 7 +0 N N
+0 0 7 1 7 -1 7 1 7 1 7 +0 7 1 N N
+0 0 7 +0 7 1 7 1 7 1 7 1 7 -1 N N
+0 0 7 1 7 1 7 1 7 1 7 1 7 -0 N N
+0 0 7 1 7 1 7 1 7 1 7 1 7 +0 N N
+0 0 7 1 7 +0 7 1 7 1 7 1 7 1 N N
+
+# small exact/inexact examples
+- - 10 0b1.01010001 10 -0b1.1000101@-6 10 973 10 964 10 725 10 745 N N
+0 0 10 -14 10 9 10 -837 10 637 10 63 10 -5 N N
+0 0 2 2 2 -1 2 4 2 3 2 1 2 2 N N
++ - 4 1.375 4 1.25 4 15 4 14 4 11 4 0 N N
+
+# Bug 20080923
++ + 4 0b11@527 4 -0b111@-489 4 -0b11@-206 4 0 4 -0b1@-733 4 -0b101@-1750 N Z
+
+# potential intermediate over- or underflow
+0 0 10 1 10 0 10 0 10 0b1@536870912 10 0 10 0b1@536870912 N N
+0 0 10 1 10 0 10 0b1@536870912 10 0 10 0b1@536870912 10 0 N N
+
+# overflow (reported by Emmanuel Thome)
+- + 250 -inf 250 +inf 250 1 250 0 250 -1e-164895850 250 -1e-164895850 N N
+
+# bug found by tgeneric of ui_div
++ + 2 0b1.1@256 2 0b1.1@-2758 34 52349199244 2 0 2 0b1.1@-221 2 -0b1@-3234 U N
+
+# cases that should yield 1, but cannot be handled due to intermediate
+# over- or underflows
+# current result: (@NaN@ 0)
+#0 0 10 1 10 0 10 1 10 0b1@536870912 10 1 10 0b1@536870912 N N
+# current result: (@Inf@ 0)
+#0 0 10 1 10 0 10 1 10 0b1@-536870913 10 1 10 0b1@-536870913 N N
+# current result: (@NaN@ 0)
+#0 0 10 1 10 0 10 0b1@536870912 10 0b1@536870912 10 0b1@536870912 10 0b1@536870912 N N
+# current result: (@NaN@ 0)
+#0 0 10 1 10 0 10 0b1@-536870913 10 0b1@-536870913 10 0b1@-536870913 10 0b1@-536870913 N N
+# current result: (@Inf@ 0)
+#0 0 10 1 10 0 10 0b1@536870912 10 0b1@-536870913 10 0b1@536870912 10 0b1@-536870913 N N
+# cases that should yield i, but cannot be handled due to intermediate
+# over- or underflows
+# current result: (0 @Inf@)
+#0 0 10 0 10 1 10 -0b1@536870912 10 1 10 1 10 0b1@536870912 N N
+# current result: (@NaN@ 1.0)
+#0 0 10 0 10 1 10 -0b1@-536870913 10 1 10 1 10 0b1@-536870913 N N
+# current result: (0 @Inf@)
+#0 0 10 0 10 1 10 -0b1@536870912 10 0b1@536870912 10 0b1@536870912 10 0b1@536870912 N N
+# current result: (@NaN@ 0)
+#0 0 10 0 10 1 10 -0b1@-536870913 10 0b1@-536870913 10 0b1@-536870913 10 0b1@-536870913 N N
+# current result: (@NaN@ @Inf@)
+#0 0 10 0 10 1 10 -0b1@-536870913 10 0b1@536870912 10 0b1@536870912 10 0b1@-536870913 N N
+
+# examples to exercise overflow (re)
+# positive overflow
++ 0 2 inf 2 0 10 0x3ffp1073741813 10 0x3ffp1073741813 10 0x2abp-10 10 0x2abp-10 N N
+# negative overflow
+- 0 2 -inf 2 0 10 -0x3ffp1073741813 10 -0x3ffp1073741813 10 0x2abp-10 10 0x2abp-10 N N
+# examples to exercise overflow (im)
+# positive overflow
+0 + 2 0 2 inf 10 0x3ffp1073741813 10 0x3ffp1073741813 10 0x2abp-10 10 -0x2abp-10 N N
+# negative overflow
+0 - 2 0 2 -inf 10 -0x3ffp1073741813 10 -0x3ffp1073741813 10 0x2abp-10 10 -0x2abp-10 N N
+
+# examples to exercise underflow
+# (1.5+i)*2^emin/(1-i) gives (0.25 + 1.25*i)*2^emin
+- - 2 0 2 0x1p-1073741823 2 0x3p-1073741824 2 0x1p-1073741823 2 1 2 -1 Z Z
+# (1.5+i)*2^emin/(1+i) gives (1.25 - 0.25*i)*2^emin
+- + 2 0x1p-1073741823 2 -0 2 0x3p-1073741824 2 0x1p-1073741823 2 1 2 1 Z Z
diff --git a/mpc/tests/div_fr.dat b/mpc/tests/div_fr.dat
new file mode 100644
index 0000000000..724d3611ef
--- /dev/null
+++ b/mpc/tests/div_fr.dat
@@ -0,0 +1,368 @@
+# Data file for mpc_div_fr.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see add_fr.dat.
+
+# special values
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf N N
+0 0 7 +inf 7 +inf 7 -inf 7 -inf 7 -1 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -inf 7 -0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 +0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 +0 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 1 7 -inf 7 -1 7 -1 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -1 7 -0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 -1 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 -0 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 +0 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 +0 7 -inf 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 -0 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 -0 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 -0 7 -inf 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 +0 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 -0 7 -inf 7 1 7 -inf N N
+0 0 7 +inf 7 -1 7 -inf 7 1 7 -1 N N
+0 0 7 +inf 7 -inf 7 -inf 7 1 7 -0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 1 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 +0 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 +inf 7 -1 N N
+0 0 7 +inf 7 -inf 7 -inf 7 +inf 7 -0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf N N
+0 0 7 +inf 7 nan 7 -inf 7 nan 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 nan 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 +0 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan N N
+0 0 7 +0 7 nan 7 -1 7 -inf 7 -inf N N
+0 0 7 1 7 +inf 7 -1 7 -inf 7 -1 N N
+0 0 7 +inf 7 +inf 7 -1 7 -inf 7 -0 N N
+0 0 7 -inf 7 -inf 7 -1 7 -inf 7 +0 N N
+0 0 7 -1 7 -inf 7 -1 7 -inf 7 1 N N
+0 0 7 -0 7 nan 7 -1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -inf N N
+0 0 7 -0 7 -0 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 nan N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -inf N N
+0 0 7 -0 7 -0 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 +0 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 1 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 nan N N
+0 0 7 +0 7 nan 7 -1 7 +inf 7 -inf N N
+0 0 7 1 7 -inf 7 -1 7 +inf 7 -1 N N
+0 0 7 +inf 7 -inf 7 -1 7 +inf 7 -0 N N
+0 0 7 -inf 7 +inf 7 -1 7 +inf 7 +0 N N
+0 0 7 -1 7 +inf 7 -1 7 +inf 7 1 N N
+0 0 7 -0 7 nan 7 -1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan N N
+0 0 7 +0 7 nan 7 -1 7 nan 7 -inf N N
+0 0 7 1 7 nan 7 -1 7 nan 7 -1 N N
+0 0 7 +inf 7 nan 7 -1 7 nan 7 -0 N N
+0 0 7 -inf 7 nan 7 -1 7 nan 7 +0 N N
+0 0 7 -1 7 nan 7 -1 7 nan 7 1 N N
+0 0 7 -0 7 nan 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan N N
+0 0 7 +0 7 nan 7 -0 7 -inf 7 -inf N N
+0 0 7 +0 7 +inf 7 -0 7 -inf 7 -1 N N
+0 0 7 nan 7 +inf 7 -0 7 -inf 7 -0 N N
+0 0 7 nan 7 -inf 7 -0 7 -inf 7 +0 N N
+0 0 7 -0 7 -inf 7 -0 7 -inf 7 1 N N
+0 0 7 -0 7 nan 7 -0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -inf N N
+0 0 7 -0 7 -0 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 nan N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -inf N N
+0 0 7 -0 7 -0 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 1 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 nan N N
+0 0 7 +0 7 nan 7 -0 7 +inf 7 -inf N N
+0 0 7 +0 7 -inf 7 -0 7 +inf 7 -1 N N
+0 0 7 nan 7 -inf 7 -0 7 +inf 7 -0 N N
+0 0 7 nan 7 +inf 7 -0 7 +inf 7 +0 N N
+0 0 7 -0 7 +inf 7 -0 7 +inf 7 1 N N
+0 0 7 -0 7 nan 7 -0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan N N
+0 0 7 +0 7 nan 7 -0 7 nan 7 -inf N N
+0 0 7 +0 7 nan 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 N N
+0 0 7 -0 7 nan 7 -0 7 nan 7 1 N N
+0 0 7 -0 7 nan 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan N N
+0 0 7 -0 7 nan 7 +0 7 -inf 7 -inf N N
+0 0 7 -0 7 +inf 7 +0 7 -inf 7 -1 N N
+0 0 7 nan 7 +inf 7 +0 7 -inf 7 -0 N N
+0 0 7 nan 7 -inf 7 +0 7 -inf 7 +0 N N
+0 0 7 +0 7 -inf 7 +0 7 -inf 7 1 N N
+0 0 7 +0 7 nan 7 +0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 nan N N
+0 0 7 -0 7 -0 7 +0 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 nan N N
+0 0 7 -0 7 -0 7 +0 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 nan N N
+0 0 7 -0 7 nan 7 +0 7 +inf 7 -inf N N
+0 0 7 -0 7 -inf 7 +0 7 +inf 7 -1 N N
+0 0 7 nan 7 -inf 7 +0 7 +inf 7 -0 N N
+0 0 7 nan 7 +inf 7 +0 7 +inf 7 +0 N N
+0 0 7 +0 7 +inf 7 +0 7 +inf 7 1 N N
+0 0 7 +0 7 nan 7 +0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan N N
+0 0 7 -0 7 nan 7 +0 7 nan 7 -inf N N
+0 0 7 -0 7 nan 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 N N
+0 0 7 +0 7 nan 7 +0 7 nan 7 1 N N
+0 0 7 +0 7 nan 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan N N
+0 0 7 -0 7 nan 7 1 7 -inf 7 -inf N N
+0 0 7 -1 7 +inf 7 1 7 -inf 7 -1 N N
+0 0 7 -inf 7 +inf 7 1 7 -inf 7 -0 N N
+0 0 7 +inf 7 -inf 7 1 7 -inf 7 +0 N N
+0 0 7 1 7 -inf 7 1 7 -inf 7 1 N N
+0 0 7 +0 7 nan 7 1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 nan N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 nan N N
+0 0 7 -0 7 -0 7 1 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 nan N N
+0 0 7 -0 7 -0 7 1 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 nan N N
+0 0 7 -0 7 nan 7 1 7 +inf 7 -inf N N
+0 0 7 -1 7 -inf 7 1 7 +inf 7 -1 N N
+0 0 7 -inf 7 -inf 7 1 7 +inf 7 -0 N N
+0 0 7 +inf 7 +inf 7 1 7 +inf 7 +0 N N
+0 0 7 1 7 +inf 7 1 7 +inf 7 1 N N
+0 0 7 +0 7 nan 7 1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan N N
+0 0 7 -0 7 nan 7 1 7 nan 7 -inf N N
+0 0 7 -1 7 nan 7 1 7 nan 7 -1 N N
+0 0 7 -inf 7 nan 7 1 7 nan 7 -0 N N
+0 0 7 +inf 7 nan 7 1 7 nan 7 +0 N N
+0 0 7 1 7 nan 7 1 7 nan 7 1 N N
+0 0 7 +0 7 nan 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 -inf 7 -1 N N
+0 0 7 -inf 7 +inf 7 +inf 7 -inf 7 -0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 +0 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 1 7 +inf 7 -1 7 -1 N N
+0 0 7 -inf 7 +inf 7 +inf 7 -1 7 -0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -1 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 -0 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 +0 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 +0 7 +inf 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 -0 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 -0 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 -0 7 +inf 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 +0 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 -0 7 +inf 7 1 7 -inf N N
+0 0 7 -inf 7 -1 7 +inf 7 1 7 -1 N N
+0 0 7 -inf 7 -inf 7 +inf 7 1 7 -0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 1 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 +0 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf N N
+0 0 7 -inf 7 -inf 7 +inf 7 +inf 7 -1 N N
+0 0 7 -inf 7 -inf 7 +inf 7 +inf 7 -0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 +0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf N N
+0 0 7 -inf 7 nan 7 +inf 7 nan 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 nan 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 +0 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 +0 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 -0 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 +0 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 +0 7 nan 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 -0 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 -0 7 nan 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 -0 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 -1 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 1 7 nan 7 1 7 1 N N
+0 0 7 nan 7 +0 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan N N
+
+# values with only 1, -1, +0, -0
+0 0 7 1 7 1 7 -1 7 -1 7 -1 N N
+0 0 7 +inf 7 +inf 7 -1 7 -1 7 -0 N N
+0 0 7 -inf 7 -inf 7 -1 7 -1 7 +0 N N
+0 0 7 -1 7 -1 7 -1 7 -1 7 1 N N
+0 0 7 1 7 +0 7 -1 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -1 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 -1 7 -0 7 +0 N N
+0 0 7 -1 7 -0 7 -1 7 -0 7 1 N N
+0 0 7 1 7 -0 7 -1 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 -1 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -1 7 +0 7 +0 N N
+0 0 7 -1 7 +0 7 -1 7 +0 7 1 N N
+0 0 7 1 7 -1 7 -1 7 1 7 -1 N N
+0 0 7 +inf 7 -inf 7 -1 7 1 7 -0 N N
+0 0 7 -inf 7 +inf 7 -1 7 1 7 +0 N N
+0 0 7 -1 7 1 7 -1 7 1 7 1 N N
+0 0 7 +0 7 1 7 -0 7 -1 7 -1 N N
+0 0 7 nan 7 +inf 7 -0 7 -1 7 -0 N N
+0 0 7 nan 7 -inf 7 -0 7 -1 7 +0 N N
+0 0 7 -0 7 -1 7 -0 7 -1 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 +0 N N
+0 0 7 -0 7 -0 7 -0 7 -0 7 1 N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 +0 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 1 N N
+0 0 7 +0 7 -1 7 -0 7 1 7 -1 N N
+0 0 7 nan 7 -inf 7 -0 7 1 7 -0 N N
+0 0 7 nan 7 +inf 7 -0 7 1 7 +0 N N
+0 0 7 -0 7 1 7 -0 7 1 7 1 N N
+0 0 7 -0 7 1 7 +0 7 -1 7 -1 N N
+0 0 7 nan 7 +inf 7 +0 7 -1 7 -0 N N
+0 0 7 nan 7 -inf 7 +0 7 -1 7 +0 N N
+0 0 7 +0 7 -1 7 +0 7 -1 7 1 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 1 N N
+0 0 7 -0 7 -0 7 +0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 +0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 N N
+0 0 7 -0 7 -1 7 +0 7 1 7 -1 N N
+0 0 7 nan 7 -inf 7 +0 7 1 7 -0 N N
+0 0 7 nan 7 +inf 7 +0 7 1 7 +0 N N
+0 0 7 +0 7 1 7 +0 7 1 7 1 N N
+0 0 7 -1 7 1 7 1 7 -1 7 -1 N N
+0 0 7 -inf 7 +inf 7 1 7 -1 7 -0 N N
+0 0 7 +inf 7 -inf 7 1 7 -1 7 +0 N N
+0 0 7 1 7 -1 7 1 7 -1 7 1 N N
+0 0 7 -1 7 +0 7 1 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 1 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 1 7 -0 7 +0 N N
+0 0 7 1 7 -0 7 1 7 -0 7 1 N N
+0 0 7 -1 7 -0 7 1 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 1 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 1 7 +0 7 +0 N N
+0 0 7 1 7 +0 7 1 7 +0 7 1 N N
+0 0 7 -1 7 -1 7 1 7 1 7 -1 N N
+0 0 7 -inf 7 -inf 7 1 7 1 7 -0 N N
+0 0 7 +inf 7 +inf 7 1 7 1 7 +0 N N
+0 0 7 1 7 1 7 1 7 1 7 1 N N
+
diff --git a/mpc/tests/exp.dat b/mpc/tests/exp.dat
new file mode 100644
index 0000000000..04ed7636d8
--- /dev/null
+++ b/mpc/tests/exp.dat
@@ -0,0 +1,118 @@
+# Data file for mpc_exp.
+#
+# Copyright (C) 2008, 2010 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM 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)
+0 0 53 0 53 0 53 -inf 53 -inf N N
+0 0 53 +0 53 +0 53 -inf 53 -6 N N
+0 0 53 -0 53 +0 53 -inf 53 -4 N N
+0 0 53 -0 53 -0 53 -inf 53 -2 N N
+0 0 53 +0 53 -0 53 -inf 53 -1 N N
+0 0 53 +0 53 -0 53 -inf 53 -0 N N
+0 0 53 +0 53 +0 53 -inf 53 +0 N N
+0 0 53 +0 53 +0 53 -inf 53 +1 N N
+0 0 53 -0 53 +0 53 -inf 53 +2 N N
+0 0 53 -0 53 -0 53 -inf 53 +4 N N
+0 0 53 +0 53 -0 53 -inf 53 +6 N N
+0 0 53 0 53 0 53 -inf 53 +inf N N
+0 0 53 0 53 0 53 -inf 53 nan N N
+0 0 53 nan 53 nan 53 -1 53 -inf N N
+0 0 53 nan 53 nan 53 -1 53 +inf N N
+0 0 53 nan 53 nan 53 -1 53 nan N N
+0 0 53 nan 53 nan 53 -0 53 -inf N N
+0 0 53 +1 53 -0 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 -0 53 +0 N N
+0 0 53 nan 53 nan 53 -0 53 +inf N N
+0 0 53 nan 53 nan 53 -0 53 nan N N
+0 0 53 nan 53 nan 53 +0 53 -inf N N
+0 0 53 +1 53 -0 53 +0 53 -0 N N
+0 0 53 +1 53 +0 53 +0 53 +0 N N
+0 0 53 nan 53 nan 53 +0 53 +inf N N
+0 0 53 nan 53 nan 53 +0 53 nan N N
+0 0 53 nan 53 nan 53 +1 53 -inf N N
+0 0 53 nan 53 nan 53 +1 53 +inf N N
+0 0 53 nan 53 nan 53 +1 53 nan N N
+0 0 53 inf 53 nan 53 +inf 53 -inf N N
+0 0 53 +inf 53 +inf 53 +inf 53 -6 N N
+0 0 53 -inf 53 +inf 53 +inf 53 -4 N N
+0 0 53 -inf 53 -inf 53 +inf 53 -2 N N
+0 0 53 +inf 53 -inf 53 +inf 53 -1 N N
+0 0 53 +inf 53 -0 53 +inf 53 -0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +0 N N
+0 0 53 +inf 53 +inf 53 +inf 53 +1 N N
+0 0 53 -inf 53 +inf 53 +inf 53 +2 N N
+0 0 53 -inf 53 -inf 53 +inf 53 +4 N N
+0 0 53 +inf 53 -inf 53 +inf 53 +6 N N
+0 0 53 inf 53 nan 53 +inf 53 +inf N N
+0 0 53 inf 53 nan 53 +inf 53 nan N N
+0 0 53 nan 53 nan 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 -0 53 nan 53 -0 N N
+0 0 53 nan 53 +0 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# purely real argument
+- 0 53 0x1936dc5690c08fp-44 2 +0 53 6 17 +0 N N
+- 0 53 0x4b0556e084f3d0p-60 3 +0 54 -4 16 +0 Z N
++ 0 53 0xec7325c6a6ed70p-53 4 -0 55 2 15 -0 U N
+- 0 53 0x178b56362cef37p-54 5 -0 56 -1 14 -0 D N
+- 0 53 0x3699205c4e74b0p-48 6 +0 57 4 13 +0 Z Z
++ 0 53 0x454aaa8efe0730p-57 7 +0 58 -2 12 +0 U Z
+- 0 53 0x15bf0a8b145769p-51 8 -0 59 1 11 -0 D Z
++ 0 53 0xa2728f889ea6b0p-64 9 -0 60 -6 10 -0 N Z
++ 0 53 0xec7325c6a6ed70p-53 10 +0 61 2 9 +0 U U
+- 0 53 0x178b56362cef37p-54 11 +0 62 -1 8 +0 D U
+- 0 53 0x1936dc5690c08fp-44 12 -0 63 6 7 -0 N U
+- 0 53 0x4b0556e084f3d0p-60 13 -0 64 -4 6 -0 Z U
+- 0 53 0x15bf0a8b145769p-51 14 +0 65 1 5 +0 D D
++ 0 53 0xa2728f889ea6b0p-64 15 +0 66 -6 4 +0 N D
+- 0 53 0x3699205c4e74b0p-48 16 -0 67 4 3 -0 Z D
++ 0 53 0x454aaa8efe0730p-57 17 -0 68 -2 2 -0 U D
+
+# purely imaginary argument
+- + 53 0x1eb9b7097822f5p-53 53 -0x4787c62ac28b0p-52 53 +0 53 6 N N
++ + 53 -0x53aa981b6c9300p-55 53 -0xc1bdceeee0f57p-52 51 -0 54 4 Z N
++ - 53 -0x6a88995d4dc810p-56 53 -0xe8c7b7568da23p-52 49 +0 55 -2 U N
+- + 53 0x114a280fb5068bp-53 53 -0xd76aa47848677p-52 47 -0 56 -1 D N
++ + 53 -0x53aa981b6c9300p-55 53 -0xc1bdceeee0f57p-52 45 +0 57 4 Z Z
++ - 53 -0x6a88995d4dc810p-56 53 0x1d18f6ead1b445p-53 43 -0 58 2 U Z
+- + 53 0x114a280fb5068bp-53 53 -0xd76aa47848677p-52 41 +0 59 -1 D Z
+- - 53 0x1eb9b7097822f5p-53 53 0x4787c62ac28b0p-52 39 -0 60 -6 N Z
++ + 53 -0x6a88995d4dc810p-56 53 0xe8c7b7568da23p-52 37 +0 61 2 U U
+- + 53 0x114a280fb5068bp-53 53 0x1aed548f090cefp-53 35 -0 62 1 D U
+- + 53 0x1eb9b7097822f5p-53 53 0x11e1f18ab0a2c1p-54 33 +0 63 -6 N U
++ + 53 -0x53aa981b6c9300p-55 53 0x1837b9dddc1eafp-53 31 -0 64 -4 Z U
+- - 53 0x114a280fb5068bp-53 53 0xd76aa47848677p-52 29 +0 65 1 D D
+- - 53 0x1eb9b7097822f5p-53 53 -0x11e1f18ab0a2c1p-54 27 -0 66 6 N D
++ - 53 -0x53aa981b6c9300p-55 53 0xc1bdceeee0f57p-52 25 +0 67 -4 Z D
++ - 53 -0x6a88995d4dc810p-56 53 -0xe8c7b7568da23p-52 23 -0 68 -2 U D
+
+# overflow
+- - 2 -inf 2 -inf 53 0x3312ae437f94441ec@-9 53 0xe45f7bab0595dd700@-10 N N
+
+# input close to 0
+? ? 53 1 53 0x5D7A2148071Fp-7213522 53 0x1E02AE0D0F6Fp-7213521 53 0x5D7A2148071Fp-7213522 N N
diff --git a/mpc/tests/fma.dat b/mpc/tests/fma.dat
new file mode 100644
index 0000000000..6d0f682139
--- /dev/null
+++ b/mpc/tests/fma.dat
@@ -0,0 +1,32 @@
+# Data file for mpc_exp.
+#
+# Copyright (C) 2008, 2010, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP1_RE OP1_RE PREC_OP1_IM OP1_IM PREC_OP2_RE OP2_RE PREC_OP2_IM OP2_IM PREC_OP3_RE OP3_RE PREC_OP3_IM OP3_IM RND_RE RND_IM
+#
+# see sin.dat for precisions
+
++ - 53 -0x189281b52abc03p-55 53 0x178a1d3cd134e5p-49 53 0x16A09E667F3BCDp-52 53 0x9CC470A049097p-50 53 0x23C6EF372FE95p-48 53 0x9CC470A049097p-50 53 0xA953FD4E97C75p-50 53 0x16A09E667F3BCDp-51 N N
++ + 53 -0x178a1d3cd134e5p-49 53 -0x189281b52abc03p-55 53 -0x9CC470A049097p-50 53 0x16A09E667F3BCDp-52 53 0x23C6EF372FE95p-48 53 0x9CC470A049097p-50 53 -0x16A09E667F3BCDp-51 53 0xA953FD4E97C75p-50 N N
++ + 53 -0x178a1d3cd134e5p-49 53 -0x189281b52abc03p-55 53 -0x9CC470A049097p-50 53 0x16A09E667F3BCDp-52 53 0x23C6EF372FE95p-48 53 0x9CC470A049097p-50 53 -0x16A09E667F3BCDp-51 53 0xA953FD4E97C75p-50 U U
+0 0 10 0 10 0 10 7 10 5 10 3 10 -12 10 -81 10 69 N N
+0 0 10 0 10 0 10 7 10 5 10 3 10 -12 10 -81 10 69 Z D
+0 0 2 1 2 1 7 99 7 98 7 97 7 96 7 -194 15 -19009 N N
diff --git a/mpc/tests/fr_div.dat b/mpc/tests/fr_div.dat
new file mode 100644
index 0000000000..cb9a5a90da
--- /dev/null
+++ b/mpc/tests/fr_div.dat
@@ -0,0 +1,381 @@
+# Data file for mpc_fr_div.
+#
+# Copyright (C) 2008, 2009 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see add.dat, and take into
+# account the necessary modifications for one real argument.
+
+# special values
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 -1 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 -1 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 -1 7 +0 N N
+0 0 7 +inf 7 +inf 7 -inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -inf 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 -inf 7 -0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 -inf N N
+0 0 7 nan 7 -inf 7 -inf 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 +0 N N
+0 0 7 nan 7 +inf 7 -inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 1 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 1 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -inf 7 -inf N N
+0 0 7 +0 7 -0 7 -1 7 -inf 7 -1 N N
+0 0 7 +0 7 -0 7 -1 7 -inf 7 -0 N N
+0 0 7 +0 7 +0 7 -1 7 -inf 7 +0 N N
+0 0 7 +0 7 +0 7 -1 7 -inf 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 -inf 7 +inf N N
+0 0 7 +0 7 +0 7 -1 7 -inf 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -1 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 nan N N
+0 0 7 +0 7 -0 7 -1 7 -0 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 +inf 7 -inf N N
+0 0 7 -0 7 +0 7 -1 7 +inf 7 -1 N N
+0 0 7 -0 7 +0 7 -1 7 +inf 7 -0 N N
+0 0 7 -0 7 +0 7 -1 7 +inf 7 +0 N N
+0 0 7 -0 7 +0 7 -1 7 +inf 7 1 N N
+0 0 7 -0 7 +0 7 -1 7 +inf 7 +inf N N
+0 0 7 -0 7 +0 7 -1 7 +inf 7 nan N N
+0 0 7 -0 7 -0 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -inf 7 -inf N N
+0 0 7 +0 7 -0 7 -0 7 -inf 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 -inf 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 -inf 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 -inf 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 -inf 7 +inf N N
+0 0 7 +0 7 +0 7 -0 7 -inf 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -1 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 nan N N
+0 0 7 +0 7 -0 7 -0 7 -0 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 +inf 7 -inf N N
+0 0 7 -0 7 +0 7 -0 7 +inf 7 -1 N N
+0 0 7 -0 7 +0 7 -0 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 -0 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 +inf 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 -0 7 +inf 7 nan N N
+0 0 7 -0 7 +0 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 -inf 7 -inf N N
+0 0 7 -0 7 +0 7 +0 7 -inf 7 -1 N N
+0 0 7 -0 7 +0 7 +0 7 -inf 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 -inf 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 -inf 7 1 N N
+0 0 7 +0 7 -0 7 +0 7 -inf 7 +inf N N
+0 0 7 +0 7 -0 7 +0 7 -inf 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 nan N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 1 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 +inf 7 -inf N N
+0 0 7 +0 7 +0 7 +0 7 +inf 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 +0 7 +inf 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 +0 7 +inf 7 nan N N
+0 0 7 +0 7 +0 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 1 N N
+0 0 7 +0 7 +0 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan N N
+0 0 7 -0 7 +0 7 1 7 -inf 7 -inf N N
+0 0 7 -0 7 +0 7 1 7 -inf 7 -1 N N
+0 0 7 -0 7 +0 7 1 7 -inf 7 -0 N N
+0 0 7 -0 7 -0 7 1 7 -inf 7 +0 N N
+0 0 7 -0 7 -0 7 1 7 -inf 7 1 N N
+0 0 7 -0 7 -0 7 1 7 -inf 7 +inf N N
+0 0 7 -0 7 -0 7 1 7 -inf 7 nan N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 nan N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 nan N N
+0 0 7 +0 7 +0 7 1 7 +0 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 nan N N
+0 0 7 +0 7 +0 7 1 7 1 7 -inf N N
+0 0 7 +0 7 -0 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 nan N N
+0 0 7 +0 7 +0 7 1 7 +inf 7 -inf N N
+0 0 7 +0 7 +0 7 1 7 +inf 7 -1 N N
+0 0 7 +0 7 +0 7 1 7 +inf 7 -0 N N
+0 0 7 +0 7 +0 7 1 7 +inf 7 +0 N N
+0 0 7 +0 7 +0 7 1 7 +inf 7 1 N N
+0 0 7 +0 7 -0 7 1 7 +inf 7 +inf N N
+0 0 7 +0 7 +0 7 1 7 +inf 7 nan N N
+0 0 7 +0 7 +0 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 1 7 nan 7 1 N N
+0 0 7 +0 7 -0 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 -1 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 -1 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 -1 7 +0 N N
+0 0 7 -inf 7 -inf 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 +inf 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 +inf 7 -0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 -inf N N
+0 0 7 nan 7 +inf 7 +inf 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 +0 N N
+0 0 7 nan 7 -inf 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 1 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 1 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan N N
+
+# finite values
+0 0 7 0.5 7 -0.5 7 -1 7 -1 7 -1 N N
+0 0 7 1 7 -0 7 -1 7 -1 7 -0 N N
+# cf line 2206 of div.dat, revision 658:
+0 0 7 1 7 +0 7 -1 7 -1 7 +0 N N
+0 0 7 0.5 7 0.5 7 -1 7 -1 7 1 N N
+# cf line 2208 of div.dat, revision 658:
+0 0 7 +0 7 -1 7 -1 7 -0 7 -1 N N
+0 0 7 +inf 7 nan 7 -1 7 -0 7 -0 N N
+0 0 7 +inf 7 nan 7 -1 7 -0 7 +0 N N
+0 0 7 +0 7 1 7 -1 7 -0 7 1 N N
+0 0 7 -0 7 -1 7 -1 7 +0 7 -1 N N
+0 0 7 -inf 7 nan 7 -1 7 +0 7 -0 N N
+0 0 7 -inf 7 nan 7 -1 7 +0 7 +0 N N
+0 0 7 +0 7 1 7 -1 7 +0 7 1 N N
+0 0 7 -0.5 7 -0.5 7 -1 7 1 7 -1 N N
+0 0 7 -1 7 +0 7 -1 7 1 7 -0 N N
+0 0 7 -1 7 +0 7 -1 7 1 7 +0 N N
+0 0 7 -0.5 7 0.5 7 -1 7 1 7 1 N N
+0 0 7 0 7 -0 7 -0 7 -1 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 -1 7 -0 N N
+# cf line 2270 of div.dat, revision 658:
+0 0 7 +0 7 +0 7 -0 7 -1 7 +0 N N
+0 0 7 +0 7 0 7 -0 7 -1 7 1 N N
+# cf line 2272 of div.dat, revision 658:
+0 0 7 +0 7 -0 7 -0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 1 N N
+# cf line 2276 of div.dat, revision 658:
+0 0 7 -0 7 +0 7 -0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 +0 N N
+0 0 7 +0 7 +0 7 -0 7 +0 7 1 N N
+0 0 7 -0 7 0 7 -0 7 1 7 -1 N N
+0 0 7 -0 7 +0 7 -0 7 1 7 -0 N N
+# cf line 2282 of div.dat, revision 658:
+0 0 7 +0 7 +0 7 -0 7 1 7 +0 N N
+0 0 7 0 7 +0 7 -0 7 1 7 1 N N
+0 0 7 -0 7 0 7 +0 7 -1 7 -1 N N
+# cf line 2333 of div.dat, revision 658:
+0 0 7 -0 7 +0 7 +0 7 -1 7 -0 N N
+# cf line 2334 of div.dat, revision 658:
+0 0 7 +0 7 -0 7 +0 7 -1 7 +0 N N
+0 0 7 0 7 -0 7 +0 7 -1 7 1 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 1 N N
+# cf line 2340 of div.dat, revision 658:
+0 0 7 +0 7 +0 7 +0 7 +0 7 -1 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 -0 N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 +0 N N
+# cf line 2343 of div.dat, revision 658:
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 N N
+0 0 7 0 7 +0 7 +0 7 1 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 1 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +0 N N
+0 0 7 +0 7 0 7 +0 7 1 7 1 N N
+0 0 7 -0.5 7 0.5 7 1 7 -1 7 -1 N N
+# cf line 2397 of div.dat, revision 658:
+0 0 7 -1 7 +0 7 1 7 -1 7 -0 N N
+0 0 7 -1 7 -0 7 1 7 -1 7 +0 N N
+0 0 7 -0.5 7 -0.5 7 1 7 -1 7 1 N N
+0 0 7 -0 7 1 7 1 7 -0 7 -1 N N
+0 0 7 -inf 7 nan 7 1 7 -0 7 -0 N N
+0 0 7 -inf 7 nan 7 1 7 -0 7 +0 N N
+0 0 7 +0 7 -1 7 1 7 -0 7 1 N N
+# cf line 2404 of div.dat, revision 658:
+0 0 7 +0 7 1 7 1 7 +0 7 -1 N N
+0 0 7 +inf 7 nan 7 1 7 +0 7 -0 N N
+0 0 7 +inf 7 nan 7 1 7 +0 7 +0 N N
+0 0 7 +0 7 -1 7 1 7 +0 7 1 N N
+0 0 7 0.5 7 0.5 7 1 7 1 7 -1 N N
+0 0 7 1 7 +0 7 1 7 1 7 -0 N N
+0 0 7 1 7 +0 7 1 7 1 7 +0 N N
+0 0 7 0.5 7 -0.5 7 1 7 1 7 1 N N
+
diff --git a/mpc/tests/fr_sub.dat b/mpc/tests/fr_sub.dat
new file mode 100644
index 0000000000..460e07d8da
--- /dev/null
+++ b/mpc/tests/fr_sub.dat
@@ -0,0 +1,373 @@
+# Data file for mpc_fr_sub.
+#
+# Copyright (C) 2008, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see add_fr.dat.
+
+# special values
+0 0 7 nan 7 +inf 7 -inf 7 -inf 7 -inf N N
+0 0 7 nan 7 1 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 +0 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 -0 7 -inf 7 -inf 7 +0 N N
+0 0 7 nan 7 -1 7 -inf 7 -inf 7 1 N N
+0 0 7 nan 7 -inf 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan N N
+0 0 7 -inf 7 +inf 7 -inf 7 -1 7 -inf N N
+0 0 7 -inf 7 1 7 -inf 7 -1 7 -1 N N
+0 0 7 -inf 7 +0 7 -inf 7 -1 7 -0 N N
+0 0 7 -inf 7 -0 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 -1 7 -inf 7 -1 7 1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -1 7 +inf N N
+0 0 7 -inf 7 nan 7 -inf 7 -1 7 nan N N
+0 0 7 -inf 7 +inf 7 -inf 7 -0 7 -inf N N
+0 0 7 -inf 7 1 7 -inf 7 -0 7 -1 N N
+0 0 7 -inf 7 +0 7 -inf 7 -0 7 -0 N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 -1 7 -inf 7 -0 7 1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -0 7 +inf N N
+0 0 7 -inf 7 nan 7 -inf 7 -0 7 nan N N
+0 0 7 -inf 7 +inf 7 -inf 7 +0 7 -inf N N
+0 0 7 -inf 7 1 7 -inf 7 +0 7 -1 N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 7 -0 N N
+0 0 7 -inf 7 -0 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 -1 7 -inf 7 +0 7 1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 +0 7 +inf N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 nan N N
+0 0 7 -inf 7 +inf 7 -inf 7 1 7 -inf N N
+0 0 7 -inf 7 1 7 -inf 7 1 7 -1 N N
+0 0 7 -inf 7 +0 7 -inf 7 1 7 -0 N N
+0 0 7 -inf 7 -0 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 -1 7 -inf 7 1 7 1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 1 7 +inf N N
+0 0 7 -inf 7 nan 7 -inf 7 1 7 nan N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 -inf N N
+0 0 7 -inf 7 1 7 -inf 7 +inf 7 -1 N N
+0 0 7 -inf 7 +0 7 -inf 7 +inf 7 -0 N N
+0 0 7 -inf 7 -0 7 -inf 7 +inf 7 +0 N N
+0 0 7 -inf 7 -1 7 -inf 7 +inf 7 1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 +inf 7 +inf N N
+0 0 7 -inf 7 nan 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 +inf 7 -inf 7 nan 7 -inf N N
+0 0 7 nan 7 1 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 +0 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 -0 7 -inf 7 nan 7 +0 N N
+0 0 7 nan 7 -1 7 -inf 7 nan 7 1 N N
+0 0 7 nan 7 -inf 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan N N
+0 0 7 +inf 7 +inf 7 -1 7 -inf 7 -inf N N
+0 0 7 +inf 7 1 7 -1 7 -inf 7 -1 N N
+0 0 7 +inf 7 +0 7 -1 7 -inf 7 -0 N N
+0 0 7 +inf 7 -0 7 -1 7 -inf 7 +0 N N
+0 0 7 +inf 7 -1 7 -1 7 -inf 7 1 N N
+0 0 7 +inf 7 -inf 7 -1 7 -inf 7 +inf N N
+0 0 7 +inf 7 nan 7 -1 7 -inf 7 nan N N
+0 0 7 0 7 +inf 7 -1 7 -1 7 -inf N N
+0 0 7 0 7 -inf 7 -1 7 -1 7 +inf N N
+0 0 7 0 7 nan 7 -1 7 -1 7 nan N N
+0 0 7 -1 7 +inf 7 -1 7 -0 7 -inf N N
+0 0 7 -1 7 -inf 7 -1 7 -0 7 +inf N N
+0 0 7 -1 7 nan 7 -1 7 -0 7 nan N N
+0 0 7 -1 7 +inf 7 -1 7 +0 7 -inf N N
+0 0 7 -1 7 -inf 7 -1 7 +0 7 +inf N N
+0 0 7 -1 7 nan 7 -1 7 +0 7 nan N N
+0 0 7 -2 7 +inf 7 -1 7 1 7 -inf N N
+0 0 7 -2 7 -inf 7 -1 7 1 7 +inf N N
+0 0 7 -2 7 nan 7 -1 7 1 7 nan N N
+0 0 7 -inf 7 +inf 7 -1 7 +inf 7 -inf N N
+0 0 7 -inf 7 1 7 -1 7 +inf 7 -1 N N
+0 0 7 -inf 7 +0 7 -1 7 +inf 7 -0 N N
+0 0 7 -inf 7 -0 7 -1 7 +inf 7 +0 N N
+0 0 7 -inf 7 -1 7 -1 7 +inf 7 1 N N
+0 0 7 -inf 7 -inf 7 -1 7 +inf 7 +inf N N
+0 0 7 -inf 7 nan 7 -1 7 +inf 7 nan N N
+0 0 7 nan 7 +inf 7 -1 7 nan 7 -inf N N
+0 0 7 nan 7 1 7 -1 7 nan 7 -1 N N
+0 0 7 nan 7 +0 7 -1 7 nan 7 -0 N N
+0 0 7 nan 7 -0 7 -1 7 nan 7 +0 N N
+0 0 7 nan 7 -1 7 -1 7 nan 7 1 N N
+0 0 7 nan 7 -inf 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan N N
+0 0 7 +inf 7 +inf 7 -0 7 -inf 7 -inf N N
+0 0 7 +inf 7 1 7 -0 7 -inf 7 -1 N N
+0 0 7 +inf 7 +0 7 -0 7 -inf 7 -0 N N
+0 0 7 +inf 7 -0 7 -0 7 -inf 7 +0 N N
+0 0 7 +inf 7 -1 7 -0 7 -inf 7 1 N N
+0 0 7 +inf 7 -inf 7 -0 7 -inf 7 +inf N N
+0 0 7 +inf 7 nan 7 -0 7 -inf 7 nan N N
+0 0 7 1 7 +inf 7 -0 7 -1 7 -inf N N
+0 0 7 1 7 -inf 7 -0 7 -1 7 +inf N N
+0 0 7 1 7 nan 7 -0 7 -1 7 nan N N
+0 0 7 0 7 +inf 7 -0 7 -0 7 -inf N N
+0 0 7 0 7 -inf 7 -0 7 -0 7 +inf N N
+0 0 7 0 7 nan 7 -0 7 -0 7 nan N N
+0 0 7 -0 7 +inf 7 -0 7 +0 7 -inf N N
+0 0 7 -0 7 -inf 7 -0 7 +0 7 +inf N N
+0 0 7 -0 7 nan 7 -0 7 +0 7 nan N N
+0 0 7 -1 7 +inf 7 -0 7 1 7 -inf N N
+0 0 7 -1 7 -inf 7 -0 7 1 7 +inf N N
+0 0 7 -1 7 nan 7 -0 7 1 7 nan N N
+0 0 7 -inf 7 +inf 7 -0 7 +inf 7 -inf N N
+0 0 7 -inf 7 1 7 -0 7 +inf 7 -1 N N
+0 0 7 -inf 7 +0 7 -0 7 +inf 7 -0 N N
+0 0 7 -inf 7 -0 7 -0 7 +inf 7 +0 N N
+0 0 7 -inf 7 -1 7 -0 7 +inf 7 1 N N
+0 0 7 -inf 7 -inf 7 -0 7 +inf 7 +inf N N
+0 0 7 -inf 7 nan 7 -0 7 +inf 7 nan N N
+0 0 7 nan 7 +inf 7 -0 7 nan 7 -inf N N
+0 0 7 nan 7 1 7 -0 7 nan 7 -1 N N
+0 0 7 nan 7 +0 7 -0 7 nan 7 -0 N N
+0 0 7 nan 7 -0 7 -0 7 nan 7 +0 N N
+0 0 7 nan 7 -1 7 -0 7 nan 7 1 N N
+0 0 7 nan 7 -inf 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan N N
+0 0 7 +inf 7 +inf 7 +0 7 -inf 7 -inf N N
+0 0 7 +inf 7 1 7 +0 7 -inf 7 -1 N N
+0 0 7 +inf 7 +0 7 +0 7 -inf 7 -0 N N
+0 0 7 +inf 7 -0 7 +0 7 -inf 7 +0 N N
+0 0 7 +inf 7 -1 7 +0 7 -inf 7 1 N N
+0 0 7 +inf 7 -inf 7 +0 7 -inf 7 +inf N N
+0 0 7 +inf 7 nan 7 +0 7 -inf 7 nan N N
+0 0 7 1 7 +inf 7 +0 7 -1 7 -inf N N
+0 0 7 1 7 -inf 7 +0 7 -1 7 +inf N N
+0 0 7 1 7 nan 7 +0 7 -1 7 nan N N
+0 0 7 +0 7 +inf 7 +0 7 -0 7 -inf N N
+0 0 7 +0 7 -inf 7 +0 7 -0 7 +inf N N
+0 0 7 +0 7 nan 7 +0 7 -0 7 nan N N
+0 0 7 0 7 +inf 7 +0 7 +0 7 -inf N N
+0 0 7 0 7 -inf 7 +0 7 +0 7 +inf N N
+0 0 7 0 7 nan 7 +0 7 +0 7 nan N N
+0 0 7 -1 7 +inf 7 +0 7 1 7 -inf N N
+0 0 7 -1 7 -inf 7 +0 7 1 7 +inf N N
+0 0 7 -1 7 nan 7 +0 7 1 7 nan N N
+0 0 7 -inf 7 +inf 7 +0 7 +inf 7 -inf N N
+0 0 7 -inf 7 1 7 +0 7 +inf 7 -1 N N
+0 0 7 -inf 7 +0 7 +0 7 +inf 7 -0 N N
+0 0 7 -inf 7 -0 7 +0 7 +inf 7 +0 N N
+0 0 7 -inf 7 -1 7 +0 7 +inf 7 1 N N
+0 0 7 -inf 7 -inf 7 +0 7 +inf 7 +inf N N
+0 0 7 -inf 7 nan 7 +0 7 +inf 7 nan N N
+0 0 7 nan 7 +inf 7 +0 7 nan 7 -inf N N
+0 0 7 nan 7 1 7 +0 7 nan 7 -1 N N
+0 0 7 nan 7 +0 7 +0 7 nan 7 -0 N N
+0 0 7 nan 7 -0 7 +0 7 nan 7 +0 N N
+0 0 7 nan 7 -1 7 +0 7 nan 7 1 N N
+0 0 7 nan 7 -inf 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan N N
+0 0 7 +inf 7 +inf 7 1 7 -inf 7 -inf N N
+0 0 7 +inf 7 1 7 1 7 -inf 7 -1 N N
+0 0 7 +inf 7 +0 7 1 7 -inf 7 -0 N N
+0 0 7 +inf 7 -0 7 1 7 -inf 7 +0 N N
+0 0 7 +inf 7 -1 7 1 7 -inf 7 1 N N
+0 0 7 +inf 7 -inf 7 1 7 -inf 7 +inf N N
+0 0 7 +inf 7 nan 7 1 7 -inf 7 nan N N
+0 0 7 2 7 +inf 7 1 7 -1 7 -inf N N
+0 0 7 2 7 -inf 7 1 7 -1 7 +inf N N
+0 0 7 2 7 nan 7 1 7 -1 7 nan N N
+0 0 7 1 7 +inf 7 1 7 -0 7 -inf N N
+0 0 7 1 7 -inf 7 1 7 -0 7 +inf N N
+0 0 7 1 7 nan 7 1 7 -0 7 nan N N
+0 0 7 1 7 +inf 7 1 7 +0 7 -inf N N
+0 0 7 1 7 -inf 7 1 7 +0 7 +inf N N
+0 0 7 1 7 nan 7 1 7 +0 7 nan N N
+0 0 7 0 7 +inf 7 1 7 1 7 -inf N N
+0 0 7 0 7 -inf 7 1 7 1 7 +inf N N
+0 0 7 0 7 nan 7 1 7 1 7 nan N N
+0 0 7 -inf 7 +inf 7 1 7 +inf 7 -inf N N
+0 0 7 -inf 7 1 7 1 7 +inf 7 -1 N N
+0 0 7 -inf 7 +0 7 1 7 +inf 7 -0 N N
+0 0 7 -inf 7 -0 7 1 7 +inf 7 +0 N N
+0 0 7 -inf 7 -1 7 1 7 +inf 7 1 N N
+0 0 7 -inf 7 -inf 7 1 7 +inf 7 +inf N N
+0 0 7 -inf 7 nan 7 1 7 +inf 7 nan N N
+0 0 7 nan 7 +inf 7 1 7 nan 7 -inf N N
+0 0 7 nan 7 1 7 1 7 nan 7 -1 N N
+0 0 7 nan 7 +0 7 1 7 nan 7 -0 N N
+0 0 7 nan 7 -0 7 1 7 nan 7 +0 N N
+0 0 7 nan 7 -1 7 1 7 nan 7 1 N N
+0 0 7 nan 7 -inf 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan N N
+0 0 7 +inf 7 +inf 7 +inf 7 -inf 7 -inf N N
+0 0 7 +inf 7 1 7 +inf 7 -inf 7 -1 N N
+0 0 7 +inf 7 +0 7 +inf 7 -inf 7 -0 N N
+0 0 7 +inf 7 -0 7 +inf 7 -inf 7 +0 N N
+0 0 7 +inf 7 -1 7 +inf 7 -inf 7 1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 +inf N N
+0 0 7 +inf 7 nan 7 +inf 7 -inf 7 nan N N
+0 0 7 +inf 7 +inf 7 +inf 7 -1 7 -inf N N
+0 0 7 +inf 7 1 7 +inf 7 -1 7 -1 N N
+0 0 7 +inf 7 +0 7 +inf 7 -1 7 -0 N N
+0 0 7 +inf 7 -0 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -1 7 +inf 7 -1 7 1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -1 7 +inf N N
+0 0 7 +inf 7 nan 7 +inf 7 -1 7 nan N N
+0 0 7 +inf 7 +inf 7 +inf 7 -0 7 -inf N N
+0 0 7 +inf 7 1 7 +inf 7 -0 7 -1 N N
+0 0 7 +inf 7 +0 7 +inf 7 -0 7 -0 N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 -1 7 +inf 7 -0 7 1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -0 7 +inf N N
+0 0 7 +inf 7 nan 7 +inf 7 -0 7 nan N N
+0 0 7 +inf 7 +inf 7 +inf 7 +0 7 -inf N N
+0 0 7 +inf 7 1 7 +inf 7 +0 7 -1 N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 7 -0 N N
+0 0 7 +inf 7 -0 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 -1 7 +inf 7 +0 7 1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 +0 7 +inf N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 nan N N
+0 0 7 +inf 7 +inf 7 +inf 7 1 7 -inf N N
+0 0 7 +inf 7 1 7 +inf 7 1 7 -1 N N
+0 0 7 +inf 7 +0 7 +inf 7 1 7 -0 N N
+0 0 7 +inf 7 -0 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 -1 7 +inf 7 1 7 1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 1 7 +inf N N
+0 0 7 +inf 7 nan 7 +inf 7 1 7 nan N N
+0 0 7 nan 7 +inf 7 +inf 7 +inf 7 -inf N N
+0 0 7 nan 7 1 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 +0 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 -0 7 +inf 7 +inf 7 +0 N N
+0 0 7 nan 7 -1 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 -inf 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan N N
+0 0 7 nan 7 +inf 7 +inf 7 nan 7 -inf N N
+0 0 7 nan 7 1 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 +0 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 -0 7 +inf 7 nan 7 +0 N N
+0 0 7 nan 7 -1 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 -inf 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 -0 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 -0 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 +0 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 1 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan N N
+
+# values with only 1, -1, +0, -0
+0 0 7 0 7 1 7 -1 7 -1 7 -1 N N
+0 0 7 0 7 +0 7 -1 7 -1 7 -0 N N
+0 0 7 0 7 -0 7 -1 7 -1 7 +0 N N
+0 0 7 0 7 -1 7 -1 7 -1 7 1 N N
+0 0 7 -1 7 1 7 -1 7 -0 7 -1 N N
+0 0 7 -1 7 +0 7 -1 7 -0 7 -0 N N
+0 0 7 -1 7 -0 7 -1 7 -0 7 +0 N N
+0 0 7 -1 7 -1 7 -1 7 -0 7 1 N N
+0 0 7 -1 7 1 7 -1 7 +0 7 -1 N N
+0 0 7 -1 7 +0 7 -1 7 +0 7 -0 N N
+0 0 7 -1 7 -0 7 -1 7 +0 7 +0 N N
+0 0 7 -1 7 -1 7 -1 7 +0 7 1 N N
+0 0 7 -2 7 1 7 -1 7 1 7 -1 N N
+0 0 7 -2 7 +0 7 -1 7 1 7 -0 N N
+0 0 7 -2 7 -0 7 -1 7 1 7 +0 N N
+0 0 7 -2 7 -1 7 -1 7 1 7 1 N N
+0 0 7 1 7 1 7 -0 7 -1 7 -1 N N
+0 0 7 1 7 +0 7 -0 7 -1 7 -0 N N
+0 0 7 1 7 -0 7 -0 7 -1 7 +0 N N
+0 0 7 1 7 -1 7 -0 7 -1 7 1 N N
+0 0 7 0 7 1 7 -0 7 -0 7 -1 N N
+0 0 7 0 7 +0 7 -0 7 -0 7 -0 N N
+0 0 7 0 7 -0 7 -0 7 -0 7 +0 N N
+0 0 7 0 7 -1 7 -0 7 -0 7 1 N N
+0 0 7 -0 7 1 7 -0 7 +0 7 -1 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 -0 N N
+0 0 7 -0 7 -0 7 -0 7 +0 7 +0 N N
+0 0 7 -0 7 -1 7 -0 7 +0 7 1 N N
+0 0 7 -1 7 1 7 -0 7 1 7 -1 N N
+0 0 7 -1 7 +0 7 -0 7 1 7 -0 N N
+0 0 7 -1 7 -0 7 -0 7 1 7 +0 N N
+0 0 7 -1 7 -1 7 -0 7 1 7 1 N N
+0 0 7 1 7 1 7 +0 7 -1 7 -1 N N
+0 0 7 1 7 +0 7 +0 7 -1 7 -0 N N
+0 0 7 1 7 -0 7 +0 7 -1 7 +0 N N
+0 0 7 1 7 -1 7 +0 7 -1 7 1 N N
+0 0 7 +0 7 1 7 +0 7 -0 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 -0 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +0 N N
+0 0 7 +0 7 -1 7 +0 7 -0 7 1 N N
+0 0 7 0 7 1 7 +0 7 +0 7 -1 N N
+0 0 7 0 7 +0 7 +0 7 +0 7 -0 N N
+0 0 7 0 7 -0 7 +0 7 +0 7 +0 N N
+0 0 7 0 7 -1 7 +0 7 +0 7 1 N N
+0 0 7 -1 7 1 7 +0 7 1 7 -1 N N
+0 0 7 -1 7 +0 7 +0 7 1 7 -0 N N
+0 0 7 -1 7 -0 7 +0 7 1 7 +0 N N
+0 0 7 -1 7 -1 7 +0 7 1 7 1 N N
+0 0 7 2 7 1 7 1 7 -1 7 -1 N N
+0 0 7 2 7 +0 7 1 7 -1 7 -0 N N
+0 0 7 2 7 -0 7 1 7 -1 7 +0 N N
+0 0 7 2 7 -1 7 1 7 -1 7 1 N N
+0 0 7 1 7 1 7 1 7 -0 7 -1 N N
+0 0 7 1 7 +0 7 1 7 -0 7 -0 N N
+0 0 7 1 7 -0 7 1 7 -0 7 +0 N N
+0 0 7 1 7 -1 7 1 7 -0 7 1 N N
+0 0 7 1 7 1 7 1 7 +0 7 -1 N N
+0 0 7 1 7 +0 7 1 7 +0 7 -0 N N
+0 0 7 1 7 -0 7 1 7 +0 7 +0 N N
+0 0 7 1 7 -1 7 1 7 +0 7 1 N N
+0 0 7 0 7 1 7 1 7 1 7 -1 N N
+0 0 7 0 7 +0 7 1 7 1 7 -0 N N
+0 0 7 0 7 -0 7 1 7 1 7 +0 N N
+0 0 7 0 7 -1 7 1 7 1 7 1 N N
+
+# inexact return values
+- - 2 -8 2 -8 3 1 3 8 3 7 D D
+- - 2 -8 2 -8 3 1 3 8 3 7 N N
++ + 2 -6 2 -6 3 1 3 8 3 7 U U
++ + 2 -6 2 -6 3 1 3 8 3 7 Z Z
diff --git a/mpc/tests/inp_str.dat b/mpc/tests/inp_str.dat
new file mode 100644
index 0000000000..b6cd79859a
--- /dev/null
+++ b/mpc/tests/inp_str.dat
@@ -0,0 +1,163 @@
+# Data file for mpc_inp_str.
+#
+# Copyright (C) 2009 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The format respects the parameter order in function prototype as follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM SIZE BASE RND_RE RND_IM "STRING"
+#
+# The string STRING is considered as a complex number rop = rop1 + i*rop2
+# written in base BASE as "rop1 " if rop is real or "(rop1 rop2)". Notice that
+# a least one whitespace is required after real part
+#
+# ROP_RE is checked against rop1 rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against rop2 rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "!" function should return error indicator -1
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# invalid strings
+! ! 53 nan 53 nan 3 10 N N "non "
+! ! 53 nan 53 nan 4 10 N N " NON "
+! ! 53 nan 53 nan 5 10 N N "nan(0 1) " #invalid space in brackets
+! ! 53 nan 53 nan 5 10 N N "nan(0-1) " #invalid char in brackets
+! ! 53 nan 53 nan 4 10 N N "NaN((keepout)) " #two levels of parenthesis
+! ! 53 nan 53 nan 4 10 N N "(1e1) " #one part missing
+! ! 53 nan 53 nan 1 10 N N ". " #no digit
+! ! 53 nan 53 nan 2 2 N N "+3 " #invalid binary digit
+! ! 53 nan 53 nan 6 10 N N "( +INF) " #one part missing
+! ! 53 nan 53 nan 2 10 N N "(1(1))" #too many levels of parentheses
+! ! 53 nan 53 nan 3 10 N N "(1 (1 (1 0)))"
+! ! 53 nan 53 nan 1 10 N N "((1 1)) "
+! ! 53 nan 53 nan 6 10 N N "(1 +1 " #closing parenthesis missing
+! ! 53 nan 53 nan 4 10 N N "(1+1) " #space needed
+! ! 53 nan 53 nan 5 10 N N "(1 + 1) " #space after sign
+! ! 53 nan 53 nan 17 10 N N "(@nan@(quiet) 0 " #closing parenthesis missing
+! ! 53 nan 53 nan 4 10 N N "zero " #invalid digits
+! ! 53 nan 53 nan 3 10 N N "&^+ " #invalid digits
+! ! 53 nan 53 nan 1 18 N N "i " #invalid digit
+! ! 53 nan 53 nan 1 18 N N "I " #invalid digit
+! ! 53 nan 53 nan 1 35 N N "z " #invalid digit
+! ! 53 nan 53 nan 1 35 N N "Z " #invalid digit
+! ! 53 nan 53 nan 5 18 N N "(i 0) " #invalid digit
+! ! 53 nan 53 nan 5 18 N N "(I 0) " #invalid digit
+! ! 53 nan 53 nan 5 35 N N "(z 0) " #invalid digit
+! ! 53 nan 53 nan 5 35 N N "(Z 0) " #invalid digit
+! ! 53 nan 53 nan 5 18 N N "(0 i) " #invalid digit
+! ! 53 nan 53 nan 5 18 N N "(0 I) " #invalid digit
+! ! 53 nan 53 nan 5 35 N N "(0 z) " #invalid digit
+! ! 53 nan 53 nan 5 35 N N "(0 Z) " #invalid digit
+! ! 53 nan 53 nan 7 10 N N "-25p+32 " #invalid exponent char in base 10
+! ! 53 nan 53 nan 6 10 N N "0xabcd " #invalid prefix in base 10
+! ! 53 nan 53 nan 6 10 N N "+0b010 " #invalid prefix in base 10
+
+# special values
+0 0 53 nan 53 +0 3 10 N N "nan "
+0 0 53 nan 53 +0 4 10 N N "+NAN "
+0 0 53 nan 53 +0 5 10 N N "@NAN@ "
+0 0 53 nan 53 nan 18 10 N N "(@nan@(QUIET) nan) "
+0 0 53 nan 53 +0 5 10 N N "@nan@ "
+0 0 53 nan 53 +0 12 10 N N "NaN(keepout) "
+0 0 53 nan 53 +0 122 10 N N "Nan(very_long_suffix_oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo) "
+0 0 53 nan 53 +0 8 10 N N "nan(0_1) "
+0 0 53 nan 53 +0 3 10 N N "nan "
+0 0 53 inf 53 +0 3 10 N N "inf "
+0 0 53 -inf 53 +0 4 10 N N "-inf "
+0 0 53 +inf 53 +0 8 10 N N "infinity "
+0 0 53 +inf 53 +0 4 10 N N "+INF "
+0 0 53 +0 53 +inf 8 10 N N "(0 +inf) "
+0 0 53 +0 53 +inf 12 10 N N "(+0 INF) "
+0 0 53 +0 53 -inf 13 10 N N "(0 -infinity) "
+0 0 53 +0 53 -inf 9 10 N N "(+0 -INF) "
+0 0 53 -inf 53 -0 11 10 N N "(-@inf@ -0) "
+0 0 53 +inf 53 nan 17 10 N N "(+inf nan(9u137)) "
+0 0 53 nan 53 +inf 12 10 N N "(NaN +inf ) "
+
+# pure real argument
+0 0 53 +0 53 +0 1 10 N N "0 "
+0 0 53 +0 53 +0 5 10 N N "00000 "
+0 0 53 +0 53 +0 2 10 N N "+0 "
+0 0 53 -0 53 +0 2 10 N N "-0 "
+0 0 53 +1 53 +0 1 10 N N "1 "
+0 0 53 +1 53 +0 3 10 N N "001 "
+0 0 53 +1 53 +0 6 10 N N "1.0000 "
+0 0 53 +1 53 +0 2 10 N N "+1) "
+- 0 53 +0x9D70A3D70A3D7p-51 53 +0 11 10 N N "(+1.23 0.0) "
+0 0 53 -10 53 +0 11 10 N N "(-10. 0000) "
+0 0 53 +0x5p-3 53 -0 12 10 N N "( .625 -0 )"
+- 0 53 +0x14E718D7D7625Ap+612 53 +0 10 10 N N "(1e200 0) "
++ 0 53 +0x14E718D7D7625Bp+612 53 +0 10 10 U N "(1e200 0) "
+- 0 53 +0x14E718D7D7625Ap+612 53 +0 10 10 D N "(1e200 0) "
+0 0 53 +0x7530 53 +0 8 10 N N "(3e+4 0) "
+- 0 53 +0x10C6F7A0B5ED8Dp-73 53 +0 5 10 N N ".5e-6 "
+- 0 53 +0x1B1C1E0D914133p-83 53 +0 12 10 N N "(7.89E-10 0) "
++ 0 53 -0x7B426FAB61F00Cp+56 53 +0 7 10 N N "-25@+32 "
+0 0 53 +43981 53 +0 6 16 N N "0xabcd "
+0 0 53 +2 53 +0 6 2 N N "+0b010 "
+0 0 53 +18 53 +0 1 20 N N "i "
+0 0 53 +18 53 +0 1 19 N N "i "
+0 0 53 +35 53 +0 1 36 N N "z "
+0 0 53 +35 53 +0 1 36 N N "Z "
+
+# pure imaginary argument
+0 0 53 +0 53 +1 5 10 N N "(0 1) "
+0 0 53 +0 53 +1 6 20 N N "(0 +1) "
+0 0 53 -0 53 -1 7 10 N N "(-0 -1) "
+0 0 53 -0 53 -2 7 10 N N "(-0 -2) "
+0 0 53 +0 53 +2 6 10 N N "(+0 2) "
+0 0 53 +0 53 +17 5 20 N N "(0 h) "
+0 0 53 +0 53 +18 5 20 N N "(0 i) "
+0 + 53 +0 53 -0x14F800008637BDp-44 19 10 N Z "(0 -33.55000005e+1) "
+0 + 53 +0 53 -0xA1765976008AFp-401 18 10 N U "(+0 -.550000E-105) "
+0 0 53 +0 53 +18 5 19 N N "(0 i) "
+0 0 53 +0 53 +18 5 19 N N "(0 I) "
+0 0 53 +0 53 +35 5 36 N N "(0 z) "
+0 0 53 +0 53 +35 5 36 N N "(0 Z) "
+
+# complex argument
+0 0 53 +1 53 +1 10 10 N N "( 1 +1) "
+0 0 53 +1 53 +1 8 10 N N "(1 +1) "
+0 0 53 +7 53 +14 7 10 N N "(7 14) "
+0 0 53 +17 53 +1 7 10 N N "(+17 1) "
+0 0 53 +27 53 +1 8 20 N N "(+17 +1) "
+0 0 53 -18 53 -1 7 20 N N "(-i -1) "
+0 0 53 +18 53 -1 6 20 N N "(i -1) "
+0 0 53 -18 53 +1 7 20 N N "(-i +1) "
+0 0 53 +18 53 +18 6 20 N N "(i +i) "
+0 0 53 -14643 53 +20328 10 36 N N "(-bar foo) "
+0 0 53 -1647190 53 -512315 13 36 N N "(-zaza -azaz) "
+0 0 53 +0b1010 53 +0xabcd 16 0 N N "(0b1010 +0xabcd) "
+0 0 53 +0xabcd 53 +0b1010 22 0 N N "(+0xa.bcd@+3 0b.101p4) "
+
+# white space before the closing ')'
+0 0 53 +1 53 +1 13 10 N N "( 1 +1 ) "
diff --git a/mpc/tests/log.dat b/mpc/tests/log.dat
new file mode 100644
index 0000000000..ee95025de8
--- /dev/null
+++ b/mpc/tests/log.dat
@@ -0,0 +1,190 @@
+# Data test file for mpc_log.
+#
+# Copyright (C) 2008, 2009, 2010, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+# option) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+
+# See file sin.dat for the format description.
+
+# Special values, following ISO C99 standard, Annex G,
+# more precisely Section G.6.3.2 "The clog functions".
+
+# Rule [conj]: log(conj(z)) = conj(log(z))
+
+# log(-0 + i*0) = -inf + i*pi
+0 - 2 -inf 53 +0x3243F6A8885A3p-48 2 -0 2 +0 N N
+0 + 2 -inf 53 -0x3243F6A8885A3p-48 2 -0 2 -0 N N
+0 - 2 -inf 53 +0x3243F6A8885A3p-48 2 -0 2 +0 N D
+0 - 2 -inf 53 -0x3243F6A8885A32p-52 2 -0 2 -0 N D
+
+# log(+0 + i*0) = -inf + i*0
+0 0 2 -inf 2 +0 2 +0 2 +0 N N
+0 0 2 -inf 2 -0 2 +0 2 -0 N N
+
+# log(+1 +- i*0) = +0 +- i*0
+0 0 2 +0 2 +0 2 1 2 +0 N N
+0 0 2 +0 2 -0 2 1 2 -0 N N
+
+# log(-1 +- i*0) = +0 +- i*pi
+0 - 2 +0 53 +0x3243F6A8885A3p-48 2 -1 2 +0 N N
+0 + 2 +0 53 -0x3243F6A8885A3p-48 2 -1 2 -0 N N
+
+# log(x + i*inf) = +inf + i*pi/2 for finite x
+0 - 2 +inf 53 +0x3243F6A8885A3p-49 2 1 2 +inf N N
+0 - 2 +inf 53 +0x3243F6A8885A3p-49 2 +0 2 +inf N N
+0 - 2 +inf 53 +0x3243F6A8885A3p-49 2 -0 2 +inf N N
+0 - 2 +inf 53 +0x3243F6A8885A3p-49 2 -1 2 +inf N N
+# by [conj]: log(x - i*inf) = +inf - i*pi/2 for finite x
+0 + 2 +inf 53 -0x3243F6A8885A3p-49 2 1 2 -inf N N
+0 + 2 +inf 53 -0x3243F6A8885A3p-49 2 +0 2 -inf N N
+0 + 2 +inf 53 -0x3243F6A8885A3p-49 2 -0 2 -inf N N
+0 + 2 +inf 53 -0x3243F6A8885A3p-49 2 -1 2 -inf N N
+
+# log(x + i*nan) = nan+i*nan for finite x
+0 0 2 nan 2 nan 2 1 2 nan N N
+0 0 2 nan 2 nan 2 +0 2 nan N N
+0 0 2 nan 2 nan 2 -0 2 nan N N
+0 0 2 nan 2 nan 2 -1 2 nan N N
+
+# log(-inf + i*y) = +inf + i*pi for finite positive-signed y
+0 - 2 +inf 53 0x3243F6A8885A3p-48 2 -inf 2 1 N N
+0 - 2 +inf 53 0x3243F6A8885A3p-48 2 -inf 2 +0 N N
+# by [conj]: log(-inf + i*y) = +inf - i*pi for finite negative-signed y
+0 + 2 +inf 53 -0x3243F6A8885A3p-48 2 -inf 2 -1 N N
+0 + 2 +inf 53 -0x3243F6A8885A3p-48 2 -inf 2 -0 N N
+
+# log(+inf + i*y) = +inf + i*0 for finite positive-signed y
+0 0 2 +inf 2 +0 2 +inf 2 1 N N
+0 0 2 +inf 2 +0 2 +inf 2 +0 N N
+# by [conj]: log(+inf + i*y) = +inf - i*0 for finite negative-signed y
+0 0 2 +inf 2 -0 2 +inf 2 -1 N N
+0 0 2 +inf 2 -0 2 +inf 2 -0 N N
+
+# log(-inf + i*inf) = +inf + i*(3*pi/4)
+0 - 2 +inf 53 0x96CBE3F9990E9p-50 2 -inf 2 +inf N N
+# by [conj]: log(-inf - i*inf) = +inf - i*(3*pi/4)
+0 + 2 +inf 53 -0x96CBE3F9990E9p-50 2 -inf 2 -inf N N
+
+# log(+inf + i*inf) = +inf + i*(pi/4)
+0 - 2 +inf 53 0x3243F6A8885A3p-50 2 +inf 2 +inf N N
+# by [conj]: log(+inf - i*inf) = +inf - i*(pi/4)
+0 + 2 +inf 53 -0x3243F6A8885A3p-50 2 +inf 2 -inf N N
+
+# log(+/-inf + i*nan) = +inf + i*nan
+0 0 2 +inf 2 nan 2 +inf 2 nan N N
+0 0 2 +inf 2 nan 2 -inf 2 nan N N
+
+# log(nan + i*y) = nan + i*nan for finite y
+0 0 2 nan 2 nan 2 nan 2 1 N N
+0 0 2 nan 2 nan 2 nan 2 +0 N N
+0 0 2 nan 2 nan 2 nan 2 -0 N N
+0 0 2 nan 2 nan 2 nan 2 -1 N N
+
+# log(nan + i*inf) = +inf + i*nan
+0 0 2 +inf 2 nan 2 nan 2 +inf N N
+0 0 2 +inf 2 nan 2 nan 2 -inf N N
+
+# log(nan + i*nan) = nan + i*nan
+0 0 2 nan 2 nan 2 nan 2 nan N N
+
+# log(x + i*y) with either x or y zero and the other non-zero
++ 0 53 0xB5535E0FD3FBDp-50 2 0 5 0x11 2 0 N N
++ - 53 0xB5535E0FD3FBDp-50 53 0x3243F6A8885A3p-49 2 0 5 0x11 N N
+- - 53 0x5E38D81812CCBp-49 53 0x3243F6A8885A3p-48 5 -0x13 2 +0 N N
+- + 53 0x5E38D81812CCBp-49 53 -0x3243F6A8885A3p-48 5 -0x13 2 -0 N N
+- + 53 0x5E38D81812CCBp-49 53 -0x3243F6A8885A3p-49 2 0 5 -0x13 N N
+
+- + 53 0x19157DFDD1B3Fp-47 53 0x1921FB54442D19p-51 5 -0x17 2 +0 Z U
+- - 53 0x19157DFDD1B3Fp-47 53 -0x1921FB54442D19p-51 5 -0x17 2 -0 N D
++ - 53 0x19157DFDD1B3F1p-51 53 0x3243F6A8885A3p-48 5 -0x17 2 +0 U Z
+- + 53 0x19157DFDD1B3Fp-47 53 -0x3243F6A8885A3p-48 5 -0x17 2 -0 D N
+- - 53 0x8611A6D2511D3p-49 53 0x3243F6A8885A3p-48 7 -0x42 2 +0 Z D
+- + 53 0x8611A6D2511D3p-49 53 -0x3243F6A8885A3p-48 7 -0x42 2 -0 N Z
++ - 53 0x10C234DA4A23A7p-50 53 0x3243F6A8885A3p-48 7 -0x42 2 +0 U N
+- + 53 0x8611A6D2511D3p-49 53 -0x3243F6A8885A3p-48 7 -0x42 2 -0 D U
+
+# normal non-zero numbers
+- - 17 0x6701p-15 42 0x3b58ce0ac37p-43 2 2 2 1 N N
+- + 17 0x6701p-15 42 -0x3b58ce0ac37p-43 2 2 2 -1 N N
+- + 17 0x6701p-15 42 0x2ad8dce72ffp-40 2 -2 2 1 N N
+- - 17 0x6701p-15 42 -0x2ad8dce72ffp-40 2 -2 2 -1 N N
+- + 17 0x6701p-15 42 0x46db864bafp-38 2 1 2 2 N N
+- - 17 0x6701p-15 42 -0x46db864bafp-38 2 1 2 -2 N N
+- + 17 0x6701p-15 42 0x10468a8ace5p-39 2 -1 2 2 N N
+- - 17 0x6701p-15 42 -0x10468a8ace5p-39 2 -1 2 -2 N N
+
+# huge values
++ 0 53 0x162E42FEFA39Fp-39 2 0 2 0x1p1024 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-38 2 0 2 0x1p2048 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-37 2 0 2 0x1p4096 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-36 2 0 2 0x1p8192 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-35 2 0 2 0x1p16384 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-34 2 0 2 0x1p32768 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-33 2 0 2 0x1p65536 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-32 2 0 2 0x1p131072 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-31 2 0 2 0x1p262144 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-30 2 0 2 0x1p524288 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-29 2 0 2 0x1p1048576 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-28 2 0 2 0x1p2097152 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-27 2 0 2 0x1p4194304 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-26 2 0 2 0x1p8388608 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-25 2 0 2 0x1p16777216 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-24 2 0 2 0x1p33554432 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-23 2 0 2 0x1p67108864 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-22 2 0 2 0x1p134217728 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-21 2 0 2 0x1p268435456 2 +0 U U
++ 0 53 0x162E42FEFA39Fp-20 2 0 2 0x1p536870912 2 +0 U U
++ + 53 0x163108C75A1937p-43 53 0x1921FB54442D19p-53 2 0x1p1024 2 0x1p1024 U U
++ + 53 0x162FA5E32A2993p-42 53 0x1921FB54442D19p-53 2 0x1p2048 2 0x1p2048 U U
++ + 53 0xB177A388918E1p-40 53 0x1921FB54442D19p-53 2 0x1p4096 2 0x1p4096 U U
++ + 53 0x162E9BB80635D9p-40 53 0x1921FB54442D19p-53 2 0x1p8192 2 0x1p8192 U U
++ + 53 0x58B9BD6E00DF9p-37 53 0x1921FB54442D19p-53 2 0x1p16384 2 0x1p16384 U U
++ + 53 0xB172C969E9C75p-37 53 0x1921FB54442D19p-53 2 0x1p32768 2 0x1p32768 U U
++ + 53 0x162E4E161BB96Dp-37 53 0x1921FB54442D19p-53 2 0x1p65536 2 0x1p65536 U U
++ + 53 0xB172445457CD7p-35 2 0x1p0 2 0x1p131072 2 0x1p131072 U U
++ + 53 0x162E45C4C299CFp-35 2 0x1p0 2 0x1p262144 2 0x1p262144 U U
++ + 53 0x162E4461DE69DFp-34 2 0x1p0 2 0x1p524288 2 0x1p524288 U U
++ + 53 0x2C5C8760D8A3Dp-30 2 0x1p0 2 0x1p1048576 2 0x1p1048576 U U
++ + 53 0x58B90D5ECD17Bp-30 2 0x1p0 2 0x1p2097152 2 0x1p2097152 U U
++ + 53 0xB172195AB5FF7p-30 2 0x1p0 2 0x1p4194304 2 0x1p4194304 U U
++ + 53 0x162E4315287CEFp-30 2 0x1p0 2 0x1p8388608 2 0x1p8388608 U U
++ + 53 0x162E430A115B6Fp-29 2 0x1p0 2 0x1p16777216 2 0x1p16777216 U U
++ + 53 0x162E430485CAAFp-28 2 0x1p0 2 0x1p33554432 2 0x1p33554432 U U
++ + 53 0x162E4301C0025p-23 2 0x1p0 2 0x1p67108864 2 0x1p67108864 U U
++ + 53 0xB1721802E8F1p-21 2 0x1p0 2 0x1p134217728 2 0x1p134217728 U U
++ + 53 0x2C5C85FF57581p-22 2 0x1p0 2 0x1p268435456 2 0x1p268435456 U U
+
+# Example leading to intermediate overflow in x^2+y^2
++ + 53 0x58B90BFD4BCBFp-22 2 0x1p0 2 0x1p536870912 2 0x1p536870912 U U
++ + 53 0x58B90BFAA42A98p-25 2 0x1p0 2 0x3p1073741821 2 0x3p1073741821 U U
+# Example leading to intermediate underflow in x^2+y^2
+- - 53 -0x58B90BFB3775A8p-25 2 0x3p-2 2 0x1p-1073741824 2 0x1p-1073741824 D D
+
+# log (-1 + i*eps), looped in previous version
+- - 2 0 2 3 2 -1 2 0x1p-1073741813 N N
+- - 2 0 2 3 2 -1 2 0x1p-1073741813 D D
++ + 2 0x1p-1073741824 2 4 2 -1 2 0x1p-1073741813 U U
+# log(1 + i*eps), could cause similar problems
+- + 2 0 2 0x1p-1073741824 2 1 2 0x1p-1073741824 N N
+- - 2 0 2 0 2 1 2 0x1p-1073741824 D D
++ + 2 0x1p-1073741824 2 0x1p-1073741824 2 1 2 0x1p-1073741824 U U
+# log (eps + i)
+- - 2 0 2 0x3p-1 2 0x1p-1073741824 2 1 N N
+- - 2 0 2 0x3p-1 2 0x1p-1073741824 2 1 D D
++ + 2 0x1p-1073741824 2 2 2 0x1p-1073741824 2 1 U U
+
+# log (close to 1 + i*eps), improves test coverage
++ - 2 -0x1p-36 2 0x1p-1073741824 36 0x0.FFFFFFFFF 2 0x1p-1073741824 N N
diff --git a/mpc/tests/log10.dat b/mpc/tests/log10.dat
new file mode 100644
index 0000000000..9316c79f89
--- /dev/null
+++ b/mpc/tests/log10.dat
@@ -0,0 +1,179 @@
+# Data test file for mpc_log10.
+#
+# Copyright (C) 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+
+# See file sin.dat for the format description.
+
+# Special values, following ISO C99 standard, Annex G,
+# more precisely Section 7.26 "Future library directions"
+
+# Rule [conj]: log10(conj(z)) = conj(log10(z))
+
+# log10(nan + i*inf) = +inf + i*nan
+0 0 2 +inf 2 nan 2 nan 2 +inf N N
+0 0 2 +inf 2 nan 2 nan 2 -inf N N
+
+# log10(nan + i*nan) = nan + i*nan
+0 0 2 nan 2 nan 2 nan 2 nan N N
+
+# log10(nan + i*y) = nan + i*nan for finite y
+0 0 2 nan 2 nan 2 nan 2 1 N N
+0 0 2 nan 2 nan 2 nan 2 +0 N N
+0 0 2 nan 2 nan 2 nan 2 -0 N N
+0 0 2 nan 2 nan 2 nan 2 -1 N N
+
+# log10(+/-inf + i*nan) = +inf + i*nan
+0 0 2 +inf 2 nan 2 +inf 2 nan N N
+0 0 2 +inf 2 nan 2 -inf 2 nan N N
+
+# log10(x + i*nan) = nan+i*nan for finite x
+0 0 2 nan 2 nan 2 1 2 nan N N
+0 0 2 nan 2 nan 2 +0 2 nan N N
+0 0 2 nan 2 nan 2 -0 2 nan N N
+0 0 2 nan 2 nan 2 -1 2 nan N N
+
+# log10(x + i*inf) = +inf + i*pi/2/log(10) for finite x
+0 + 2 +inf 53 +0x15d47c4cb2fba1p-53 2 1 2 +inf N N
+0 + 2 +inf 53 +0x15d47c4cb2fba1p-53 2 +0 2 +inf N N
+0 + 2 +inf 53 +0x15d47c4cb2fba1p-53 2 -0 2 +inf N N
+0 + 2 +inf 53 +0x15d47c4cb2fba1p-53 2 -1 2 +inf N N
+# by [conj]: log10(x - i*inf) = +inf - i*pi/2/log(10) for finite x
+0 - 2 +inf 53 -0x15d47c4cb2fba1p-53 2 1 2 -inf N N
+0 - 2 +inf 53 -0x15d47c4cb2fba1p-53 2 +0 2 -inf N N
+0 - 2 +inf 53 -0x15d47c4cb2fba1p-53 2 -0 2 -inf N N
+0 - 2 +inf 53 -0x15d47c4cb2fba1p-53 2 -1 2 -inf N N
+
+# log10(-inf + i*y) = +inf + i*pi/log(10) for finite positive-signed y
+0 + 2 +inf 53 0x15d47c4cb2fba1p-52 2 -inf 2 1 N N
+0 + 2 +inf 53 0x15d47c4cb2fba1p-52 2 -inf 2 +0 N N
+# by [conj]: log10(-inf+i*y) = +inf - i*pi/log(10) for finite negative-signed y
+0 - 2 +inf 53 -0x15d47c4cb2fba1p-52 2 -inf 2 -1 N N
+0 - 2 +inf 53 -0x15d47c4cb2fba1p-52 2 -inf 2 -0 N N
+
+# log10(+inf + i*y) = +inf + i*0 for finite positive-signed y
+0 0 2 +inf 2 +0 2 +inf 2 1 N N
+0 0 2 +inf 2 +0 2 +inf 2 +0 N N
+# by [conj]: log10(+inf + i*y) = +inf - i*0 for finite negative-signed y
+0 0 2 +inf 2 -0 2 +inf 2 -1 N N
+0 0 2 +inf 2 -0 2 +inf 2 -0 N N
+
+# log10(-inf + i*inf) = +inf + i*(3*pi/4)/log(10)
+0 + 2 +inf 53 0x105f5d39863cb9p-52 2 -inf 2 +inf N N
+# by [conj]: log10(-inf - i*inf) = +inf - i*(3*pi/4)/log(10)
+0 - 2 +inf 53 -0x105f5d39863cb9p-52 2 -inf 2 -inf N N
+
+# log10(+inf + i*inf) = +inf + i*(pi/4)/log(10)
+0 + 2 +inf 53 0x15d47c4cb2fba1p-54 2 +inf 2 +inf N N
+# by [conj]: log10(+inf - i*inf) = +inf - i*(pi/4)/log(10)
+0 - 2 +inf 53 -0x15d47c4cb2fba1p-54 2 +inf 2 -inf N N
+
+# log10(-0 + i*0) = -inf + i*pi/log(10)
+0 + 2 -inf 53 +0x15d47c4cb2fba1p-52 2 -0 2 +0 N N
+0 - 2 -inf 53 -0x15d47c4cb2fba1p-52 2 -0 2 -0 N N
+0 + 2 -inf 53 +0x15d47c4cb2fba1p-52 2 -0 2 +0 N U
+0 + 2 -inf 53 -0xaea3e26597ddp-47 2 -0 2 -0 N U
+0 - 2 -inf 53 +0xaea3e26597ddp-47 2 -0 2 +0 N D
+0 - 2 -inf 53 -0x15d47c4cb2fba1p-52 2 -0 2 -0 N D
+
+# log10(+0 + i*0) = -inf + i*0
+0 0 2 -inf 2 +0 2 +0 2 +0 N N
+0 0 2 -inf 2 -0 2 +0 2 -0 N N
+
+# log10(+1 +- i*0) = +0 +- i*0
+0 0 2 +0 2 +0 2 1 2 +0 N N
+0 0 2 +0 2 -0 2 1 2 -0 N N
+
+# log10(10 +- i*0) = 1 +- i*0
+0 0 2 1 2 +0 4 10 2 +0 N N
+0 0 2 1 2 -0 4 10 2 -0 N N
+
+# log10(100 +- i*0) = 1 +- i*0
+0 0 2 2 2 +0 5 100 2 +0 N N
+0 0 2 2 2 -0 5 100 2 -0 N N
+
+# log10(-1 +- i*0) = +0 +- i*pi/log(10)
+0 + 2 +0 53 +0x15d47c4cb2fba1p-52 2 -1 2 +0 N N
+0 - 2 +0 53 -0x15d47c4cb2fba1p-52 2 -1 2 -0 N N
+
+# log10(x + i*y) with either x or y zero and the other non-zero
+- 0 53 0x13afeb354b7d97p-52 2 0 5 0x11 2 0 N N
+- + 53 0x13afeb354b7d97p-52 53 0x15d47c4cb2fba1p-53 2 0 5 0x11 N N
+- + 53 0x1475c655fbc11p-48 53 0x15d47c4cb2fba1p-52 5 -0x13 2 +0 N N
+- - 53 0x1475c655fbc11p-48 53 -0x15d47c4cb2fba1p-52 5 -0x13 2 -0 N N
+- - 53 0x1475c655fbc11p-48 53 -0x15d47c4cb2fba1p-53 2 0 5 -0x13 N N
+
+- + 53 0x15c9a3209bf97fp-52 53 0x15d47c4cb2fba1p-52 5 -0x17 2 +0 Z U
+- - 53 0x15c9a3209bf97fp-52 53 -0x15d47c4cb2fba1p-52 5 -0x17 2 -0 N D
++ - 53 0x2b93464137f3p-45 53 0xaea3e26597ddp-47 5 -0x17 2 +0 U Z
+- - 53 0x15c9a3209bf97fp-52 53 -0x15d47c4cb2fba1p-52 5 -0x17 2 -0 D N
+- - 53 0x1d1cda1a0c996dp-52 53 0xaea3e26597ddp-47 7 -0x42 2 +0 Z D
++ + 53 0xe8e6d0d064cb7p-51 53 -0xaea3e26597ddp-47 7 -0x42 2 -0 N Z
++ + 53 0xe8e6d0d064cb7p-51 53 0x15d47c4cb2fba1p-52 7 -0x42 2 +0 U N
+- + 53 0x1d1cda1a0c996dp-52 53 -0xaea3e26597ddp-47 7 -0x42 2 -0 D U
+
+# huge values
++ 0 53 0x134413509f79ffp-44 2 0 2 0x1p1024 2 +0 U U
++ 0 53 0x134413509f79ffp-43 2 0 2 0x1p2048 2 +0 U U
++ 0 53 0x134413509f79ffp-42 2 0 2 0x1p4096 2 +0 U U
++ 0 53 0x134413509f79ffp-41 2 0 2 0x1p8192 2 +0 U U
++ 0 53 0x134413509f79ffp-40 2 0 2 0x1p16384 2 +0 U U
++ 0 53 0x134413509f79ffp-39 2 0 2 0x1p32768 2 +0 U U
++ 0 53 0x134413509f79ffp-38 2 0 2 0x1p65536 2 +0 U U
++ 0 53 0x134413509f79ffp-37 2 0 2 0x1p131072 2 +0 U U
++ 0 53 0x134413509f79ffp-36 2 0 2 0x1p262144 2 +0 U U
++ 0 53 0x134413509f79ffp-35 2 0 2 0x1p524288 2 +0 U U
++ 0 53 0x134413509f79ffp-34 2 0 2 0x1p1048576 2 +0 U U
++ 0 53 0x134413509f79ffp-33 2 0 2 0x1p2097152 2 +0 U U
++ 0 53 0x134413509f79ffp-32 2 0 2 0x1p4194304 2 +0 U U
++ 0 53 0x134413509f79ffp-31 2 0 2 0x1p8388608 2 +0 U U
++ 0 53 0x134413509f79ffp-30 2 0 2 0x1p16777216 2 +0 U U
++ 0 53 0x134413509f79ffp-29 2 0 2 0x1p33554432 2 +0 U U
++ 0 53 0x134413509f79ffp-28 2 0 2 0x1p67108864 2 +0 U U
++ 0 53 0x134413509f79ffp-27 2 0 2 0x1p134217728 2 +0 U U
++ 0 53 0x134413509f79ffp-26 2 0 2 0x1p268435456 2 +0 U U
++ 0 53 0x134413509f79ffp-25 2 0 2 0x1p536870912 2 +0 U U
++ + 53 0x13467bd3098defp-44 53 0x15d47c4cb2fba1p-54 2 0x1p1024 2 0x1p1024 U U
++ + 53 0x13454791d483f7p-43 53 0x15d47c4cb2fba1p-54 2 0x1p2048 2 0x1p2048 U U
++ + 53 0x1344ad7139fefbp-42 53 0x15d47c4cb2fba1p-54 2 0x1p4096 2 0x1p4096 U U
++ + 53 0x13446060ecbc7dp-41 53 0x15d47c4cb2fba1p-54 2 0x1p8192 2 0x1p8192 U U
++ + 53 0x9a21cec630d9fp-39 53 0x15d47c4cb2fba1p-54 2 0x1p16384 2 0x1p16384 U U
++ + 53 0x13442694b2ca9fp-39 53 0x15d47c4cb2fba1p-54 2 0x1p32768 2 0x1p32768 U U
++ + 53 0x13441cf2a9224fp-38 53 0x15d47c4cb2fba1p-54 2 0x1p65536 2 0x1p65536 U U
++ + 53 0x13441821a44e27p-37 2 0x3p-3 2 0x1p131072 2 0x1p131072 U U
++ + 53 0x134415b921e413p-36 2 0x3p-3 2 0x1p262144 2 0x1p262144 U U
++ + 53 0x13441484e0af09p-35 2 0x3p-3 2 0x1p524288 2 0x1p524288 U U
++ + 53 0x4d104fab00521p-32 2 0x3p-3 2 0x1p1048576 2 0x1p1048576 U U
++ + 53 0x9a209ced7e3a1p-32 2 0x3p-3 2 0x1p2097152 2 0x1p2097152 U U
++ + 53 0x1344137727a0a1p-32 2 0x3p-3 2 0x1p4194304 2 0x1p4194304 U U
++ + 53 0x13441363e38d5p-27 2 0x3p-3 2 0x1p8388608 2 0x1p8388608 U U
++ + 53 0x268826b483075p-27 2 0x3p-3 2 0x1p16777216 2 0x1p16777216 U U
++ + 53 0x4d104d55c1fb5p-27 2 0x3p-3 2 0x1p33554432 2 0x1p33554432 U U
++ + 53 0x9a209a983fe35p-27 2 0x3p-3 2 0x1p67108864 2 0x1p67108864 U U
++ + 53 0x4d104d474eecdp-25 2 0x3p-3 2 0x1p134217728 2 0x1p134217728 U U
++ + 53 0x9a209a89ccd4dp-25 2 0x3p-3 2 0x1p268435456 2 0x1p268435456 U U
+# Due to intermediate overflow, the following result has wrong real part
+# instead of the correct result. Since this may happen in other parts of the
+# library as well, we do not consider it a bug for the moment.
+# + + 53 0x13441350ec8a4dp-25 2 0x3p-3 2 0x1p536870912 2 0x1p536870912 U U
+
+# log10(3+I) has an exact real part (from Joseph S. Myers)
+0 + 53 0.5 53 0x8f168ee8415e7p-54 2 3 2 1 N N
+
+# bug found by Mickael Gastineau on 29 Sep 2012
+0 + 2 +0 2 0.75 2 +0 2 1 N N
+0 - 2 +0 2 -0.75 2 +0 2 -1 N N
diff --git a/mpc/tests/mpc-tests.h b/mpc/tests/mpc-tests.h
new file mode 100644
index 0000000000..d1ce58690e
--- /dev/null
+++ b/mpc/tests/mpc-tests.h
@@ -0,0 +1,235 @@
+/* mpc-tests.h -- Tests helper functions.
+
+Copyright (C) 2008, 2009, 2010, 2011, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#ifndef __MPC_TESTS_H
+#define __MPC_TESTS_H
+
+#include "config.h"
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include "mpc.h"
+
+/* pieces copied from mpc-impl.h */
+#define MPC_PREC_RE(x) (mpfr_get_prec(mpc_realref(x)))
+#define MPC_PREC_IM(x) (mpfr_get_prec(mpc_imagref(x)))
+#define MPC_MAX_PREC(x) MPC_MAX(MPC_PREC_RE(x), MPC_PREC_IM(x))
+#define MPC_MAX(h,i) ((h) > (i) ? (h) : (i))
+
+#define MPC_ASSERT(expr) \
+ do { \
+ if (!(expr)) \
+ { \
+ fprintf (stderr, "%s:%d: MPC assertion failed: %s\n", \
+ __FILE__, __LINE__, #expr); \
+ abort(); \
+ } \
+ } while (0)
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+__MPC_DECLSPEC int mpc_mul_naive (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
+__MPC_DECLSPEC int mpc_mul_karatsuba (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
+__MPC_DECLSPEC int mpc_fma_naive (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
+#if defined (__cplusplus)
+}
+#endif
+/* end pieces copied from mpc-impl.h */
+
+#define MPC_OUT(x) \
+do { \
+ printf (#x "[%lu,%lu]=", (unsigned long int) MPC_PREC_RE (x), \
+ (unsigned long int) MPC_PREC_IM (x)); \
+ mpc_out_str (stdout, 2, 0, x, MPC_RNDNN); \
+ printf ("\n"); \
+} while (0)
+
+#define MPFR_OUT(x) \
+do { \
+ printf (#x "[%lu]=", (unsigned long int) mpfr_get_prec (x)); \
+ mpfr_out_str (stdout, 2, 0, x, GMP_RNDN); \
+ printf ("\n"); \
+} while (0)
+
+
+#define MPC_INEX_STR(inex) \
+ (inex) == 0 ? "(0, 0)" \
+ : (inex) == 1 ? "(+1, 0)" \
+ : (inex) == 2 ? "(-1, 0)" \
+ : (inex) == 4 ? "(0, +1)" \
+ : (inex) == 5 ? "(+1, +1)" \
+ : (inex) == 6 ? "(-1, +1)" \
+ : (inex) == 8 ? "(0, -1)" \
+ : (inex) == 9 ? "(+1, -1)" \
+ : (inex) == 10 ? "(-1, -1)" : "unknown"
+
+#define TEST_FAILED(func,op,got,expected,rnd) \
+ do { \
+ printf ("%s(op) failed [rnd=%d]\n with", func, rnd); \
+ MPC_OUT (op); \
+ printf (" "); \
+ MPC_OUT (got); \
+ MPC_OUT (expected); \
+ exit (1); \
+ } while (0)
+
+#define QUOTE(X) NAME(X)
+#define NAME(X) #X
+
+/** RANDOM FUNCTIONS **/
+/* the 3 following functions handle seed for random numbers. Usage:
+ - add test_start at the beginning of your test function
+ - use test_default_random (or use your random functions with
+ gmp_randstate_t rands) in your tests
+ - add test_end at the end the test function */
+extern gmp_randstate_t rands;
+
+extern void test_start (void);
+extern void test_end (void);
+extern void test_default_random (mpc_ptr, mp_exp_t, mp_exp_t, unsigned int, unsigned int);
+
+
+/** COMPARISON FUNCTIONS **/
+/* some sign are unspecified in ISO C99, thus we record in struct known_signs_t
+ whether the sign has to be checked */
+typedef struct
+{
+ int re; /* boolean value */
+ int im; /* boolean value */
+} known_signs_t;
+
+/* same_mpfr_value returns 1:
+ - if got and ref have the same value and known_sign is true,
+ or
+ - if they have the same absolute value, got = 0 or got = inf, and known_sign is
+ false.
+ returns 0 in other cases.
+ Unlike mpfr_cmp, same_mpfr_value(got, ref, x) return 1 when got and
+ ref are both NaNs. */
+extern int same_mpfr_value (mpfr_ptr got, mpfr_ptr ref, int known_sign);
+extern int same_mpc_value (mpc_ptr got, mpc_ptr ref, known_signs_t known_signs);
+
+
+/** GENERIC TESTS **/
+
+typedef int (*CC_func_ptr) (mpc_t, mpc_srcptr, mpc_rnd_t);
+typedef int (*C_CC_func_ptr) (mpc_t, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
+typedef int (*CCCC_func_ptr) (mpc_t, mpc_srcptr, mpc_srcptr, mpc_srcptr,
+ mpc_rnd_t);
+typedef int (*CCU_func_ptr) (mpc_t, mpc_srcptr, unsigned long, mpc_rnd_t);
+typedef int (*CCS_func_ptr) (mpc_t, mpc_srcptr, long, mpc_rnd_t);
+typedef int (*CCI_func_ptr) (mpc_t, mpc_srcptr, int, mpc_rnd_t);
+typedef int (*CCF_func_ptr) (mpc_t, mpc_srcptr, mpfr_srcptr, mpc_rnd_t);
+typedef int (*CFC_func_ptr) (mpc_t, mpfr_srcptr, mpc_srcptr, mpc_rnd_t);
+typedef int (*CUC_func_ptr) (mpc_t, unsigned long, mpc_srcptr, mpc_rnd_t);
+typedef int (*CUUC_func_ptr) (mpc_t, unsigned long, unsigned long, mpc_srcptr,
+ mpc_rnd_t);
+typedef int (*FC_func_ptr) (mpfr_t, mpc_srcptr, mpfr_rnd_t);
+typedef int (*CC_C_func_ptr) (mpc_t, mpc_t, mpc_srcptr, mpc_rnd_t, mpc_rnd_t);
+
+typedef union {
+ FC_func_ptr FC; /* output: mpfr_t, input: mpc_t */
+ CC_func_ptr CC; /* output: mpc_t, input: mpc_t */
+ C_CC_func_ptr C_CC; /* output: mpc_t, inputs: (mpc_t, mpc_t) */
+ CCCC_func_ptr CCCC; /* output: mpc_t, inputs: (mpc_t, mpc_t, mpc_t) */
+ CCU_func_ptr CCU; /* output: mpc_t, inputs: (mpc_t, unsigned long) */
+ CCS_func_ptr CCS; /* output: mpc_t, inputs: (mpc_t, long) */
+ CCI_func_ptr CCI; /* output: mpc_t, inputs: (mpc_t, int) */
+ CCF_func_ptr CCF; /* output: mpc_t, inputs: (mpc_t, mpfr_t) */
+ CFC_func_ptr CFC; /* output: mpc_t, inputs: (mpfr_t, mpc_t) */
+ CUC_func_ptr CUC; /* output: mpc_t, inputs: (unsigned long, mpc_t) */
+ CUUC_func_ptr CUUC; /* output: mpc_t, inputs: (ulong, ulong, mpc_t) */
+ CC_C_func_ptr CC_C; /* outputs: (mpc_t, mpc_t), input: mpc_t */
+} func_ptr;
+
+/* the rounding mode is implicit */
+typedef enum {
+ FC, /* output: mpfr_t, input: mpc_t */
+ CC, /* output: mpc_t, input: mpc_t */
+ C_CC, /* output: mpc_t, inputs: (mpc_t, mpc_t) */
+ CCCC, /* output: mpc_t, inputs: (mpc_t, mpc_t, mpc_t) */
+ CCU, /* output: mpc_t, inputs: (mpc_t, unsigned long) */
+ CCS, /* output: mpc_t, inputs: (mpc_t, long) */
+ CCI, /* output: mpc_t, inputs: (mpc_t, int) */
+ CCF, /* output: mpc_t, inputs: (mpc_t, mpfr_t) */
+ CFC, /* output: mpc_t, inputs: (mpfr_t, mpc_t) */
+ CUC, /* output: mpc_t, inputs: (unsigned long, mpc_t) */
+ CUUC, /* output: mpc_t, inputs: (ulong, ulong, mpc_t) */
+ CC_C /* outputs: (mpc_t, mpc_t), input: mpc_t */
+} func_type;
+
+/* properties */
+#define FUNC_PROP_NONE 0
+#define FUNC_PROP_SYMETRIC 1
+
+typedef struct
+{
+ func_ptr pointer;
+ func_type type;
+ const char * name;
+ int properties;
+} mpc_function;
+
+#define DECL_FUNC(_ftype, _fvar, _func) \
+ mpc_function _fvar; \
+ _fvar.pointer._ftype = _func; \
+ _fvar.type = _ftype; \
+ _fvar.name = QUOTE (_func); \
+ _fvar.properties = FUNC_PROP_NONE;
+
+
+/* tgeneric(mpc_function, prec_min, prec_max, step, exp_max) checks rounding
+ with random numbers:
+ - with precision ranging from prec_min to prec_max with an increment of
+ step,
+ - with exponent between -exp_max and exp_max.
+
+ It also checks parameter reuse (it is assumed here that either two mpc_t
+ variables are equal or they are different, in the sense that the real part of
+ one of them cannot be the imaginary part of the other). */
+void tgeneric (mpc_function, mpfr_prec_t, mpfr_prec_t, mpfr_prec_t, mp_exp_t);
+
+
+/** READ FILE WITH TEST DATA SET **/
+/* data_check (function, "data_file_name") checks function results against
+ precomputed data in a file.*/
+extern void data_check (mpc_function, const char *);
+
+extern FILE * open_data_file (const char *file_name);
+extern void close_data_file (FILE *fp);
+
+/* helper file reading functions */
+extern void skip_whitespace_comments (FILE *fp);
+extern void read_ternary (FILE *fp, int* ternary);
+extern void read_mpfr_rounding_mode (FILE *fp, mpfr_rnd_t* rnd);
+extern void read_mpc_rounding_mode (FILE *fp, mpc_rnd_t* rnd);
+extern mpfr_prec_t read_mpfr_prec (FILE *fp);
+extern void read_int (FILE *fp, int *n, const char *name);
+extern size_t read_string (FILE *fp, char **buffer_ptr, size_t buffer_length, const char *name);
+extern void read_mpfr (FILE *fp, mpfr_ptr x, int *known_sign);
+extern void read_mpc (FILE *fp, mpc_ptr z, known_signs_t *ks);
+
+#define TERNARY_NOT_CHECKED 255
+ /* special value to indicate that the ternary value is not checked */
+#define TERNARY_ERROR 254
+ /* special value to indicate that an error occurred in an mpc function */
+
+#endif /* __MPC_TESTS_H */
diff --git a/mpc/tests/mul.dat b/mpc/tests/mul.dat
new file mode 100755
index 0000000000..13ea1e6ba5
--- /dev/null
+++ b/mpc/tests/mul.dat
@@ -0,0 +1,178 @@
+# Data file for mpc_mul
+#
+# Copyright (C) 2008, 2010, 2011, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP1_RE OP1_RE PREC_OP1_IM OP1_IM PREC_OP2_RE OP2_RE PREC_OP2_IM OP2_IM RND_RE RND_IM
+#
+# See add.dat for more details.
+
+# special values (following ISO C99 standard, G.5.1)
+0 0 53 nan 53 +inf 53 -inf 53 -inf 53 -inf 53 -inf N Z
+0 0 53 nan 53 +inf 53 -inf 53 +inf 53 +1 53 -inf Z U
+0 0 53 +inf 53 -inf 53 +inf 53 -inf 53 +inf 53 +0 U D
+0 0 53 +inf 53 -inf 53 +inf 53 +inf 53 -0 53 -1 D N
+0 0 53 -inf 53 +inf 53 -inf 53 -inf 53 -0 53 -1 N U
+0 0 53 -inf 53 +inf 53 -inf 53 +inf 53 +inf 53 nan Z D
+0 0 53 -inf 53 -inf 53 +inf 53 -inf 53 nan 53 -1 U N
+0 0 53 nan 53 nan 53 +inf 53 +inf 53 -0 53 nan D Z
+0 0 53 nan 53 nan 53 -inf 53 -inf 53 nan 53 nan N D
+
+0 0 53 -inf 53 -inf 53 -1 53 -inf 53 +inf 53 -1 N D
+0 0 53 -inf 53 nan 53 -inf 53 +1 53 +inf 53 -0 Z N
+0 0 53 +inf 53 nan 53 +1 53 -inf 53 -0 53 +1 U Z
+0 0 53 nan 53 nan 53 +inf 53 +1 53 -0 53 -0 D U
+0 0 53 nan 53 -inf 53 -1 53 -inf 53 +inf 53 nan N N
+0 0 53 nan 53 -inf 53 -inf 53 +1 53 nan 53 +1 Z Z
+0 0 53 nan 53 nan 53 +1 53 -inf 53 -0 53 nan U U
+0 0 53 nan 53 nan 53 +inf 53 +1 53 nan 53 nan D D
+
+0 0 53 +inf 53 nan 53 -0 53 -inf 53 +0 53 +inf D D
+0 0 53 -inf 53 nan 53 -inf 53 +0 53 +1 53 -0 N Z
+0 0 53 nan 53 nan 53 +0 53 -inf 53 -0 53 -0 Z U
+0 0 53 -inf 53 nan 53 +inf 53 +0 53 -inf 53 nan U D
+0 0 53 -inf 53 nan 53 -0 53 -inf 53 nan 53 -1 D N
+0 0 53 nan 53 nan 53 -inf 53 +0 53 +0 53 nan N U
+0 0 53 nan 53 nan 53 +0 53 -inf 53 nan 53 nan Z D
+
+0 0 53 +1 53 -0 53 +0 53 +1 53 -0 53 -1 Z D
+0 0 53 -0 53 +0 53 -1 53 -0 53 +0 53 -0 U N
+0 0 53 -inf 53 nan 53 -0 53 +1 53 nan 53 +inf D Z
+0 0 53 nan 53 nan 53 +1 53 -0 53 -1 53 nan N D
+0 0 53 nan 53 nan 53 +0 53 +1 53 nan 53 -0 Z N
+0 0 53 nan 53 nan 53 -1 53 -0 53 nan 53 nan U Z
+
+0 0 53 +0 53 +0 53 -0 53 +0 53 +0 53 -0 U Z
+0 0 53 nan 53 nan 53 +0 53 -0 53 nan 53 -inf D U
+0 0 53 nan 53 nan 53 +0 53 +0 53 -1 53 nan N N
+0 0 53 nan 53 nan 53 -0 53 -0 53 nan 53 -0 Z Z
+0 0 53 nan 53 nan 53 -0 53 +0 53 nan 53 nan U U
+
+0 0 53 +inf 53 nan 53 nan 53 -inf 53 nan 53 +inf U U
+0 0 53 -inf 53 nan 53 +inf 53 nan 53 -1 53 nan D D
+0 0 53 nan 53 nan 53 nan 53 -inf 53 nan 53 -0 N Z
+0 0 53 nan 53 nan 53 -inf 53 nan 53 nan 53 nan Z U
+
+0 0 53 nan 53 nan 53 +1 53 nan 53 nan 53 -1 Z U
+0 0 53 nan 53 nan 53 nan 53 +1 53 -0 53 nan U D
+0 0 53 nan 53 nan 53 -1 53 nan 53 nan 53 nan D N
+
+0 0 53 nan 53 nan 53 nan 53 +0 53 +0 53 nan D N
+0 0 53 nan 53 nan 53 +0 53 nan 53 nan 53 nan N U
+
+0 0 53 nan 53 nan 53 nan 53 nan 53 nan 53 nan N U
+
+# pure real arguments
+0 0 53 0x10000000000001p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-52 53 -0 N N
+0 0 53 0x10000000000001p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-52 53 -0 Z Z
+0 0 53 0x10000000000001p-52 53 -0 53 +1 53 -0 53 0x10000000000001p-52 53 -0 U U
+0 0 53 -0x10000000000001p-52 53 -0 53 -1 53 -0 53 0x10000000000001p-52 53 -0 D D
+
+# one pure real argument
+0 0 53 0x10000000000001p-52 53 0x10000000000001p-52 53 +1 53 +1 53 0x10000000000001p-52 53 -0 N N
+0 0 53 0x10000000000001p-52 53 -0x10000000000001p-51 53 +1 53 -2 53 0x10000000000001p-52 53 -0 Z Z
+- + 53 -0x30000000000004p-52 53 0x30000000000004p-52 53 -3 53 +3 53 0x10000000000001p-52 53 +0 N N
++ - 53 -0x30000000000002p-52 53 0x30000000000002p-52 53 -3 53 +3 53 0x10000000000001p-52 53 +0 Z Z
++ + 53 -0x30000000000002p-52 53 0x30000000000004p-52 53 -3 53 +3 53 0x10000000000001p-52 53 +0 U U
+- - 53 -0x30000000000004p-52 53 0x30000000000002p-52 53 -3 53 +3 53 0x10000000000001p-52 53 +0 D D
+0 0 53 -0x10000000000001p-52 53 -0x10000000000001p-50 53 -1 53 -4 53 0x10000000000001p-52 53 +0 D D
+0 0 53 +0 53 +0 53 +0 53 +0 53 0x10000000000001p-52 53 -1 N N
+0 0 53 +0 53 -0 53 +0 53 -0 53 0x10000000000001p-52 53 -2 Z Z
+0 0 53 +0 53 +0 53 +0 53 +0 53 0x10000000000001p-52 53 +3 U U
+0 0 53 -0 53 -0 53 -0 53 -0 53 0x10000000000001p-52 53 +4 D D
+
+# pure imaginary arguments
+0 0 53 -0x10000000000001p-52 53 -0 53 -0 53 0x10000000000001p-52 53 -0 53 +1 N N
+0 0 53 -0x10000000000001p-52 53 +0 53 +0 53 0x10000000000001p-52 53 -0 53 +1 Z Z
+0 0 53 -0x10000000000001p-52 53 +0 53 +0 53 0x10000000000001p-52 53 -0 53 +1 U U
+0 0 53 -0x10000000000001p-52 53 -0 53 -0 53 0x10000000000001p-52 53 -0 53 +1 D D
+
+# one pure imaginary argument
+0 0 53 -0x10000000000001p-52 53 -0x10000000000001p-52 53 -0 53 0x10000000000001p-52 53 -1 53 +1 N N
+0 0 53 +0x10000000000001p-52 53 -0x10000000000001p-51 53 +0 53 0x10000000000001p-52 53 -2 53 -1 Z Z
++ - 53 0x30000000000004p-52 53 -0x30000000000004p-52 53 +0 53 0x10000000000001p-52 53 -3 53 -3 N N
+- + 53 0x30000000000002p-52 53 -0x30000000000002p-52 53 +0 53 0x10000000000001p-52 53 -3 53 -3 Z Z
++ + 53 0x30000000000004p-52 53 -0x30000000000002p-52 53 +0 53 0x10000000000001p-52 53 -3 53 -3 U U
+- - 53 0x30000000000002p-52 53 -0x30000000000004p-52 53 +0 53 0x10000000000001p-52 53 -3 53 -3 D D
+0 0 53 +0x10000000000001p-52 53 -0x10000000000001p-50 53 -0 53 0x10000000000001p-52 53 -4 53 -1 D D
+
+# big precision uses Karatsuba method
+0 0 4096 0x1420176785BD601FC018AD36471p-96 4096 -0x1ECCDBDA38B2611A32848E7ADF43p-100 53 0x6B2E363676587p-44 53 0x1AC20AAC49ED37p-47 53 0x12264C57B44C6Bp-53 53 -0x138639A4B8D8B3p-50 N N
+
+# Karatsuba case where x=0 since ad=bc: (1+i)^2 at artificially high
+# precision so that Karatsuba is actually used.
+0 0 4096 0 4096 2 4096 1 4096 1 4096 1 4096 1 N N
+# trigger the line reducing prec_x to prec_u
+0 0 4096 0 4096 2 40960 1 40960 1 40960 1 40960 1 N N
+# another particular cases
++ + 6 -0x9p-497 6 0x33p-315 6 -0x1dp-73 6 0x3p148 6 0x11p-463 6 0x3p-645 N N
++ - 6 0x33p-315 6 0x9p-497 6 0x3p148 6 0x1dp-73 6 0x11p-463 6 0x3p-645 N N
+0 0 4 0x1p-1902 4 0x3p-1085 4 -0x1p-892 4 -0x3p-75 4 -0x1p-1010 4 0 N N
+
+# a few particular values
+0 0 8 10 8 -5 8 4 8 3 8 1 8 -2 N N
++ + 27 0b1.10110000001100010010000000e-3 27 0b1.00111100000010100001011001e-1 27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3 27 0b1.10100101110110011011100100e-1 27 0b1.10111100011000001100110011e-1 N N
+0 0 15 2 15 0 15 -1 15 -1 15 -1 15 1 N N
+
+# check squares, copied from sqr.dat
++ - 53 0xfdbac097c8dc58p+2096 53 -0x7f6e5d4c3b2a2p+1036 53 -0xfedcba9876543p+1024 53 0x10000000000001p-42 53 -0xfedcba9876543p+1024 53 0x10000000000001p-42 U D
++ 0 30 309485009533114692573069312 30 18889465966662952943616 30 17592186044416 30 536870913 30 17592186044416 30 536870913 N N
+0 0 4 0 4 2 4 1 4 1 4 1 4 1 N N
++ + 8 0b1.1000111e-3 8 0b1.1100111e-3 27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3 27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3 N N
+? + 3464 inf 3464 inf 866 -0x2.5763c6519ef1510f8afa101a210b8030b1909cc17004db561a25d9b53e2c08c41c01e8bbac5af6299b9d8786030aa14943d841798c8c369287942e4d4cec42a60ab0922af931159805e631128e97f973754ad53972d5d320a651a3b4a667f0ef2b92dbd698d159c3642675140@192158913 866 -0xd.15f2d530934dd930d66e89d70762d2337a8f973dd6915eb6b532fd372fcc955df1d852632d4e46fe64154ceda991a1302caf1b0ec622497e3e5724dd05b1c89a06e28d7e18e8af58f5ff4c9998cb31714688867524f41e0b31e847c1bf40de5127f858069998efd7c3e599080@192158893 866 -0x2.5763c6519ef1510f8afa101a210b8030b1909cc17004db561a25d9b53e2c08c41c01e8bbac5af6299b9d8786030aa14943d841798c8c369287942e4d4cec42a60ab0922af931159805e631128e97f973754ad53972d5d320a651a3b4a667f0ef2b92dbd698d159c3642675140@192158913 866 -0xd.15f2d530934dd930d66e89d70762d2337a8f973dd6915eb6b532fd372fcc955df1d852632d4e46fe64154ceda991a1302caf1b0ec622497e3e5724dd05b1c89a06e28d7e18e8af58f5ff4c9998cb31714688867524f41e0b31e847c1bf40de5127f858069998efd7c3e599080@192158893 N N
+? + 2256 0 2256 -0 564 0xc.87999bfd1cb1a64288881e214b7cf1af979863b23c030b79c4a8bebb39177967608388a2e4df527977e7755a25df8af8f72fdd6dd2f42bd00de83088b4e9b59ce85caf2e6b0c0@-184298749 564 -0x2.5109af459d4daf357e09475ec991cdc9b02c8f7dfacdc060d2a24710d09c997f8aea6dbd46f10828c30b583fdcc90d7dcbb895689d594d3813db40784d2309e450d1fb6e38da8@-184298726 564 0xc.87999bfd1cb1a64288881e214b7cf1af979863b23c030b79c4a8bebb39177967608388a2e4df527977e7755a25df8af8f72fdd6dd2f42bd00de83088b4e9b59ce85caf2e6b0c0@-184298749 564 -0x2.5109af459d4daf357e09475ec991cdc9b02c8f7dfacdc060d2a24710d09c997f8aea6dbd46f10828c30b583fdcc90d7dcbb895689d594d3813db40784d2309e450d1fb6e38da8@-184298726 N N
+
+# intermediate over- and underflows
+- + 100 -inf 100 +inf 100 0x1@125000750 100 0x3@125000750 100 0x1@225000750 100 0x2@225000750 N N
+- + 100 -inf 100 +inf 100 0x1@225000750 100 0x2@225000750 100 0x1@125000750 100 0x3@125000750 N N
+- - 100 -inf 100 -inf 100 0x1@225000750 100 -0x2@225000750 100 0x1@125000750 100 -0x3@125000750 N N
++ - 100 -0 100 +0 100 0x1@-125000750 100 0x3@-125000750 100 0x1@-225000750 100 0x2@-225000750 N N
++ - 100 -0 100 +0 100 0x1@-225000750 100 0x2@-225000750 100 0x1@-125000750 100 0x3@-125000750 N N
+- - 100 +0 100 +0 100 0x3@-125000750 100 0x1@-125000750 100 0x1@-225000750 100 0x2@-225000750 N N
+- - 100 +0 100 +0 100 0x4@-125000750 100 0x1@-125000750 100 0x1@-225000750 100 0x2@-225000750 N N
++ - 100 -0 100 +0 100 0x2@-225000750 100 0x1@-225000750 100 0x1@-125000750 100 0x3@-125000750 N N
+0 - 100 +0 100 +0 100 0x1@-225000750 100 0x1@-225000750 100 0x1@-125000750 100 0x1@-125000750 N N
+0 + 100 +0 100 +inf 100 0x1@125000750 100 0x1@125000750 100 0x1@225000750 100 0x1@225000750 N N
++ 0 100 +inf 100 +0 100 0x1@125000750 100 0x1@125000750 100 0x1@225000750 100 -0x1@225000750 N N
+# the same with directed rounding
+- + 10 -inf 10 +inf 10 0x1@125000750 10 0x3@125000750 10 0x1@225000750 10 0x2@225000750 D U
++ - 10 -0b1.111111111e1073741822 10 0b1.111111111e1073741822 10 0x1@125000750 10 0x3@125000750 10 0x1@225000750 10 0x2@225000750 U D
++ - 10 -0 10 +0 10 0x1@-125000750 10 0x3@-125000750 10 0x1@-225000750 10 0x2@-225000750 U D
+- + 10 -0b1e-1073741824 10 0b1e-1073741824 10 0x1@-125000750 10 0x3@-125000750 10 0x1@-225000750 10 0x2@-225000750 D U
+# starting with Karatsuba
+- + 10000 -inf 100 +inf 100 0x1@125000750 100 0x3@125000750 100 0x1@225000750 100 0x2@225000750 N N
+- + 10000 -inf 100 +inf 100 0x1@225000750 100 0x2@225000750 100 0x1@125000750 100 0x3@125000750 N N
+- - 10000 -inf 100 -inf 100 0x1@225000750 100 -0x2@225000750 100 0x1@125000750 100 -0x3@125000750 N N
++ - 10000 -0 100 +0 100 0x1@-125000750 100 0x3@-125000750 100 0x1@-225000750 100 0x2@-225000750 N N
++ - 10000 -0 100 +0 100 0x1@-225000750 100 0x2@-225000750 100 0x1@-125000750 100 0x3@-125000750 N N
+- - 10000 +0 100 +0 100 0x3@-125000750 100 0x1@-125000750 100 0x1@-225000750 100 0x2@-225000750 N N
+- - 10000 +0 100 +0 100 0x4@-125000750 100 0x1@-125000750 100 0x1@-225000750 100 0x2@-225000750 N N
++ - 10000 -0 100 +0 100 0x2@-225000750 100 0x1@-225000750 100 0x1@-125000750 100 0x3@-125000750 N N
+0 - 10000 +0 100 +0 100 0x1@-225000750 100 0x1@-225000750 100 0x1@-125000750 100 0x1@-125000750 N N
+0 + 10000 +0 100 +inf 100 0x1@125000750 100 0x1@125000750 100 0x1@225000750 100 0x1@225000750 N N
++ 0 10000 +inf 100 +0 100 0x1@125000750 100 0x1@125000750 100 0x1@225000750 100 -0x1@225000750 N N
++ + 10000 +inf 100 +inf 100 0x1@125000750 100 0x3@125000750 100 0x1@143434706 100 0x2@143434705 N N
+
+# improve code coverage: case where sign_x==0 in mpc_mul_karatsuba
+0 0 2000 6 2000 8 2000 4 2000 2 2000 2 2000 1 N N
+0 0 2000 0 2000 4 2000 2 2000 2 2000 1 2000 1 N N
+
++ 0 2 1 2 0x2p-536870913 2 1 2 0x1p-536870913 2 1 2 0x1p-536870913 N N
+0 - 2 0 2 1 2 0x1p-536870913 2 1 2 1 2 0x1p-536870913 N N
diff --git a/mpc/tests/mul_fr.dat b/mpc/tests/mul_fr.dat
new file mode 100644
index 0000000000..e284093099
--- /dev/null
+++ b/mpc/tests/mul_fr.dat
@@ -0,0 +1,368 @@
+# Data file for mpc_mul_fr.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see add_fr.dat.
+
+# special values
+0 0 7 +inf 7 +inf 7 -inf 7 -inf 7 -inf N N
+0 0 7 +inf 7 +inf 7 -inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 +0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -inf 7 nan N N
+0 0 7 +inf 7 +inf 7 -inf 7 -1 7 -inf N N
+0 0 7 +inf 7 1 7 -inf 7 -1 7 -1 N N
+0 0 7 nan 7 +0 7 -inf 7 -1 7 -0 N N
+0 0 7 nan 7 -0 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 -1 7 -inf 7 -1 7 1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -1 7 nan N N
+0 0 7 +inf 7 nan 7 -inf 7 -0 7 -inf N N
+0 0 7 +inf 7 +0 7 -inf 7 -0 7 -1 N N
+0 0 7 nan 7 +0 7 -inf 7 -0 7 -0 N N
+0 0 7 nan 7 -0 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 7 1 N N
+0 0 7 -inf 7 nan 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 -0 7 nan N N
+0 0 7 +inf 7 nan 7 -inf 7 +0 7 -inf N N
+0 0 7 +inf 7 -0 7 -inf 7 +0 7 -1 N N
+0 0 7 nan 7 -0 7 -inf 7 +0 7 -0 N N
+0 0 7 nan 7 +0 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 7 1 N N
+0 0 7 -inf 7 nan 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +0 7 nan N N
+0 0 7 +inf 7 -inf 7 -inf 7 1 7 -inf N N
+0 0 7 +inf 7 -1 7 -inf 7 1 7 -1 N N
+0 0 7 nan 7 -0 7 -inf 7 1 7 -0 N N
+0 0 7 nan 7 +0 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 1 7 -inf 7 1 7 1 N N
+0 0 7 -inf 7 +inf 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 1 7 nan N N
+0 0 7 +inf 7 -inf 7 -inf 7 +inf 7 -inf N N
+0 0 7 +inf 7 -inf 7 -inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 1 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 +inf 7 nan N N
+0 0 7 +inf 7 nan 7 -inf 7 nan 7 -inf N N
+0 0 7 +inf 7 nan 7 -inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 +0 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 1 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan N N
+0 0 7 +inf 7 +inf 7 -1 7 -inf 7 -inf N N
+0 0 7 1 7 +inf 7 -1 7 -inf 7 -1 N N
+0 0 7 +0 7 nan 7 -1 7 -inf 7 -0 N N
+0 0 7 -0 7 nan 7 -1 7 -inf 7 +0 N N
+0 0 7 -1 7 -inf 7 -1 7 -inf 7 1 N N
+0 0 7 -inf 7 -inf 7 -1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -inf 7 nan N N
+0 0 7 +inf 7 +inf 7 -1 7 -1 7 -inf N N
+0 0 7 -inf 7 -inf 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -1 7 nan N N
+0 0 7 +inf 7 nan 7 -1 7 -0 7 -inf N N
+0 0 7 -inf 7 nan 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 -0 7 nan N N
+0 0 7 +inf 7 nan 7 -1 7 +0 7 -inf N N
+0 0 7 -inf 7 nan 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +0 7 nan N N
+0 0 7 +inf 7 -inf 7 -1 7 1 7 -inf N N
+0 0 7 -inf 7 +inf 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 1 7 nan N N
+0 0 7 +inf 7 -inf 7 -1 7 +inf 7 -inf N N
+0 0 7 1 7 -inf 7 -1 7 +inf 7 -1 N N
+0 0 7 +0 7 nan 7 -1 7 +inf 7 -0 N N
+0 0 7 -0 7 nan 7 -1 7 +inf 7 +0 N N
+0 0 7 -1 7 +inf 7 -1 7 +inf 7 1 N N
+0 0 7 -inf 7 +inf 7 -1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 +inf 7 nan N N
+0 0 7 +inf 7 nan 7 -1 7 nan 7 -inf N N
+0 0 7 1 7 nan 7 -1 7 nan 7 -1 N N
+0 0 7 +0 7 nan 7 -1 7 nan 7 -0 N N
+0 0 7 -0 7 nan 7 -1 7 nan 7 +0 N N
+0 0 7 -1 7 nan 7 -1 7 nan 7 1 N N
+0 0 7 -inf 7 nan 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan N N
+0 0 7 nan 7 +inf 7 -0 7 -inf 7 -inf N N
+0 0 7 +0 7 +inf 7 -0 7 -inf 7 -1 N N
+0 0 7 +0 7 nan 7 -0 7 -inf 7 -0 N N
+0 0 7 -0 7 nan 7 -0 7 -inf 7 +0 N N
+0 0 7 -0 7 -inf 7 -0 7 -inf 7 1 N N
+0 0 7 nan 7 -inf 7 -0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -inf 7 nan N N
+0 0 7 nan 7 +inf 7 -0 7 -1 7 -inf N N
+0 0 7 nan 7 -inf 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +0 7 nan N N
+0 0 7 nan 7 -inf 7 -0 7 1 7 -inf N N
+0 0 7 nan 7 +inf 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 1 7 nan N N
+0 0 7 nan 7 -inf 7 -0 7 +inf 7 -inf N N
+0 0 7 +0 7 -inf 7 -0 7 +inf 7 -1 N N
+0 0 7 +0 7 nan 7 -0 7 +inf 7 -0 N N
+0 0 7 -0 7 nan 7 -0 7 +inf 7 +0 N N
+0 0 7 -0 7 +inf 7 -0 7 +inf 7 1 N N
+0 0 7 nan 7 +inf 7 -0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 -inf N N
+0 0 7 +0 7 nan 7 -0 7 nan 7 -1 N N
+0 0 7 +0 7 nan 7 -0 7 nan 7 -0 N N
+0 0 7 -0 7 nan 7 -0 7 nan 7 +0 N N
+0 0 7 -0 7 nan 7 -0 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan N N
+0 0 7 nan 7 +inf 7 +0 7 -inf 7 -inf N N
+0 0 7 -0 7 +inf 7 +0 7 -inf 7 -1 N N
+0 0 7 -0 7 nan 7 +0 7 -inf 7 -0 N N
+0 0 7 +0 7 nan 7 +0 7 -inf 7 +0 N N
+0 0 7 +0 7 -inf 7 +0 7 -inf 7 1 N N
+0 0 7 nan 7 -inf 7 +0 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -inf 7 nan N N
+0 0 7 nan 7 +inf 7 +0 7 -1 7 -inf N N
+0 0 7 nan 7 -inf 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 -inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +0 7 nan N N
+0 0 7 nan 7 -inf 7 +0 7 1 7 -inf N N
+0 0 7 nan 7 +inf 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 1 7 nan N N
+0 0 7 nan 7 -inf 7 +0 7 +inf 7 -inf N N
+0 0 7 -0 7 -inf 7 +0 7 +inf 7 -1 N N
+0 0 7 -0 7 nan 7 +0 7 +inf 7 -0 N N
+0 0 7 +0 7 nan 7 +0 7 +inf 7 +0 N N
+0 0 7 +0 7 +inf 7 +0 7 +inf 7 1 N N
+0 0 7 nan 7 +inf 7 +0 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 -inf N N
+0 0 7 -0 7 nan 7 +0 7 nan 7 -1 N N
+0 0 7 -0 7 nan 7 +0 7 nan 7 -0 N N
+0 0 7 +0 7 nan 7 +0 7 nan 7 +0 N N
+0 0 7 +0 7 nan 7 +0 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan N N
+0 0 7 -inf 7 +inf 7 1 7 -inf 7 -inf N N
+0 0 7 -1 7 +inf 7 1 7 -inf 7 -1 N N
+0 0 7 -0 7 nan 7 1 7 -inf 7 -0 N N
+0 0 7 +0 7 nan 7 1 7 -inf 7 +0 N N
+0 0 7 1 7 -inf 7 1 7 -inf 7 1 N N
+0 0 7 +inf 7 -inf 7 1 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -inf 7 nan N N
+0 0 7 -inf 7 +inf 7 1 7 -1 7 -inf N N
+0 0 7 +inf 7 -inf 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -1 7 nan N N
+0 0 7 -inf 7 nan 7 1 7 -0 7 -inf N N
+0 0 7 +inf 7 nan 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 -0 7 nan N N
+0 0 7 -inf 7 nan 7 1 7 +0 7 -inf N N
+0 0 7 +inf 7 nan 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +0 7 nan N N
+0 0 7 -inf 7 -inf 7 1 7 1 7 -inf N N
+0 0 7 +inf 7 +inf 7 1 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 1 7 nan N N
+0 0 7 -inf 7 -inf 7 1 7 +inf 7 -inf N N
+0 0 7 -1 7 -inf 7 1 7 +inf 7 -1 N N
+0 0 7 -0 7 nan 7 1 7 +inf 7 -0 N N
+0 0 7 +0 7 nan 7 1 7 +inf 7 +0 N N
+0 0 7 1 7 +inf 7 1 7 +inf 7 1 N N
+0 0 7 +inf 7 +inf 7 1 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 +inf 7 nan N N
+0 0 7 -inf 7 nan 7 1 7 nan 7 -inf N N
+0 0 7 -1 7 nan 7 1 7 nan 7 -1 N N
+0 0 7 -0 7 nan 7 1 7 nan 7 -0 N N
+0 0 7 +0 7 nan 7 1 7 nan 7 +0 N N
+0 0 7 1 7 nan 7 1 7 nan 7 1 N N
+0 0 7 +inf 7 nan 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan N N
+0 0 7 -inf 7 +inf 7 +inf 7 -inf 7 -inf N N
+0 0 7 -inf 7 +inf 7 +inf 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -inf 7 nan N N
+0 0 7 -inf 7 +inf 7 +inf 7 -1 7 -inf N N
+0 0 7 -inf 7 1 7 +inf 7 -1 7 -1 N N
+0 0 7 nan 7 +0 7 +inf 7 -1 7 -0 N N
+0 0 7 nan 7 -0 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -1 7 +inf 7 -1 7 1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -1 7 nan N N
+0 0 7 -inf 7 nan 7 +inf 7 -0 7 -inf N N
+0 0 7 -inf 7 +0 7 +inf 7 -0 7 -1 N N
+0 0 7 nan 7 +0 7 +inf 7 -0 7 -0 N N
+0 0 7 nan 7 -0 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 7 1 N N
+0 0 7 +inf 7 nan 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 -0 7 nan N N
+0 0 7 -inf 7 nan 7 +inf 7 +0 7 -inf N N
+0 0 7 -inf 7 -0 7 +inf 7 +0 7 -1 N N
+0 0 7 nan 7 -0 7 +inf 7 +0 7 -0 N N
+0 0 7 nan 7 +0 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 7 1 N N
+0 0 7 +inf 7 nan 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +0 7 nan N N
+0 0 7 -inf 7 -inf 7 +inf 7 1 7 -inf N N
+0 0 7 -inf 7 -1 7 +inf 7 1 7 -1 N N
+0 0 7 nan 7 -0 7 +inf 7 1 7 -0 N N
+0 0 7 nan 7 +0 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 1 7 +inf 7 1 7 1 N N
+0 0 7 +inf 7 +inf 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 1 7 nan N N
+0 0 7 -inf 7 -inf 7 +inf 7 +inf 7 -inf N N
+0 0 7 -inf 7 -inf 7 +inf 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 +0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 1 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 +inf 7 nan N N
+0 0 7 -inf 7 nan 7 +inf 7 nan 7 -inf N N
+0 0 7 -inf 7 nan 7 +inf 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +0 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 1 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 +inf 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 +0 7 nan 7 -0 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 -0 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 -0 7 nan 7 +0 7 -1 N N
+0 0 7 nan 7 -0 7 nan 7 +0 7 -0 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 -inf 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 -1 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 -0 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 +0 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 1 7 nan 7 1 7 1 N N
+0 0 7 nan 7 +inf 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 1 7 nan N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 -inf 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan N N
+
+# values with only 1, -1, +0, -0
+0 0 7 1 7 1 7 -1 7 -1 7 -1 N N
+0 0 7 +0 7 +0 7 -1 7 -1 7 -0 N N
+0 0 7 -0 7 -0 7 -1 7 -1 7 +0 N N
+0 0 7 -1 7 -1 7 -1 7 -1 7 1 N N
+0 0 7 1 7 +0 7 -1 7 -0 7 -1 N N
+0 0 7 +0 7 +0 7 -1 7 -0 7 -0 N N
+0 0 7 -0 7 -0 7 -1 7 -0 7 +0 N N
+0 0 7 -1 7 -0 7 -1 7 -0 7 1 N N
+0 0 7 1 7 -0 7 -1 7 +0 7 -1 N N
+0 0 7 +0 7 -0 7 -1 7 +0 7 -0 N N
+0 0 7 -0 7 +0 7 -1 7 +0 7 +0 N N
+0 0 7 -1 7 +0 7 -1 7 +0 7 1 N N
+0 0 7 1 7 -1 7 -1 7 1 7 -1 N N
+0 0 7 +0 7 -0 7 -1 7 1 7 -0 N N
+0 0 7 -0 7 +0 7 -1 7 1 7 +0 N N
+0 0 7 -1 7 1 7 -1 7 1 7 1 N N
+0 0 7 +0 7 1 7 -0 7 -1 7 -1 N N
+0 0 7 +0 7 +0 7 -0 7 -1 7 -0 N N
+0 0 7 -0 7 -0 7 -0 7 -1 7 +0 N N
+0 0 7 -0 7 -1 7 -0 7 -1 7 1 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -1 N N
+0 0 7 +0 7 +0 7 -0 7 -0 7 -0 N N
+0 0 7 -0 7 -0 7 -0 7 -0 7 +0 N N
+0 0 7 -0 7 -0 7 -0 7 -0 7 1 N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 +0 7 -0 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 +0 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 1 N N
+0 0 7 +0 7 -1 7 -0 7 1 7 -1 N N
+0 0 7 +0 7 -0 7 -0 7 1 7 -0 N N
+0 0 7 -0 7 +0 7 -0 7 1 7 +0 N N
+0 0 7 -0 7 1 7 -0 7 1 7 1 N N
+0 0 7 -0 7 1 7 +0 7 -1 7 -1 N N
+0 0 7 -0 7 +0 7 +0 7 -1 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 -1 7 +0 N N
+0 0 7 +0 7 -1 7 +0 7 -1 7 1 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -1 N N
+0 0 7 -0 7 +0 7 +0 7 -0 7 -0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 +0 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 1 N N
+0 0 7 -0 7 -0 7 +0 7 +0 7 -1 N N
+0 0 7 -0 7 -0 7 +0 7 +0 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 +0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 1 N N
+0 0 7 -0 7 -1 7 +0 7 1 7 -1 N N
+0 0 7 -0 7 -0 7 +0 7 1 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 1 7 +0 N N
+0 0 7 +0 7 1 7 +0 7 1 7 1 N N
+0 0 7 -1 7 1 7 1 7 -1 7 -1 N N
+0 0 7 -0 7 +0 7 1 7 -1 7 -0 N N
+0 0 7 +0 7 -0 7 1 7 -1 7 +0 N N
+0 0 7 1 7 -1 7 1 7 -1 7 1 N N
+0 0 7 -1 7 +0 7 1 7 -0 7 -1 N N
+0 0 7 -0 7 +0 7 1 7 -0 7 -0 N N
+0 0 7 +0 7 -0 7 1 7 -0 7 +0 N N
+0 0 7 1 7 -0 7 1 7 -0 7 1 N N
+0 0 7 -1 7 -0 7 1 7 +0 7 -1 N N
+0 0 7 -0 7 -0 7 1 7 +0 7 -0 N N
+0 0 7 +0 7 +0 7 1 7 +0 7 +0 N N
+0 0 7 1 7 +0 7 1 7 +0 7 1 N N
+0 0 7 -1 7 -1 7 1 7 1 7 -1 N N
+0 0 7 -0 7 -0 7 1 7 1 7 -0 N N
+0 0 7 +0 7 +0 7 1 7 1 7 +0 N N
+0 0 7 1 7 1 7 1 7 1 7 1 N N
+
diff --git a/mpc/tests/neg.dat b/mpc/tests/neg.dat
new file mode 100644
index 0000000000..0e036e6d9f
--- /dev/null
+++ b/mpc/tests/neg.dat
@@ -0,0 +1,109 @@
+# Data file for mpc_neg.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM 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)
+0 0 53 +inf 53 +inf 53 -inf 53 -inf N N
+0 0 53 +inf 53 +1 53 -inf 53 -1 N N
+0 0 53 +inf 53 +0 53 -inf 53 -0 N N
+0 0 53 +inf 53 -0 53 -inf 53 +0 N N
+0 0 53 +inf 53 -1 53 -inf 53 +1 N N
+0 0 53 +inf 53 -inf 53 -inf 53 +inf N N
+0 0 53 +inf 53 nan 53 -inf 53 nan N N
+0 0 53 +1 53 +inf 53 -1 53 -inf N N
+0 0 53 +1 53 +0 53 -1 53 -0 N N
+0 0 53 +1 53 -0 53 -1 53 +0 N N
+0 0 53 +1 53 -inf 53 -1 53 +inf N N
+0 0 53 +1 53 nan 53 -1 53 nan N N
+0 0 53 +0 53 +inf 53 -0 53 -inf N N
+0 0 53 +0 53 +1 53 -0 53 -1 N N
+0 0 53 +0 53 +0 53 -0 53 -0 N N
+0 0 53 +0 53 -0 53 -0 53 +0 N N
+0 0 53 +0 53 -1 53 -0 53 +1 N N
+0 0 53 +0 53 -inf 53 -0 53 +inf N N
+0 0 53 +0 53 nan 53 -0 53 nan N N
+0 0 53 -0 53 +inf 53 +0 53 -inf N N
+0 0 53 -0 53 +1 53 +0 53 -1 N N
+0 0 53 -0 53 +0 53 +0 53 -0 N N
+0 0 53 -0 53 -0 53 +0 53 +0 N N
+0 0 53 -0 53 -1 53 +0 53 +1 N N
+0 0 53 -0 53 -inf 53 +0 53 +inf N N
+0 0 53 -0 53 nan 53 +0 53 nan N N
+0 0 53 -1 53 +inf 53 +1 53 -inf N N
+0 0 53 -1 53 +0 53 +1 53 -0 N N
+0 0 53 -1 53 -0 53 +1 53 +0 N N
+0 0 53 -1 53 -inf 53 +1 53 +inf N N
+0 0 53 -1 53 nan 53 +1 53 nan N N
+0 0 53 -inf 53 +inf 53 +inf 53 -inf N N
+0 0 53 -inf 53 +1 53 +inf 53 -1 N N
+0 0 53 -inf 53 +0 53 +inf 53 -0 N N
+0 0 53 -inf 53 -0 53 +inf 53 +0 N N
+0 0 53 -inf 53 -1 53 +inf 53 +1 N N
+0 0 53 -inf 53 -inf 53 +inf 53 +inf N N
+0 0 53 -inf 53 nan 53 +inf 53 nan N N
+0 0 53 nan 53 +inf 53 nan 53 -inf N N
+0 0 53 nan 53 +1 53 nan 53 -1 N N
+0 0 53 nan 53 +0 53 nan 53 -0 N N
+0 0 53 nan 53 -0 53 nan 53 +0 N N
+0 0 53 nan 53 -1 53 nan 53 +1 N N
+0 0 53 nan 53 -inf 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
+0 0 53 -0x123456789abcdep+52 2 -0 53 0x123456789abcdep+52 17 +0 N N
+0 0 53 0x123456789abcdep+52 3 -0 54 -0x123456789abcdep+52 16 +0 Z N
+0 0 53 -0x123456789abcdep+52 4 +0 55 0x123456789abcdep+52 15 -0 U N
+0 0 53 0x123456789abcdep+52 5 +0 56 -0x123456789abcdep+52 14 -0 D N
+0 0 53 -0x123456789abcdep+52 6 -0 57 0x123456789abcdep+52 13 +0 Z Z
+0 0 53 0x123456789abcdep+52 7 -0 58 -0x123456789abcdep+52 12 +0 U Z
+0 0 53 -0x123456789abcdep+52 8 +0 59 0x123456789abcdep+52 11 -0 D Z
+0 0 53 0x123456789abcdep+52 9 +0 60 -0x123456789abcdep+52 10 -0 N Z
+0 0 53 -0x123456789abcdep+52 10 -0 61 0x123456789abcdep+52 9 +0 U U
+0 0 53 0x123456789abcdep+52 11 -0 62 -0x123456789abcdep+52 8 +0 D U
+0 0 53 -0x123456789abcdep+52 12 +0 63 0x123456789abcdep+52 7 -0 N U
+0 0 53 0x123456789abcdep+52 13 +0 64 -0x123456789abcdep+52 6 -0 Z U
+0 0 53 -0x123456789abcdep+52 14 -0 65 0x123456789abcdep+52 5 +0 D D
+0 0 53 0x123456789abcdep+52 15 -0 66 -0x123456789abcdep+52 4 +0 N D
+0 0 53 -0x123456789abcdep+52 16 +0 67 0x123456789abcdep+52 3 -0 Z D
+0 0 53 0x123456789abcdep+52 17 +0 68 -0x123456789abcdep+52 2 -0 U D
+
+# pure imaginary argument
+0 0 53 -0 53 -0x123456789abcdep+52 53 +0 53 0x123456789abcdep+52 N N
+0 0 53 +0 53 -0x123456789abcdep+52 51 -0 54 0x123456789abcdep+52 Z N
+0 0 53 -0 53 0x123456789abcdep+52 49 +0 55 -0x123456789abcdep+52 U N
+0 0 53 +0 53 0x123456789abcdep+52 47 -0 56 -0x123456789abcdep+52 D N
+0 0 53 -0 53 -0x123456789abcdep+52 45 +0 57 0x123456789abcdep+52 Z Z
+0 0 53 +0 53 -0x123456789abcdep+52 43 -0 58 0x123456789abcdep+52 U Z
+0 0 53 -0 53 0x123456789abcdep+52 41 +0 59 -0x123456789abcdep+52 D Z
+0 0 53 +0 53 0x123456789abcdep+52 39 -0 60 -0x123456789abcdep+52 N Z
+0 0 53 -0 53 -0x123456789abcdep+52 37 +0 61 0x123456789abcdep+52 U U
+0 0 53 +0 53 -0x123456789abcdep+52 35 -0 62 0x123456789abcdep+52 D U
+0 0 53 -0 53 0x123456789abcdep+52 33 +0 63 -0x123456789abcdep+52 N U
+0 0 53 +0 53 0x123456789abcdep+52 31 -0 64 -0x123456789abcdep+52 Z U
+0 0 53 -0 53 -0x123456789abcdep+52 29 +0 65 0x123456789abcdep+52 D D
+0 0 53 +0 53 -0x123456789abcdep+52 27 -0 66 0x123456789abcdep+52 N D
+0 0 53 -0 53 0x123456789abcdep+52 25 +0 67 -0x123456789abcdep+52 Z D
+0 0 53 +0 53 0x123456789abcdep+52 23 -0 68 -0x123456789abcdep+52 U D
+
diff --git a/mpc/tests/norm.dat b/mpc/tests/norm.dat
new file mode 100644
index 0000000000..1a7e341cbe
--- /dev/null
+++ b/mpc/tests/norm.dat
@@ -0,0 +1,166 @@
+# Data file for mpc_norm.
+#
+# Copyright (C) 2008, 2010, 2011 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see abs.dat.
+
+# special values
+0 7 +inf 7 -inf 7 -inf N
+0 7 +inf 7 -inf 7 -1 N
+0 7 +inf 7 -inf 7 -0 N
+0 7 +inf 7 -inf 7 +0 N
+0 7 +inf 7 -inf 7 1 N
+0 7 +inf 7 -inf 7 +inf N
+0 7 +inf 7 -inf 7 nan N
+0 7 +inf 7 -1 7 -inf N
+0 7 +inf 7 -1 7 +inf N
+0 7 nan 7 -1 7 nan N
+0 7 +inf 7 -0 7 -inf N
+0 7 +inf 7 -0 7 +inf N
+0 7 nan 7 -0 7 nan N
+0 7 +inf 7 +0 7 -inf N
+0 7 +inf 7 +0 7 +inf N
+0 7 nan 7 +0 7 nan N
+0 7 +inf 7 1 7 -inf N
+0 7 +inf 7 1 7 +inf N
+0 7 nan 7 1 7 nan N
+0 7 +inf 7 +inf 7 -inf N
+0 7 +inf 7 +inf 7 -1 N
+0 7 +inf 7 +inf 7 -0 N
+0 7 +inf 7 +inf 7 +0 N
+0 7 +inf 7 +inf 7 1 N
+0 7 +inf 7 +inf 7 +inf N
+0 7 +inf 7 +inf 7 nan N
+0 7 +inf 7 nan 7 -inf N
+0 7 nan 7 nan 7 -1 N
+0 7 nan 7 nan 7 -0 N
+0 7 nan 7 nan 7 +0 N
+0 7 nan 7 nan 7 1 N
+0 7 +inf 7 nan 7 +inf N
+0 7 nan 7 nan 7 nan N
+
+# values with only 1, -1, +0, -0
+0 7 2 7 -1 7 -1 N
+0 7 1 7 -1 7 -0 N
+0 7 1 7 -1 7 +0 N
+0 7 2 7 -1 7 1 N
+0 7 1 7 -0 7 -1 N
+0 7 +0 7 -0 7 -0 N
+0 7 +0 7 -0 7 +0 N
+0 7 1 7 -0 7 1 N
+0 7 1 7 +0 7 -1 N
+0 7 +0 7 +0 7 -0 N
+0 7 +0 7 +0 7 +0 N
+0 7 1 7 +0 7 1 N
+0 7 2 7 1 7 -1 N
+0 7 1 7 1 7 -0 N
+0 7 1 7 1 7 +0 N
+0 7 2 7 1 7 1 N
+
+# overflow
++ 53 +inf 2 0x1p536870912 2 0x1p536870912 U
+
+# infinite loop reported by E. Thome
+- 250 +0 250 -0xf.fdda3457c3e69e5841461d505b42987feb42867a4a2d2872179c4efa20054c0@-136943039 250 -0xc.670d1beda685fdd771b6246e32ff49ec4fd70aec25367444e00933e6965d3c0@-136943040 N
+
+# inexact values: norm (2+i)=5, in the middle between two values at precision 2
+- 2 4 2 2 2 1 D
+- 2 4 2 2 2 1 Z
++ 2 6 2 2 2 1 U
+- 2 4 2 2 2 1 N
+
+# over- and underflows
++ 10 inf 10 0 10 0b1@536870912 N
++ 10 inf 10 0 10 0b1@536870912 U
+- 10 0b1.111111111@1073741822 10 0 10 0b1@536870912 D
+- 10 0b1.111111111@1073741822 10 0 10 0b1@536870912 Z
+- 10 0 10 0 10 0b1@-536870913 N
+- 10 0 10 0 10 0b1@-536870913 D
+- 10 0 10 0 10 0b1@-536870913 Z
++ 10 0b1.000000000e-1073741824 10 0 10 0b1@-536870913 U
+
++ 10 inf 10 0b1@536870912 10 0 N
++ 10 inf 10 0b1@536870912 10 0 U
+- 10 0b1.111111111@1073741822 10 0b1@536870912 10 0 D
+- 10 0b1.111111111@1073741822 10 0b1@536870912 10 0 Z
+- 10 0 10 0b1@-536870913 10 0 N
+- 10 0 10 0b1@-536870913 10 0 D
+- 10 0 10 0b1@-536870913 10 0 Z
++ 10 0b1.000000000e-1073741824 10 0b1@-536870913 10 0 U
+
++ 10 inf 10 1 10 0b1@536870912 N
++ 10 inf 10 1 10 0b1@536870912 U
+- 10 0b1.111111111@1073741822 10 1 10 0b1@536870912 D
+- 10 0b1.111111111@1073741822 10 1 10 0b1@536870912 Z
+- 10 1 10 1 10 0b1@-536870913 N
+- 10 1 10 1 10 0b1@-536870913 D
+- 10 1 10 1 10 0b1@-536870913 Z
++ 10 0b1.000000001 10 1 10 0b1@-536870913 U
+
++ 10 inf 10 0b1@536870912 10 1 N
++ 10 inf 10 0b1@536870912 10 1 U
+- 10 0b1.111111111@1073741822 10 0b1@536870912 10 1 D
+- 10 0b1.111111111@1073741822 10 0b1@536870912 10 1 Z
+- 10 1 10 0b1@-536870913 10 1 N
+- 10 1 10 0b1@-536870913 10 1 D
+- 10 1 10 0b1@-536870913 10 1 Z
++ 10 0b1.000000001 10 0b1@-536870913 10 1 U
+
++ 3 inf 10 0b1.1 10 0b1@536870912 N
++ 3 inf 10 0b1.1 10 0b1@536870912 U
+- 3 0b1.11@1073741822 10 0b1.1 10 0b1@536870912 D
+- 3 0b1.11@1073741822 10 0b1.1 10 0b1@536870912 Z
++ 3 2.5 10 0b1.1 10 0b1@-536870913 N
+- 3 2 10 0b1.1 10 0b1@-536870913 D
+- 3 2 10 0b1.1 10 0b1@-536870913 Z
++ 3 0b1.01@1 10 0b1.1 10 0b1@-536870913 U
+
++ 3 inf 10 0b1@536870912 10 0b1.1 N
++ 3 inf 10 0b1@536870912 10 0b1.1 U
+- 3 0b1.11@1073741822 10 0b1@536870912 10 0b1.1 D
+- 3 0b1.11@1073741822 10 0b1@536870912 10 0b1.1 Z
++ 3 2.5 10 0b1@-536870913 10 0b1.1 N
+- 3 2 10 0b1@-536870913 10 0b1.1 D
+- 3 2 10 0b1@-536870913 10 0b1.1 Z
++ 3 0b1.01@1 10 0b1@-536870913 10 0b1.1 U
+
++ 10 inf 10 0b1@-536870913 10 0b1@536870912 N
++ 10 inf 10 0b1@-536870913 10 0b1@536870912 U
+- 10 0b1.111111111@1073741822 10 0b1@-536870913 10 0b1@536870912 D
+- 10 0b1.111111111@1073741822 10 0b1@-536870912 10 0b1@536870912 Z
++ 10 inf 10 0b1@536870912 10 0b1@-536870913 N
++ 10 inf 10 0b1@536870912 10 0b1@-536870913 U
+- 10 0b1.111111111@1073741822 10 0b1@536870912 10 0b1@-536870913 D
+- 10 0b1.111111111@1073741822 10 0b1@536870912 10 0b1@-536870913 Z
++ 10 inf 10 0b1@536870912 10 0b1@536870912 N
++ 10 inf 10 0b1@536870912 10 0b1@536870912 U
+- 10 0b1.111111111@1073741822 10 0b1@536870912 10 0b1@536870912 D
+- 10 0b1.111111111@1073741822 10 0b1@536870912 10 0b1@536870912 Z
+- 10 0 10 0b1@-536870913 10 0b1@-536870913 N
+- 10 0 10 0b1@-536870913 10 0b1@-536870913 D
+- 10 0 10 0b1@-536870913 10 0b1@-536870913 Z
++ 10 0b1@-1073741824 10 0b1@-536870913 10 0b1@-536870913 U
+
+0 18 0b1.00100000000001001@-1073741811 2 0b1.1@-536870906 2 0b1.1@-536870913 N
+0 18 0b1.00100000000001001@-1073741811 2 0b1.1@-536870913 2 0b1.1@-536870906 N
+0 18 0b1.00100000000001001@-1073741811 2 0b1.1@-536870906 2 0b1.1@-536870913 Z
+0 18 0b1.00100000000001001@-1073741811 2 0b1.1@-536870913 2 0b1.1@-536870906 Z
+0 18 0b1.00100000000001001@-1073741811 2 0b1.1@-536870906 2 0b1.1@-536870913 D
+0 18 0b1.00100000000001001@-1073741811 2 0b1.1@-536870913 2 0b1.1@-536870906 D
+0 18 0b1.00100000000001001@-1073741811 2 0b1.1@-536870906 2 0b1.1@-536870913 U
+0 18 0b1.00100000000001001@-1073741811 2 0b1.1@-536870913 2 0b1.1@-536870906 U
diff --git a/mpc/tests/pow.dat b/mpc/tests/pow.dat
new file mode 100644
index 0000000000..8157ecd06a
--- /dev/null
+++ b/mpc/tests/pow.dat
@@ -0,0 +1,470 @@
+# Data file for mpc_pow.
+#
+# Copyright (C) 2009, 2011, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see add.dat.
+
+0 0 53 +1 53 0 53 nan 53 +0 53 +0 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 +0 53 +1 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 +0 53 -1 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 +1 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 +1 53 +1 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 -1 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 +inf 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 +inf 53 +1 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 +inf 53 -1 N N
+0 0 53 nan 53 nan 53 nan 53 +0 53 -inf 53 +0 N N
+0 0 53 nan 53 nan 53 +inf 53 +0 53 +0 53 +1 N N
+0 0 53 nan 53 nan 53 +inf 53 +0 53 +0 53 -1 N N
+0 0 53 inf 53 nan 53 +inf 53 +0 53 +1 53 +0 N N
+0 0 53 +inf 53 nan 53 +inf 53 +0 53 +1 53 +1 N N
+0 0 53 +inf 53 nan 53 +inf 53 +0 53 +1 53 -1 N N
+0 0 53 0 53 0 53 +inf 53 +0 53 -1 53 +0 N N
+0 0 53 0 53 0 53 +inf 53 +0 53 -1 53 +1 N N
+0 0 53 0 53 0 53 +inf 53 +0 53 -1 53 -1 N N
+0 0 53 nan 53 nan 53 +inf 53 +0 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 +inf 53 +0 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 +inf 53 +0 53 nan 53 -1 N N
+0 0 53 +inf 53 nan 53 +inf 53 +0 53 +inf 53 +0 N N
+0 0 53 +inf 53 nan 53 +inf 53 +0 53 +inf 53 +1 N N
+0 0 53 +inf 53 nan 53 +inf 53 +0 53 +inf 53 -1 N N
+0 0 53 0 53 0 53 +inf 53 +0 53 -inf 53 +0 N N
+0 0 53 0 53 0 53 +inf 53 +0 53 -inf 53 +1 N N
+0 0 53 0 53 0 53 +inf 53 +0 53 -inf 53 -1 N N
+0 0 53 nan 53 nan 53 +inf 53 +1 53 +0 53 +1 N N
+0 0 53 nan 53 nan 53 +inf 53 +1 53 +0 53 -1 N N
+0 0 53 +inf 53 nan 53 +inf 53 +1 53 +1 53 +0 N N
+0 0 53 +inf 53 nan 53 +inf 53 +1 53 +1 53 +1 N N
+0 0 53 +inf 53 nan 53 +inf 53 +1 53 +1 53 -1 N N
+0 0 53 0 53 0 53 +inf 53 +1 53 -1 53 +0 N N
+0 0 53 0 53 0 53 +inf 53 +1 53 -1 53 +1 N N
+0 0 53 0 53 0 53 +inf 53 +1 53 -1 53 -1 N N
+0 0 53 nan 53 nan 53 +inf 53 +1 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 +inf 53 +1 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 +inf 53 +1 53 nan 53 -1 N N
+0 0 53 +inf 53 nan 53 +inf 53 +1 53 +inf 53 +0 N N
+0 0 53 +inf 53 nan 53 +inf 53 +1 53 +inf 53 +1 N N
+0 0 53 +inf 53 nan 53 +inf 53 +1 53 +inf 53 -1 N N
+0 0 53 0 53 0 53 +inf 53 +1 53 -inf 53 +0 N N
+0 0 53 0 53 0 53 +inf 53 +1 53 -inf 53 +1 N N
+0 0 53 0 53 0 53 +inf 53 +1 53 -inf 53 -1 N N
+0 0 53 nan 53 nan 53 +inf 53 -1 53 +0 53 +1 N N
+0 0 53 nan 53 nan 53 +inf 53 -1 53 +0 53 -1 N N
+0 0 53 +inf 53 nan 53 +inf 53 -1 53 +1 53 +0 N N
+0 0 53 +inf 53 nan 53 +inf 53 -1 53 +1 53 +1 N N
+0 0 53 +inf 53 nan 53 +inf 53 -1 53 +1 53 -1 N N
+0 0 53 0 53 0 53 +inf 53 -1 53 -1 53 +0 N N
+0 0 53 0 53 0 53 +inf 53 -1 53 -1 53 +1 N N
+0 0 53 0 53 0 53 +inf 53 -1 53 -1 53 -1 N N
+0 0 53 nan 53 nan 53 +inf 53 -1 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 +inf 53 -1 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 +inf 53 -1 53 nan 53 -1 N N
+0 0 53 +inf 53 nan 53 +inf 53 -1 53 +inf 53 +0 N N
+0 0 53 +inf 53 nan 53 +inf 53 -1 53 +inf 53 +1 N N
+0 0 53 +inf 53 nan 53 +inf 53 -1 53 +inf 53 -1 N N
+0 0 53 0 53 0 53 +inf 53 -1 53 -inf 53 +0 N N
+0 0 53 0 53 0 53 +inf 53 -1 53 -inf 53 +1 N N
+0 0 53 0 53 0 53 +inf 53 -1 53 -inf 53 -1 N N
+0 0 53 nan 53 nan 53 -inf 53 +0 53 +0 53 +1 N N
+0 0 53 nan 53 nan 53 -inf 53 +0 53 +0 53 -1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +0 53 +1 53 +0 N N
+0 0 53 +inf 53 nan 53 -inf 53 +0 53 +1 53 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +0 53 +1 53 -1 N N
+0 0 53 0 53 0 53 -inf 53 +0 53 -1 53 +0 N N
+0 0 53 0 53 0 53 -inf 53 +0 53 -1 53 +1 N N
+0 0 53 0 53 0 53 -inf 53 +0 53 -1 53 -1 N N
+0 0 53 nan 53 nan 53 -inf 53 +0 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 -inf 53 +0 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 -inf 53 +0 53 nan 53 -1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +0 53 +inf 53 +0 N N
+0 0 53 +inf 53 nan 53 -inf 53 +0 53 +inf 53 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +0 53 +inf 53 -1 N N
+0 0 53 0 53 0 53 -inf 53 +0 53 -inf 53 +0 N N
+0 0 53 0 53 0 53 -inf 53 +0 53 -inf 53 +1 N N
+0 0 53 0 53 0 53 -inf 53 +0 53 -inf 53 -1 N N
+0 0 53 nan 53 nan 53 -inf 53 +1 53 +0 53 +1 N N
+0 0 53 nan 53 nan 53 -inf 53 +1 53 +0 53 -1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +1 53 +1 53 +0 N N
+0 0 53 +inf 53 nan 53 -inf 53 +1 53 +1 53 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +1 53 +1 53 -1 N N
+0 0 53 0 53 0 53 -inf 53 +1 53 -1 53 +0 N N
+0 0 53 0 53 0 53 -inf 53 +1 53 -1 53 +1 N N
+0 0 53 0 53 0 53 -inf 53 +1 53 -1 53 -1 N N
+0 0 53 nan 53 nan 53 -inf 53 +1 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 -inf 53 +1 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 -inf 53 +1 53 nan 53 -1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +1 53 +inf 53 +0 N N
+0 0 53 +inf 53 nan 53 -inf 53 +1 53 +inf 53 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +1 53 +inf 53 -1 N N
+0 0 53 0 53 0 53 -inf 53 +1 53 -inf 53 +0 N N
+0 0 53 0 53 0 53 -inf 53 +1 53 -inf 53 +1 N N
+0 0 53 0 53 0 53 -inf 53 +1 53 -inf 53 -1 N N
+0 0 53 nan 53 nan 53 -inf 53 -1 53 +0 53 +1 N N
+0 0 53 nan 53 nan 53 -inf 53 -1 53 +0 53 -1 N N
+0 0 53 +inf 53 nan 53 -inf 53 -1 53 +1 53 +0 N N
+0 0 53 +inf 53 nan 53 -inf 53 -1 53 +1 53 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 -1 53 +1 53 -1 N N
+0 0 53 0 53 0 53 -inf 53 -1 53 -1 53 +0 N N
+0 0 53 0 53 0 53 -inf 53 -1 53 -1 53 +1 N N
+0 0 53 0 53 0 53 -inf 53 -1 53 -1 53 -1 N N
+0 0 53 nan 53 nan 53 -inf 53 -1 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 -inf 53 -1 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 -inf 53 -1 53 nan 53 -1 N N
+0 0 53 +inf 53 nan 53 -inf 53 -1 53 +inf 53 +0 N N
+0 0 53 +inf 53 nan 53 -inf 53 -1 53 +inf 53 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 -1 53 +inf 53 -1 N N
+0 0 53 0 53 0 53 -inf 53 -1 53 -inf 53 +0 N N
+0 0 53 0 53 0 53 -inf 53 -1 53 -inf 53 +1 N N
+0 0 53 0 53 0 53 -inf 53 -1 53 -inf 53 -1 N N
+
+0 0 53 1 53 +0 53 +0 53 +0 53 +0 53 +0 N N
+0 0 53 1 53 +0 53 +0 53 +0 53 -0 53 +0 N N
+0 0 53 1 53 +0 53 +0 53 -0 53 +0 53 +0 N N
+0 0 53 1 53 +0 53 +0 53 -0 53 -0 53 +0 N N
+0 0 53 1 53 +0 53 -0 53 +0 53 +0 53 +0 N N
+0 0 53 1 53 +0 53 -0 53 +0 53 -0 53 +0 N N
+0 0 53 1 53 +0 53 -0 53 -0 53 +0 53 +0 N N
+0 0 53 1 53 +0 53 -0 53 -0 53 -0 53 +0 N N
+0 0 53 1 53 +0 53 +0 53 +0 53 +0 53 -0 N N
+0 0 53 1 53 +0 53 +0 53 +0 53 -0 53 -0 N N
+0 0 53 1 53 +0 53 +0 53 -0 53 +0 53 -0 N N
+0 0 53 1 53 +0 53 +0 53 -0 53 -0 53 -0 N N
+0 0 53 1 53 +0 53 -0 53 +0 53 +0 53 -0 N N
+0 0 53 1 53 +0 53 -0 53 +0 53 -0 53 -0 N N
+0 0 53 1 53 +0 53 -0 53 -0 53 +0 53 -0 N N
+0 0 53 1 53 +0 53 -0 53 -0 53 -0 53 -0 N N
+0 0 53 nan 53 nan 53 +0 53 +0 53 +0 53 +1 N N
+0 0 53 nan 53 nan 53 +0 53 +0 53 +0 53 -1 N N
+0 0 53 0 53 0 53 +0 53 +0 53 +1 53 +0 N N
+0 0 53 0 53 0 53 +0 53 +0 53 +1 53 +1 N N
+0 0 53 0 53 0 53 +0 53 +0 53 +1 53 -1 N N
+0 0 53 +inf 53 nan 53 +0 53 +0 53 -1 53 +0 N N
+0 0 53 +inf 53 nan 53 +0 53 +0 53 -1 53 +1 N N
+0 0 53 +inf 53 nan 53 +0 53 +0 53 -1 53 -1 N N
+0 0 53 nan 53 nan 53 +0 53 +0 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 +0 53 +0 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 +0 53 +0 53 nan 53 -1 N N
+0 0 53 0 53 0 53 +0 53 +0 53 +inf 53 +0 N N
+0 0 53 0 53 0 53 +0 53 +0 53 +inf 53 +1 N N
+0 0 53 0 53 0 53 +0 53 +0 53 +inf 53 -1 N N
+0 0 53 +inf 53 nan 53 +0 53 +0 53 -inf 53 +0 N N
+0 0 53 +inf 53 nan 53 +0 53 +0 53 -inf 53 +1 N N
+0 0 53 +inf 53 nan 53 +0 53 +0 53 -inf 53 -1 N N
+
+# zeros with determined sign, see algorithms.tex
+# x^0 = +1 +sign(Im(x))*sign(Re(y))*0i when |x|=1
+0 0 53 +1 53 +0 53 +0 53 +1 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 +0 53 +1 53 +0 53 +0 N D #round toward -oo
+0 0 53 +1 53 +0 53 -0 53 +1 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 -1 53 +0 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 -1 53 -0 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 -0 53 -1 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 +0 53 -1 53 +0 53 +0 N N
+
+0 0 53 +1 53 +0 53 +0 53 +1 53 +0 53 -0 N N
+0 0 53 +1 53 +0 53 -0 53 +1 53 +0 53 -0 N N
+0 0 53 +1 53 +0 53 -1 53 +0 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 -1 53 -0 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 -0 53 -1 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 +0 53 -1 53 +0 53 -0 N N
+
+0 0 53 +1 53 -0 53 +0 53 +1 53 -0 53 +0 N N
+0 0 53 +1 53 -0 53 -0 53 +1 53 -0 53 +0 N N
+0 0 53 +1 53 -0 53 -1 53 +0 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 -1 53 -0 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 -0 53 -1 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 +0 53 -1 53 -0 53 +0 N N
+
+0 0 53 +1 53 -0 53 +0 53 +1 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 -0 53 +1 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 -1 53 +0 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 -1 53 -0 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 -0 53 -1 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 +0 53 -1 53 -0 53 -0 N N
+
+# x^0 = +1 +sign(Im(y))*0i when |x| > 1
+0 0 53 +1 53 +0 53 +inf 53 +2 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 +inf 53 -0 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 +2 53 +inf 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 +2 53 +0 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 +0 53 +2 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 +0 53 +inf 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 -0 53 +2 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 -0 53 +inf 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 -5 53 +inf 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 -2 53 +0 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 -inf 53 +0 53 +0 53 +0 N N
+0 0 53 +1 53 +0 53 -inf 53 +3 53 +0 53 +0 N N
+
+0 0 53 +1 53 -0 53 +inf 53 -inf 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 +inf 53 +0 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 +inf 53 -2 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 +2 53 -5 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 +5 53 +0 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 +0 53 -inf 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 -0 53 -inf 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 -5 53 -0 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 +inf 53 -0 53 +0 53 -0 N N
+0 0 53 +1 53 -0 53 +inf 53 -2 53 +0 53 -0 N N
+
+0 0 53 +1 53 +0 53 -inf 53 -inf 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 +inf 53 +0 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 +2 53 -5 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 +5 53 +0 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 +5 53 -0 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 +0 53 -2 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 -0 53 -2 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 -5 53 -0 53 -0 53 +0 N N
+0 0 53 +1 53 +0 53 -inf 53 -0 53 -0 53 +0 N N
+
+0 0 53 +1 53 -0 53 +inf 53 +inf 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 +2 53 +5 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 +2 53 +0 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 +2 53 -0 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 +0 53 +2 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 -0 53 +2 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 -5 53 +2 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 -5 53 +0 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 -inf 53 +inf 53 -0 53 -0 N N
+0 0 53 +1 53 -0 53 -inf 53 +inf 53 -0 53 -0 N N
+
+# x^0 = +1 -sign(Im(y))*0i when 1 > |x| > 0
+0 0 53 +1 53 -0 53 +0.5 53 -0.5 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 +0.5 53 +0 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 +0.5 53 -0 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 -0.5 53 -0 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 +0 53 -0.5 53 +0 53 +0 N N
+0 0 53 +1 53 -0 53 -0 53 -0.5 53 +0 53 +0 N N
+
+0 0 53 +1 53 +0 53 +0.5 53 +0.5 53 +0 53 -0 N N
+0 0 53 +1 53 +0 53 +0.5 53 +0 53 +0 53 -0 N N
+0 0 53 +1 53 +0 53 +0.5 53 -0 53 +0 53 -0 N N
+0 0 53 +1 53 +0 53 -0.5 53 +0 53 +0 53 -0 N N
+0 0 53 +1 53 +0 53 +0 53 +0.5 53 +0 53 -0 N N
+0 0 53 +1 53 +0 53 -0 53 +0.5 53 +0 53 -0 N N
+
+0 0 53 +1 53 -0 53 +0.5 53 +0.5 53 -0 53 +0 N N
+0 0 53 +1 53 -0 53 +0.5 53 +0 53 -0 53 +0 N N
+0 0 53 +1 53 -0 53 +0.5 53 -0 53 -0 53 +0 N N
+0 0 53 +1 53 -0 53 -0.5 53 -0 53 -0 53 +0 N N
+0 0 53 +1 53 -0 53 +0 53 +0.5 53 -0 53 +0 N N
+0 0 53 +1 53 -0 53 -0 53 +0.5 53 -0 53 +0 N N
+
+0 0 53 +1 53 +0 53 +0.5 53 -0.5 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 +0.5 53 +0 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 +0.5 53 -0 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 -0.5 53 -0 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 +0 53 -0.5 53 -0 53 -0 N N
+0 0 53 +1 53 +0 53 -0 53 -0.5 53 -0 53 -0 N N
+
+# determined sign of imaginary part in pure real powers
+0 0 53 +9 53 +0 53 +3 53 +0 53 +2 53 +0 N N
+0 0 53 +9 53 -0 53 +3 53 -0 53 +2 53 -0 N N
+0 0 53 0.25 53 +0 53 +2 53 -0 53 -2 53 +0 N N
+0 0 53 0.25 53 -0 53 +2 53 +0 53 -2 53 -0 N N
+0 0 53 +1 53 +0 53 +1 53 +0 53 +4 53 +0 N N
+0 0 53 +1 53 +0 53 +1 53 +0 53 +4 53 -0 N N
+0 0 53 +1 53 -0 53 +1 53 -0 53 +4 53 +0 N N
+0 0 53 +1 53 -0 53 +1 53 -0 53 +4 53 -0 N N
+0 0 53 +1 53 +0 53 +1 53 -0 53 -4 53 +0 N N
+0 0 53 +1 53 +0 53 +1 53 -0 53 -4 53 -0 N N
+0 0 53 +1 53 -0 53 +1 53 +0 53 -4 53 +0 N N
+0 0 53 +1 53 -0 53 +1 53 +0 53 -4 53 -0 N N
+0 0 53 0.25 53 +0 53 +0.5 53 +0 53 +2 53 -0 N N
+0 0 53 0.25 53 -0 53 +0.5 53 -0 53 +2 53 +0 N N
+0 0 53 +4 53 +0 53 +0.5 53 -0 53 -2 53 -0 N N
+0 0 53 +4 53 -0 53 +0.5 53 +0 53 -2 53 +0 N N
+
+
+# pure real power with nondetermined sign in imaginary part
+0 0 53 1 53 0 53 +2 53 -1 53 +0 53 +0 N N
+0 0 53 1 53 0 53 -2 53 -1 53 +0 53 +0 N N
+0 0 53 1 53 0 53 -2 53 -0 53 +0 53 +0 N N
+0 0 53 1 53 0 53 +0.5 53 +0.5 53 +0 53 +0 N N
+0 0 53 1 53 0 53 -0.5 53 +0.5 53 +0 53 +0 N N
+0 0 53 1 53 0 53 -0.5 53 +0 53 +0 53 +0 N N
+0 0 53 1 53 0 53 +0 53 +0.5 53 +0 53 +0 N N
+0 0 53 1 53 0 53 -0 53 +0.5 53 +0 53 +0 N N
+0 0 53 1 53 0 53 -0 53 -4 53 +0 53 +0 N N
+0 0 53 1 53 0 53 +0 53 -4 53 +0 53 +0 N N
+0 0 53 1 53 0 53 -1 53 -0 53 +0 53 +0 N N
+0 0 53 1 53 0 53 -1 53 +0 53 +0 53 +0 N N
+0 0 53 1 53 0 53 +2 53 -1 53 -0 53 -0 N N
+0 0 53 1 53 0 53 -2 53 -1 53 -0 53 -0 N N
+0 0 53 1 53 0 53 -2 53 -0 53 -0 53 -0 N N
+0 0 53 1 53 0 53 +0.5 53 +0.5 53 -0 53 -0 N N
+0 0 53 1 53 0 53 -0.5 53 +0.5 53 -0 53 -0 N N
+0 0 53 1 53 0 53 -0.5 53 +0 53 -0 53 -0 N N
+0 0 53 1 53 0 53 +0 53 +0.5 53 -0 53 -0 N N
+0 0 53 1 53 0 53 -0 53 +0.5 53 -0 53 -0 N N
+0 0 53 1 53 0 53 -0 53 -4 53 -0 53 -0 N N
+0 0 53 1 53 0 53 +0 53 -4 53 -0 53 -0 N N
+0 0 53 1 53 0 53 -1 53 -0 53 -0 53 -0 N N
+0 0 53 1 53 0 53 -1 53 +0 53 -0 53 -0 N N
+0 0 53 1 53 0 53 +2 53 +1 53 -0 53 +0 N N
+0 0 53 1 53 0 53 -2 53 +1 53 -0 53 +0 N N
+0 0 53 1 53 0 53 -2 53 +0 53 -0 53 +0 N N
+0 0 53 1 53 0 53 +0.5 53 -0.5 53 -0 53 +0 N N
+0 0 53 1 53 0 53 -0.5 53 -0.5 53 -0 53 +0 N N
+0 0 53 1 53 0 53 -0.5 53 -0 53 -0 53 +0 N N
+0 0 53 1 53 0 53 +0 53 +5 53 -0 53 +0 N N
+0 0 53 1 53 0 53 -0 53 +5 53 -0 53 +0 N N
+0 0 53 1 53 0 53 -0 53 -0.5 53 -0 53 +0 N N
+0 0 53 1 53 0 53 +0 53 -0.5 53 -0 53 +0 N N
+0 0 53 1 53 0 53 -1 53 -0 53 -0 53 +0 N N
+0 0 53 1 53 0 53 -1 53 +0 53 -0 53 +0 N N
+0 0 53 1 53 0 53 +2 53 +1 53 +0 53 -0 N N
+0 0 53 1 53 0 53 -2 53 +1 53 +0 53 -0 N N
+0 0 53 1 53 0 53 -2 53 +0 53 +0 53 -0 N N
+0 0 53 1 53 0 53 +0.5 53 -0.5 53 +0 53 -0 N N
+0 0 53 1 53 0 53 -0.5 53 -0.5 53 +0 53 -0 N N
+0 0 53 1 53 0 53 -0.5 53 -0 53 +0 53 -0 N N
+0 0 53 1 53 0 53 +0 53 +5 53 +0 53 -0 N N
+0 0 53 1 53 0 53 -0 53 +5 53 +0 53 -0 N N
+0 0 53 1 53 0 53 -0 53 -0.5 53 +0 53 -0 N N
+0 0 53 1 53 0 53 +0 53 -0.5 53 +0 53 -0 N N
+0 0 53 1 53 0 53 -1 53 -0 53 +0 53 -0 N N
+0 0 53 1 53 0 53 -1 53 +0 53 +0 53 -0 N N
+
+0 0 53 4 53 0 53 +2 53 -0 53 +2 53 +0 N N
+0 0 53 1 53 0 53 +1 53 +0 53 +2 53 +0 N N
+0 0 53 1 53 0 53 +1 53 +0 53 +2 53 -0 N N
+0 0 53 4 53 0 53 +2 53 +0 53 +2 53 -0 N N
+0 0 53 1 53 0 53 +1 53 -0 53 +2 53 +0 N N
+0 0 53 1 53 0 53 +1 53 -0 53 +2 53 -0 N N
+0 0 53 +.25 53 0 53 +2 53 +0 53 -2 53 +0 N N
+0 0 53 1 53 0 53 +1 53 +0 53 -2 53 +0 N N
+0 0 53 1 53 0 53 +1 53 +0 53 -2 53 -0 N N
+0 0 53 +.25 53 0 53 +2 53 -0 53 -2 53 -0 N N
+0 0 53 1 53 0 53 +1 53 -0 53 -2 53 +0 N N
+0 0 53 1 53 0 53 +1 53 -0 53 -2 53 -0 N N
+
+# when (+/-1 +/-0i)^y is pure real
+0 0 53 1 53 0 53 +1 53 -0 53 -2 53 +1 N N
+0 0 53 1 53 0 53 +1 53 -0 53 -1 53 +2 N N
+0 0 53 1 53 0 53 +1 53 -0 53 -0 53 +1 N N
+- 0 53 +0x10BBEEE9177E19p-43 53 0 53 -1 53 -0 53 -0 53 +2 N N
++ 0 53 +0x1E989F5D6DFF5Cp-62 53 0 53 -1 53 +0 53 +0 53 +2 N N
+0 0 53 1 53 0 53 +1 53 +0 53 +0 53 +2 N N
+0 0 53 1 53 0 53 +1 53 +0 53 +2 53 +2 N N
+0 0 53 1 53 0 53 +1 53 +0 53 +0 53 +2 N N
+0 0 53 1 53 0 53 +1 53 +0 53 -1 53 -1 N N
+0 0 53 1 53 0 53 +1 53 +0 53 -0 53 -1 N N
++ 0 53 +0x1724046EB0933Ap-48 53 0 53 -1 53 +0 53 -0 53 -1 N N
+0 0 53 1 53 0 53 +1 53 -0 53 +0 53 -1 N N
++ 0 53 +0x1620227B598EF9p-57 53 0 53 -1 53 -0 53 +0 53 -1 N N
+0 0 53 1 53 0 53 +1 53 -0 53 +2 53 -3 N N
++ 0 53 +0x1D4102BC3F7D4Cp-71 53 0 53 -1 53 +0 53 +0 53 +4 N N
++ 0 53 +0x1724046EB0933Ap-48 53 0 53 -1 53 -0 53 -0 53 +1 N N
+
+# when (0 +/-i)^y is pure real
++ 0 53 +0x1724046EB0933Ap-48 53 0 53 -0 53 -1 53 -0 53 +2 N N
+- 0 53 +0x1BD4567B975381p-46 53 0 53 +0 53 -1 53 -0 53 +3 N N
++ 0 53 +0x1620227B598EF9p-57 53 0 53 +0 53 +1 53 +0 53 +2 N N
+- 0 53 +0x1265D4E92B6B9Bp-59 53 0 53 -0 53 +1 53 +0 53 +3 N N
++ 0 53 +0x1724046EB0933Ap-48 53 0 53 +0 53 +1 53 -0 53 -2 N N
+- 0 53 +0x1BD4567B975381p-46 53 0 53 -0 53 +1 53 -0 53 -3 N N
+- 0 53 +0x1A9BCC46F767DFp-55 53 0 53 +0 53 -1 53 +0 53 -1 N N
++ 0 53 +0x1620227B598EF9p-57 53 0 53 -0 53 -1 53 +0 53 -2 N N
+
+# exact cases
+# (-1)^(1/2) = i
+0 0 2 0 2 1 2 -1 2 0 2 0x1p-1 2 0 N N
+# (-4)^(1/4) = 1+i
+0 0 2 1 2 1 2 -4 2 0 2 0x1p-2 2 0 N N
+# for an odd positive integer n, a positive integer m and an integer e:
+# (-4 m^4 16^e)^(n/4) = (1+i)^n m^n 2^(e n)
+# m=3 e=5 n=7
+0 0 12 0x88Bp38 12 -0x88Bp38 7 -0x51p22 7 0 3 0x7p-2 3 0 N N
+# (-4 16^e)^(-n/4) = (1-i)^n 2^(- (e+1) n)
+# e=3 n=5
+0 0 2 -0x1p-18 2 0x1p-18 2 -0x1p14 2 0 3 -0x5p-2 3 0 N N
+# e=2 n=5
+0 0 2 -0x1p-13 2 0x1p-13 2 -0x1p10 2 0 3 -0x5p-2 3 0 N N
+# (+2 +0)^(-3 -0) -> (-1/8 -0)
+# x = 2 + epsilon*i, y = -3 - delta*i
+# log(x) = log(2) + epsilon/2*i + O(epsilon^2)
+# y*log(x) = [-3*log(2) + o(1)] + [-3*epsilon/2-delta*log(2)]*i
+0 0 2 0x1p-3 2 -0 2 2 2 +0 2 -3 2 -0 N N
+# (-2 -0)^(3 +0) -> (-8 -0)
+# x = -2 - epsilon*i, y = 3 + delta*i
+# log(x) = log(2) - [Pi-epsilon/2]*i + O(epsilon^2)
+# y*log(x) ~ 3*log(2) + [-3*Pi+3*epsilon/2+delta*log(2)]*i
+0 0 2 -8 2 -0 2 -2 2 -0 2 3 2 +0 N N
+# (-2 -0)^(-3 -0) -> (-1/8 +0)
+# x = -2 - epsilon*i, y = -3 - delta*i
+# log(x) = log(2) - [Pi-epsilon/2]*i + O(epsilon^2)
+# y*log(x) ~ -3*log(2) + [3*Pi-3*epsilon/2-delta*log(2)]*i
+0 0 2 -0x1p-3 2 +0 2 -2 2 -0 2 -3 2 -0 N N
+0 0 2 +0 2 -2 2 +0 2 0x1p-1 2 -1 2 -0 N N
+0 0 2 +0 2 -2 2 +0 2 0x1p-1 65 -1 2 -0 N N
++ + 2 -0x3p-64 2 -2 2 +0 2 0x1p-1 65 -0x10000000000000001p-64 2 -0 N N
+
+0 - 2 +0 3 -5 2 +0 53 0xCCCCCCCCCCCCDp-54 2 -1 2 -0 N N
+# undefined zero sign in result
+- 0 5 -25 2 0 2 +0 53 0xCCCCCCCCCCCCDp-54 2 -2 2 -0 N N
+
+- - 53 -0x85649E3220691p-63 53 -0x14A25D455A9D0Dp-60 3 5 2 3 2 -3 2 +0 N N
++ 0 53 0xABCC77118461Dp-74 2 +0 3 5 3 5 2 -8 2 +0 N N
+
++ 0 53 -0x127DB86014739Dp-93 2 -0 2 -1 2 -0 2 1 4 -9 N N
++ + 24 0xC1F98Dp-21 24 0x12FF89p-2 24 -7 24 +0 24 0xCFFFF3p-21 24 +0 N N
+# underflow case
+- - 24 +0 24 +0 24 2 24 0x44CCCDp-20 24 -0x7FFFF200 24 -0x7FFFF200 N N
+- 0 53 0x14D55AFA6E0BB0p210433620 53 0 53 +0 53 0x44CCCCFFFFFFFp-48 53 0x5F5E100 53 +0 N N
+- 0 53 0x14D55B174EE67Ep210433620 53 0 53 +0 53 0x44CCCDp-20 53 0x5F5E100 53 +0 N N
+0 0 24 -10 24 198 24 5 24 3 24 3 24 +0 N N
++ - 113 0x1731C86FF8E8C7D80C8F1C83460B7p-38951 113 0x1CE5ECB8E88C769AF45FA662568CFp-38950 113 2 113 0x11333333333333333333333333333p-110 113 -10000 113 10000 N N
+- - 652 0x8E0380781E0124C92903E153123260CEF2C8821EDEC1D518A270FD55720DB5114D3D72CEE0E51CCEAA532FC6DA983707E66AE0E1A5E116D72AF5F2420D8402BE3E7FF03658E7ADFE2667C67291D74877383p-651 652 -0xB5FECD07C42E7AEE5A3489729B566DB4C6284C575E281585B0BFA711859D178BD8B07352B58BF615DD2DEC68798F0D2A644D5D18149D12BC53F851C5908F1EDE1C71F2B8D4934B1CE932AB94C0B8AE54C73p-665 163 0x5E9BDCC756D1E864413EA56F2A35C6D7D58DD117Bp-158 163 -0xE6BCC7A0E6EC5F2B1CBCF2707D829C2CB1A56FCFp-164 163 0x21A13BA8E157F23649FC27B031EAA12B826FB7E9Dp-166 163 0 N N
+0 0 2 0 2 1 2 -1 2 0 2 0x1p-1 2 0 N N
++ + 2 -0x3p-65 2 1 2 -1 2 0 65 0x10000000000000001p-65 2 0 N N
+0 0 2 1 2 +0 65 0x10000000000000001p-64 2 +0 2 +0 2 +0 N N
+0 0 2 1 2 -0 65 0xFFFFFFFFFFFFFFFFp-64 2 +0 2 +0 2 +0 N N
+0 + 2 +0 2 0.75 2 -0.5 2 0 2 0.5 2 0 N N
+0 0 2 0 2 2 2 1 2 1 2 2 2 +0 N N
+# I^2 = -1
+0 0 2 -1 2 +0 2 +0 2 1 2 2 2 +0 N N
++ 0 2 -1 2 +0 2 +0 65 0x10000000000000001p-64 2 2 2 +0 N N
+
+# overflow cases
+- - 2 -inf 2 -inf 2 3 2 1 28 744261116 2 +0 N N
+- + 2 -inf 2 +inf 2 3 2 -1 28 744261116 2 +0 N N
++ + 2 +inf 2 +inf 2 4 2 3 28 744261116 2 +0 N N
++ - 2 +inf 2 -inf 2 4 2 -3 28 744261116 2 +0 N N
+
+# underflow cases
++ - 2 -0 2 +0 2 3 2 1 28 -744261116 2 +0 N N
++ + 2 -0 2 -0 2 3 2 -1 28 -744261116 2 +0 N N
+- + 2 +0 2 -0 2 4 2 3 28 -744261116 2 +0 N N
+- - 2 +0 2 +0 2 4 2 -3 28 -744261116 2 +0 N N
+
+# exact powers with non-integer exponent
+0 0 2 1 2 1 2 0 2 2 2 0.5 2 0 N N
+0 0 2 -2 2 2 2 0 2 2 2 1.5 2 0 N N
+0 0 2 1 2 64 12 -4095 2 128 2 0.5 2 0 N N
+0 0 3 5 2 3 2 16 4 30 2 0.5 2 0 N N
+0 0 7 97 7 99 6 -392 14 19206 2 0.5 2 0 N N
+0 0 6 63 6 61 5 248 18 7686 2 0.5 2 0 N N
+0 0 6 63 6 61 24 -59013092 17 3812256 2 0.25 2 0 N N
+
+0 + 2 0 2 0x3p-6 2 -1 2 0 2 0.5 2 1 N N
++ + 2 6 2 1 41 -0x2ce019e6f1e 36 0x1878418ba20 2 0.0625 2 0 N N
++ + 4 11 2 1 111 -0x73558286726957f922819cbeffff 109 0x1c484a8b32dbf409e966a8c00000 2 0x1p-5 2 0 N N
++ + 5 21 2 1 282 -0x24ea91ddba938e750d999f1075444e15d6ca0fff6a19c8cbefe6260261fd57effffffff 278 0x390aa828a3d933391ab999b0b0aa71aafbfc7b127fe30c84d107634940ba8000000000 2 0x1p-6 2 0 N N
++ - 53 0x7f661e2bd0db5p-51 53 0xc63ee1a1c4d19p-55 2 0x1p1000 2 0 2 0 2 0x1p1000 N N
diff --git a/mpc/tests/pow_fr.dat b/mpc/tests/pow_fr.dat
new file mode 100644
index 0000000000..0816c1341c
--- /dev/null
+++ b/mpc/tests/pow_fr.dat
@@ -0,0 +1,74 @@
+# Data file for mpc_pow_fr.
+#
+# Copyright (C) 2011 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see add_fr.dat.
+
+0 0 5 -9 5 46 5 3 5 2 3 3 N N
+
+# (-0 -0.75)^4 = (0.31640625 -0) is rounded to (0.375 -0)
++ 0 2 0x3p-3 2 -0 2 -0 2 -0x3p-2 2 4 N N
+0 0 8 0x51p-8 2 -0 2 -0 2 -0x3p-2 2 4 N N
+# (+0 -0.75)^4 = (0.31640625 +0) is rounded to (0.375 +0)
++ 0 2 0x3p-3 2 +0 2 +0 2 -0x3p-2 2 4 N N
+0 0 8 0x51p-8 2 +0 2 +0 2 -0x3p-2 2 4 N N
+# (-0 0.75)^5 = (0.31640625 +0) is rounded to (0.375 +0)
++ 0 2 0x3p-3 2 +0 2 -0 2 0x3p-2 2 4 N N
+0 0 8 0x51p-8 2 +0 2 -0 2 0x3p-2 2 4 N N
+# (+0 0.75)^5 = (0.31640625 -0) is rounded to (0.375 -0)
++ 0 2 0x3p-3 2 -0 2 +0 2 0x3p-2 2 4 N N
+0 0 8 0x51p-8 2 -0 2 +0 2 0x3p-2 2 4 N N
+
+# (-0 -0.75)^5 = (-0 -0.2373046875) is rounded to (-0 -0.25)
+0 - 2 -0 2 -0x1p-2 2 -0 2 -0x3p-2 3 5 N N
+0 0 8 -0 8 -0xf3p-10 2 -0 2 -0x3p-2 3 5 N N
+# (+0 -0.75)^5 = (+0 -0.2373046875) is rounded to (+0 -0.25)
+0 - 2 +0 2 -0x1p-2 2 +0 2 -0x3p-2 3 5 N N
+0 0 8 +0 8 -0xf3p-10 2 +0 2 -0x3p-2 3 5 N N
+# (-0 0.75)^5 = (-0 0.2373046875) is rounded to (-0 0.25)
+0 + 2 -0 2 0x1p-2 2 -0 2 0x3p-2 3 5 N N
+0 0 8 -0 8 0xf3p-10 2 -0 2 0x3p-2 3 5 N N
+# (+0 0.75)^5 = (+0 0.2373046875) is rounded to (+0 0.25)
+0 + 2 +0 2 0x1p-2 2 +0 2 0x3p-2 3 5 N N
+0 0 8 +0 8 0xf3p-10 2 +0 2 0x3p-2 3 5 N N
+
+# (-0 -0.75)^6 = (-0.177978515625 +0) is rounded to (-0.1875 +0)
+- 0 2 -0x3p-4 2 +0 2 -0 2 -0x3p-2 3 6 N N
++ 0 8 -0x5bp-9 8 +0 2 -0 2 -0x3p-2 3 6 N N
+# (+0 -0.75)^6 = (-0.177978515625 -0) is rounded to (-0.1875 -0)
+- 0 2 -0x3p-4 2 -0 2 +0 2 -0x3p-2 3 6 N N
++ 0 8 -0x5bp-9 8 -0 2 +0 2 -0x3p-2 3 6 N N
+# (-0 0.75)^6 = (-0.177978515625 -0) is rounded to (-0.1875 -0)
+- 0 2 -0x3p-4 2 -0 2 -0 2 0x3p-2 3 6 N N
++ 0 8 -0x5bp-9 8 -0 2 -0 2 0x3p-2 3 6 N N
+# (+0 0.75)^6 = (-0.177978515625 +0) is rounded to (-0.1875 +0)
+- 0 2 -0x3p-4 2 +0 2 +0 2 0x3p-2 3 6 N N
++ 0 8 -0x5bp-9 8 +0 2 +0 2 0x3p-2 3 6 N N
+
+# (-0 -0.75)^7 = (+0 0.13348388671875) is rounded to (+0 0.125)
+0 - 2 +0 2 0x1p-3 2 -0 2 -0x3p-2 3 7 N N
+0 + 8 +0 8 0x89p-10 2 -0 2 -0x3p-2 3 7 N N
+# (+0 -0.75)^7 = (-0 0.13348388671875) is rounded to (-0 0.125)
+0 - 2 -0 2 0x1p-3 2 +0 2 -0x3p-2 3 7 N N
+0 + 8 -0 8 0x89p-10 2 +0 2 -0x3p-2 3 7 N N
+# (-0 0.75)^7 = (+0 -0.13348388671875) is rounded to (+0 -0.125)
+0 + 2 +0 2 -0x1p-3 2 -0 2 0x3p-2 3 7 N N
+0 - 8 +0 8 -0x89p-10 2 -0 2 0x3p-2 3 7 N N
+# (+0 0.75)^7 = (-0 -0.13348388671875) is rounded to (-0 -0.125)
+0 + 2 -0 2 -0x1p-3 2 +0 2 0x3p-2 3 7 N N
+0 - 8 -0 8 -0x89p-10 2 +0 2 0x3p-2 3 7 N N
diff --git a/mpc/tests/pow_si.dat b/mpc/tests/pow_si.dat
new file mode 100644
index 0000000000..a45d022147
--- /dev/null
+++ b/mpc/tests/pow_si.dat
@@ -0,0 +1,29 @@
+# Data file for mpc_pow_si.
+#
+# Copyright (C) 2011 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP1_RE OP1_RE PREC_OP1_IM OP1_IM OP2 RND_RE RND_IM
+#
+# For further details, see add_fr.dat.
+
+# special cases with exponents -1 and -2
+0 0 53 0.5 53 -0.5 53 1 53 1 -1 N N
+0 0 53 0 53 -0.5 53 1 53 1 -2 N N
diff --git a/mpc/tests/pow_ui.dat b/mpc/tests/pow_ui.dat
new file mode 100644
index 0000000000..d448a68874
--- /dev/null
+++ b/mpc/tests/pow_ui.dat
@@ -0,0 +1,102 @@
+# Data file for mpc_pow_ui.
+#
+# Copyright (C) 2010, 2011, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP1_RE OP1_RE PREC_OP1_IM OP1_IM OP2 RND_RE RND_IM
+#
+# For further details, see add_fr.dat.
+
+# special cases, copied from pow.dat
+0 0 53 +1 53 0 53 nan 53 +0 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 +1 N N
+0 0 53 inf 53 nan 53 +inf 53 +0 +1 N N
+0 0 53 +inf 53 nan 53 +inf 53 +1 +1 N N
+0 0 53 +inf 53 nan 53 +inf 53 -1 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +0 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 +1 +1 N N
+0 0 53 +inf 53 nan 53 -inf 53 -1 +1 N N
+
+0 0 53 +1 53 +0 53 +0 53 +0 +0 N N
+0 0 53 +0 53 +0 53 +0 53 +0 +1 N N
+
+0 0 53 +1 53 +0 53 +0 53 +1 +0 N N
+0 0 53 +1 53 -0 53 +0 53 +1 +0 N D
+0 0 53 +1 53 +0 53 -0 53 +1 +0 N N
+0 0 53 +1 53 +0 53 -1 53 +0 +0 N N
+0 0 53 +1 53 -0 53 -1 53 -0 +0 N N
+0 0 53 +1 53 -0 53 -0 53 -1 +0 N N
+0 0 53 +1 53 -0 53 +0 53 -1 +0 N N
+
+0 0 53 +1 53 +0 53 +inf 53 +2 +0 N N
+0 0 53 +1 53 +0 53 +inf 53 -0 +0 N N
+0 0 53 +1 53 +0 53 +2 53 +inf +0 N N
+0 0 53 +1 53 +0 53 +2 53 +0 +0 N N
+0 0 53 +1 53 +0 53 +0 53 +2 +0 N N
+0 0 53 +1 53 +0 53 +0 53 +inf +0 N N
+0 0 53 +1 53 +0 53 -0 53 +2 +0 N N
+0 0 53 +1 53 +0 53 -0 53 +inf +0 N N
+0 0 53 +1 53 +0 53 -5 53 +inf +0 N N
+0 0 53 +1 53 +0 53 -2 53 +0 +0 N N
+0 0 53 +1 53 +0 53 -inf 53 +0 +0 N N
+0 0 53 +1 53 +0 53 -inf 53 +3 +0 N N
+0 0 53 +1 53 -0 53 +0.5 53 -0.5 +0 N N
+0 0 53 +1 53 -0 53 +0.5 53 +0 +0 N N
+0 0 53 +1 53 -0 53 +0.5 53 -0 +0 N N
+0 0 53 +1 53 -0 53 -0.5 53 -0 +0 N N
+0 0 53 +1 53 -0 53 +0 53 -0.5 +0 N N
+0 0 53 +1 53 -0 53 -0 53 -0.5 +0 N N
+0 0 53 +9 53 +0 53 +3 53 +0 +2 N N
+0 0 53 +1 53 +0 53 +1 53 +0 +4 N N
+0 0 53 +1 53 -0 53 +1 53 -0 +4 N N
+0 0 53 0.25 53 -0 53 +0.5 53 -0 +2 N N
+
+0 0 53 1 53 0 53 +2 53 -1 +0 N N
+0 0 53 1 53 0 53 -2 53 -1 +0 N N
+0 0 53 1 53 0 53 -2 53 -0 +0 N N
+0 0 53 1 53 0 53 +0.5 53 +0.5 +0 N N
+0 0 53 1 53 0 53 -0.5 53 +0.5 +0 N N
+0 0 53 1 53 0 53 -0.5 53 +0 +0 N N
+0 0 53 1 53 0 53 +0 53 +0.5 +0 N N
+0 0 53 1 53 0 53 -0 53 +0.5 +0 N N
+0 0 53 1 53 0 53 -0 53 -4 +0 N N
+0 0 53 1 53 0 53 +0 53 -4 +0 N N
+0 0 53 1 53 0 53 -1 53 -0 +0 N N
+0 0 53 1 53 0 53 -1 53 +0 +0 N N
+
+0 0 53 4 53 0 53 +2 53 -0 +2 N N
+0 0 53 1 53 0 53 +1 53 +0 +2 N N
+0 0 53 1 53 0 53 +1 53 -0 +2 N N
+
+# overflow
+? ? 53 +inf 53 +inf 53 1e100000000 53 1e100000000 1000000000 N N
+# underflow
+? ? 53 0 53 0 53 1e-100000000 53 1e-100000000 1000000000 N N
+# cannot round after one loop
+? ? 420 -0x1.c3fb41a71665f9a144927e70cbc2dc899e9e30880c0b5aa924ad8a538b4cd06e503f38bdbb7cfcfded29f7504fe0c91ecd4230984@-187 420 -0xc.82a09ac98133eb05b2643c98eb1c8e1a1609e75f682b14098176abd6c8b4b3c6c72dadaf8929f9bd87f8c78d03361bacb9fb13140@-292 420 0x1.cf13ce58adc4e639fd1c3063ffc9291433647999951bc04ba6797ec4de0335336ad0a28df18573d3b6322ebab662c08eadaed4a8e@-8 420 0x3.cf71d602ca6f754ebd6af522154f3ee1c46da0a52deb1f60016fca4b1e0b4b447b752169e837bb1866aa3734850cd158a7e3ca33c@-9 24 N N
+# exact result
+0 0 5 -9 5 46 5 3 5 2 3 D U
+
+# special cases with exponents 1 and 2
+0 0 53 3 53 4 53 3 53 4 1 N N
+0 0 53 -7 53 24 53 3 53 4 2 N N
+
+# coverage test
++ - 2 1 2 1 100 0x8ac78f4e6aec091921cbdc891p-99 100 0x4a5f2972ea662e1cc0caebb81p-100 3 N N
diff --git a/mpc/tests/proj.dat b/mpc/tests/proj.dat
new file mode 100644
index 0000000000..f9ead72f68
--- /dev/null
+++ b/mpc/tests/proj.dat
@@ -0,0 +1,73 @@
+# Data file for mpc_proj.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_RE 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)
+0 0 53 +inf 53 -0 53 -inf 53 -inf N N
+0 0 53 +inf 53 -0 53 -inf 53 -1 N N
+0 0 53 +inf 53 -0 53 -inf 53 -0 N N
+0 0 53 +inf 53 +0 53 -inf 53 +0 N N
+0 0 53 +inf 53 +0 53 -inf 53 +1 N N
+0 0 53 +inf 53 +0 53 -inf 53 +inf N N
+0 0 53 +inf 53 0 53 -inf 53 nan N N
+0 0 53 +inf 53 -0 53 -1 53 -inf N N
+0 0 53 -1 53 -0 53 -1 53 -0 N N
+0 0 53 -1 53 +0 53 -1 53 +0 N N
+0 0 53 +inf 53 +0 53 -1 53 +inf N N
+0 0 53 -1 53 nan 53 -1 53 nan N N
+0 0 53 +inf 53 -0 53 -0 53 -inf N N
+0 0 53 -0 53 -1 53 -0 53 -1 N N
+0 0 53 -0 53 -0 53 -0 53 -0 N N
+0 0 53 -0 53 +0 53 -0 53 +0 N N
+0 0 53 -0 53 +1 53 -0 53 +1 N N
+0 0 53 +inf 53 +0 53 -0 53 +inf N N
+0 0 53 -0 53 nan 53 -0 53 nan N N
+0 0 53 +inf 53 -0 53 +0 53 -inf N N
+0 0 53 +0 53 -1 53 +0 53 -1 N N
+0 0 53 +0 53 -0 53 +0 53 -0 N N
+0 0 53 +0 53 +0 53 +0 53 +0 N N
+0 0 53 +0 53 +1 53 +0 53 +1 N N
+0 0 53 +inf 53 +0 53 +0 53 +inf N N
+0 0 53 +0 53 nan 53 +0 53 nan N N
+0 0 53 +inf 53 -0 53 +1 53 -inf N N
+0 0 53 +1 53 -0 53 +1 53 -0 N N
+0 0 53 +1 53 +0 53 +1 53 +0 N N
+0 0 53 +inf 53 +0 53 +1 53 +inf N N
+0 0 53 +1 53 nan 53 +1 53 nan N N
+0 0 53 +inf 53 -0 53 +inf 53 -inf N N
+0 0 53 +inf 53 -0 53 +inf 53 -1 N N
+0 0 53 +inf 53 -0 53 +inf 53 -0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +1 N N
+0 0 53 +inf 53 +0 53 +inf 53 +inf N N
+0 0 53 +inf 53 0 53 +inf 53 nan N N
+0 0 53 +inf 53 -0 53 nan 53 -inf N N
+0 0 53 nan 53 -1 53 nan 53 -1 N N
+0 0 53 nan 53 -0 53 nan 53 -0 N N
+0 0 53 nan 53 +0 53 nan 53 +0 N N
+0 0 53 nan 53 +1 53 nan 53 +1 N N
+0 0 53 +inf 53 +0 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
diff --git a/mpc/tests/random.c b/mpc/tests/random.c
new file mode 100644
index 0000000000..aa06355d3f
--- /dev/null
+++ b/mpc/tests/random.c
@@ -0,0 +1,160 @@
+/* random.c -- Handle seed for random numbers.
+
+// Copyright (C) 2008, 2009, 2010, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+/* Put test_start at the beginning of your test function and
+ test_end at the end.
+ These are an adaptation of those of MPFR. */
+
+#include "config.h"
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+gmp_randstate_t rands;
+static char rands_initialized;
+
+void
+test_start (void)
+{
+ char *environment_seed;
+ unsigned long seed;
+
+ if (rands_initialized)
+ {
+ fprintf (stderr,
+ "Put test_start at the beginning of your test function.\n");
+ exit (1);
+ }
+
+ gmp_randinit_default (rands);
+ rands_initialized = 1;
+
+ environment_seed = getenv ("GMP_CHECK_RANDOMIZE");
+ if (environment_seed == NULL)
+ gmp_randseed_ui (rands, 0xfac11e);
+ else
+ {
+ seed = (unsigned long int) atoi (environment_seed);
+ if (seed == 0 || seed == 1)
+ {
+#if defined HAVE_GETTIMEOFDAY
+ struct timeval tv;
+ gettimeofday (&tv, NULL);
+ seed = (unsigned long int) (tv.tv_sec + tv.tv_usec);
+#else
+ time_t tv;
+ time (&tv);
+ seed = (unsigned long int) tv;
+#endif
+ gmp_randseed_ui (rands, seed);
+ printf ("Seed GMP_CHECK_RANDOMIZE=%lu "
+ "(include this in bug reports)\n", seed);
+ }
+ else
+ {
+ printf ("Re-seeding with GMP_CHECK_RANDOMIZE=%lu\n", seed);
+ gmp_randseed_ui (rands, seed);
+ }
+ }
+}
+
+void
+test_end (void)
+{
+ if (rands_initialized)
+ {
+ rands_initialized = 0;
+ gmp_randclear (rands);
+ }
+ mpfr_free_cache ();
+}
+
+/* Set z to a non zero value random value with absolute values of Re(z) and
+ Im(z) either zero (but not both in the same time) or otherwise greater than
+ or equal to 2^{emin-1} and less than 2^emax.
+ Each part is negative with probability equal to NEGATIVE_PROBABILITY / 256.
+ The result has one zero part (but never the two of them) with probability
+ equal to ZERO_PROBABILITY / 256.
+*/
+void
+test_default_random (mpc_ptr z, mpfr_exp_t emin, mpfr_exp_t emax,
+ unsigned int negative_probability,
+ unsigned int zero_probability)
+{
+ const unsigned long range = (unsigned long int) (emax - emin) + 1;
+ unsigned long r;
+
+ if (!rands_initialized)
+ {
+ fprintf (stderr,
+ "Put test_start at the beginning of your test function.\n");
+ exit (1);
+ }
+
+ do
+ {
+ mpc_urandom (z, rands);
+ } while (mpfr_zero_p (mpc_realref (z)) || mpfr_zero_p (mpc_imagref (z)));
+
+ if (zero_probability > 256)
+ zero_probability = 256;
+ r = gmp_urandomb_ui (rands, 19);
+ if ((r & 0x1FF) < zero_probability
+ || ((r >> 9) & 0x1FF) < zero_probability)
+ {
+ int zero_re_p = (r & 0x1FF) < zero_probability;
+ int zero_im_p = ((r >> 9) & 0x1FF) < zero_probability;
+
+ if (zero_re_p && zero_im_p)
+ {
+ /* we just want one zero part. */
+ zero_re_p = (r >> 18) & 1;
+ zero_im_p = !zero_re_p;
+ }
+ if (zero_re_p)
+ mpfr_set_ui (mpc_realref (z), 0, GMP_RNDN);
+ if (zero_im_p)
+ mpfr_set_ui (mpc_imagref (z), 0, GMP_RNDN);
+ }
+ if (!mpfr_zero_p (mpc_realref (z)))
+ mpfr_set_exp (mpc_realref (z), (mpfr_exp_t) gmp_urandomm_ui (rands, range) + emin);
+
+ if (!mpfr_zero_p (mpc_imagref (z)))
+ mpfr_set_exp (mpc_imagref (z), (mpfr_exp_t) gmp_urandomm_ui (rands, range) + emin);
+
+ if (negative_probability > 256)
+ negative_probability = 256;
+ r = gmp_urandomb_ui (rands, 16);
+ if ((r & 0xFF) < negative_probability)
+ mpfr_neg (mpc_realref (z), mpc_realref (z), GMP_RNDN);
+ if (((r>>8) & 0xFF) < negative_probability)
+ mpfr_neg (mpc_imagref (z), mpc_imagref (z), GMP_RNDN);
+}
diff --git a/mpc/tests/read_data.c b/mpc/tests/read_data.c
new file mode 100644
index 0000000000..7f3d91f622
--- /dev/null
+++ b/mpc/tests/read_data.c
@@ -0,0 +1,1059 @@
+/* read_data,c -- Read data file and check function.
+
+Copyright (C) 2008, 2009, 2010, 2011, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include "mpc-tests.h"
+
+char *pathname;
+unsigned long line_number;
+ /* file name with complete path and currently read line;
+ kept globally to simplify parameter passing */
+unsigned long test_line_number;
+ /* start line of data test (which may extend over several lines) */
+int nextchar;
+ /* character appearing next in the file, may be EOF */
+
+#define MPC_INEX_CMP(r, i, c) \
+ (((r) == TERNARY_NOT_CHECKED || (r) == MPC_INEX_RE(c)) \
+ && ((i) == TERNARY_NOT_CHECKED || (i) == MPC_INEX_IM (c)))
+
+#define MPFR_INEX_STR(inex) \
+ (inex) == TERNARY_NOT_CHECKED ? "?" \
+ : (inex) == +1 ? "+1" \
+ : (inex) == -1 ? "-1" : "0"
+
+static const char *mpfr_rnd_mode [] =
+ { "GMP_RNDN", "GMP_RNDZ", "GMP_RNDU", "GMP_RNDD" };
+
+const char *rnd_mode[] =
+ { "MPC_RNDNN", "MPC_RNDZN", "MPC_RNDUN", "MPC_RNDDN",
+ "undefined", "undefined", "undefined", "undefined", "undefined",
+ "undefined", "undefined", "undefined", "undefined", "undefined",
+ "undefined", "undefined",
+ "MPC_RNDNZ", "MPC_RNDZZ", "MPC_RNDUZ", "MPC_RNDDZ",
+ "undefined", "undefined", "undefined", "undefined", "undefined",
+ "undefined", "undefined", "undefined", "undefined", "undefined",
+ "undefined", "undefined",
+ "MPC_RNDNU", "MPC_RNDZU", "MPC_RNDUU", "MPC_RNDDU",
+ "undefined", "undefined", "undefined", "undefined", "undefined",
+ "undefined", "undefined", "undefined", "undefined", "undefined",
+ "undefined", "undefined",
+ "MPC_RNDND", "MPC_RNDZD", "MPC_RNDUD", "MPC_RNDDD",
+ "undefined", "undefined", "undefined", "undefined", "undefined",
+ "undefined", "undefined", "undefined", "undefined", "undefined",
+ "undefined", "undefined",
+ };
+
+/* file functions */
+FILE *
+open_data_file (const char *file_name)
+{
+ FILE *fp;
+ char *src_dir;
+ char default_srcdir[] = ".";
+
+ src_dir = getenv ("srcdir");
+ if (src_dir == NULL)
+ src_dir = default_srcdir;
+
+ pathname = (char *) malloc ((strlen (src_dir)) + strlen (file_name) + 2);
+ if (pathname == NULL)
+ {
+ printf ("Cannot allocate memory\n");
+ exit (1);
+ }
+ sprintf (pathname, "%s/%s", src_dir, file_name);
+ fp = fopen (pathname, "r");
+ if (fp == NULL)
+ {
+ fprintf (stderr, "Unable to open %s\n", pathname);
+ exit (1);
+ }
+
+ return fp;
+}
+
+void
+close_data_file (FILE *fp)
+{
+ free (pathname);
+ fclose (fp);
+}
+
+/* read primitives */
+static void
+skip_line (FILE *fp)
+ /* skips characters until reaching '\n' or EOF; */
+ /* '\n' is skipped as well */
+{
+ while (nextchar != EOF && nextchar != '\n')
+ nextchar = getc (fp);
+ if (nextchar != EOF)
+ {
+ line_number ++;
+ nextchar = getc (fp);
+ }
+}
+
+static void
+skip_whitespace (FILE *fp)
+ /* skips over whitespace if any until reaching EOF */
+ /* or non-whitespace */
+{
+ while (isspace (nextchar))
+ {
+ if (nextchar == '\n')
+ line_number ++;
+ nextchar = getc (fp);
+ }
+}
+
+void
+skip_whitespace_comments (FILE *fp)
+ /* skips over all whitespace and comments, if any */
+{
+ skip_whitespace (fp);
+ while (nextchar == '#') {
+ skip_line (fp);
+ if (nextchar != EOF)
+ skip_whitespace (fp);
+ }
+}
+
+
+size_t
+read_string (FILE *fp, char **buffer_ptr, size_t buffer_length, const char *name)
+{
+ size_t pos;
+ char *buffer;
+
+ pos = 0;
+ buffer = *buffer_ptr;
+
+ if (nextchar == '"')
+ nextchar = getc (fp);
+ else
+ goto error;
+
+ while (nextchar != EOF && nextchar != '"')
+ {
+ if (nextchar == '\n')
+ line_number ++;
+ if (pos + 1 > buffer_length)
+ {
+ buffer = (char *) realloc (buffer, 2 * buffer_length);
+ if (buffer == NULL)
+ {
+ printf ("Cannot allocate memory\n");
+ exit (1);
+ }
+ buffer_length *= 2;
+ }
+ buffer[pos++] = (char) nextchar;
+ nextchar = getc (fp);
+ }
+
+ if (nextchar != '"')
+ goto error;
+
+ if (pos + 1 > buffer_length)
+ {
+ buffer = (char *) realloc (buffer, buffer_length + 1);
+ if (buffer == NULL)
+ {
+ printf ("Cannot allocate memory\n");
+ exit (1);
+ }
+ buffer_length *= 2;
+ }
+ buffer[pos] = '\0';
+
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+
+ *buffer_ptr = buffer;
+
+ return buffer_length;
+
+ error:
+ printf ("Error: Unable to read %s in file '%s' line '%lu'\n",
+ name, pathname, line_number);
+ exit (1);
+}
+
+/* All following read routines skip over whitespace and comments; */
+/* so after calling them, nextchar is either EOF or the beginning */
+/* of a non-comment token. */
+void
+read_ternary (FILE *fp, int* ternary)
+{
+ switch (nextchar)
+ {
+ case '!':
+ *ternary = TERNARY_ERROR;
+ break;
+ case '?':
+ *ternary = TERNARY_NOT_CHECKED;
+ break;
+ case '+':
+ *ternary = +1;
+ break;
+ case '0':
+ *ternary = 0;
+ break;
+ case '-':
+ *ternary = -1;
+ break;
+ default:
+ printf ("Error: Unexpected ternary value '%c' in file '%s' line %lu\n",
+ nextchar, pathname, line_number);
+ exit (1);
+ }
+
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+}
+
+void
+read_mpfr_rounding_mode (FILE *fp, mpfr_rnd_t* rnd)
+{
+ switch (nextchar)
+ {
+ case 'n': case 'N':
+ *rnd = GMP_RNDN;
+ break;
+ case 'z': case 'Z':
+ *rnd = GMP_RNDZ;
+ break;
+ case 'u': case 'U':
+ *rnd = GMP_RNDU;
+ break;
+ case 'd': case 'D':
+ *rnd = GMP_RNDD;
+ break;
+ default:
+ printf ("Error: Unexpected rounding mode '%c' in file '%s' line %lu\n",
+ nextchar, pathname, line_number);
+ exit (1);
+ }
+
+ nextchar = getc (fp);
+ if (nextchar != EOF && !isspace (nextchar)) {
+ printf ("Error: Rounding mode not followed by white space in file "
+ "'%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ skip_whitespace_comments (fp);
+}
+
+void
+read_mpc_rounding_mode (FILE *fp, mpc_rnd_t* rnd)
+{
+ mpfr_rnd_t re, im;
+ read_mpfr_rounding_mode (fp, &re);
+ read_mpfr_rounding_mode (fp, &im);
+ *rnd = MPC_RND (re, im);
+}
+
+void
+read_int (FILE *fp, int *nread, const char *name)
+{
+ int n = 0;
+
+ if (nextchar == EOF)
+ {
+ printf ("Error: Unexpected EOF when reading int "
+ "in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ ungetc (nextchar, fp);
+ n = fscanf (fp, "%i", nread);
+ if (ferror (fp) || n == 0 || n == EOF)
+ {
+ printf ("Error: Cannot read %s in file '%s' line %lu\n",
+ name, pathname, line_number);
+ exit (1);
+ }
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+}
+
+static void
+read_uint (FILE *fp, unsigned long int *ui)
+{
+ int n = 0;
+
+ if (nextchar == EOF)
+ {
+ printf ("Error: Unexpected EOF when reading uint "
+ "in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ ungetc (nextchar, fp);
+ n = fscanf (fp, "%lu", ui);
+ if (ferror (fp) || n == 0 || n == EOF)
+ {
+ printf ("Error: Cannot read uint in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+}
+
+static void
+read_sint (FILE *fp, long int *si)
+{
+ int n = 0;
+
+ if (nextchar == EOF)
+ {
+ printf ("Error: Unexpected EOF when reading sint "
+ "in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ ungetc (nextchar, fp);
+ n = fscanf (fp, "%li", si);
+ if (ferror (fp) || n == 0 || n == EOF)
+ {
+ printf ("Error: Cannot read sint in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+}
+
+mpfr_prec_t
+read_mpfr_prec (FILE *fp)
+{
+ unsigned long prec;
+ int n;
+
+ if (nextchar == EOF) {
+ printf ("Error: Unexpected EOF when reading mpfr precision "
+ "in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ ungetc (nextchar, fp);
+ n = fscanf (fp, "%lu", &prec);
+ if (ferror (fp)) /* then also n == EOF */
+ perror ("Error when reading mpfr precision");
+ if (n == 0 || n == EOF || prec < MPFR_PREC_MIN || prec > MPFR_PREC_MAX) {
+ printf ("Error: Impossible mpfr precision in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+ return (mpfr_prec_t) prec;
+}
+
+static void
+read_mpfr_mantissa (FILE *fp, mpfr_ptr x)
+{
+ if (nextchar == EOF) {
+ printf ("Error: Unexpected EOF when reading mpfr mantissa "
+ "in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ ungetc (nextchar, fp);
+ if (mpfr_inp_str (x, fp, 0, GMP_RNDN) == 0) {
+ printf ("Error: Impossible to read mpfr mantissa "
+ "in file '%s' line %lu\n",
+ pathname, line_number);
+ exit (1);
+ }
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+}
+
+void
+read_mpfr (FILE *fp, mpfr_ptr x, int *known_sign)
+{
+ int sign;
+ mpfr_set_prec (x, read_mpfr_prec (fp));
+ sign = nextchar;
+ read_mpfr_mantissa (fp, x);
+
+ /* the sign always matters for regular values ('+' is implicit),
+ but when no sign appears before 0 or Inf in the data file, it means
+ that only absolute value must be checked. */
+ if (known_sign != NULL)
+ *known_sign =
+ (!mpfr_zero_p (x) && !mpfr_inf_p (x))
+ || sign == '+' || sign == '-';
+}
+
+void
+read_mpc (FILE *fp, mpc_ptr z, known_signs_t *ks)
+{
+ read_mpfr (fp, mpc_realref (z), ks == NULL ? NULL : &ks->re);
+ read_mpfr (fp, mpc_imagref (z), ks == NULL ? NULL : &ks->im);
+}
+
+static void
+check_compatible (int inex, mpfr_t expected, mpfr_rnd_t rnd, const char *s)
+{
+ if ((rnd == GMP_RNDU && inex == -1) ||
+ (rnd == GMP_RNDD && inex == +1) ||
+ (rnd == GMP_RNDZ && !mpfr_signbit (expected) && inex == +1) ||
+ (rnd == GMP_RNDZ && mpfr_signbit (expected) && inex == -1))
+ {
+ if (s != NULL)
+ printf ("Incompatible ternary value '%c' (%s part) in file '%s' line %lu\n",
+ (inex == 1) ? '+' : '-', s, pathname, test_line_number);
+ else
+ printf ("Incompatible ternary value '%c' in file '%s' line %lu\n",
+ (inex == 1) ? '+' : '-', pathname, test_line_number);
+ }
+}
+
+/* read lines of data */
+static void
+read_cc (FILE *fp, int *inex_re, int *inex_im, mpc_ptr expected,
+ known_signs_t *signs, mpc_ptr op, mpc_rnd_t *rnd)
+{
+ test_line_number = line_number;
+ read_ternary (fp, inex_re);
+ read_ternary (fp, inex_im);
+ read_mpc (fp, expected, signs);
+ read_mpc (fp, op, NULL);
+ read_mpc_rounding_mode (fp, rnd);
+ check_compatible (*inex_re, mpc_realref(expected), MPC_RND_RE(*rnd), "real");
+ check_compatible (*inex_im, mpc_imagref(expected), MPC_RND_IM(*rnd), "imag");
+}
+
+static void
+read_fc (FILE *fp, int *inex, mpfr_ptr expected, int *sign, mpc_ptr op,
+ mpfr_rnd_t *rnd)
+{
+ test_line_number = line_number;
+ read_ternary (fp, inex);
+ read_mpfr (fp, expected, sign);
+ read_mpc (fp, op, NULL);
+ read_mpfr_rounding_mode (fp, rnd);
+ check_compatible (*inex, expected, *rnd, NULL);
+}
+
+static void
+read_ccc (FILE *fp, int *inex_re, int *inex_im, mpc_ptr expected,
+ known_signs_t *signs, mpc_ptr op1, mpc_ptr op2, mpc_rnd_t *rnd)
+{
+ test_line_number = line_number;
+ read_ternary (fp, inex_re);
+ read_ternary (fp, inex_im);
+ read_mpc (fp, expected, signs);
+ read_mpc (fp, op1, NULL);
+ read_mpc (fp, op2, NULL);
+ read_mpc_rounding_mode (fp, rnd);
+ check_compatible (*inex_re, mpc_realref(expected), MPC_RND_RE(*rnd), "real");
+ check_compatible (*inex_im, mpc_imagref(expected), MPC_RND_IM(*rnd), "imag");
+}
+
+/* read lines of data for function with three mpc_t inputs and one mpc_t
+ output like mpc_fma */
+static void
+read_cccc (FILE *fp, int *inex_re, int *inex_im, mpc_ptr expected,
+ known_signs_t *signs, mpc_ptr op1, mpc_ptr op2, mpc_ptr op3,
+ mpc_rnd_t *rnd)
+{
+ test_line_number = line_number;
+ read_ternary (fp, inex_re);
+ read_ternary (fp, inex_im);
+ read_mpc (fp, expected, signs);
+ read_mpc (fp, op1, NULL);
+ read_mpc (fp, op2, NULL);
+ read_mpc (fp, op3, NULL);
+ read_mpc_rounding_mode (fp, rnd);
+ check_compatible (*inex_re, mpc_realref(expected), MPC_RND_RE(*rnd), "real");
+ check_compatible (*inex_im, mpc_imagref(expected), MPC_RND_IM(*rnd), "imag");
+}
+
+static void
+read_cfc (FILE *fp, int *inex_re, int *inex_im, mpc_ptr expected,
+ known_signs_t *signs, mpfr_ptr op1, mpc_ptr op2, mpc_rnd_t *rnd)
+{
+ test_line_number = line_number;
+ read_ternary (fp, inex_re);
+ read_ternary (fp, inex_im);
+ read_mpc (fp, expected, signs);
+ read_mpfr (fp, op1, NULL);
+ read_mpc (fp, op2, NULL);
+ read_mpc_rounding_mode (fp, rnd);
+ check_compatible (*inex_re, mpc_realref(expected), MPC_RND_RE(*rnd), "real");
+ check_compatible (*inex_im, mpc_imagref(expected), MPC_RND_IM(*rnd), "imag");
+}
+
+static void
+read_ccf (FILE *fp, int *inex_re, int *inex_im, mpc_ptr expected,
+ known_signs_t *signs, mpc_ptr op1, mpfr_ptr op2, mpc_rnd_t *rnd)
+{
+ test_line_number = line_number;
+ read_ternary (fp, inex_re);
+ read_ternary (fp, inex_im);
+ read_mpc (fp, expected, signs);
+ read_mpc (fp, op1, NULL);
+ read_mpfr (fp, op2, NULL);
+ read_mpc_rounding_mode (fp, rnd);
+ check_compatible (*inex_re, mpc_realref(expected), MPC_RND_RE(*rnd), "real");
+ check_compatible (*inex_im, mpc_imagref(expected), MPC_RND_IM(*rnd), "imag");
+}
+
+static void
+read_ccu (FILE *fp, int *inex_re, int *inex_im, mpc_ptr expected,
+ known_signs_t *signs, mpc_ptr op1, unsigned long int *op2, mpc_rnd_t *rnd)
+{
+ test_line_number = line_number;
+ read_ternary (fp, inex_re);
+ read_ternary (fp, inex_im);
+ read_mpc (fp, expected, signs);
+ read_mpc (fp, op1, NULL);
+ read_uint (fp, op2);
+ read_mpc_rounding_mode (fp, rnd);
+ check_compatible (*inex_re, mpc_realref(expected), MPC_RND_RE(*rnd), "real");
+ check_compatible (*inex_im, mpc_imagref(expected), MPC_RND_IM(*rnd), "imag");
+}
+
+static void
+read_ccs (FILE *fp, int *inex_re, int *inex_im, mpc_ptr expected,
+ known_signs_t *signs, mpc_ptr op1, long int *op2, mpc_rnd_t *rnd)
+{
+ test_line_number = line_number;
+ read_ternary (fp, inex_re);
+ read_ternary (fp, inex_im);
+ read_mpc (fp, expected, signs);
+ read_mpc (fp, op1, NULL);
+ read_sint (fp, op2);
+ read_mpc_rounding_mode (fp, rnd);
+ check_compatible (*inex_re, mpc_realref(expected), MPC_RND_RE(*rnd), "real");
+ check_compatible (*inex_im, mpc_imagref(expected), MPC_RND_IM(*rnd), "imag");
+}
+
+/* set MPFR flags to random values */
+static void
+set_mpfr_flags (int counter)
+{
+ if (counter & 1)
+ mpfr_set_underflow ();
+ else
+ mpfr_clear_underflow ();
+ if (counter & 2)
+ mpfr_set_overflow ();
+ else
+ mpfr_clear_overflow ();
+ /* the divide-by-0 flag was added in MPFR 3.1.0 */
+#ifdef mpfr_set_divby0
+ if (counter & 4)
+ mpfr_set_divby0 ();
+ else
+ mpfr_clear_divby0 ();
+#endif
+ if (counter & 8)
+ mpfr_set_nanflag ();
+ else
+ mpfr_clear_nanflag ();
+ if (counter & 16)
+ mpfr_set_inexflag ();
+ else
+ mpfr_clear_inexflag ();
+ if (counter & 32)
+ mpfr_set_erangeflag ();
+ else
+ mpfr_clear_erangeflag ();
+}
+
+/* Check MPFR flags: we allow that some flags are set internally by MPC,
+ for example if MPC does internal computations (using MPFR) which yield
+ an overflow, even if the final MPC result fits in the exponent range.
+ However we don't allow MPC to *clear* the MPFR flags */
+static void
+check_mpfr_flags (int counter)
+{
+ int old, neu;
+
+ old = (counter & 1) != 0;
+ neu = mpfr_underflow_p () != 0;
+ if (old && (neu == 0))
+ {
+ printf ("Error, underflow flag has been modified from %d to %d\n",
+ old, neu);
+ exit (1);
+ }
+ old = (counter & 2) != 0;
+ neu = mpfr_overflow_p () != 0;
+ if (old && (neu == 0))
+ {
+ printf ("Error, overflow flag has been modified from %d to %d\n",
+ old, neu);
+ exit (1);
+ }
+#ifdef mpfr_divby0_p
+ old = (counter & 4) != 0;
+ neu = mpfr_divby0_p () != 0;
+ if (old && (neu == 0))
+ {
+ printf ("Error, divby0 flag has been modified from %d to %d\n",
+ old, neu);
+ exit (1);
+ }
+#endif
+ old = (counter & 8) != 0;
+ neu = mpfr_nanflag_p () != 0;
+ if (old && (neu == 0))
+ {
+ printf ("Error, nanflag flag has been modified from %d to %d\n",
+ old, neu);
+ exit (1);
+ }
+ old = (counter & 16) != 0;
+ neu = mpfr_inexflag_p () != 0;
+ if (old && (neu == 0))
+ {
+ printf ("Error, inexflag flag has been modified from %d to %d\n",
+ old, neu);
+ exit (1);
+ }
+ old = (counter & 32) != 0;
+ neu = mpfr_erangeflag_p () != 0;
+ if (old && (neu == 0))
+ {
+ printf ("Error, erangeflag flag has been modified from %d to %d\n",
+ old, neu);
+ exit (1);
+ }
+}
+
+/* data_check (function, data_file_name) checks function results against
+ precomputed data in a file.*/
+void
+data_check (mpc_function function, const char *file_name)
+{
+ FILE *fp;
+
+ int inex_re;
+ mpfr_t x1, x2;
+ mpfr_rnd_t mpfr_rnd = GMP_RNDN;
+ int sign_real;
+
+ int inex_im;
+ mpc_t z1, z2, z3, z4, z5;
+ mpc_rnd_t rnd = MPC_RNDNN;
+
+ unsigned long int ui;
+ long int si;
+
+ known_signs_t signs;
+ int inex = 0;
+
+ static int rand_counter = 0;
+
+ fp = open_data_file (file_name);
+
+ /* 1. init needed variables */
+ mpc_init2 (z1, 2);
+ switch (function.type)
+ {
+ case FC:
+ mpfr_init (x1);
+ mpfr_init (x2);
+ break;
+ case CC: case CCU: case CCS:
+ mpc_init2 (z2, 2);
+ mpc_init2 (z3, 2);
+ break;
+ case C_CC:
+ mpc_init2 (z2, 2);
+ mpc_init2 (z3, 2);
+ mpc_init2 (z4, 2);
+ break;
+ case CCCC:
+ mpc_init2 (z2, 2);
+ mpc_init2 (z3, 2);
+ mpc_init2 (z4, 2);
+ mpc_init2 (z5, 2);
+ break;
+ case CFC: case CCF:
+ mpfr_init (x1);
+ mpc_init2 (z2, 2);
+ mpc_init2 (z3, 2);
+ break;
+ default:
+ ;
+ }
+
+ /* 2. read data file */
+ line_number = 1;
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+ while (nextchar != EOF) {
+ set_mpfr_flags (rand_counter);
+
+ /* for each kind of function prototype: */
+ /* 3.1 read a line of data: expected result, parameters, rounding mode */
+ /* 3.2 compute function at the same precision as the expected result */
+ /* 3.3 compare this result with the expected one */
+ switch (function.type)
+ {
+ case FC: /* example mpc_norm */
+ read_fc (fp, &inex_re, x1, &sign_real, z1, &mpfr_rnd);
+ mpfr_set_prec (x2, mpfr_get_prec (x1));
+ inex = function.pointer.FC (x2, z1, mpfr_rnd);
+ if ((inex_re != TERNARY_NOT_CHECKED && inex_re != inex)
+ || !same_mpfr_value (x1, x2, sign_real))
+ {
+ mpfr_t got, expected;
+ mpc_t op;
+ op[0] = z1[0];
+ got[0] = x2[0];
+ expected[0] = x1[0];
+ printf ("%s(op) failed (%s:%lu)\nwith rounding mode %s\n",
+ function.name, file_name, test_line_number,
+ mpfr_rnd_mode[mpfr_rnd]);
+ if (inex_re != TERNARY_NOT_CHECKED && inex_re != inex)
+ printf("ternary value: got %s, expected %s\n",
+ MPFR_INEX_STR (inex), MPFR_INEX_STR (inex_re));
+ MPC_OUT (op);
+ printf (" ");
+ MPFR_OUT (got);
+ MPFR_OUT (expected);
+
+ exit (1);
+ }
+ break;
+
+ case CC: /* example mpc_log */
+ read_cc (fp, &inex_re, &inex_im, z1, &signs, z2, &rnd);
+ mpfr_set_prec (mpc_realref (z3), MPC_PREC_RE (z1));
+ mpfr_set_prec (mpc_imagref (z3), MPC_PREC_IM (z1));
+ inex = function.pointer.CC (z3, z2, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z3, z1, signs))
+ {
+ mpc_t op, got, expected; /* display sensible variable names */
+ op[0] = z2[0];
+ expected[0]= z1[0];
+ got[0] = z3[0];
+ printf ("%s(op) failed (line %lu)\nwith rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPC_OUT (op);
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ break;
+
+ case C_CC: /* example mpc_mul */
+ read_ccc (fp, &inex_re, &inex_im, z1, &signs, z2, z3, &rnd);
+ mpfr_set_prec (mpc_realref(z4), MPC_PREC_RE (z1));
+ mpfr_set_prec (mpc_imagref(z4), MPC_PREC_IM (z1));
+ inex = function.pointer.C_CC (z4, z2, z3, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z4, z1, signs))
+ {
+ /* display sensible variable names */
+ mpc_t op1, op2, got, expected;
+ op1[0] = z2[0];
+ op2[0] = z3[0];
+ expected[0]= z1[0];
+ got[0] = z4[0];
+ printf ("%s(op) failed (line %lu)\nwith rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPC_OUT (op1);
+ MPC_OUT (op2);
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ if (function.properties & FUNC_PROP_SYMETRIC)
+ {
+ inex = function.pointer.C_CC (z4, z3, z2, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z4, z1, signs))
+ {
+ /* display sensible variable names */
+ mpc_t op1, op2, got, expected;
+ op1[0] = z3[0];
+ op2[0] = z2[0];
+ expected[0]= z1[0];
+ got[0] = z4[0];
+ printf ("%s(op) failed (line %lu/symetric test)\n"
+ "with rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPC_OUT (op1);
+ MPC_OUT (op2);
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ }
+ break;
+
+ case CCCC: /* example mpc_fma */
+ read_cccc (fp, &inex_re, &inex_im, z1, &signs, z2, z3, z4, &rnd);
+ /* z1 is the expected value, z2, z3, z4 are the inputs, and z5 is
+ the computed value */
+ mpfr_set_prec (mpc_realref(z5), MPC_PREC_RE (z1));
+ mpfr_set_prec (mpc_imagref(z5), MPC_PREC_IM (z1));
+ inex = function.pointer.CCCC (z5, z2, z3, z4, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z5, z1, signs))
+ {
+ /* display sensible variable names */
+ mpc_t op1, op2, op3, got, expected;
+ op1[0] = z2[0];
+ op2[0] = z3[0];
+ op3[0] = z4[0];
+ expected[0]= z1[0];
+ got[0] = z5[0];
+ printf ("%s(op) failed (line %lu)\nwith rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPC_OUT (op1);
+ MPC_OUT (op2);
+ MPC_OUT (op3);
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ if (function.properties & FUNC_PROP_SYMETRIC)
+ {
+ inex = function.pointer.CCCC (z5, z3, z2, z4, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z5, z1, signs))
+ {
+ /* display sensible variable names */
+ mpc_t op1, op2, op3, got, expected;
+ op1[0] = z3[0];
+ op2[0] = z2[0];
+ op3[0] = z4[0];
+ expected[0]= z1[0];
+ got[0] = z5[0];
+ printf ("%s(op) failed (line %lu/symetric test)\n"
+ "with rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPC_OUT (op1);
+ MPC_OUT (op2);
+ MPC_OUT (op3);
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ }
+ break;
+
+ case CFC: /* example mpc_fr_div */
+ read_cfc (fp, &inex_re, &inex_im, z1, &signs, x1, z2, &rnd);
+ mpfr_set_prec (mpc_realref(z3), MPC_PREC_RE (z1));
+ mpfr_set_prec (mpc_imagref(z3), MPC_PREC_IM (z1));
+ inex = function.pointer.CFC (z3, x1, z2, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z3, z1, signs))
+ {
+ /* display sensible variable names */
+ mpc_t op2, got, expected;
+ mpfr_t op1;
+ op1[0] = x1[0];
+ op2[0] = z2[0];
+ expected[0]= z1[0];
+ got[0] = z3[0];
+ printf ("%s(op) failed (line %lu)\nwith rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPFR_OUT (op1);
+ MPC_OUT (op2);
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ break;
+
+ case CCF: /* example mpc_mul_fr */
+ read_ccf (fp, &inex_re, &inex_im, z1, &signs, z2, x1, &rnd);
+ mpfr_set_prec (mpc_realref(z3), MPC_PREC_RE (z1));
+ mpfr_set_prec (mpc_imagref(z3), MPC_PREC_IM (z1));
+ inex = function.pointer.CCF (z3, z2, x1, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z3, z1, signs))
+ {
+ /* display sensible variable names */
+ mpc_t op1, got, expected;
+ mpfr_t op2;
+ op1[0] = z2[0];
+ op2[0] = x1[0];
+ expected[0]= z1[0];
+ got[0] = z3[0];
+ printf ("%s(op) failed (line %lu)\nwith rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPC_OUT (op1);
+ MPFR_OUT (op2);
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ break;
+
+ case CCU: /* example mpc_pow_ui */
+ read_ccu (fp, &inex_re, &inex_im, z1, &signs, z2, &ui, &rnd);
+ mpfr_set_prec (mpc_realref(z3), MPC_PREC_RE (z1));
+ mpfr_set_prec (mpc_imagref(z3), MPC_PREC_IM (z1));
+ inex = function.pointer.CCU (z3, z2, ui, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z3, z1, signs))
+ {
+ /* display sensible variable names */
+ mpc_t op1, got, expected;
+ op1[0] = z2[0];
+ expected[0]= z1[0];
+ got[0] = z3[0];
+ printf ("%s(op) failed (line %lu)\nwith rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPC_OUT (op1);
+ printf ("op2 %lu\n ", ui);
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ break;
+
+ case CCS: /* example mpc_pow_si */
+ read_ccs (fp, &inex_re, &inex_im, z1, &signs, z2, &si, &rnd);
+ mpfr_set_prec (mpc_realref(z3), MPC_PREC_RE (z1));
+ mpfr_set_prec (mpc_imagref(z3), MPC_PREC_IM (z1));
+ inex = function.pointer.CCS (z3, z2, si, rnd);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex)
+ || !same_mpc_value (z3, z1, signs))
+ {
+ /* display sensible variable names */
+ mpc_t op1, got, expected;
+ op1[0] = z2[0];
+ expected[0]= z1[0];
+ got[0] = z3[0];
+ printf ("%s(op) failed (line %lu)\nwith rounding mode %s\n",
+ function.name, test_line_number, rnd_mode[rnd]);
+ if (!MPC_INEX_CMP (inex_re, inex_im, inex))
+ printf("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ MPFR_INEX_STR (inex_re), MPFR_INEX_STR (inex_im));
+ MPC_OUT (op1);
+ printf ("op2 %li\n ", si);
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+ break;
+
+ default:
+ printf ("Unhandled function prototype %i in 'data_check'\n", function.type);
+ exit (1);
+ }
+
+ /* check MPFR flags were not modified */
+ check_mpfr_flags (rand_counter);
+ rand_counter ++;
+ }
+
+ /* 3. Clear used variables */
+ mpc_clear (z1);
+ switch (function.type)
+ {
+ case FC:
+ mpfr_clear (x1);
+ mpfr_clear (x2);
+ break;
+ case CC: case CCU: case CCS:
+ mpc_clear (z2);
+ mpc_clear (z3);
+ break;
+ case C_CC:
+ mpc_clear (z2);
+ mpc_clear (z3);
+ mpc_clear (z4);
+ break;
+ case CCCC:
+ mpc_clear (z2);
+ mpc_clear (z3);
+ mpc_clear (z4);
+ mpc_clear (z5);
+ break;
+ case CFC: case CCF:
+ mpfr_clear (x1);
+ mpc_clear (z2);
+ mpc_clear (z3);
+ break;
+ default:
+ ;
+ }
+
+ close_data_file (fp);
+}
diff --git a/mpc/tests/sin.dat b/mpc/tests/sin.dat
new file mode 100644
index 0000000000..9831fa6590
--- /dev/null
+++ b/mpc/tests/sin.dat
@@ -0,0 +1,163 @@
+# Data file for mpc_sin.
+#
+# Copyright (C) 2008, 2010 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP_RE OP_RE PREC_OP_IM OP_IM RND_RE RND_IM
+#
+# where op = op_re + i * op_im, rop = rop_re + i * rop_im,
+# rop_re is ROP_RE rounded to nearest to the precision of PREC_ROP_RE
+# rop_im is ROP_IM rounded to nearest to the precision of PREC_ROP_IM
+# op_re is OP_RE rounded to nearest to the precision of PREC_OP_RE
+# op_im is OP_IM rounded to nearest to the precision of PREC_OP_IM
+# ROP_RE is checked against Re(sin op) rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against Im(sin op) rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# special values (following ISO C99 standard)
+0 0 53 nan 53 inf 53 -inf 53 -inf N N
+0 0 53 nan 53 nan 53 -inf 53 -1 N N
+0 0 53 nan 53 0 53 -inf 53 -0 N N
+0 0 53 nan 53 0 53 -inf 53 +0 N N
+0 0 53 nan 53 nan 53 -inf 53 +1 N N
+0 0 53 nan 53 inf 53 -inf 53 +inf N N
+0 0 53 nan 53 nan 53 -inf 53 nan N N
+0 0 53 +inf 53 -inf 53 -6 53 -inf N N
+0 0 53 +inf 53 +inf 53 -6 53 +inf N N
+0 0 53 nan 53 nan 53 -6 53 nan N N
+0 0 53 +inf 53 +inf 53 -4 53 -inf N N
+0 0 53 +inf 53 -inf 53 -4 53 +inf N N
+0 0 53 nan 53 nan 53 -4 53 nan N N
+0 0 53 -inf 53 +inf 53 -2 53 -inf N N
+0 0 53 -inf 53 -inf 53 -2 53 +inf N N
+0 0 53 nan 53 nan 53 -2 53 nan N N
+0 0 53 -inf 53 -inf 53 -1 53 -inf N N
+0 0 53 -inf 53 +inf 53 -1 53 +inf N N
+0 0 53 nan 53 nan 53 -1 53 nan N N
+0 0 53 -0 53 -inf 53 -0 53 -inf N N
+0 0 53 -0 53 -0 53 -0 53 -0 N N
+0 0 53 -0 53 +0 53 -0 53 +0 N N
+0 0 53 -0 53 +inf 53 -0 53 +inf N N
+0 0 53 -0 53 nan 53 -0 53 nan N N
+0 0 53 +0 53 -inf 53 +0 53 -inf N N
+0 0 53 +0 53 -0 53 +0 53 -0 N N
+0 0 53 +0 53 +0 53 +0 53 +0 N N
+0 0 53 +0 53 +inf 53 +0 53 +inf N N
+0 0 53 +0 53 nan 53 +0 53 nan N N
+0 0 53 +inf 53 -inf 53 +1 53 -inf N N
+0 0 53 +inf 53 +inf 53 +1 53 +inf N N
+0 0 53 nan 53 nan 53 +1 53 nan N N
+0 0 53 +inf 53 +inf 53 +2 53 -inf N N
+0 0 53 +inf 53 -inf 53 +2 53 +inf N N
+0 0 53 nan 53 nan 53 +2 53 nan N N
+0 0 53 -inf 53 +inf 53 +4 53 -inf N N
+0 0 53 -inf 53 -inf 53 +4 53 +inf N N
+0 0 53 nan 53 nan 53 +4 53 nan N N
+0 0 53 -inf 53 -inf 53 +6 53 -inf N N
+0 0 53 -inf 53 +inf 53 +6 53 +inf N N
+0 0 53 nan 53 nan 53 +6 53 nan N N
+0 0 53 nan 53 inf 53 +inf 53 -inf N N
+0 0 53 nan 53 nan 53 +inf 53 -1 N N
+0 0 53 nan 53 0 53 +inf 53 -0 N N
+0 0 53 nan 53 0 53 +inf 53 +0 N N
+0 0 53 nan 53 nan 53 +inf 53 +1 N N
+0 0 53 nan 53 inf 53 +inf 53 +inf N N
+0 0 53 nan 53 nan 53 +inf 53 nan N N
+0 0 53 nan 53 inf 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 0 53 nan 53 -0 N N
+0 0 53 nan 53 0 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 nan 53 inf 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
+- 0 53 0x4787C62AC28Bp-48 53 -0 53 -6 53 -0 N N
+- 0 53 0x4787C62AC28Bp-48 53 +0 53 -6 53 +0 N N
+- 0 53 0xC1BDCEEEE0F57p-52 53 +0 53 -4 53 -0 N N
+- 0 53 0xC1BDCEEEE0F57p-52 53 -0 53 -4 53 +0 N N
+- 0 53 -0xE8C7B7568DA23p-52 53 +0 53 -2 53 -0 N N
+- 0 53 -0xE8C7B7568DA23p-52 53 -0 53 -2 53 +0 N N
++ 0 53 -0xD76AA47848677p-52 53 -0 53 -1 53 -0 N N
++ 0 53 -0xD76AA47848677p-52 53 +0 53 -1 53 +0 N N
+- 0 53 0xD76AA47848677p-52 53 -0 53 +1 53 -0 N N
+- 0 53 0xD76AA47848677p-52 53 +0 53 +1 53 +0 N N
++ 0 53 0xE8C7B7568DA23p-52 53 +0 53 +2 53 -0 N N
++ 0 53 0xE8C7B7568DA23p-52 53 -0 53 +2 53 +0 N N
++ 0 53 -0xC1BDCEEEE0F57p-52 53 +0 53 +4 53 -0 N N
++ 0 53 -0xC1BDCEEEE0F57p-52 53 -0 53 +4 53 +0 N N
++ 0 53 -0x4787C62AC28Bp-48 53 -0 53 +6 53 -0 N N
++ 0 53 -0x4787C62AC28Bp-48 53 +0 53 +6 53 +0 N N
+
+# pure imaginary argument
+0 + 53 -0 53 -0x1936D22F67C805p-45 53 -0 53 -6 N N
+0 + 53 +0 53 -0x1936D22F67C805p-45 53 +0 53 -6 N N
+0 - 53 -0 53 -0x1B4A3803703631p-48 53 -0 53 -4 N N
+0 - 53 +0 53 -0x1B4A3803703631p-48 53 +0 53 -4 N N
+0 + 53 -0 53 -0x1D03CF63B6E19Fp-51 53 -0 53 -2 N N
+0 + 53 +0 53 -0x1D03CF63B6E19Fp-51 53 +0 53 -2 N N
+0 + 53 -0 53 -0x966CFE2275CC1p-51 53 -0 53 -1 N N
+0 + 53 +0 53 -0x966CFE2275CC1p-51 53 +0 53 -1 N N
+0 - 53 -0 53 0x966CFE2275CC1p-51 53 -0 53 +1 N N
+0 - 53 +0 53 0x966CFE2275CC1p-51 53 +0 53 +1 N N
+0 - 53 -0 53 0x1D03CF63B6E19Fp-51 53 -0 53 +2 N N
+0 - 53 +0 53 0x1D03CF63B6E19Fp-51 53 +0 53 +2 N N
+0 + 53 -0 53 0x1B4A3803703631p-48 53 -0 53 +4 N N
+0 + 53 +0 53 0x1B4A3803703631p-48 53 +0 53 +4 N N
+0 - 53 -0 53 0x1936D22F67C805p-45 53 -0 53 +6 N N
+0 - 53 +0 53 0x1936D22F67C805p-45 53 +0 53 +6 N N
+
+# IEEE-754 double precision
++ + 53 514 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 N N
++ + 53 514 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 N Z
++ + 53 514 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 N U
++ - 53 514 53 -0x8DBE5135A8CA9p-96 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 N D
+- + 53 0x100FFFFFFFFFFFp-43 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 Z N
+- + 53 0x100FFFFFFFFFFFp-43 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 Z Z
+- + 53 0x100FFFFFFFFFFFp-43 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 Z U
+- - 53 0x100FFFFFFFFFFFp-43 53 -0x8DBE5135A8CA9p-96 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 Z D
++ + 53 514 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 U N
++ + 53 514 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 U Z
++ + 53 514 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 U U
++ - 53 514 53 -0x8DBE5135A8CA9p-96 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 U D
+- + 53 0x100FFFFFFFFFFFp-43 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 D N
+- + 53 0x100FFFFFFFFFFFp-43 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 D Z
+- + 53 0x100FFFFFFFFFFFp-43 53 -0x11B7CA26B51951p-97 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 D U
+- - 53 0x100FFFFFFFFFFFp-43 53 -0x8DBE5135A8CA9p-96 53 0x3243F6A8885A3p-49 53 -0x1BBDD1808C59A3p-50 D D
+
+# huge values
++ + 53 +inf 53 +inf 53 0x4580CBF242683p-3 53 -0x1B3E8A3660D279p-3 N N
+- + 53 -inf 53 +inf 53 -0x1B3E8A3660D279p-3 53 0x4580CBF242683p-3 N N
diff --git a/mpc/tests/sinh.dat b/mpc/tests/sinh.dat
new file mode 100644
index 0000000000..51fd46e1fb
--- /dev/null
+++ b/mpc/tests/sinh.dat
@@ -0,0 +1,84 @@
+# Data file for mpc_sinh.
+#
+# Copyright (C) 2008, 2010 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see sin.dat.
+
+# special values (following ISO C99 standard)
+0 0 7 inf 7 NaN 7 -inf 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 -1 N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 1 N N
+0 0 7 inf 7 NaN 7 -inf 7 +inf N N
+0 0 7 inf 7 NaN 7 -inf 7 NaN N N
+0 0 7 NaN 7 NaN 7 -1 7 -inf N N
+0 0 7 NaN 7 NaN 7 -1 7 +inf N N
+0 0 7 NaN 7 NaN 7 -1 7 NaN N N
+0 0 7 0 7 NaN 7 -0 7 -inf N N
+0 0 7 -0 7 -0 7 -0 7 -0 N N
+0 0 7 -0 7 +0 7 -0 7 +0 N N
+0 0 7 0 7 NaN 7 -0 7 +inf N N
+0 0 7 0 7 NaN 7 -0 7 NaN N N
+0 0 7 0 7 NaN 7 +0 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 N N
+0 0 7 0 7 NaN 7 +0 7 +inf N N
+0 0 7 0 7 NaN 7 +0 7 NaN N N
+0 0 7 NaN 7 NaN 7 1 7 -inf N N
+0 0 7 NaN 7 NaN 7 1 7 +inf N N
+0 0 7 NaN 7 NaN 7 1 7 NaN N N
+0 0 7 inf 7 NaN 7 +inf 7 -inf N N
+0 0 7 +inf 7 -inf 7 +inf 7 -1 N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 1 N N
+0 0 7 inf 7 NaN 7 +inf 7 +inf N N
+0 0 7 inf 7 NaN 7 +inf 7 NaN N N
+0 0 7 NaN 7 NaN 7 NaN 7 -inf N N
+0 0 7 NaN 7 NaN 7 NaN 7 -1 N N
+0 0 7 NaN 7 -0 7 NaN 7 -0 N N
+0 0 7 NaN 7 +0 7 NaN 7 +0 N N
+0 0 7 NaN 7 NaN 7 NaN 7 1 N N
+0 0 7 NaN 7 NaN 7 NaN 7 +inf N N
+0 0 7 NaN 7 NaN 7 NaN 7 NaN N N
+
+# purely real argument
++ 0 50 -0x12cd9fc44eb98p-48 50 -0 7 -1 7 -0 N N
++ 0 50 -0x12cd9fc44eb98p-48 50 +0 7 -1 7 +0 N N
+- 0 50 0x12cd9fc44eb98p-48 50 -0 7 1 7 -0 N N
+- 0 50 0x12cd9fc44eb98p-48 50 +0 7 1 7 +0 N N
+
+# purely imaginary argument
+0 - 50 -0 50 -0xd76aa47848678p-52 7 -0 7 -1 N N
+0 + 50 -0 50 0xd76aa47848678p-52 7 -0 7 1 N N
+0 - 50 +0 50 -0xd76aa47848678p-52 7 +0 7 -1 N N
+0 + 50 +0 50 0xd76aa47848678p-52 7 +0 7 1 N N
+
+# values with +1 and -1
++ - 50 -0xa28cfec023fc8p-52 50 -0x14c67b74f6cc5p-48 7 -1 7 -1 N N
++ + 50 -0xa28cfec023fc8p-52 50 0x14c67b74f6cc5p-48 7 -1 7 1 N N
+- - 50 0xa28cfec023fc8p-52 50 -0x14c67b74f6cc5p-48 7 1 7 -1 N N
+- + 50 0xa28cfec023fc8p-52 50 0x14c67b74f6cc5p-48 7 1 7 1 N N
+
+# IEEE-754 double precision
+- - 53 0xF48D4FDF29C53p-105 53 2 53 0x15124271980435p-52 53 0x3243F6A8885A3p-49 N N
+
+# huge values
++ - 53 +inf 53 -inf 53 0x4580CBF242683p-3 53 -0x1B3E8A3660D279p-3 N N
++ + 53 +inf 53 +inf 53 -0x1B3E8A3660D279p-3 53 0x4580CBF242683p-3 N N
diff --git a/mpc/tests/sqr.dat b/mpc/tests/sqr.dat
new file mode 100644
index 0000000000..72bfe076fc
--- /dev/null
+++ b/mpc/tests/sqr.dat
@@ -0,0 +1,170 @@
+# Data file for mpc_sqr.
+#
+# Copyright (C) 2008, 2010, 2012 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# 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)
+0 0 53 nan 53 +inf 53 -inf 53 -inf N N
+0 0 53 +inf 53 +inf 53 -inf 53 -1 N N
+0 0 53 +inf 53 nan 53 -inf 53 -0 N N
+0 0 53 +inf 53 nan 53 -inf 53 +0 N N
+0 0 53 +inf 53 -inf 53 -inf 53 +1 N N
+0 0 53 nan 53 -inf 53 -inf 53 +inf N N
+0 0 53 nan 53 nan 53 -inf 53 nan N N
+0 0 53 -inf 53 +inf 53 -1 53 -inf N N
+0 0 53 +1 53 +0 53 -1 53 -0 N N
+0 0 53 +1 53 -0 53 -1 53 +0 N N
+0 0 53 -inf 53 -inf 53 -1 53 +inf N N
+0 0 53 nan 53 nan 53 -1 53 nan N N
+0 0 53 -inf 53 nan 53 -0 53 -inf N N
+0 0 53 -1 53 +0 53 -0 53 -1 N N
+0 0 53 0 53 +0 53 -0 53 -0 N N
+0 0 53 0 53 -0 53 -0 53 +0 N N
+0 0 53 -1 53 -0 53 -0 53 +1 N N
+0 0 53 -inf 53 nan 53 -0 53 +inf N N
+0 0 53 nan 53 nan 53 -0 53 nan N N
+0 0 53 -inf 53 nan 53 +0 53 -inf N N
+0 0 53 -1 53 -0 53 +0 53 -1 N N
+0 0 53 0 53 -0 53 +0 53 -0 N N
+0 0 53 0 53 +0 53 +0 53 +0 N N
+0 0 53 -1 53 +0 53 +0 53 +1 N N
+0 0 53 -inf 53 nan 53 +0 53 +inf N N
+0 0 53 nan 53 nan 53 +0 53 nan N N
+0 0 53 -inf 53 -inf 53 +1 53 -inf N N
+0 0 53 +1 53 -0 53 +1 53 -0 N N
+0 0 53 +1 53 +0 53 +1 53 +0 N N
+0 0 53 -inf 53 +inf 53 +1 53 +inf N N
+0 0 53 nan 53 nan 53 +1 53 nan N N
+0 0 53 nan 53 -inf 53 +inf 53 -inf N N
+0 0 53 +inf 53 -inf 53 +inf 53 -1 N N
+0 0 53 +inf 53 nan 53 +inf 53 -0 N N
+0 0 53 +inf 53 nan 53 +inf 53 +0 N N
+0 0 53 +inf 53 +inf 53 +inf 53 +1 N N
+0 0 53 nan 53 +inf 53 +inf 53 +inf N N
+0 0 53 nan 53 nan 53 +inf 53 nan N N
+0 0 53 nan 53 nan 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 nan 53 nan 53 -0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 nan 53 nan 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# pure real argument
++ 0 53 0x12345676543230p+52 2 +0 53 0x1111111000000f 17 +0 N N
+- 0 53 0x1234567654322fp+52 3 -0 54 -0x1111111000000f 16 +0 Z N
++ 0 53 0x12345676543230p+52 4 -0 55 0x1111111000000f 15 -0 U N
+- 0 53 0x1234567654322fp+52 5 +0 56 -0x1111111000000f 14 -0 D N
+- 0 53 0x1234567654322fp+52 6 +0 57 0x1111111000000f 13 +0 Z Z
++ 0 53 0x12345676543230p+52 7 -0 58 -0x1111111000000f 12 +0 U Z
+- 0 53 0x1234567654322fp+52 8 -0 59 0x1111111000000f 11 -0 D Z
++ 0 53 0x12345676543230p+52 9 +0 60 -0x1111111000000f 10 -0 N Z
++ 0 53 0x12345676543230p+52 10 +0 61 0x1111111000000f 9 +0 U U
+- 0 53 0x1234567654322fp+52 11 -0 62 -0x1111111000000f 8 +0 D U
++ 0 53 0x12345676543230p+52 12 -0 63 0x1111111000000f 7 -0 N U
+- 0 53 0x1234567654322fp+52 13 +0 64 -0x1111111000000f 6 -0 Z U
+- 0 53 0x1234567654322fp+52 14 +0 65 0x1111111000000f 5 +0 D D
++ 0 53 0x12345676543230p+52 15 -0 66 -0x1111111000000f 4 +0 N D
+- 0 53 0x1234567654322fp+52 16 -0 67 0x1111111000000f 3 -0 Z D
++ 0 53 0x12345676543230p+52 17 +0 68 -0x1111111000000f 2 -0 U D
+
+# pure imaginary argument
+- 0 53 -0xE1000002000000p+56 53 +0 53 +0 53 0xf0000001111111 N N
++ 0 53 -0xe1000001fffff8p+56 52 -0 51 -0 54 0xf0000001111111 Z N
++ 0 53 -0xe1000001fffff8p+56 51 -0 49 +0 55 -0xf0000001111111 U N
+- 0 53 -0xe1000002000000p+56 50 +0 47 -0 56 -0xf0000001111111 D N
++ 0 53 -0xe1000001fffff8p+56 49 +0 45 +0 57 0xf0000001111111 Z Z
++ 0 53 -0xe1000001fffff8p+56 48 -0 43 -0 58 0xf0000001111111 U Z
+- 0 53 -0xe1000002000000p+56 47 -0 41 +0 59 -0xf0000001111111 D Z
+- 0 53 -0xe1000002000000p+56 46 +0 39 -0 60 -0xf0000001111111 N Z
++ 0 53 -0xe1000001fffff8p+56 45 +0 37 +0 61 0xf0000001111111 U U
+- 0 53 -0xe1000002000000p+56 44 -0 35 -0 62 0xf0000001111111 D U
+- 0 53 -0xe1000002000000p+56 43 -0 33 +0 63 -0xf0000001111111 N U
++ 0 53 -0xe1000001fffff8p+56 42 +0 31 -0 64 -0xf0000001111111 Z U
+- 0 53 -0xe1000002000000p+56 41 +0 29 +0 65 0xf0000001111111 D D
+- 0 53 -0xe1000002000000p+56 40 -0 27 -0 66 0xf0000001111111 N D
++ 0 53 -0xe1000001fffff8p+56 39 -0 25 +0 67 -0xf0000001111111 Z D
++ 0 53 -0xe1000001fffff8p+56 38 +0 23 -0 68 -0xf0000001111111 U D
+
+# IEEE-754 double precision
+- + 53 0x10000000020000p+04 53 0x10000000effff 53 0x400008000180fp-22 53 0x7ffff0077efcbp-32 N N
+- - 53 0x3ffffffffffffd 53 0x7ffffffffffff4p+52 53 0x1fffffffffffff 53 0x1ffffffffffffe Z N
++ + 53 0x1c16e5d4c4d5e7p-45 53 -0x7ffffff800007p-47 53 0xf 53 -0x1111111000000fp-53 U N
+- + 53 0xfdbac097c8dc50p+2096 53 0x7f6e5d4c3b2a2p+1036 53 0xfedcba9876543p+1024 53 0x10000000000001p-42 D N
++ - 53 -0x10000000020000p+04 53 0x10000000efffefp-04 53 0x7ffff0077efcbp-32 53 0x400008000180fp-22 Z Z
++ + 53 0x3ffffffffffffe 53 -0x7ffffffffffff4p+52 53 0x1fffffffffffff 53 -0x1ffffffffffffe U Z
+- - 53 0xe0b72ea626af3p-44 53 0x7ffffff800007p-47 53 0xf 53 0x1111111000000fp-53 D Z
+- - 53 -0xfdbac097c8dc58p+2096 53 0x7f6e5d4c3b2a1cp+1032 53 -0x10000000000001p-42 53 -0xfedcba9876543p+1024 N Z
++ + 53 0x10000000020001p+04 53 -0x10000000efffefp-04 53 0x400008000180fp-22 53 -0x7ffff0077efcbp-32 U U
+- + 53 -0x3ffffffffffffe 53 -0x7ffffffffffff4p+52 53 -0x1ffffffffffffe 53 0x1fffffffffffff D U
+- + 53 -0x1C16E5D4C4D5E7p-45 53 0x1ffffffe00001dp-49 53 -0x1111111000000fp-53 53 -0xf N U
++ + 53 -0xfdbac097c8dc50p+2096 53 -0x7f6e5d4c3b2a1cp+1032 53 0x10000000000001p-42 53 -0xfedcba9876543p+1024 Z U
+- - 53 -0x10000000020001p+04 53 -0x10000000effff 53 -0x7ffff0077efcbp-32 53 0x400008000180fp-22 D D
+- - 53 0x3ffffffffffffd 53 -0x7ffffffffffff8p+52 53 -0x1fffffffffffff 53 0x1ffffffffffffe N D
++ - 53 -0xE0B72EA626AF3p-44 53 -0x1FFFFFFE00001Dp-49 53 0x1111111000000fp-53 53 -0xf Z D
++ - 53 0xfdbac097c8dc58p+2096 53 -0x7f6e5d4c3b2a2p+1036 53 -0xfedcba9876543p+1024 53 0x10000000000001p-42 U D
+
+# improve test coverage:
+# For op=x+i*y, we need a case where x+y and x-y are inexact at the
+# higher computing precision, and where x and y do not have too
+# distinct exponents so that Karatsuba gets triggered...
+# (2^44 + i*(2^29 + 1))^2 \approx (2^88-2^58) + i*2^45*(2^29+1)
++ 0 30 309485009533114692573069312 30 18889465966662952943616 30 17592186044416 30 536870913 N N
+# ...and a case where x+y or x-y are 0.
+0 0 4 0 4 2 4 1 4 1 N N
+
+# a few values, previously hard-coded in tsqr.c
+0 0 8 7 8 24 8 4 8 3 N N
++ + 8 0b1.1000111e-3 8 0b1.1100111e-3 27 0b1.11111011011000010101000000e-2 27 0b1.11010001010110111001110001e-3 N N
+
+# bug 20090930, infinite loop
++ + 3464 inf 3464 inf 866 -0x2.5763c6519ef1510f8afa101a210b8030b1909cc17004db561a25d9b53e2c08c41c01e8bbac5af6299b9d8786030aa14943d841798c8c369287942e4d4cec42a60ab0922af931159805e631128e97f973754ad53972d5d320a651a3b4a667f0ef2b92dbd698d159c3642675140@192158913 866 -0xd.15f2d530934dd930d66e89d70762d2337a8f973dd6915eb6b532fd372fcc955df1d852632d4e46fe64154ceda991a1302caf1b0ec622497e3e5724dd05b1c89a06e28d7e18e8af58f5ff4c9998cb31714688867524f41e0b31e847c1bf40de5127f858069998efd7c3e599080@192158893 N N
+
+# bug 20091001, infinite loop
+? + 2256 0 2256 -0 564 0xc.87999bfd1cb1a64288881e214b7cf1af979863b23c030b79c4a8bebb39177967608388a2e4df527977e7755a25df8af8f72fdd6dd2f42bd00de83088b4e9b59ce85caf2e6b0c0@-184298749 564 -0x2.5109af459d4daf357e09475ec991cdc9b02c8f7dfacdc060d2a24710d09c997f8aea6dbd46f10828c30b583fdcc90d7dcbb895689d594d3813db40784d2309e450d1fb6e38da8@-184298726 N N
+
+# (x+x*i)^2 = 0+2*x^2*i with exact real part
+0 0 100 0 100 304831530559368 100 12345678 100 12345678 N N
+0 0 1000 0 100 304831530559368 100 12345678 100 12345678 N N
+# intermediate overflow- and underflows
+0 + 100 0 100 +inf 100 0x1@225000750 100 0x1@225000750 N N
+0 + 10000 0 10000 +inf 100 0x1@225000750 100 0x1@225000750 N N
+0 - 100 0 100 +0 100 0x1@-225000750 100 0x1@-225000750 N N
+0 + 100 0 100 -0 100 0x1@-225000750 100 -0x1@-225000750 N N
+0 - 10000 0 10000 +0 100 0x1@-225000750 100 0x1@-225000750 N N
+0 + 10000 0 10000 -0 100 0x1@-225000750 100 -0x1@-225000750 N N
+
+# intermediate overflow in Karatsuba found by hydra, simplified test case
+- - 100 -inf 100 -inf 593 -0xf@192058806 593 0x1@192058873 N N
+# another interesting one with not exactly the same behaviour
+- - 100 -inf 100 -inf 100 -0xf@192058806 100 0x1@192058873 N N
+0 + 100 0 100 inf 100 0x1@192058806 100 0x1@192058806 N N
+# Re(op)*Im(op) can be computed, but multiplication by 2 triggers overflow
+0 + 100 0 100 inf 100 0b1@536870911 100 0b1@536870911 N N
+0 - 10 0 10 0b1.111111111e1073741822 100 0b1@536870911 100 0b1@536870911 N D
+0 - 10 0 10 0b1.111111111e1073741822 100 0b1@536870912 100 0b1@536870912 N D
+0 0 10 0 10 0b1e-1073741823 100 0b1@-536870912 100 0b1@-536870912 N N
+0 - 10 0 10 0 100 0b1@-536870913 100 0b1@-536870913 N N
+0 + 10 0 10 0b1@-1073741824 100 0b1@-536870913 100 0b1@-536870913 N U
++ - 10 0b1e-1073741824 10 0 100 0b1@-536870912 100 0b1@-536870913 N N
diff --git a/mpc/tests/sqrt.dat b/mpc/tests/sqrt.dat
new file mode 100644
index 0000000000..076f2afadc
--- /dev/null
+++ b/mpc/tests/sqrt.dat
@@ -0,0 +1,139 @@
+# Data file for mpc_sqrt.
+#
+# Copyright (C) 2008, 2010 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM 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)
+0 0 53 +inf 53 -inf 53 -inf 53 -inf N N
+0 0 53 +0 53 -inf 53 -inf 53 -1 N N
+0 0 53 +0 53 -inf 53 -inf 53 -0 N N
+0 0 53 +0 53 +inf 53 -inf 53 +0 N N
+0 0 53 +0 53 +inf 53 -inf 53 +1 N N
+0 0 53 +inf 53 +inf 53 -inf 53 +inf N N
+0 0 53 nan 53 inf 53 -inf 53 nan N N
+0 0 53 +inf 53 -inf 53 -1 53 -inf N N
+0 0 53 +0 53 -1 53 -1 53 -0 N N
+0 0 53 +0 53 +1 53 -1 53 +0 N N
+0 0 53 +inf 53 +inf 53 -1 53 +inf N N
+0 0 53 nan 53 nan 53 -1 53 nan N N
+0 0 53 +inf 53 -inf 53 -0 53 -inf N N
+0 0 53 +1 53 -1 53 -0 53 -2 N N
+0 0 53 +0 53 -0 53 -0 53 -0 N N
+0 0 53 +0 53 +0 53 -0 53 +0 N N
+0 0 53 +1 53 +1 53 -0 53 +2 N N
+0 0 53 +inf 53 +inf 53 -0 53 +inf N N
+0 0 53 nan 53 nan 53 -0 53 nan N N
+0 0 53 +inf 53 -inf 53 +0 53 -inf N N
+0 0 53 +1 53 -1 53 +0 53 -2 N N
+0 0 53 +0 53 -0 53 +0 53 -0 N N
+0 0 53 +0 53 +0 53 +0 53 +0 N N
+0 0 53 +1 53 +1 53 +0 53 +2 N N
+0 0 53 +inf 53 +inf 53 +0 53 +inf N N
+0 0 53 nan 53 nan 53 +0 53 nan N N
+0 0 53 +inf 53 -inf 53 +1 53 -inf N N
+0 0 53 +1 53 -0 53 +1 53 -0 N N
+0 0 53 +1 53 +0 53 +1 53 +0 N N
+0 0 53 +inf 53 +inf 53 +1 53 +inf N N
+0 0 53 nan 53 nan 53 +1 53 nan N N
+0 0 53 +inf 53 -inf 53 +inf 53 -inf N N
+0 0 53 +inf 53 -0 53 +inf 53 -1 N N
+0 0 53 +inf 53 -0 53 +inf 53 -0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +0 N N
+0 0 53 +inf 53 +0 53 +inf 53 +1 N N
+0 0 53 +inf 53 +inf 53 +inf 53 +inf N N
+0 0 53 +inf 53 nan 53 +inf 53 nan N N
+0 0 53 +inf 53 -inf 53 nan 53 -inf N N
+0 0 53 nan 53 nan 53 nan 53 -1 N N
+0 0 53 nan 53 nan 53 nan 53 -0 N N
+0 0 53 nan 53 nan 53 nan 53 +0 N N
+0 0 53 nan 53 nan 53 nan 53 +1 N N
+0 0 53 +inf 53 +inf 53 nan 53 +inf N N
+0 0 53 nan 53 nan 53 nan 53 nan N N
+
+# purely 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
++ 0 53 0x16a09e667f3bcdp-52 53 +0 53 2 17 +0 N N
+0 + 53 +0 53 0x16a09e667f3bcdp-52 54 -2 16 +0 Z N
++ 0 53 0x16a09e667f3bcdp-52 53 -0 55 2 15 -0 U N
+0 - 53 +0 53 -0x16a09e667f3bcdp-52 56 -2 14 -0 D N
+- 0 53 0x5a827999fcef30p-54 53 +0 57 2 13 +0 Z Z
+0 - 53 +0 53 0x5a827999fcef30p-54 58 -2 12 +0 U Z
+- 0 53 0x5a827999fcef30p-54 53 -0 59 2 11 -0 D Z
+0 + 53 +0 53 -0x5a827999fcef30p-54 60 -2 10 -0 N Z
++ 0 53 0x16a09e667f3bcdp-52 53 +0 61 2 9 +0 U U
+0 + 53 +0 53 0x16a09e667f3bcdp-52 62 -2 8 +0 D U
++ 0 53 0x16a09e667f3bcdp-52 53 -0 63 2 7 -0 N U
+0 + 53 +0 53 -0x5a827999fcef30p-54 64 -2 6 -0 Z U
+- 0 53 0x5a827999fcef30p-54 53 +0 65 2 5 +0 D D
+0 - 53 +0 53 0x5a827999fcef30p-54 66 -2 4 +0 N D
+- 0 53 0x5a827999fcef30p-54 53 -0 67 2 3 -0 Z D
+0 - 53 +0 53 -0x16a09e667f3bcdp-52 68 -2 2 -0 U D
+
+# purely 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
+0 + 2 0 2 -0b10p+117 2 -0b11p+235 2 -0 N Z
+
+# close to infinite loop reported by Emmanuel Thome, 22 Oct 2010,
+# and all its variants of signs and directed roundings
+- + 375 1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281177 375 1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 N N
++ + 375 0x1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281177 375 1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 U U
+- - 375 1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 D D
+- + 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 D U
+- - 375 1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 Z Z
+- - 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281177 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 N N
++ + 375 0x1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 U U
+- - 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281177 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 D D
+- + 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 Z Z
++ - 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281177 375 1 375 -1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 N N
++ + 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281177 375 0x1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004 375 -1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 U U
+- - 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 1 375 -1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 D D
+- - 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 1 375 -1 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 Z Z
++ + 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281177 375 -1 375 -1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 N N
++ + 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281177 375 -1 375 -1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 U U
+- - 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 -0x1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004 375 -1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 D D
+- + 375 0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef5fffffffffffffffffffffffffffffffffffffffffffep-202281177 375 -1 375 -1 375 -0xf.8a8aae3080b3dd665e316d262fd54c1ca22a83dc9acb92ef6p-202281176 Z Z
diff --git a/mpc/tests/strtoc.dat b/mpc/tests/strtoc.dat
new file mode 100644
index 0000000000..e69e4b6f3e
--- /dev/null
+++ b/mpc/tests/strtoc.dat
@@ -0,0 +1,168 @@
+# Data file for mpc_strtoc.
+#
+# Copyright (C) 2009 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The format respects the parameter order in function prototype as follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM "NSTRING" "RSTRING" BASE RND_RE RND_IM
+#
+# The string NSTRING is considered as a complex number rop = rop1 + i*rop2
+# written in base BASE. The remainder of the string, i.e. non-whitespace
+# characters being not part of the number, is equal to RSTRING.
+#
+# ROP_RE is checked against rop1 rounded to the precision PREC_ROP_RE
+# in the direction RND_RE
+# ROP_IM is checked against rop2 rounded to the precision PREC_ROP_IM
+# in the direction RND_IM
+# INEX_RE is the ternary value for the real part with the following notation:
+# "?" ternary value not checked
+# "!" function should return error indicator -1
+# "+" if ROP_RE is greater than the exact mathematical result
+# "0" if ROP_RE is exactly the mathematical result
+# "-" if ROP_RE is less than the exact mathematical result
+# (m.m. INEX_IM)
+# rounding modes notation:
+# "N" is rounding to nearest
+# "Z" is rounding towards zero
+# "U" is rounding towards plus infinity
+# "D" is rounding towards minus infinity
+# Use prefixes "0b" for values in base two, "0x" for values in base sixteen,
+# no prefix for value in base ten.
+# In all bases, "nan" is NaN, "inf" is infinity;
+# The sign of the result is checked with "+inf", "-inf", "-0", or "+0".
+
+# invalid base
+! ! 53 nan 53 nan "(1 1)" "(1 1)" 99 N N
+! ! 53 nan 53 nan "(1 1)" "(1 1)" 1 N N
+
+# invalid strings
+! ! 53 nan 53 nan "" "" 10 N N
+! ! 53 nan 53 nan "non" "non" 10 N N
+! ! 53 nan 53 nan "NON" "NON" 10 N N
+! ! 53 nan 53 nan "N A N" "N A N" 10 N N
+! ! 53 nan 53 nan "(1) 1" "(1) 1" 10 N N #no imaginary part
+! ! 53 nan 53 nan "." "." 10 N N
+! ! 53 nan 53 nan ". 1" ". 1" 10 N N #no space allowed here
+! ! 53 nan 53 nan "+ 1" "+ 1" 2 N N #no space allowed here
+! ! 53 nan 53 nan "+3 " "+3 " 2 N N #invalid digit
+! ! 53 nan 53 nan "+ INF " "+ INF " 10 N N #no space allowed here
+! ! 53 nan 53 nan "( +INF)" "( +INF)" 10 N N
+! ! 53 nan 53 nan "(1 +1 " "(1 +1 " 10 N N
+! ! 53 nan 53 nan "(1+1)" "(1+1)" 10 N N
+! ! 53 nan 53 nan "(1 + 1)" "(1 + 1)" 10 N N
+! ! 53 nan 53 nan "(@nan@(quiet)" "(@nan@(quiet)" 10 N N
+! ! 53 nan 53 nan "zero" "zero" 10 N N
+! ! 53 nan 53 nan "&^+" "&^+" 10 N N
+! ! 53 nan 53 nan "i" "i" 18 N N
+! ! 53 nan 53 nan "I" "I" 18 N N
+! ! 53 nan 53 nan "z" "z" 35 N N
+! ! 53 nan 53 nan "Z" "Z" 35 N N
+! ! 53 nan 53 nan "(i 0)" "(i 0)" 18 N N
+! ! 53 nan 53 nan "(I 0)" "(I 0)" 18 N N
+! ! 53 nan 53 nan "(z 0)" "(z 0)" 35 N N
+! ! 53 nan 53 nan "(Z 0)" "(Z 0)" 35 N N
+! ! 53 nan 53 nan "(0 i)" "(0 i)" 18 N N
+! ! 53 nan 53 nan "(0 I)" "(0 I)" 18 N N
+! ! 53 nan 53 nan "(0 z)" "(0 z)" 35 N N
+! ! 53 nan 53 nan "(0 Z)" "(0 Z)" 35 N N
+
+# special values
+0 0 53 nan 53 +0 "nan" "" 10 N N
+0 0 53 +nan 53 +0 "+NAN" "" 10 N N
+0 0 53 nan 53 +0 " @NAN@ " " " 10 N N
+0 0 53 nan 53 nan "(@nan@(QUIET) nan)" "" 10 N N
+0 0 53 nan 53 +0 "@nan@(quiet" "(quiet" 10 N N
+0 0 53 nan 53 +0 "NaN((keep out))" "((keep out))" 10 N N
+0 0 53 nan 53 +0 "nan(0 1)" "(0 1)" 10 N N
+0 0 53 nan 53 +0 "nan(0-1)" "(0-1)" 10 N N
+0 0 53 nan 53 +0 "nan(0_1)" "" 10 N N
+0 0 53 nan 53 +0 " nan nan nan nan" " nan nan nan" 10 N N
+0 0 53 inf 53 +0 "inf" "" 10 N N
+0 0 53 -inf 53 +0 "-inf" "" 10 N N
+0 0 53 +inf 53 +0 " infinity" "" 10 N N
+0 0 53 +inf 53 +0 "+INF x" " x" 10 N N
+0 0 53 +0 53 +inf "(0 +inf)" "" 10 N N
+0 0 53 +0 53 +inf " (+0 INF) " " " 10 N N
+0 0 53 +0 53 -inf "(0 -infinity)" "" 10 N N
+0 0 53 +0 53 -inf " (+0 -INF)" "" 10 N N
+0 0 53 -inf 53 -0 " (-@inf@ -0)" "" 10 N N
+0 0 53 +inf 53 nan "(+inf nan(9u137)) " " " 10 N N
+0 0 53 nan 53 +0 "NaN + inf" " + inf" 10 N N
+
+# pure real argument
+0 0 53 +0 53 +0 "0" "" 10 N N
+0 0 53 +0 53 +0 "00000" "" 10 N N
+0 0 53 +0 53 +0 "+0" "" 10 N N
+0 0 53 -0 53 +0 "-0" "" 10 N N
+0 0 53 +1 53 +0 "1" "" 10 N N
+0 0 53 +1 53 +0 "001" "" 10 N N
+0 0 53 +1 53 +0 "1 +1" " +1" 10 N N
+0 0 53 +1 53 +0 "1a" "a" 10 N N
+0 0 53 +1 53 +0 "1e-" "e-" 10 N N
+0 0 53 +1 53 +0 "1+2" "+2" 10 N N
+- 0 53 +0x9D70A3D70A3D7p-51 53 +0 "(+1.23 0.0)" "" 10 N N
+0 0 53 -10 53 +0 "(-10. 0000) " " " 10 N N
+0 0 53 +0x5p-3 53 -0 "(.625 -0)" "" 10 N N
+- 0 53 +0x14E718D7D7625Ap+612 53 +0 "(1e200 0)" "" 10 N N
+0 0 53 +0x7530 53 +0 " (3e+4 0)" "" 10 N N
+- 0 53 +0x10C6F7A0B5ED8Dp-73 53 +0 ".5e-6" "" 10 N N
+- 0 53 +0x1B1C1E0D914133p-83 53 +0 "(7.89E-10 0)" "" 10 N N
++ 0 53 -0x7B426FAB61F00Cp+56 53 +0 " -25@+32" "" 10 N N
+0 0 53 -25 53 +0 "-25p+32" "p+32" 10 N N
+0 0 53 +43981 53 +0 "0xabcd" "" 16 N N
+0 0 53 +0 53 +0 "0xabcd" "xabcd" 10 N N #no prefix in base ten
+0 0 53 +2 53 +0 "+0b010" "" 2 N N
+0 0 53 +0 53 +0 "+0b010" "b010" 10 N N #no prefix in base ten
+0 0 53 +1 53 +0 "1*i" "*i" 10 N N
+0 0 53 +18 53 +0 "i*i" "*i" 20 N N
+0 0 53 18 53 0 "i" "" 19 N N
+0 0 53 35 53 0 "z" "" 36 N N
+0 0 53 35 53 0 "Z" "" 36 N N
+
+# pure imaginary argument
+0 0 53 +0 53 +1 "(0 1)" "" 10 N N
+0 0 53 +0 53 +1 "(0 +1)" "" 20 N N
+0 0 53 -0 53 -1 " (-0 -1)" "" 10 N N
+0 0 53 -0 53 -2 "(-0 -2) " " " 10 N N
+0 0 53 +0 53 +2 "(+0 2)" "" 10 N N
+0 0 53 +0 53 +17 "(0 h)" "" 20 N N
+0 0 53 +0 53 +18 "(0 i)" "" 20 N N
+0 + 53 +0 53 -0x14F800008637BDp-44 "(0 -33.55000005e+1)" "" 10 N Z
+0 + 53 +0 53 -0xA1765976008AFp-401 "(+0 -.550000E-105) " " " 10 N U
+0 0 53 0 53 18 "(0 i)" "" 19 N N
+0 0 53 0 53 18 "(0 I)" "" 19 N N
+0 0 53 0 53 35 "(0 z)" "" 36 N N
+0 0 53 0 53 35 "(0 Z)" "" 36 N N
+
+# complex argument
+0 0 53 +1 53 +1 "( 1 +1)" "" 10 N N
+0 0 53 +1 53 +1 " (1 +1) " " " 10 N N
+0 0 53 +7 53 +14 "(7 14)" "" 10 N N
+0 0 53 +17 53 +1 "(+17 1)" "" 10 N N
+0 0 53 +27 53 +1 " (+17 +1)" "" 20 N N
+0 0 53 -18 53 -1 "(-i -1)" "" 20 N N
+0 0 53 +18 53 -1 "(i -1)" "" 20 N N
+0 0 53 -18 53 +1 "(-i +1)" "" 20 N N
+0 0 53 +18 53 +18 "(i +i)" "" 20 N N
+0 0 53 -14643 53 +20328 "(-bar foo)" "" 36 N N
+0 0 53 -1647190 53 -512315 "(-zaza -azaz)" "" 36 N N
+0 0 53 +0b1010 53 +0xabcd "(0b1010 +0xabcd)" "" 0 N N #base autodetection
+0 0 53 +0xabcd 53 +0b1010 "(+0xa.bcd@+3 0b.101p4)" "" 0 N N #base autodetection
+
+# white space before the closing ')'
+0 0 53 +1 53 +1 "( 1 +1 )1" "1" 10 N N
diff --git a/mpc/tests/sub.dat b/mpc/tests/sub.dat
new file mode 100644
index 0000000000..8d68dbb612
--- /dev/null
+++ b/mpc/tests/sub.dat
@@ -0,0 +1,94 @@
+# Data file for mpc_sub.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# The line format respects the parameter order in function prototype as
+# follow:
+#
+# INEX_RE INEX_IM PREC_ROP_RE ROP_RE PREC_ROP_IM ROP_IM PREC_OP1_RE OP1_RE PREC_OP1_IM OP1_IM PREC_OP2_RE OP2_RE PREC_OP2_IM OP2_IM RND_RE RND_IM
+#
+# see add.dat for details.
+
+# special values (following ISO C99 standard)
+0 0 53 nan 53 nan 53 -inf 53 -inf 53 -inf 53 -inf N Z
+0 0 53 -inf 53 +inf 53 -inf 53 +inf 53 +1 53 -inf Z U
+0 0 53 nan 53 -inf 53 +inf 53 -inf 53 +inf 53 +0 U D
+0 0 53 +inf 53 +inf 53 +inf 53 +inf 53 -0 53 -1 D N
+0 0 53 -inf 53 -inf 53 -inf 53 -inf 53 -0 53 -1 N U
+0 0 53 -inf 53 nan 53 -inf 53 +inf 53 +inf 53 nan Z D
+0 0 53 nan 53 -inf 53 +inf 53 -inf 53 nan 53 -1 U N
+0 0 53 +inf 53 nan 53 +inf 53 +inf 53 -0 53 nan D Z
+0 0 53 nan 53 nan 53 -inf 53 -inf 53 nan 53 nan N D
+
+0 0 53 -inf 53 -inf 53 -1 53 -inf 53 +inf 53 -1 N D
+0 0 53 -inf 53 +1 53 -inf 53 +1 53 +inf 53 -0 Z N
+0 0 53 +1 53 -inf 53 +1 53 -inf 53 -0 53 +1 U Z
+0 0 53 +inf 53 +1 53 +inf 53 +1 53 -0 53 -0 D U
+0 0 53 -inf 53 nan 53 -1 53 -inf 53 +inf 53 nan N N
+0 0 53 nan 53 +0 53 -inf 53 +1 53 nan 53 +1 Z Z
+0 0 53 +1 53 nan 53 +1 53 -inf 53 -0 53 nan U U
+0 0 53 nan 53 nan 53 +inf 53 +1 53 nan 53 nan D D
+
+0 0 53 -0 53 -inf 53 -0 53 -inf 53 +0 53 +inf D D
+0 0 53 -inf 53 +0 53 -inf 53 +0 53 +1 53 -0 N Z
+0 0 53 +0 53 -inf 53 +0 53 -inf 53 -0 53 -0 Z U
+0 0 53 +inf 53 nan 53 +inf 53 +0 53 -inf 53 nan U D
+0 0 53 nan 53 -inf 53 -0 53 -inf 53 nan 53 -1 D N
+0 0 53 -inf 53 nan 53 -inf 53 +0 53 +0 53 nan N U
+0 0 53 nan 53 nan 53 +0 53 -inf 53 nan 53 nan Z D
+
+0 0 53 +0 53 +2 53 +0 53 +1 53 -0 53 -1 Z D
+0 0 53 -1 53 +0 53 -1 53 -0 53 +0 53 -0 U N
+0 0 53 nan 53 -inf 53 -0 53 +1 53 nan 53 +inf D Z
+0 0 53 +2 53 nan 53 +1 53 -0 53 -1 53 nan N D
+0 0 53 nan 53 +1 53 +0 53 +1 53 nan 53 -0 Z N
+0 0 53 nan 53 nan 53 -1 53 -0 53 nan 53 nan U Z
+
+0 0 53 -0 53 +0 53 -0 53 +0 53 +0 53 -0 U Z
+0 0 53 nan 53 +inf 53 +0 53 -0 53 nan 53 -inf D U
+0 0 53 +1 53 nan 53 +0 53 +0 53 -1 53 nan N N
+0 0 53 nan 53 +0 53 -0 53 -0 53 nan 53 -0 Z Z
+0 0 53 nan 53 nan 53 -0 53 +0 53 nan 53 nan U U
+
+0 0 53 nan 53 -inf 53 nan 53 -inf 53 nan 53 +inf U U
+0 0 53 +inf 53 nan 53 +inf 53 nan 53 -1 53 nan D D
+0 0 53 nan 53 -inf 53 nan 53 -inf 53 nan 53 -0 N Z
+0 0 53 nan 53 nan 53 -inf 53 nan 53 nan 53 nan Z U
+
+0 0 53 nan 53 nan 53 +1 53 nan 53 nan 53 -1 Z U
+0 0 53 nan 53 nan 53 nan 53 +1 53 -0 53 nan U D
+0 0 53 nan 53 nan 53 -1 53 nan 53 nan 53 nan D N
+
+0 0 53 nan 53 nan 53 nan 53 +0 53 +0 53 nan D N
+0 0 53 nan 53 nan 53 +0 53 nan 53 nan 53 nan N U
+
+0 0 53 nan 53 nan 53 nan 53 nan 53 nan 53 nan N U
+
+# pure real argument
++ 0 53 0x10000000000000p-52 53 +0 53 +1 53 -0 53 0x1p-105 53 -0 N N
+- 0 53 0x1fffffffffffffp-53 53 +0 53 +1 53 -0 53 0x1p-105 53 -0 Z Z
++ 0 53 0x10000000000000p-52 53 +0 53 +1 53 -0 53 0x1p-105 53 -0 U U
+- 0 53 0x1fffffffffffffp-53 53 -0 53 +1 53 -0 53 0x1p-105 53 -0 D D
+
+# pure imaginary argument
+0 - 53 +0 53 -0x10000000000000p-52 53 -0 53 0x10000000000000p-106 53 -0 53 +1 N N
+0 + 53 +0 53 -0x1fffffffffffffp-53 53 -0 53 0x10000000000001p-106 53 -0 53 +1 N N
+0 + 53 +0 53 -0x1fffffffffffffp-53 53 +0 53 0x10000000000001p-106 53 -0 53 +1 Z Z
+0 + 53 +0 53 -0x1fffffffffffffp-53 53 +0 53 0x10000000000001p-106 53 -0 53 +1 U U
+0 - 53 -0 53 -0x10000000000000p-52 53 -0 53 0x10000000000001p-106 53 -0 53 +1 D D
+
diff --git a/mpc/tests/sub_fr.dat b/mpc/tests/sub_fr.dat
new file mode 100644
index 0000000000..06d58d1797
--- /dev/null
+++ b/mpc/tests/sub_fr.dat
@@ -0,0 +1,378 @@
+# Data file for mpc_sub_fr.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+
+# For explanations on the file format, see add_fr.dat.
+
+# special values
+0 0 7 nan 7 -inf 7 -inf 7 -inf 7 -inf N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 -1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 -0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 +0 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 1 N N
+0 0 7 -inf 7 -inf 7 -inf 7 -inf 7 +inf N N
+0 0 7 nan 7 -inf 7 -inf 7 -inf 7 nan N N
+0 0 7 nan 7 -1 7 -inf 7 -1 7 -inf N N
+0 0 7 -inf 7 -1 7 -inf 7 -1 7 -1 N N
+0 0 7 -inf 7 -1 7 -inf 7 -1 7 -0 N N
+0 0 7 -inf 7 -1 7 -inf 7 -1 7 +0 N N
+0 0 7 -inf 7 -1 7 -inf 7 -1 7 1 N N
+0 0 7 -inf 7 -1 7 -inf 7 -1 7 +inf N N
+0 0 7 nan 7 -1 7 -inf 7 -1 7 nan N N
+0 0 7 nan 7 -0 7 -inf 7 -0 7 -inf N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 7 -1 N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 7 -0 N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 7 +0 N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 7 1 N N
+0 0 7 -inf 7 -0 7 -inf 7 -0 7 +inf N N
+0 0 7 nan 7 -0 7 -inf 7 -0 7 nan N N
+0 0 7 nan 7 +0 7 -inf 7 +0 7 -inf N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 7 -1 N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 7 -0 N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 7 +0 N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 7 1 N N
+0 0 7 -inf 7 +0 7 -inf 7 +0 7 +inf N N
+0 0 7 nan 7 +0 7 -inf 7 +0 7 nan N N
+0 0 7 nan 7 1 7 -inf 7 1 7 -inf N N
+0 0 7 -inf 7 1 7 -inf 7 1 7 -1 N N
+0 0 7 -inf 7 1 7 -inf 7 1 7 -0 N N
+0 0 7 -inf 7 1 7 -inf 7 1 7 +0 N N
+0 0 7 -inf 7 1 7 -inf 7 1 7 1 N N
+0 0 7 -inf 7 1 7 -inf 7 1 7 +inf N N
+0 0 7 nan 7 1 7 -inf 7 1 7 nan N N
+0 0 7 nan 7 +inf 7 -inf 7 +inf 7 -inf N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 -1 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 -0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 +0 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 1 N N
+0 0 7 -inf 7 +inf 7 -inf 7 +inf 7 +inf N N
+0 0 7 nan 7 +inf 7 -inf 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 -inf N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 -1 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 -0 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 +0 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 1 N N
+0 0 7 -inf 7 nan 7 -inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -inf 7 nan 7 nan N N
+0 0 7 +inf 7 -inf 7 -1 7 -inf 7 -inf N N
+0 0 7 0 7 -inf 7 -1 7 -inf 7 -1 N N
+0 0 7 -1 7 -inf 7 -1 7 -inf 7 -0 N N
+0 0 7 -1 7 -inf 7 -1 7 -inf 7 +0 N N
+0 0 7 -2 7 -inf 7 -1 7 -inf 7 1 N N
+0 0 7 -inf 7 -inf 7 -1 7 -inf 7 +inf N N
+0 0 7 nan 7 -inf 7 -1 7 -inf 7 nan N N
+0 0 7 +inf 7 -1 7 -1 7 -1 7 -inf N N
+0 0 7 -inf 7 -1 7 -1 7 -1 7 +inf N N
+0 0 7 nan 7 -1 7 -1 7 -1 7 nan N N
+0 0 7 +inf 7 -0 7 -1 7 -0 7 -inf N N
+0 0 7 -inf 7 -0 7 -1 7 -0 7 +inf N N
+0 0 7 nan 7 -0 7 -1 7 -0 7 nan N N
+0 0 7 +inf 7 +0 7 -1 7 +0 7 -inf N N
+0 0 7 -inf 7 +0 7 -1 7 +0 7 +inf N N
+0 0 7 nan 7 +0 7 -1 7 +0 7 nan N N
+0 0 7 +inf 7 1 7 -1 7 1 7 -inf N N
+0 0 7 -inf 7 1 7 -1 7 1 7 +inf N N
+0 0 7 nan 7 1 7 -1 7 1 7 nan N N
+0 0 7 +inf 7 +inf 7 -1 7 +inf 7 -inf N N
+0 0 7 0 7 +inf 7 -1 7 +inf 7 -1 N N
+0 0 7 -1 7 +inf 7 -1 7 +inf 7 -0 N N
+0 0 7 -1 7 +inf 7 -1 7 +inf 7 +0 N N
+0 0 7 -2 7 +inf 7 -1 7 +inf 7 1 N N
+0 0 7 -inf 7 +inf 7 -1 7 +inf 7 +inf N N
+0 0 7 nan 7 +inf 7 -1 7 +inf 7 nan N N
+0 0 7 +inf 7 nan 7 -1 7 nan 7 -inf N N
+0 0 7 0 7 nan 7 -1 7 nan 7 -1 N N
+0 0 7 -1 7 nan 7 -1 7 nan 7 -0 N N
+0 0 7 -1 7 nan 7 -1 7 nan 7 +0 N N
+0 0 7 -2 7 nan 7 -1 7 nan 7 1 N N
+0 0 7 -inf 7 nan 7 -1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -1 7 nan 7 nan N N
+0 0 7 +inf 7 -inf 7 -0 7 -inf 7 -inf N N
+0 0 7 1 7 -inf 7 -0 7 -inf 7 -1 N N
+0 0 7 0 7 -inf 7 -0 7 -inf 7 -0 N N
+0 0 7 -0 7 -inf 7 -0 7 -inf 7 +0 N N
+0 0 7 -1 7 -inf 7 -0 7 -inf 7 1 N N
+0 0 7 -inf 7 -inf 7 -0 7 -inf 7 +inf N N
+0 0 7 nan 7 -inf 7 -0 7 -inf 7 nan N N
+0 0 7 +inf 7 -1 7 -0 7 -1 7 -inf N N
+0 0 7 -inf 7 -1 7 -0 7 -1 7 +inf N N
+0 0 7 nan 7 -1 7 -0 7 -1 7 nan N N
+0 0 7 +inf 7 -0 7 -0 7 -0 7 -inf N N
+0 0 7 -inf 7 -0 7 -0 7 -0 7 +inf N N
+0 0 7 nan 7 -0 7 -0 7 -0 7 nan N N
+0 0 7 +inf 7 +0 7 -0 7 +0 7 -inf N N
+0 0 7 -inf 7 +0 7 -0 7 +0 7 +inf N N
+0 0 7 nan 7 +0 7 -0 7 +0 7 nan N N
+0 0 7 +inf 7 1 7 -0 7 1 7 -inf N N
+0 0 7 -inf 7 1 7 -0 7 1 7 +inf N N
+0 0 7 nan 7 1 7 -0 7 1 7 nan N N
+0 0 7 +inf 7 +inf 7 -0 7 +inf 7 -inf N N
+0 0 7 1 7 +inf 7 -0 7 +inf 7 -1 N N
+0 0 7 0 7 +inf 7 -0 7 +inf 7 -0 N N
+0 0 7 -0 7 +inf 7 -0 7 +inf 7 +0 N N
+0 0 7 -1 7 +inf 7 -0 7 +inf 7 1 N N
+0 0 7 -inf 7 +inf 7 -0 7 +inf 7 +inf N N
+0 0 7 nan 7 +inf 7 -0 7 +inf 7 nan N N
+0 0 7 +inf 7 nan 7 -0 7 nan 7 -inf N N
+0 0 7 1 7 nan 7 -0 7 nan 7 -1 N N
+0 0 7 0 7 nan 7 -0 7 nan 7 -0 N N
+0 0 7 -0 7 nan 7 -0 7 nan 7 +0 N N
+0 0 7 -1 7 nan 7 -0 7 nan 7 1 N N
+0 0 7 -inf 7 nan 7 -0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 -0 7 nan 7 nan N N
+0 0 7 +inf 7 -inf 7 +0 7 -inf 7 -inf N N
+0 0 7 1 7 -inf 7 +0 7 -inf 7 -1 N N
+0 0 7 +0 7 -inf 7 +0 7 -inf 7 -0 N N
+0 0 7 0 7 -inf 7 +0 7 -inf 7 +0 N N
+0 0 7 -1 7 -inf 7 +0 7 -inf 7 1 N N
+0 0 7 -inf 7 -inf 7 +0 7 -inf 7 +inf N N
+0 0 7 nan 7 -inf 7 +0 7 -inf 7 nan N N
+0 0 7 +inf 7 -1 7 +0 7 -1 7 -inf N N
+0 0 7 -inf 7 -1 7 +0 7 -1 7 +inf N N
+0 0 7 nan 7 -1 7 +0 7 -1 7 nan N N
+0 0 7 +inf 7 -0 7 +0 7 -0 7 -inf N N
+0 0 7 -inf 7 -0 7 +0 7 -0 7 +inf N N
+0 0 7 nan 7 -0 7 +0 7 -0 7 nan N N
+0 0 7 +inf 7 +0 7 +0 7 +0 7 -inf N N
+0 0 7 -inf 7 +0 7 +0 7 +0 7 +inf N N
+0 0 7 nan 7 +0 7 +0 7 +0 7 nan N N
+0 0 7 +inf 7 1 7 +0 7 1 7 -inf N N
+0 0 7 -inf 7 1 7 +0 7 1 7 +inf N N
+0 0 7 nan 7 1 7 +0 7 1 7 nan N N
+0 0 7 +inf 7 +inf 7 +0 7 +inf 7 -inf N N
+0 0 7 1 7 +inf 7 +0 7 +inf 7 -1 N N
+0 0 7 +0 7 +inf 7 +0 7 +inf 7 -0 N N
+0 0 7 0 7 +inf 7 +0 7 +inf 7 +0 N N
+0 0 7 -1 7 +inf 7 +0 7 +inf 7 1 N N
+0 0 7 -inf 7 +inf 7 +0 7 +inf 7 +inf N N
+0 0 7 nan 7 +inf 7 +0 7 +inf 7 nan N N
+0 0 7 +inf 7 nan 7 +0 7 nan 7 -inf N N
+0 0 7 1 7 nan 7 +0 7 nan 7 -1 N N
+0 0 7 +0 7 nan 7 +0 7 nan 7 -0 N N
+0 0 7 0 7 nan 7 +0 7 nan 7 +0 N N
+0 0 7 -1 7 nan 7 +0 7 nan 7 1 N N
+0 0 7 -inf 7 nan 7 +0 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +0 7 nan 7 nan N N
+0 0 7 +inf 7 -inf 7 1 7 -inf 7 -inf N N
+0 0 7 2 7 -inf 7 1 7 -inf 7 -1 N N
+0 0 7 1 7 -inf 7 1 7 -inf 7 -0 N N
+0 0 7 1 7 -inf 7 1 7 -inf 7 +0 N N
+0 0 7 0 7 -inf 7 1 7 -inf 7 1 N N
+0 0 7 -inf 7 -inf 7 1 7 -inf 7 +inf N N
+0 0 7 nan 7 -inf 7 1 7 -inf 7 nan N N
+0 0 7 +inf 7 -1 7 1 7 -1 7 -inf N N
+0 0 7 -inf 7 -1 7 1 7 -1 7 +inf N N
+0 0 7 nan 7 -1 7 1 7 -1 7 nan N N
+0 0 7 +inf 7 -0 7 1 7 -0 7 -inf N N
+0 0 7 -inf 7 -0 7 1 7 -0 7 +inf N N
+0 0 7 nan 7 -0 7 1 7 -0 7 nan N N
+0 0 7 +inf 7 +0 7 1 7 +0 7 -inf N N
+0 0 7 -inf 7 +0 7 1 7 +0 7 +inf N N
+0 0 7 nan 7 +0 7 1 7 +0 7 nan N N
+0 0 7 +inf 7 1 7 1 7 1 7 -inf N N
+0 0 7 -inf 7 1 7 1 7 1 7 +inf N N
+0 0 7 nan 7 1 7 1 7 1 7 nan N N
+0 0 7 +inf 7 +inf 7 1 7 +inf 7 -inf N N
+0 0 7 2 7 +inf 7 1 7 +inf 7 -1 N N
+0 0 7 1 7 +inf 7 1 7 +inf 7 -0 N N
+0 0 7 1 7 +inf 7 1 7 +inf 7 +0 N N
+0 0 7 0 7 +inf 7 1 7 +inf 7 1 N N
+0 0 7 -inf 7 +inf 7 1 7 +inf 7 +inf N N
+0 0 7 nan 7 +inf 7 1 7 +inf 7 nan N N
+0 0 7 +inf 7 nan 7 1 7 nan 7 -inf N N
+0 0 7 2 7 nan 7 1 7 nan 7 -1 N N
+0 0 7 1 7 nan 7 1 7 nan 7 -0 N N
+0 0 7 1 7 nan 7 1 7 nan 7 +0 N N
+0 0 7 0 7 nan 7 1 7 nan 7 1 N N
+0 0 7 -inf 7 nan 7 1 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 1 7 nan 7 nan N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 -inf N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 -1 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 -0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 +0 N N
+0 0 7 +inf 7 -inf 7 +inf 7 -inf 7 1 N N
+0 0 7 nan 7 -inf 7 +inf 7 -inf 7 +inf N N
+0 0 7 nan 7 -inf 7 +inf 7 -inf 7 nan N N
+0 0 7 +inf 7 -1 7 +inf 7 -1 7 -inf N N
+0 0 7 +inf 7 -1 7 +inf 7 -1 7 -1 N N
+0 0 7 +inf 7 -1 7 +inf 7 -1 7 -0 N N
+0 0 7 +inf 7 -1 7 +inf 7 -1 7 +0 N N
+0 0 7 +inf 7 -1 7 +inf 7 -1 7 1 N N
+0 0 7 nan 7 -1 7 +inf 7 -1 7 +inf N N
+0 0 7 nan 7 -1 7 +inf 7 -1 7 nan N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 7 -inf N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 7 -1 N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 7 -0 N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 7 +0 N N
+0 0 7 +inf 7 -0 7 +inf 7 -0 7 1 N N
+0 0 7 nan 7 -0 7 +inf 7 -0 7 +inf N N
+0 0 7 nan 7 -0 7 +inf 7 -0 7 nan N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 7 -inf N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 7 -1 N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 7 -0 N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 7 +0 N N
+0 0 7 +inf 7 +0 7 +inf 7 +0 7 1 N N
+0 0 7 nan 7 +0 7 +inf 7 +0 7 +inf N N
+0 0 7 nan 7 +0 7 +inf 7 +0 7 nan N N
+0 0 7 +inf 7 1 7 +inf 7 1 7 -inf N N
+0 0 7 +inf 7 1 7 +inf 7 1 7 -1 N N
+0 0 7 +inf 7 1 7 +inf 7 1 7 -0 N N
+0 0 7 +inf 7 1 7 +inf 7 1 7 +0 N N
+0 0 7 +inf 7 1 7 +inf 7 1 7 1 N N
+0 0 7 nan 7 1 7 +inf 7 1 7 +inf N N
+0 0 7 nan 7 1 7 +inf 7 1 7 nan N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 -inf N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 -1 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 -0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 +0 N N
+0 0 7 +inf 7 +inf 7 +inf 7 +inf 7 1 N N
+0 0 7 nan 7 +inf 7 +inf 7 +inf 7 +inf N N
+0 0 7 nan 7 +inf 7 +inf 7 +inf 7 nan N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 -inf N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 -1 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 -0 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 +0 N N
+0 0 7 +inf 7 nan 7 +inf 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 +inf 7 nan 7 nan N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 -inf N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 -1 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 -0 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 +0 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 1 N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 +inf N N
+0 0 7 nan 7 -inf 7 nan 7 -inf 7 nan N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 -inf N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 -1 N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 -0 N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 +0 N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 1 N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 +inf N N
+0 0 7 nan 7 -1 7 nan 7 -1 7 nan N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 -inf N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 -1 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 -0 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 +0 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 1 N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 +inf N N
+0 0 7 nan 7 -0 7 nan 7 -0 7 nan N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 -inf N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 -1 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 -0 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 +0 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 1 N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 +inf N N
+0 0 7 nan 7 +0 7 nan 7 +0 7 nan N N
+0 0 7 nan 7 1 7 nan 7 1 7 -inf N N
+0 0 7 nan 7 1 7 nan 7 1 7 -1 N N
+0 0 7 nan 7 1 7 nan 7 1 7 -0 N N
+0 0 7 nan 7 1 7 nan 7 1 7 +0 N N
+0 0 7 nan 7 1 7 nan 7 1 7 1 N N
+0 0 7 nan 7 1 7 nan 7 1 7 +inf N N
+0 0 7 nan 7 1 7 nan 7 1 7 nan N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 -inf N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 -1 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 -0 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 +0 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 1 N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 +inf N N
+0 0 7 nan 7 +inf 7 nan 7 +inf 7 nan N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 -0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +0 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 1 N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 +inf N N
+0 0 7 nan 7 nan 7 nan 7 nan 7 nan N N
+
+# values with only 1, -1, +0, -0
+0 0 7 0 7 -1 7 -1 7 -1 7 -1 N N
+0 0 7 -1 7 -1 7 -1 7 -1 7 -0 N N
+0 0 7 -1 7 -1 7 -1 7 -1 7 +0 N N
+0 0 7 -2 7 -1 7 -1 7 -1 7 1 N N
+0 0 7 0 7 -0 7 -1 7 -0 7 -1 N N
+0 0 7 -1 7 -0 7 -1 7 -0 7 -0 N N
+0 0 7 -1 7 -0 7 -1 7 -0 7 +0 N N
+0 0 7 -2 7 -0 7 -1 7 -0 7 1 N N
+0 0 7 0 7 +0 7 -1 7 +0 7 -1 N N
+0 0 7 -1 7 +0 7 -1 7 +0 7 -0 N N
+0 0 7 -1 7 +0 7 -1 7 +0 7 +0 N N
+0 0 7 -2 7 +0 7 -1 7 +0 7 1 N N
+0 0 7 0 7 1 7 -1 7 1 7 -1 N N
+0 0 7 -1 7 1 7 -1 7 1 7 -0 N N
+0 0 7 -1 7 1 7 -1 7 1 7 +0 N N
+0 0 7 -2 7 1 7 -1 7 1 7 1 N N
+0 0 7 1 7 -1 7 -0 7 -1 7 -1 N N
+0 0 7 0 7 -1 7 -0 7 -1 7 -0 N N
+0 0 7 -0 7 -1 7 -0 7 -1 7 +0 N N
+0 0 7 -1 7 -1 7 -0 7 -1 7 1 N N
+0 0 7 1 7 -0 7 -0 7 -0 7 -1 N N
+0 0 7 0 7 -0 7 -0 7 -0 7 -0 N N
+0 0 7 -0 7 -0 7 -0 7 -0 7 +0 N N
+0 0 7 -1 7 -0 7 -0 7 -0 7 1 N N
+0 0 7 1 7 +0 7 -0 7 +0 7 -1 N N
+0 0 7 0 7 +0 7 -0 7 +0 7 -0 N N
+0 0 7 -0 7 +0 7 -0 7 +0 7 +0 N N
+0 0 7 -1 7 +0 7 -0 7 +0 7 1 N N
+0 0 7 1 7 1 7 -0 7 1 7 -1 N N
+0 0 7 0 7 1 7 -0 7 1 7 -0 N N
+0 0 7 -0 7 1 7 -0 7 1 7 +0 N N
+0 0 7 -1 7 1 7 -0 7 1 7 1 N N
+0 0 7 1 7 -1 7 +0 7 -1 7 -1 N N
+0 0 7 +0 7 -1 7 +0 7 -1 7 -0 N N
+0 0 7 0 7 -1 7 +0 7 -1 7 +0 N N
+0 0 7 -1 7 -1 7 +0 7 -1 7 1 N N
+0 0 7 1 7 -0 7 +0 7 -0 7 -1 N N
+0 0 7 +0 7 -0 7 +0 7 -0 7 -0 N N
+0 0 7 0 7 -0 7 +0 7 -0 7 +0 N N
+0 0 7 -1 7 -0 7 +0 7 -0 7 1 N N
+0 0 7 1 7 +0 7 +0 7 +0 7 -1 N N
+0 0 7 +0 7 +0 7 +0 7 +0 7 -0 N N
+0 0 7 0 7 +0 7 +0 7 +0 7 +0 N N
+0 0 7 -1 7 +0 7 +0 7 +0 7 1 N N
+0 0 7 1 7 1 7 +0 7 1 7 -1 N N
+0 0 7 +0 7 1 7 +0 7 1 7 -0 N N
+0 0 7 0 7 1 7 +0 7 1 7 +0 N N
+0 0 7 -1 7 1 7 +0 7 1 7 1 N N
+0 0 7 2 7 -1 7 1 7 -1 7 -1 N N
+0 0 7 1 7 -1 7 1 7 -1 7 -0 N N
+0 0 7 1 7 -1 7 1 7 -1 7 +0 N N
+0 0 7 0 7 -1 7 1 7 -1 7 1 N N
+0 0 7 2 7 -0 7 1 7 -0 7 -1 N N
+0 0 7 1 7 -0 7 1 7 -0 7 -0 N N
+0 0 7 1 7 -0 7 1 7 -0 7 +0 N N
+0 0 7 0 7 -0 7 1 7 -0 7 1 N N
+0 0 7 2 7 +0 7 1 7 +0 7 -1 N N
+0 0 7 1 7 +0 7 1 7 +0 7 -0 N N
+0 0 7 1 7 +0 7 1 7 +0 7 +0 N N
+0 0 7 0 7 +0 7 1 7 +0 7 1 N N
+0 0 7 2 7 1 7 1 7 1 7 -1 N N
+0 0 7 1 7 1 7 1 7 1 7 -0 N N
+0 0 7 1 7 1 7 1 7 1 7 +0 N N
+0 0 7 0 7 1 7 1 7 1 7 1 N N
+
+# also check the imaginary part is correctly rounded
+0 - 2 nan 2 16 2 nan 5 17 2 nan N N
+0 + 2 nan 2 24 2 nan 5 17 2 nan N U
+0 - 2 nan 2 16 2 nan 5 17 2 nan N D
+0 - 2 nan 2 16 2 nan 5 17 2 nan N Z
+0 + 2 nan 2 -16 2 nan 5 -17 2 nan N N
+0 + 2 nan 2 -16 2 nan 5 -17 2 nan N U
+0 - 2 nan 2 -24 2 nan 5 -17 2 nan N D
+0 + 2 nan 2 -16 2 nan 5 -17 2 nan N Z
+
diff --git a/mpc/tests/tabs.c b/mpc/tests/tabs.c
new file mode 100644
index 0000000000..4651089478
--- /dev/null
+++ b/mpc/tests/tabs.c
@@ -0,0 +1,36 @@
+/* tabs -- test file for mpc_abs.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (FC, f, mpc_abs);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 1, 0);
+ data_check (f, "abs.dat");
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tacos.c b/mpc/tests/tacos.c
new file mode 100644
index 0000000000..38653a46f8
--- /dev/null
+++ b/mpc/tests/tacos.c
@@ -0,0 +1,36 @@
+/* tacos -- test file for mpc_acos.
+
+Copyright (C) 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_acos);
+
+ test_start ();
+
+ data_check (f, "acos.dat");
+ tgeneric (f, 2, 512, 7, 7);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tacosh.c b/mpc/tests/tacosh.c
new file mode 100644
index 0000000000..f8fbdc685d
--- /dev/null
+++ b/mpc/tests/tacosh.c
@@ -0,0 +1,57 @@
+/* tacosh.c -- test file for mpc_acosh.
+
+Copyright (C) 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+bug20091120 (void)
+{
+ mpc_t x, y;
+
+ mpc_init2 (x, 53);
+ mpc_init3 (y, 17, 42);
+ mpc_set_ui_ui (x, 1, 1, MPC_RNDNN);
+ mpc_acosh (y, x, MPC_RNDNN);
+ if (mpfr_get_prec (mpc_realref(y)) != 17 ||
+ mpfr_get_prec (mpc_imagref(y)) != 42)
+ {
+ printf ("Error, mpc_acosh changed the precisions!!!\n");
+ exit (1);
+ }
+ mpc_clear (x);
+ mpc_clear (y);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_acosh);
+
+ test_start ();
+
+ bug20091120 ();
+
+ data_check (f, "acosh.dat");
+ tgeneric (f, 2, 512, 7, 7);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tadd.c b/mpc/tests/tadd.c
new file mode 100644
index 0000000000..11a305bdb5
--- /dev/null
+++ b/mpc/tests/tadd.c
@@ -0,0 +1,70 @@
+/* tadd -- test file for mpc_add.
+
+Copyright (C) 2008, 2010, 2011, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+static void
+check_ternary_value (void)
+{
+ mpc_t x, y, z;
+ mpfr_prec_t prec;
+
+ mpc_init2 (x, 2);
+ mpc_init2 (y, 2);
+ mpc_init2 (z, 2);
+
+ for (prec = 2; prec <= 1000; prec++)
+ {
+ mpc_set_prec (x, prec);
+ mpc_set_prec (y, prec);
+
+ mpc_set_ui (x, 1, MPC_RNDNN);
+ mpc_mul_2ui (x, x, (unsigned long int) prec, MPC_RNDNN);
+ mpc_set_ui (y, 1, MPC_RNDNN);
+
+ if (mpc_add (z, x, y, MPC_RNDNN) == 0)
+ {
+ fprintf (stderr, "Error in mpc_add: 2^(-prec)+1 cannot be exact\n");
+ exit (1);
+ }
+ }
+
+ mpc_clear (x);
+ mpc_clear (y);
+ mpc_clear (z);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (C_CC, f, mpc_add);
+ f.properties = FUNC_PROP_SYMETRIC;
+
+ test_start ();
+
+ check_ternary_value();
+ data_check (f, "add.dat");
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tadd_fr.c b/mpc/tests/tadd_fr.c
new file mode 100644
index 0000000000..1f3b76a9a6
--- /dev/null
+++ b/mpc/tests/tadd_fr.c
@@ -0,0 +1,72 @@
+/* tadd_fr -- test file for mpc_add_fr.
+
+Copyright (C) 2008, 2010, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+static void
+check_ternary_value (mpfr_prec_t prec_max, mpfr_prec_t step)
+{
+ mpfr_prec_t prec;
+ mpc_t z;
+ mpfr_t f;
+
+ mpc_init2 (z, 2);
+ mpfr_init (f);
+
+ for (prec = 2; prec < prec_max; prec += step)
+ {
+ mpc_set_prec (z, prec);
+ mpfr_set_prec (f, prec);
+
+ mpc_set_ui (z, 1, MPC_RNDNN);
+ mpfr_set_ui (f, 1, GMP_RNDN);
+ if (mpc_add_fr (z, z, f, MPC_RNDNZ))
+ {
+ printf ("Error in mpc_add_fr: 1+1 should be exact\n");
+ exit (1);
+ }
+
+ mpc_set_ui (z, 1, MPC_RNDNN);
+ mpc_mul_2ui (z, z, (unsigned long int) prec, MPC_RNDNN);
+ if (mpc_add_fr (z, z, f, MPC_RNDNN) == 0)
+ {
+ fprintf (stderr, "Error in mpc_add_fr: 2^prec+1 cannot be exact\n");
+ exit (1);
+ }
+ }
+ mpc_clear (z);
+ mpfr_clear (f);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CCF, f, mpc_add_fr);
+ test_start ();
+
+ check_ternary_value (1024, 1);
+
+ data_check (f, "add_fr.dat");
+ tgeneric (f, 2, 1024, 7, 10);
+
+ test_end ();
+ return 0;
+}
diff --git a/mpc/tests/tadd_si.c b/mpc/tests/tadd_si.c
new file mode 100644
index 0000000000..da12a7a9ec
--- /dev/null
+++ b/mpc/tests/tadd_si.c
@@ -0,0 +1,68 @@
+/* tadd_si -- test file for mpc_add_si.
+
+Copyright (C) 2011, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+static void
+check_ternary_value (void)
+{
+ mpfr_prec_t prec;
+ mpc_t z;
+ const long int s = -1;
+
+ mpc_init2 (z, 2);
+
+ for (prec=2; prec <= 1024; prec++) {
+ mpc_set_prec (z, prec);
+ mpc_set_ui (z, 3ul, MPC_RNDNN);
+ if (mpc_add_si (z, z, s, MPC_RNDDU)) {
+ printf ("Error in mpc_add_si: 3+(-1) should be exact\n");
+ exit (1);
+ }
+ else if (mpc_cmp_si (z, 2l) != 0) {
+ printf ("Error in mpc_add_si: 3+(-1) should be 2\n");
+ exit (1);
+ }
+
+ mpc_mul_2ui (z, z, (unsigned long int) prec, MPC_RNDNN);
+ if (mpc_add_si (z, z, s, MPC_RNDNN) == 0) {
+ printf ("Error in mpc_add_si: 2^(prec+1)-1 cannot be exact\n");
+ exit (1);
+ }
+ }
+
+ mpc_clear (z);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CCU, f, mpc_add_ui);
+
+ test_start ();
+
+ check_ternary_value ();
+ tgeneric (f, 2, 1024, 11, -2);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tadd_ui.c b/mpc/tests/tadd_ui.c
new file mode 100644
index 0000000000..4f8efea415
--- /dev/null
+++ b/mpc/tests/tadd_ui.c
@@ -0,0 +1,68 @@
+/* tadd_ui -- test file for mpc_add_ui.
+
+Copyright (C) 2008, 2010, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+static void
+check_ternary_value (void)
+{
+ mpfr_prec_t prec;
+ mpc_t z;
+
+ mpc_init2 (z, 2);
+
+ for (prec=2; prec <= 1024; prec++)
+ {
+ mpc_set_prec (z, prec);
+
+ mpc_set_ui (z, 1, MPC_RNDNN);
+ if (mpc_add_ui (z, z, 1, MPC_RNDNZ))
+ {
+ printf ("Error in mpc_add_ui: 1+1 should be exact\n");
+ exit (1);
+ }
+
+ mpc_set_ui (z, 1, MPC_RNDNN);
+ mpc_mul_2ui (z, z, (unsigned long int) prec, MPC_RNDNN);
+ if (mpc_add_ui (z, z, 1, MPC_RNDNN) == 0)
+ {
+ printf ("Error in mpc_add_ui: 2^prec+1 cannot be exact\n");
+ exit (1);
+ }
+ }
+
+ mpc_clear (z);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CCU, f, mpc_add_ui);
+
+ test_start ();
+
+ check_ternary_value ();
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tan.dat b/mpc/tests/tan.dat
new file mode 100644
index 0000000000..ce4c0973b7
--- /dev/null
+++ b/mpc/tests/tan.dat
@@ -0,0 +1,135 @@
+# Data test file for mpc_tan.
+#
+# Copyright (C) 2008, 2010, 2011 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+
+# See file sin.dat for the format description.
+
+# Special values, following ISO C99 standard, Annex G,
+# more precisely Section G.6.2.6 "The ctanh functions"
+# since G.6 defines ctan(z) as -i * ctanh(i*z)
+
+# Rule [conj]: tan(conj(z)) = conj(tan(z))
+# Rule [odd]: tan(-z) = -tan(z)
+
+# Note: for each rule, we cite the rule for tanh from C99,
+# and below the translated rule for tan, using tanh(z) = i tan(-iz),
+# thus tanh(a+i*b) = c+i*d translates to tan(b-i*a) = d-i*c
+
+# tanh(+0 + i*0) = +0 + i*0
+# tan (+0 - i*0) = +0 - i*0
+0 0 2 +0 2 -0 2 +0 2 -0 N N
+# [conj]: tan(+0 + i*0) = +0 + i*0
+0 0 2 +0 2 +0 2 +0 2 +0 N N
+# [odd]: tan(-0 + i*0) = -0 + i*0
+0 0 2 -0 2 +0 2 -0 2 +0 N N
+# [odd+conj]: tan(-0 - i*0) = -0 - i*0
+0 0 2 -0 2 -0 2 -0 2 -0 N N
+
+# tanh(x + i*inf) = nan + i*nan for finite x
+# tan (inf - i*x) = nan + i*nan for finite x
+0 0 2 nan 2 nan 2 +inf 2 +1 N N
+0 0 2 nan 2 nan 2 +inf 2 +0 N N
+0 0 2 nan 2 nan 2 +inf 2 -0 N N
+0 0 2 nan 2 nan 2 +inf 2 -1 N N
+# [conj] does not make sense since we already considered x < 0
+# [odd]: tan(-inf + i*x) = nan + i*nan for finite x
+0 0 2 nan 2 nan 2 -inf 2 +1 N N
+0 0 2 nan 2 nan 2 -inf 2 +0 N N
+0 0 2 nan 2 nan 2 -inf 2 -0 N N
+0 0 2 nan 2 nan 2 -inf 2 -1 N N
+
+# tanh(x + i*nan) = nan + i*nan for finite x
+# tan (nan + i*x) = nan + i*nan for finite x
+0 0 2 nan 2 nan 2 nan 2 1 N N
+0 0 2 nan 2 nan 2 nan 2 +0 N N
+0 0 2 nan 2 nan 2 nan 2 -0 N N
+0 0 2 nan 2 nan 2 nan 2 -1 N N
+# [conj] makes no sense since we already considered x < 0
+# idem for [odd] since nan has no sign
+
+# tanh(+inf + i*y) = 1 + i*0*sin(2y) for positive-signed finite y
+# tan (y - i*inf) = 0*sin(2*y) - i*1 for positive-signed finite y
+0 0 2 +0 2 -1 2 1 2 -inf N N
+0 0 2 -0 2 -1 2 2 2 -inf N N
+# [conj]: tan (y + i*inf) = 0*sin(2*y) + i*1
+0 0 2 +0 2 +1 2 1 2 +inf N N
+0 0 2 -0 2 +1 2 2 2 +inf N N
+# [odd]: tan (-y + i*inf) = -0*sin(2*y) + i*1
+0 0 2 -0 2 +1 2 -1 2 +inf N N
+0 0 2 +0 2 +1 2 -2 2 +inf N N
+# [odd+conj]: tan (-y - i*inf) = -0*sin(2*y) - i*1
+0 0 2 -0 2 -1 2 -1 2 -inf N N
+0 0 2 +0 2 -1 2 -2 2 -inf N N
+
+# tanh(+inf + i*inf) = 1 +/- i*0 (unspecified sign of zero for C99)
+# tan (+inf - i*inf) = +/-0 - i*1
+0 0 2 0 2 -1 2 +inf 2 -inf N N
+# [conj]: tan (+inf + i*inf) = +/-0 + i*1
+0 0 2 0 2 +1 2 +inf 2 +inf N N
+# [odd]: tan (-inf + i*inf) = +/-0 + i*1
+0 0 2 0 2 +1 2 -inf 2 +inf N N
+# [odd+conj]: tan (-inf - i*inf) = +/-0 - i*1
+0 0 2 0 2 -1 2 -inf 2 -inf N N
+
+# tanh(+inf + i*nan) = 1 +/- i*0 (unspecified sign of zero for C99)
+# tan (nan - i*inf) = +/-0 - i*1
+0 0 2 0 2 -1 2 nan 2 -inf N N
+# [conj]: tan (nan + i*inf) = +/-0 + i*1
+0 0 2 0 2 +1 2 nan 2 +inf N N
+# [odd] = [conj] since nan has no sign, and -(+/-0) = +/-0
+
+# tanh(nan + i*0) = nan + i*0
+# tan(+0 + i*nan) = +0 + i*nan
+0 0 2 +0 2 nan 2 +0 2 nan N N
+# [conj] gives the same identity since nan has no sign
+# [odd]: tan(-0 + i*nan) = -0 + i*nan
+0 0 2 -0 2 nan 2 -0 2 nan N N
+
+# tanh(nan + i*y) = nan + i*nan for all nonzero y
+# tan (y + i*nan) = nan + i*nan
+0 0 2 nan 2 nan 2 +inf 2 nan N N
+0 0 2 nan 2 nan 2 +1 2 nan N N
+0 0 2 nan 2 nan 2 -1 2 nan N N
+0 0 2 nan 2 nan 2 -inf 2 nan N N
+# [conj] gives no new relation since nan has no sign
+# [odd] gives no new relation since we already considered y < 0
+
+# tanh(nan + i*nan) = nan + i*nan
+0 0 2 nan 2 nan 2 nan 2 nan N N
+
+# corner case: op = atan (2^(-k) + i*2^k) for k=200 and k=1000
++ + 100 0x1@-50 100 0x1@50 1000 0x1.921fb54442d18469898cc51701b839a252049c1114cf98e804177d4c76273644a29410f31c6809bbdf2a33679a748636605614dbe4be286e9fc26adadaa3848bc90b6aecc4bcfd8de89884d34c6fdad617feb96de80d6fdbdc70d7f6b5133f4b5d3e4822f8963fcc9250cca3d9c8b67b8400f97142c77e0b31b4906c38 1000 0x1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555548888888888888888888888888888888888888888888888888a@-50 N N
++ + 100 0x1@-250 100 0x1@250 4000 0x1.921fb54442d18469898cc51701b839a252049c1114cf98e804177d4c76273644a29410f31c6809bbdf2a33679a748636605614dbe4be286e9fc26adadaa3848bc90b6aecc4bcfd8de89885d34c6fdad617feb96de80d6fdbdc70d7f6b5133f4b5d3e4822f8963fcc9250cca3d9c8b67b8400f97142c77e0b31b4906c38aba734d22c7f51fa499ebf06caba47b9475b2c38c5e6ac410aa5773daa520ee12d2cdace186a9c95793009e2e8d811943042f86520bc8c5c6d9c77c73cee58301d0c07364f0745d80f451f6b8abbe0de98a593bc5797ed2ab02e30732a92f9d52ad5ca2ba44c3131f40a202ae51cb51555885b5a662e1a08a0f46750aa4357be3974c9d9f70a08b1b7de1515d4e2aeba0c18fb672e1f0b4dc3c98f57eb5d19b61267ae3d1929c0944ac33b9dc7a44c35a5dcd7e25ff40db31410c9b0ec04e67d90d4c8a43e56302ef6401977c22eaef4c2bad8ee13118175b28dc411c49f40e9cb566287b6b7f9c1fa211c9705a2415242100234e478254f0fccaf10e334217b74b64d33864e30d5e9c4783528d0696c2a17b44b07d39455a899d1b77785b609bd1df25d1df8283f7d954c50f8b28e9cd780bb33652c9f412187444677430ca2b7cfda3ec252e19dc5af5f7037baec42e09039a00d224fab60b5532769d5311b1fbb830dff6fb9214d811e9be86b92680509246d87f56a 4000 0x1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555556@-250 N N
+
+# yet another absurd case: op = atan (2^200) + 2^(-200000)*I;
+# expensive to compute
+#- - 50 0x1@50 50 0x1@-49900 1000 0x1.921fb54442d18469898cc51701b839a252049c1114cf98e803177d4c76273644a29410f31c6809bbdf2a33679a748636605614dbe4be286e9fc26adadaa3848bc90b6aecc4bcfd8de8988628a1c5302b6d540ec33d62c53131c62d4c0a6894a0b2939d784deb9521e7a621f92f1e0bd0d9564ec6981cd3608709e5c18e 1000 0x1@-50000 N N
+
+# corner case
+- + 9 -0x9bp-51 9 -1 9 -0x16dp-8 9 -0x77p-3 N N
+
+# huge values
++ - 53 -0 53 -1 53 0x4580CBF242683p-3 53 -0x1B3E8A3660D279p-3 N N
+- - 53 +0 53 -1 53 -0x4580CBF242683p-3 53 -0x1B3E8A3660D279p-3 N N
++ + 53 -0 53 +1 53 -0x1B3E8A3660D279p-3 53 0x4580CBF242683p-3 N N
+
+# some values taken from ttan.c
++ + 53 0x1D02967C31CDB5 53 0x1D02967C31CDB5 53 0x3243F6A8885A30p-53 53 0x11A62633145C07p-106 N N
+- + 53 0x1D02967C31CDB4 53 0x1D02967C31CDB5 53 0x3243F6A8885A30p-53 53 0x11A62633145C07p-106 D U
+- - 53 0x1D02967C31CDB4 53 0x1D02967C31CDB4 53 0x3243F6A8885A30p-53 53 0x11A62633145C07p-106 Z D
+- + 53 -0xB0BD0AA4A3B3D 53 -0xB0BD0AA4A3B3D 53 0x1921FB54442D19p-52 53 -0x172CECE675D1FDp-105 N N
diff --git a/mpc/tests/tanh.dat b/mpc/tests/tanh.dat
new file mode 100644
index 0000000000..439fb260e5
--- /dev/null
+++ b/mpc/tests/tanh.dat
@@ -0,0 +1,81 @@
+# Data file for mpc_tanh.
+#
+# Copyright (C) 2008 INRIA
+#
+# This file is part of GNU MPC.
+#
+# GNU MPC 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 3 of the License, or (at your
+#o ption) any later version.
+#
+# GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+#
+# For explanations on the file format, see sin.dat.
+
+# special values (following ISO C99 standard)
+0 0 7 -1 7 0 7 -inf 7 -inf N N
+0 0 7 -1 7 -0 7 -inf 7 -1 N N
+0 0 7 -1 7 -0 7 -inf 7 -0 N N
+0 0 7 -1 7 +0 7 -inf 7 +0 N N
+0 0 7 -1 7 +0 7 -inf 7 1 N N
+0 0 7 -1 7 0 7 -inf 7 +inf N N
+0 0 7 -1 7 0 7 -inf 7 NaN N N
+0 0 7 NaN 7 NaN 7 -1 7 -inf N N
+0 0 7 NaN 7 NaN 7 -1 7 +inf N N
+0 0 7 NaN 7 NaN 7 -1 7 NaN N N
+0 0 7 NaN 7 NaN 7 -0 7 -inf N N
+0 0 7 -0 7 -0 7 -0 7 -0 N N
+0 0 7 -0 7 +0 7 -0 7 +0 N N
+0 0 7 NaN 7 NaN 7 -0 7 +inf N N
+0 0 7 NaN 7 NaN 7 -0 7 NaN N N
+0 0 7 NaN 7 NaN 7 +0 7 -inf N N
+0 0 7 +0 7 -0 7 +0 7 -0 N N
+0 0 7 +0 7 +0 7 +0 7 +0 N N
+0 0 7 NaN 7 NaN 7 +0 7 +inf N N
+0 0 7 NaN 7 NaN 7 +0 7 NaN N N
+0 0 7 NaN 7 NaN 7 1 7 -inf N N
+0 0 7 NaN 7 NaN 7 1 7 +inf N N
+0 0 7 NaN 7 NaN 7 1 7 NaN N N
+0 0 7 1 7 0 7 +inf 7 -inf N N
+0 0 7 1 7 -0 7 +inf 7 -1 N N
+0 0 7 1 7 -0 7 +inf 7 -0 N N
+0 0 7 1 7 +0 7 +inf 7 +0 N N
+0 0 7 1 7 +0 7 +inf 7 1 N N
+0 0 7 1 7 0 7 +inf 7 +inf N N
+0 0 7 1 7 0 7 +inf 7 NaN N N
+0 0 7 NaN 7 NaN 7 NaN 7 -inf N N
+0 0 7 NaN 7 NaN 7 NaN 7 -1 N N
+0 0 7 NaN 7 -0 7 NaN 7 -0 N N
+0 0 7 NaN 7 +0 7 NaN 7 +0 N N
+0 0 7 NaN 7 NaN 7 NaN 7 1 N N
+0 0 7 NaN 7 NaN 7 NaN 7 +inf N N
+0 0 7 NaN 7 NaN 7 NaN 7 NaN N N
+
+# purely real argument
+- 0 50 -0xc2f7d5a8a79ccp-52 50 -0 7 -1 7 -0 N N
+- 0 50 -0xc2f7d5a8a79ccp-52 50 +0 7 -1 7 +0 N N
++ 0 50 0xc2f7d5a8a79ccp-52 50 -0 7 1 7 -0 N N
++ 0 50 0xc2f7d5a8a79ccp-52 50 +0 7 1 7 +0 N N
+
+# purely imaginary argument
+0 - 50 -0 50 -0x18eb245cbee3a8p-52 7 -0 7 -1 N N
+0 + 50 -0 50 0x18eb245cbee3a8p-52 7 -0 7 1 N N
+0 - 50 +0 50 -0x18eb245cbee3a8p-52 7 +0 7 -1 N N
+0 + 50 +0 50 0x18eb245cbee3a8p-52 7 +0 7 1 N N
+
+# values with +1 and -1
+- - 50 -0x1157bffca4a8cp-48 50 -0x459193d28cfe2p-52 7 -1 7 -1 N N
+- + 50 -0x1157bffca4a8cp-48 50 0x459193d28cfe2p-52 7 -1 7 1 N N
++ - 50 0x1157bffca4a8cp-48 50 -0x459193d28cfe2p-52 7 1 7 -1 N N
++ + 50 0x1157bffca4a8cp-48 50 0x459193d28cfe2p-52 7 1 7 1 N N
+
+# IEEE-754 double precision
++ - 53 0x10000000000001p-53 53 0x1FFFFFFFFFFFFFp-53 53 0x1E938CBCEB16DFp-55 53 0x1B1F56FDEEF00Fp-53 N N
+
diff --git a/mpc/tests/targ.c b/mpc/tests/targ.c
new file mode 100644
index 0000000000..b84c292555
--- /dev/null
+++ b/mpc/tests/targ.c
@@ -0,0 +1,36 @@
+/* targ -- test file for mpc_arg.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (FC, f, mpc_arg);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 1, 4096);
+ data_check (f, "arg.dat");
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tasin.c b/mpc/tests/tasin.c
new file mode 100644
index 0000000000..3470408f40
--- /dev/null
+++ b/mpc/tests/tasin.c
@@ -0,0 +1,36 @@
+/* tasin -- test file for mpc_asin.
+
+Copyright (C) 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_asin);
+
+ test_start ();
+
+ data_check (f, "asin.dat");
+ tgeneric (f, 2, 512, 7, 7);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tasinh.c b/mpc/tests/tasinh.c
new file mode 100644
index 0000000000..c266829266
--- /dev/null
+++ b/mpc/tests/tasinh.c
@@ -0,0 +1,57 @@
+/* tasinh -- test file for mpc_asinh.
+
+Copyright (C) 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+bug20091120 (void)
+{
+ mpc_t x, y;
+
+ mpc_init2 (x, 53);
+ mpc_init3 (y, 17, 42);
+ mpc_set_ui_ui (x, 1, 1, MPC_RNDNN);
+ mpc_asinh (y, x, MPC_RNDNN);
+ if (mpfr_get_prec (mpc_realref(y)) != 17 ||
+ mpfr_get_prec (mpc_imagref(y)) != 42)
+ {
+ printf ("Error, mpc_asinh changed the precisions!!!\n");
+ exit (1);
+ }
+ mpc_clear (x);
+ mpc_clear (y);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_asinh);
+
+ test_start ();
+
+ bug20091120 ();
+
+ data_check (f, "asinh.dat");
+ tgeneric (f, 2, 512, 7, 7);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tatan.c b/mpc/tests/tatan.c
new file mode 100644
index 0000000000..8883588bd1
--- /dev/null
+++ b/mpc/tests/tatan.c
@@ -0,0 +1,68 @@
+/* tatan -- test file for mpc_atan.
+
+Copyright (C) 2009, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+#if 0
+/* tests intermediate underflow; WONTFIX */
+static int
+test_underflow (void)
+{
+ mpc_t z;
+ mpfr_exp_t emin = mpfr_get_emin ();
+
+ mpfr_set_emin (-10);
+ mpc_init2 (z, 21);
+ mpfr_set_si (mpc_realref(z), -1, GMP_RNDZ);
+ mpfr_set_ui_2exp (mpc_imagref(z), 1, 20, GMP_RNDZ);
+ mpfr_add_ui (mpc_imagref(z), mpc_imagref(z), 1, GMP_RNDZ);
+ mpfr_div_2exp (mpc_imagref(z), mpc_imagref(z), 20, GMP_RNDZ);
+ mpc_atan (z, z, MPC_RNDNN);
+ if (mpfr_cmp_si_2exp (mpc_realref(z), -1066635, 20) != 0 ||
+ mpfr_cmp_si_2exp (mpc_imagref(z), 1687619, 22))
+ {
+ printf ("Error in test_coverage\n");
+ printf ("expected (-1066635/2^20 1687619/2^22)\n");
+ printf ("got ");
+ mpc_out_str (stdout, 10, 20, z, MPC_RNDNN);
+ printf ("\n");
+ exit (1);
+ }
+ mpc_clear (z);
+ mpfr_set_emin (emin);
+}
+#endif
+
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_atan);
+
+ test_start ();
+
+ data_check (f, "atan.dat");
+ tgeneric (f, 2, 512, 5, 128);
+
+ test_end ();
+
+ return 0;
+}
+
diff --git a/mpc/tests/tatanh.c b/mpc/tests/tatanh.c
new file mode 100644
index 0000000000..ddba68c99a
--- /dev/null
+++ b/mpc/tests/tatanh.c
@@ -0,0 +1,57 @@
+/* tatanh -- test file for mpc_atanh.
+
+Copyright (C) 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+bug20091120 (void)
+{
+ mpc_t x, y;
+
+ mpc_init2 (x, 53);
+ mpc_init3 (y, 17, 42);
+ mpc_set_ui_ui (x, 1, 1, MPC_RNDNN);
+ mpc_atanh (y, x, MPC_RNDNN);
+ if (mpfr_get_prec (mpc_realref(y)) != 17 ||
+ mpfr_get_prec (mpc_imagref(y)) != 42)
+ {
+ printf ("Error, mpc_atanh changed the precisions!!!\n");
+ exit (1);
+ }
+ mpc_clear (x);
+ mpc_clear (y);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_atanh);
+
+ test_start ();
+
+ bug20091120 ();
+
+ data_check (f, "atanh.dat");
+ tgeneric (f, 2, 512, 5, 128);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tconj.c b/mpc/tests/tconj.c
new file mode 100644
index 0000000000..949a80bdd0
--- /dev/null
+++ b/mpc/tests/tconj.c
@@ -0,0 +1,36 @@
+/* tconj -- test file for mpc_conj.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_conj);
+
+ test_start ();
+
+ data_check (f, "conj.dat");
+ tgeneric (f, 2, 1024, 1, 0);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tcos.c b/mpc/tests/tcos.c
new file mode 100644
index 0000000000..66a85bacc2
--- /dev/null
+++ b/mpc/tests/tcos.c
@@ -0,0 +1,65 @@
+/* tcos -- test file for mpc_cos.
+
+Copyright (C) 2008, 2009, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+bug20090105 (void)
+{
+ /* this bug appeared on 32-bits machines */
+ mpc_t op, expected, got;
+ mpc_init2 (op, 324);
+ mpc_init2 (expected, 324);
+ mpc_init2 (got, 324);
+
+ mpfr_set_str (mpc_realref(op), "-3.f1813b1487372434fea4414a520f65a343a16d0ec1ffb"
+ "b2b880154db8d63377ce788fc4215c450300@1", 16, GMP_RNDN);
+ mpfr_set_str (mpc_imagref(op), "-2.b7a0c80bcacf1ccbbac614bf53a58b672b1b503161bee"
+ "59a82e46a23570b652f7ba5f01ef766d1c50", 16,GMP_RNDN);
+ mpfr_set_str (mpc_realref(expected), "7.57c5b08a2b11b660d906a354289b0724b9c4b237"
+ "95abe33424e8d9858e534bd5d776ddd18e34b0240", 16, GMP_RNDN);
+ mpfr_set_str (mpc_imagref(expected), "-1.f41a389646d068e0263561cb3c5d1df763945ad"
+ "ed9339f2a98387a3c4f97dbfd8a08b7d0af2f11b46", 16,GMP_RNDN);
+
+ mpc_cos (got, op, MPC_RNDNN);
+ if (mpc_cmp (got, expected) != 0)
+ TEST_FAILED ("mpc_cos", op, got, expected, MPC_RNDNN);
+
+ mpc_clear (got);
+ mpc_clear(expected);
+ mpc_clear (op);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_cos);
+
+ test_start ();
+
+ data_check (f, "cos.dat");
+ tgeneric (f, 2, 512, 7, 7);
+
+ bug20090105 ();
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tcosh.c b/mpc/tests/tcosh.c
new file mode 100644
index 0000000000..57b5601e97
--- /dev/null
+++ b/mpc/tests/tcosh.c
@@ -0,0 +1,134 @@
+/* test file for mpc_cosh.
+
+Copyright (C) 2008, 2009, 2010, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+static void
+pure_real_argument (void)
+{
+ /* cosh(x -i*0) = cosh(x) +i*0 if x<0 */
+ /* cosh(x -i*0) = cosh(x) -i*0 if x>0 */
+ /* cosh(x +i*0) = cosh(x) -i*0 if x<0 */
+ /* cosh(x -i*0) = cosh(x) +i*0 if x>0 */
+ mpc_t u;
+ mpc_t z;
+ mpc_t cosh_z;
+
+ mpc_init2 (z, 2);
+ mpc_init2 (u, 100);
+ mpc_init2 (cosh_z, 100);
+
+ /* cosh(1 +i*0) = cosh(1) +i*0 */
+ mpc_set_ui_ui (z, 1, 0, MPC_RNDNN);
+ mpfr_cosh (mpc_realref (u), mpc_realref (z), GMP_RNDN);
+ mpfr_set_ui (mpc_imagref (u), 0, GMP_RNDN);
+ mpc_cosh (cosh_z, z, MPC_RNDNN);
+ if (mpc_cmp (cosh_z, u) != 0 || mpfr_signbit (mpc_imagref (cosh_z)))
+ TEST_FAILED ("mpc_cosh", z, cosh_z, u, MPC_RNDNN);
+
+ /* cosh(1 -i*0) = cosh(1) -i*0 */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpc_conj (u, u, MPC_RNDNN);
+ mpc_cosh (cosh_z, z, MPC_RNDNN);
+ if (mpc_cmp (cosh_z, u) != 0 || !mpfr_signbit (mpc_imagref (cosh_z)))
+ TEST_FAILED ("mpc_cosh", z, cosh_z, u, MPC_RNDNN);
+
+ /* cosh(-1 +i*0) = cosh(1) -i*0 */
+ mpc_neg (z, z, MPC_RNDNN);
+ mpc_cosh (cosh_z, z, MPC_RNDNN);
+ if (mpc_cmp (cosh_z, u) != 0 || !mpfr_signbit (mpc_imagref (cosh_z)))
+ TEST_FAILED ("mpc_cosh", z, cosh_z, u, MPC_RNDNN);
+
+ /* cosh(-1 -i*0) = cosh(1) +i*0 */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpc_conj (u, u, MPC_RNDNN);
+ mpc_cosh (cosh_z, z, MPC_RNDNN);
+ if (mpc_cmp (cosh_z, u) != 0 || mpfr_signbit (mpc_imagref (cosh_z)))
+ TEST_FAILED ("mpc_cosh", z, cosh_z, u, MPC_RNDNN);
+
+ mpc_clear (cosh_z);
+ mpc_clear (z);
+ mpc_clear (u);
+}
+
+static void
+pure_imaginary_argument (void)
+{
+ /* cosh(+0 +i*y) = cos y +i*0*sin y */
+ /* cosh(-0 +i*y) = cos y -i*0*sin y */
+ mpc_t u;
+ mpc_t z;
+ mpc_t cosh_z;
+
+ mpc_init2 (z, 2);
+ mpc_init2 (u, 100);
+ mpc_init2 (cosh_z, 100);
+
+ /* cosh(+0 +i) = cos(1) + i*0 */
+ mpc_set_ui_ui (z, 0, 1, MPC_RNDNN);
+ mpfr_cos (mpc_realref (u), mpc_imagref (z), GMP_RNDN);
+ mpfr_set_ui (mpc_imagref (u), 0, GMP_RNDN);
+ mpc_cosh (cosh_z, z, MPC_RNDNN);
+ if (mpc_cmp (cosh_z, u) != 0 || mpfr_signbit (mpc_imagref (cosh_z)))
+ TEST_FAILED ("mpc_cosh", z, cosh_z, u, MPC_RNDNN);
+
+ /* cosh(+0 -i) = cos(1) - i*0 */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpc_conj (u, u, MPC_RNDNN);
+ mpc_cosh (cosh_z, z, MPC_RNDNN);
+ if (mpc_cmp (cosh_z, u) != 0 || !mpfr_signbit (mpc_imagref (cosh_z)))
+ TEST_FAILED ("mpc_cosh", z, cosh_z, u, MPC_RNDNN);
+
+ /* cosh(-0 +i) = cos(1) - i*0 */
+ mpc_neg (z, z, MPC_RNDNN);
+ mpc_cosh (cosh_z, z, MPC_RNDNN);
+ if (mpc_cmp (cosh_z, u) != 0 || !mpfr_signbit (mpc_imagref (cosh_z)))
+ TEST_FAILED ("mpc_cosh", z, cosh_z, u, MPC_RNDNN);
+
+ /* cosh(-0 -i) = cos(1) + i*0 */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpc_conj (u, u, MPC_RNDNN);
+ mpc_cosh (cosh_z, z, MPC_RNDNN);
+ if (mpc_cmp (cosh_z, u) != 0 || mpfr_signbit (mpc_imagref (cosh_z)))
+ TEST_FAILED ("mpc_cosh", z, cosh_z, u, MPC_RNDNN);
+
+ mpc_clear (cosh_z);
+ mpc_clear (z);
+ mpc_clear (u);
+}
+
+int
+main (void)
+{
+ DECL_FUNC(CC, f,mpc_cosh);
+
+ test_start ();
+
+ data_check (f, "cosh.dat");
+ tgeneric (f, 2, 512, 7, 7);
+
+ pure_real_argument ();
+ pure_imaginary_argument ();
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tdiv.c b/mpc/tests/tdiv.c
new file mode 100644
index 0000000000..3b8340ff10
--- /dev/null
+++ b/mpc/tests/tdiv.c
@@ -0,0 +1,36 @@
+/* tdiv -- test file for mpc_div.
+
+Copyright (C) 2002, 2008, 2009, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (C_CC, f, mpc_div);
+
+ test_start ();
+
+ data_check (f, "div.dat");
+ tgeneric (f, 2, 1024, 7, 4096);
+
+ test_end ();
+ return 0;
+}
diff --git a/mpc/tests/tdiv_2si.c b/mpc/tests/tdiv_2si.c
new file mode 100644
index 0000000000..5046201185
--- /dev/null
+++ b/mpc/tests/tdiv_2si.c
@@ -0,0 +1,35 @@
+/* tdiv_2si -- test file for mpc_div_2si.
+
+Copyright (C) 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCS, f, mpc_div_2si);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tdiv_2ui.c b/mpc/tests/tdiv_2ui.c
new file mode 100644
index 0000000000..6cc8f1455e
--- /dev/null
+++ b/mpc/tests/tdiv_2ui.c
@@ -0,0 +1,35 @@
+/* tdiv_2ui -- test file for mpc_div_2ui.
+
+Copyright (C) 2008, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCU, f, mpc_div_2ui);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tdiv_fr.c b/mpc/tests/tdiv_fr.c
new file mode 100644
index 0000000000..21e677e084
--- /dev/null
+++ b/mpc/tests/tdiv_fr.c
@@ -0,0 +1,36 @@
+/* test file for mpc_div_fr.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCF, f, mpc_div_fr);
+
+ test_start ();
+
+ data_check (f, "div_fr.dat");
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tdiv_ui.c b/mpc/tests/tdiv_ui.c
new file mode 100644
index 0000000000..5e62d57c0c
--- /dev/null
+++ b/mpc/tests/tdiv_ui.c
@@ -0,0 +1,35 @@
+/* test file for mpc_div_ui.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCU, f, mpc_div_ui);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/texp.c b/mpc/tests/texp.c
new file mode 100644
index 0000000000..0486cce910
--- /dev/null
+++ b/mpc/tests/texp.c
@@ -0,0 +1,36 @@
+/* texp -- test file for mpc_exp.
+
+Copyright (C) 2002, 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_exp);
+
+ test_start ();
+
+ data_check (f, "exp.dat");
+ tgeneric (f, 2, 512, 7, 256);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tfma.c b/mpc/tests/tfma.c
new file mode 100644
index 0000000000..81bc167fe4
--- /dev/null
+++ b/mpc/tests/tfma.c
@@ -0,0 +1,107 @@
+/* tfma -- test file for mpc_fma.
+
+Copyright (C) 2011, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+cmpfma (mpc_srcptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
+ /* computes a*b+c with the naive and fast functions using the rounding
+ mode rnd and compares the results and return values.
+ In our current test suite, all input precisions are the same, and we
+ use this precision also for the result.
+ */
+{
+ mpc_t z, t;
+ int inex_z, inex_t;
+
+ mpc_init2 (z, MPC_MAX_PREC (a));
+ mpc_init2 (t, MPC_MAX_PREC (a));
+
+ inex_z = mpc_fma_naive (z, a, b, c, rnd);
+ inex_t = mpc_fma (t, a, b, c, rnd);
+
+ if (mpc_cmp (z, t) != 0 || inex_z != inex_t) {
+ fprintf (stderr, "fma_naive and fma differ for rnd=(%s,%s)\n",
+ mpfr_print_rnd_mode(MPC_RND_RE(rnd)),
+ mpfr_print_rnd_mode(MPC_RND_IM(rnd)));
+ MPC_OUT (a);
+ MPC_OUT (b);
+ MPC_OUT (c);
+ MPC_OUT (z);
+ MPC_OUT (t);
+ if (inex_z != inex_t) {
+ fprintf (stderr, "inex_re (z): %s\n", MPC_INEX_STR (inex_z));
+ fprintf (stderr, "inex_re (t): %s\n", MPC_INEX_STR (inex_t));
+ }
+ exit (1);
+ }
+
+ mpc_clear (z);
+ mpc_clear (t);
+}
+
+
+static void
+check_random (void)
+{
+ mpfr_prec_t prec;
+ int rnd_re, rnd_im;
+ mpc_t a, b, c;
+
+ mpc_init2 (a, 1000);
+ mpc_init2 (b, 1000);
+ mpc_init2 (c, 1000);
+
+ for (prec = 2; prec < 1000; prec = (mpfr_prec_t) (prec * 1.1 + 1)) {
+ mpc_set_prec (a, prec);
+ mpc_set_prec (b, prec);
+ mpc_set_prec (c, prec);
+
+ test_default_random (a, -1024, 1024, 128, 0);
+ test_default_random (b, -1024, 1024, 128, 0);
+ test_default_random (c, -1024, 1024, 128, 0);
+
+ for (rnd_re = 0; rnd_re < 4; rnd_re ++)
+ for (rnd_im = 0; rnd_im < 4; rnd_im ++)
+ cmpfma (a, b, c, MPC_RND (rnd_re, rnd_im));
+ }
+
+ mpc_clear (a);
+ mpc_clear (b);
+ mpc_clear (c);
+}
+
+
+int
+main (void)
+{
+ DECL_FUNC (CCCC, f, mpc_fma);
+
+ test_start ();
+
+ check_random ();
+
+ data_check (f, "fma.dat");
+ tgeneric (f, 2, 1024, 1, 256);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tfr_div.c b/mpc/tests/tfr_div.c
new file mode 100644
index 0000000000..bea8a21691
--- /dev/null
+++ b/mpc/tests/tfr_div.c
@@ -0,0 +1,34 @@
+/* tfr_div -- test file for mpc_fr_div.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CFC, f, mpc_fr_div);
+ test_start();
+
+ data_check (f, "fr_div.dat");
+ tgeneric (f, 2, 1024, 7, 65535);
+
+ test_end ();
+ return 0;
+}
diff --git a/mpc/tests/tfr_sub.c b/mpc/tests/tfr_sub.c
new file mode 100644
index 0000000000..e366bc68ac
--- /dev/null
+++ b/mpc/tests/tfr_sub.c
@@ -0,0 +1,35 @@
+/* tfr_div -- test file for mpc_fr_sub.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC(CFC, f, mpc_fr_sub);
+
+ test_start();
+
+ data_check (f, "fr_sub.dat");
+ tgeneric (f, 2, 4096, 7, 0);
+
+ test_end ();
+ return 0;
+}
diff --git a/mpc/tests/tgeneric.c b/mpc/tests/tgeneric.c
new file mode 100644
index 0000000000..a2bb460e74
--- /dev/null
+++ b/mpc/tests/tgeneric.c
@@ -0,0 +1,1412 @@
+/* tgeneric.c -- File for generic tests.
+
+Copyright (C) 2008, 2009, 2010, 2011, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+/* Warning: unlike the MPFR macro (defined in mpfr-impl.h), this one returns
+ true when b is singular */
+#define MPFR_CAN_ROUND(b,err,prec,rnd) \
+ (mpfr_zero_p (b) || mpfr_inf_p (b) \
+ || mpfr_can_round (b, (long)mpfr_get_prec (b) - (err), (rnd), \
+ GMP_RNDZ, (prec) + ((rnd)==GMP_RNDN)))
+
+/* functions with one input, one output */
+static void
+tgeneric_cc (mpc_function *function, mpc_ptr op, mpc_ptr rop,
+ mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ /* We compute the result with four times the precision and check whether the
+ rounding is correct. Error reports in this part of the algorithm might
+ still be wrong, though, since there are two consecutive roundings (but we
+ try to avoid them). */
+ function->pointer.CC (rop4, op, rnd);
+ function->pointer.CC (rop, op, rnd);
+
+ /* can't use the mpfr_can_round function when argument is singular,
+ use a custom macro instead. */
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ /* avoid double rounding error */
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ /* rounding failed */
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPC_OUT (op);
+
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+static void
+tgeneric_cc_c (mpc_function *function, mpc_ptr op, mpc_ptr rop1, mpc_ptr rop2,
+ mpc_ptr rop14, mpc_ptr rop24, mpc_ptr rop14rnd, mpc_ptr rop24rnd,
+ mpc_rnd_t rnd1, mpc_rnd_t rnd2)
+{
+ /* same as the previous function, but for mpc functions computing two
+ results from one argument */
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CC_C (rop14, rop24, op, rnd1, rnd2);
+ function->pointer.CC_C (rop1, rop2, op, rnd1, rnd2);
+
+ if ( MPFR_CAN_ROUND (mpc_realref (rop14), 1, MPC_PREC_RE (rop1),
+ MPC_RND_RE (rnd1))
+ && MPFR_CAN_ROUND (mpc_imagref (rop14), 1, MPC_PREC_IM (rop1),
+ MPC_RND_IM (rnd1))
+ && MPFR_CAN_ROUND (mpc_realref (rop24), 1, MPC_PREC_RE (rop2),
+ MPC_RND_RE (rnd2))
+ && MPFR_CAN_ROUND (mpc_imagref (rop24), 1, MPC_PREC_IM (rop2),
+ MPC_RND_IM (rnd2))) {
+ mpc_set (rop14rnd, rop14, rnd1);
+ mpc_set (rop24rnd, rop24, rnd2);
+ }
+ else
+ return;
+
+ if (!same_mpc_value (rop1, rop14rnd, ks)) {
+ /* rounding failed for first result */
+ printf ("Rounding might be incorrect for the first result of %s at\n", function->name);
+ MPC_OUT (op);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd1)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd1)));
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop1);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop14);
+ printf ("and is rounded to ");
+ MPC_OUT (rop14rnd);
+ exit (1);
+ }
+ else if (!same_mpc_value (rop2, rop24rnd, ks)) {
+ /* rounding failed for second result */
+ printf ("Rounding might be incorrect for the second result of %s at\n", function->name);
+ MPC_OUT (op);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd2)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd2)));
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop2);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop24);
+ printf ("and is rounded to ");
+ MPC_OUT (rop24rnd);
+ exit (1);
+ }
+}
+
+static void
+tgeneric_fc (mpc_function *function, mpc_ptr op, mpfr_ptr rop,
+ mpfr_ptr rop4, mpfr_ptr rop4rnd, mpfr_rnd_t rnd)
+{
+ function->pointer.FC (rop4, op, rnd);
+ function->pointer.FC (rop, op, rnd);
+ if (MPFR_CAN_ROUND (rop4, 1, mpfr_get_prec (rop), rnd))
+ mpfr_set (rop4rnd, rop4, rnd);
+ else
+ return;
+
+ if (same_mpfr_value (rop, rop4rnd, 1))
+ return;
+
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPC_OUT (op);
+ printf ("with rounding mode %s", mpfr_print_rnd_mode (rnd));
+
+ printf ("\n%s gives ", function->name);
+ MPFR_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPFR_OUT (rop4);
+ printf ("and is rounded to ");
+ MPFR_OUT (rop4rnd);
+
+ exit (1);
+}
+
+static void
+tgeneric_cfc (mpc_function *function, mpfr_ptr op1, mpc_ptr op2,
+ mpc_ptr rop, mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CFC (rop4, op1, op2, rnd);
+ function->pointer.CFC (rop, op1, op2, rnd);
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPFR_OUT (op1);
+ MPC_OUT (op2);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+static void
+tgeneric_ccf (mpc_function *function, mpc_ptr op1, mpfr_ptr op2,
+ mpc_ptr rop, mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CCF (rop4, op1, op2, rnd);
+ function->pointer.CCF (rop, op1, op2, rnd);
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPC_OUT (op1);
+ MPFR_OUT (op2);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+/* for functions with one mpc_t output, two mpc_t inputs */
+static void
+tgeneric_c_cc (mpc_function *function, mpc_ptr op1, mpc_ptr op2,
+ mpc_ptr rop, mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ /* We compute the result with four times the precision and check whether the
+ rounding is correct. Error reports in this part of the algorithm might
+ still be wrong, though, since there are two consecutive roundings (but we
+ try to avoid them). */
+ function->pointer.C_CC (rop4, op1, op2, rnd);
+ function->pointer.C_CC (rop, op1, op2, rnd);
+
+ /* can't use mpfr_can_round when argument is singular */
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ /* avoid double rounding error */
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ /* rounding failed */
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPC_OUT (op1);
+ MPC_OUT (op2);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+static void
+tgeneric_cccc (mpc_function *function, mpc_ptr op1, mpc_ptr op2, mpc_ptr op3,
+ mpc_ptr rop, mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ /* We compute the result with four times the precision and check whether the
+ rounding is correct. Error reports in this part of the algorithm might
+ still be wrong, though, since there are two consecutive roundings (but we
+ try to avoid them). */
+ function->pointer.CCCC (rop4, op1, op2, op3, rnd);
+ function->pointer.CCCC (rop, op1, op2, op3, rnd);
+
+ /* can't use mpfr_can_round when argument is singular */
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ /* avoid double rounding error */
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ /* rounding failed */
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPC_OUT (op1);
+ MPC_OUT (op2);
+ MPC_OUT (op3);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+static void
+tgeneric_ccu (mpc_function *function, mpc_ptr op1, unsigned long int op2,
+ mpc_ptr rop, mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CCU (rop4, op1, op2, rnd);
+ function->pointer.CCU (rop, op1, op2, rnd);
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPC_OUT (op1);
+ printf ("op2=%lu\n", op2);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+static void
+tgeneric_cuc (mpc_function *function, unsigned long int op1, mpc_ptr op2,
+ mpc_ptr rop, mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CUC (rop4, op1, op2, rnd);
+ function->pointer.CUC (rop, op1, op2, rnd);
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ printf ("op1=%lu\n", op1);
+ MPC_OUT (op2);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+static void
+tgeneric_ccs (mpc_function *function, mpc_ptr op1, long int op2,
+ mpc_ptr rop, mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CCS (rop4, op1, op2, rnd);
+ function->pointer.CCS (rop, op1, op2, rnd);
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPC_OUT (op1);
+ printf ("op2=%ld\n", op2);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+
+static void
+tgeneric_cci (mpc_function *function, mpc_ptr op1, int op2,
+ mpc_ptr rop, mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CCI (rop4, op1, op2, rnd);
+ function->pointer.CCI (rop, op1, op2, rnd);
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ MPC_OUT (op1);
+ printf ("op2=%d\n", op2);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+static void
+tgeneric_cuuc (mpc_function *function, unsigned long int op1,
+ unsigned long int op2, mpc_ptr op3, mpc_ptr rop,
+ mpc_ptr rop4, mpc_ptr rop4rnd, mpc_rnd_t rnd)
+{
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CUUC (rop4, op1, op2, op3, rnd);
+ function->pointer.CUUC (rop, op1, op2, op3, rnd);
+ if (MPFR_CAN_ROUND (mpc_realref (rop4), 1, MPC_PREC_RE (rop),
+ MPC_RND_RE (rnd))
+ && MPFR_CAN_ROUND (mpc_imagref (rop4), 1, MPC_PREC_IM (rop),
+ MPC_RND_IM (rnd)))
+ mpc_set (rop4rnd, rop4, rnd);
+ else
+ return;
+
+ if (same_mpc_value (rop, rop4rnd, ks))
+ return;
+
+ printf ("Rounding in %s might be incorrect for\n", function->name);
+ printf ("op1=%lu\n", op1);
+ printf ("op2=%lu\n", op2);
+ MPC_OUT (op3);
+ printf ("with rounding mode (%s, %s)",
+ mpfr_print_rnd_mode (MPC_RND_RE (rnd)),
+ mpfr_print_rnd_mode (MPC_RND_IM (rnd)));
+
+ printf ("\n%s gives ", function->name);
+ MPC_OUT (rop);
+ printf ("%s quadruple precision gives ", function->name);
+ MPC_OUT (rop4);
+ printf ("and is rounded to ");
+ MPC_OUT (rop4rnd);
+
+ exit (1);
+}
+
+
+/* Test parameter reuse: the function should not use its output parameter in
+ internal computations. */
+static void
+reuse_cc (mpc_function* function, mpc_srcptr z, mpc_ptr got, mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CC (expected, z, MPC_RNDNN);
+ function->pointer.CC (got, got, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, z) for\n", function->name);
+ MPC_OUT (z);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_cc_c (mpc_function* function, mpc_srcptr z, mpc_ptr got1, mpc_ptr got2,
+ mpc_ptr exp1, mpc_ptr exp2)
+{
+ known_signs_t ks = {1, 1};
+
+ function->pointer.CC_C (exp1, exp2, z, MPC_RNDNN, MPC_RNDNN);
+ mpc_set (got1, z, MPC_RNDNN); /* exact */
+ function->pointer.CC_C (got1, got2, got1, MPC_RNDNN, MPC_RNDNN);
+ if ( !same_mpc_value (got1, exp1, ks)
+ || !same_mpc_value (got2, exp2, ks)) {
+ printf ("Reuse error in first result of %s for\n", function->name);
+ MPC_OUT (z);
+ MPC_OUT (exp1);
+ MPC_OUT (got1);
+ MPC_OUT (exp2);
+ MPC_OUT (got2);
+ exit (1);
+ }
+ mpc_set (got2, z, MPC_RNDNN); /* exact */
+ function->pointer.CC_C (got1, got2, got2, MPC_RNDNN, MPC_RNDNN);
+ if ( !same_mpc_value (got1, exp1, ks)
+ || !same_mpc_value (got2, exp2, ks)) {
+ printf ("Reuse error in second result of %s for\n", function->name);
+ MPC_OUT (z);
+ MPC_OUT (exp1);
+ MPC_OUT (got1);
+ MPC_OUT (exp2);
+ MPC_OUT (got2);
+ exit (1);
+ }
+}
+
+static void
+reuse_fc (mpc_function* function, mpc_ptr z, mpc_ptr x, mpfr_ptr expected)
+{
+ mpc_set (x, z, MPC_RNDNN); /* exact */
+ function->pointer.FC (expected, z, GMP_RNDN);
+ function->pointer.FC (mpc_realref (x), x, GMP_RNDN);
+ if (!same_mpfr_value (mpc_realref (x), expected, 1))
+ {
+ mpfr_t got;
+ got[0] = mpc_realref(x)[0]; /* display sensible name */
+ printf ("Reuse error for %s(mpc_realref(z), z) for\n", function->name);
+ MPC_OUT (z);
+ MPFR_OUT (expected);
+ MPFR_OUT (got);
+
+ exit (1);
+ }
+ mpc_set (x, z, MPC_RNDNN); /* exact */
+ function->pointer.FC (mpc_imagref (x), x, GMP_RNDN);
+ if (!same_mpfr_value (mpc_imagref (x), expected, 1))
+ {
+ mpfr_t got;
+ got[0] = mpc_imagref(x)[0]; /* display sensible name */
+ printf ("Reuse error for %s(mpc_imagref(z), z) for \n", function->name);
+ MPC_OUT (z);
+ MPFR_OUT (expected);
+ MPFR_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_cfc (mpc_function* function, mpc_srcptr z, mpfr_srcptr x, mpc_ptr got,
+ mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CFC (expected, x, z, MPC_RNDNN);
+ function->pointer.CFC (got, x, got, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, x, z) for\n", function->name);
+ MPFR_OUT (x);
+ MPC_OUT (z);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_ccf (mpc_function* function, mpc_srcptr z, mpfr_srcptr x, mpc_ptr got,
+ mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CCF (expected, z, x, MPC_RNDNN);
+ function->pointer.CCF (got, got, x, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, z, x, RNDNN) for\n", function->name);
+ MPC_OUT (z);
+ MPFR_OUT (x);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+/* for functions with one mpc_t output, two mpc_t inputs */
+static void
+reuse_c_cc (mpc_function* function, mpc_srcptr z, mpc_srcptr x,
+ mpc_ptr got, mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.C_CC (expected, z, x, MPC_RNDNN);
+ function->pointer.C_CC (got, got, x, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, z, x) for\n", function->name);
+ MPC_OUT (z);
+ MPC_OUT (x);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+ mpc_set (got, x, MPC_RNDNN); /* exact */
+ function->pointer.C_CC (expected, z, x, MPC_RNDNN);
+ function->pointer.C_CC (got, z, got, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(x, z, x) for\n", function->name);
+ MPC_OUT (z);
+ MPC_OUT (x);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+ mpc_set (got, x, MPC_RNDNN); /* exact */
+ function->pointer.C_CC (expected, x, x, MPC_RNDNN);
+ function->pointer.C_CC (got, got, got, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(x, x, x) for\n", function->name);
+ MPC_OUT (x);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_cccc (mpc_function* function, mpc_srcptr z, mpc_srcptr x, mpc_srcptr y,
+ mpc_ptr got, mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CCCC (expected, z, x, y, MPC_RNDNN);
+ function->pointer.CCCC (got, got, x, y, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, z, x, y) for\n", function->name);
+ MPC_OUT (z);
+ MPC_OUT (x);
+ MPC_OUT (y);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+
+ mpc_set (got, x, MPC_RNDNN); /* exact */
+ function->pointer.CCCC (expected, z, x, y, MPC_RNDNN);
+ function->pointer.CCCC (got, z, got, y, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(x, z, x, y) for\n", function->name);
+ MPC_OUT (z);
+ MPC_OUT (x);
+ MPC_OUT (y);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+
+ mpc_set (got, y, MPC_RNDNN); /* exact */
+ function->pointer.CCCC (expected, z, x, y, MPC_RNDNN);
+ function->pointer.CCCC (got, z, x, got, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(y, z, x, y) for\n", function->name);
+ MPC_OUT (z);
+ MPC_OUT (x);
+ MPC_OUT (y);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+
+ mpc_set (got, x, MPC_RNDNN); /* exact */
+ function->pointer.CCCC (expected, x, x, x, MPC_RNDNN);
+ function->pointer.CCCC (got, got, got, got, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(x, x, x, x) for\n", function->name);
+ MPC_OUT (x);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_ccu (mpc_function* function, mpc_srcptr z, unsigned long ul,
+ mpc_ptr got, mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CCU (expected, z, ul, MPC_RNDNN);
+ function->pointer.CCU (got, got, ul, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, z, n) for\n", function->name);
+ MPC_OUT (z);
+ printf ("n=%lu\n", ul);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_cuc (mpc_function* function, unsigned long ul, mpc_srcptr z,
+ mpc_ptr got, mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CUC (expected, ul, z,MPC_RNDNN);
+ function->pointer.CUC (got, ul, got, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, n, z) for\n", function->name);
+ printf ("n=%lu\n", ul);
+ MPC_OUT (z);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_ccs (mpc_function* function, mpc_srcptr z, long lo,
+ mpc_ptr got, mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CCS (expected, z, lo, MPC_RNDNN);
+ function->pointer.CCS (got, got, lo, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, z, n) for\n", function->name);
+ MPC_OUT (z);
+ printf ("n=%ld\n", lo);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_cci (mpc_function* function, mpc_srcptr z, int i,
+ mpc_ptr got, mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CCI (expected, z, i, MPC_RNDNN);
+ function->pointer.CCI (got, got, i, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, z, n) for\n", function->name);
+ MPC_OUT (z);
+ printf ("n=%d\n", i);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+static void
+reuse_cuuc (mpc_function* function, unsigned long ul1, unsigned long ul2,
+ mpc_srcptr z, mpc_ptr got, mpc_ptr expected)
+{
+ known_signs_t ks = {1, 1};
+
+ mpc_set (got, z, MPC_RNDNN); /* exact */
+ function->pointer.CUUC (expected, ul1, ul2, z,MPC_RNDNN);
+ function->pointer.CUUC (got, ul1, ul2, got, MPC_RNDNN);
+ if (!same_mpc_value (got, expected, ks))
+ {
+ printf ("Reuse error for %s(z, m, n, z) for\n", function->name);
+ printf ("m=%lu\n", ul1);
+ printf ("n=%lu\n", ul2);
+ MPC_OUT (z);
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+}
+
+
+/* helper functions for iterating over mpfr rounding modes */
+static mpfr_rnd_t
+first_rnd_mode (void)
+{
+ return GMP_RNDN;
+}
+
+static mpfr_rnd_t
+next_rnd_mode (mpfr_rnd_t curr)
+ /* assumes that all rounding modes are non-negative, and returns -1
+ when curr is the last rounding mode */
+{
+ switch (curr) {
+ case GMP_RNDN:
+ return GMP_RNDZ;
+ case GMP_RNDZ:
+ return GMP_RNDU;
+ case GMP_RNDU:
+ return GMP_RNDD;
+ default:
+ /* return invalid guard value in mpfr_rnd_t */
+#if MPFR_VERSION_MAJOR < 3
+ return GMP_RNDNA;
+#else
+ return MPFR_RNDA; /* valid rounding type, but not (yet) used in mpc */
+#endif
+ }
+}
+
+static int
+is_valid_rnd_mode (mpfr_rnd_t curr)
+ /* returns 1 if curr is a valid rounding mode, and 0otherwise */
+{
+ if ( curr == GMP_RNDN || curr == GMP_RNDZ
+ || curr == GMP_RNDU || curr == GMP_RNDD)
+ return 1;
+ else
+ return 0;
+}
+
+/* tgeneric(prec_min, prec_max, step, exp_max) checks rounding with random
+ numbers:
+ - with precision ranging from prec_min to prec_max with an increment of
+ step,
+ - with exponent between -exp_max and exp_max.
+
+ It also checks parameter reuse (it is assumed here that either two mpc_t
+ variables are equal or they are different, in the sense that the real part
+ of one of them cannot be the imaginary part of the other). */
+void
+tgeneric (mpc_function function, mpfr_prec_t prec_min,
+ mpfr_prec_t prec_max, mpfr_prec_t step, mpfr_exp_t exp_max)
+{
+ unsigned long ul1 = 0, ul2 = 0;
+ long lo = 0;
+ int i = 0;
+ mpfr_t x1, x2, xxxx;
+ mpc_t z1, z2, z3, z4, z5, zzzz, zzzz2;
+
+ mpfr_rnd_t rnd_re, rnd_im, rnd2_re, rnd2_im;
+ mpfr_prec_t prec;
+ mpfr_exp_t exp_min;
+ int special, special_cases;
+
+ mpc_init2 (z1, prec_max);
+ switch (function.type)
+ {
+ case C_CC:
+ mpc_init2 (z2, prec_max);
+ mpc_init2 (z3, prec_max);
+ mpc_init2 (z4, prec_max);
+ mpc_init2 (zzzz, 4*prec_max);
+ special_cases = 8;
+ break;
+ case CCCC:
+ mpc_init2 (z2, prec_max);
+ mpc_init2 (z3, prec_max);
+ mpc_init2 (z4, prec_max);
+ mpc_init2 (z5, prec_max);
+ mpc_init2 (zzzz, 4*prec_max);
+ special_cases = 8;
+ break;
+ case FC:
+ mpfr_init2 (x1, prec_max);
+ mpfr_init2 (x2, prec_max);
+ mpfr_init2 (xxxx, 4*prec_max);
+ mpc_init2 (z2, prec_max);
+ special_cases = 4;
+ break;
+ case CCF: case CFC:
+ mpfr_init2 (x1, prec_max);
+ mpc_init2 (z2, prec_max);
+ mpc_init2 (z3, prec_max);
+ mpc_init2 (zzzz, 4*prec_max);
+ special_cases = 6;
+ break;
+ case CCI: case CCS:
+ case CCU: case CUC:
+ mpc_init2 (z2, prec_max);
+ mpc_init2 (z3, prec_max);
+ mpc_init2 (zzzz, 4*prec_max);
+ special_cases = 5;
+ break;
+ case CUUC:
+ mpc_init2 (z2, prec_max);
+ mpc_init2 (z3, prec_max);
+ mpc_init2 (zzzz, 4*prec_max);
+ special_cases = 6;
+ break;
+ case CC_C:
+ mpc_init2 (z2, prec_max);
+ mpc_init2 (z3, prec_max);
+ mpc_init2 (z4, prec_max);
+ mpc_init2 (z5, prec_max);
+ mpc_init2 (zzzz, 4*prec_max);
+ mpc_init2 (zzzz2, 4*prec_max);
+ special_cases = 4;
+ break;
+ case CC:
+ default:
+ mpc_init2 (z2, prec_max);
+ mpc_init2 (z3, prec_max);
+ mpc_init2 (zzzz, 4*prec_max);
+ special_cases = 4;
+ }
+
+ exp_min = mpfr_get_emin ();
+ if (exp_max <= 0 || exp_max > mpfr_get_emax ())
+ exp_max = mpfr_get_emax();
+ if (-exp_max > exp_min)
+ exp_min = - exp_max;
+
+ if (step < 1)
+ step = 1;
+
+ for (prec = prec_min, special = 0;
+ prec <= prec_max || special <= special_cases;
+ prec+=step, special += (prec > prec_max ? 1 : 0)) {
+ /* In the end, test functions in special cases of purely real, purely
+ imaginary or infinite arguments. */
+
+ /* probability of one zero part in 256th (25 is almost 10%) */
+ const unsigned int zero_probability = special != 0 ? 0 : 25;
+
+ mpc_set_prec (z1, prec);
+ test_default_random (z1, exp_min, exp_max, 128, zero_probability);
+
+ switch (function.type)
+ {
+ case C_CC:
+ mpc_set_prec (z2, prec);
+ test_default_random (z2, exp_min, exp_max, 128, zero_probability);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (z4, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ case 5:
+ mpfr_set_ui (mpc_realref (z2), 0, GMP_RNDN);
+ break;
+ case 6:
+ mpfr_set_inf (mpc_realref (z2), -1);
+ break;
+ case 7:
+ mpfr_set_ui (mpc_imagref (z2), 0, GMP_RNDN);
+ break;
+ case 8:
+ mpfr_set_inf (mpc_imagref (z2), +1);
+ break;
+ }
+ break;
+ case CCCC:
+ mpc_set_prec (z2, prec);
+ test_default_random (z2, exp_min, exp_max, 128, zero_probability);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (z4, prec);
+ mpc_set_prec (z5, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ case 5:
+ mpfr_set_ui (mpc_realref (z2), 0, GMP_RNDN);
+ break;
+ case 6:
+ mpfr_set_inf (mpc_realref (z2), -1);
+ break;
+ case 7:
+ mpfr_set_ui (mpc_imagref (z2), 0, GMP_RNDN);
+ break;
+ case 8:
+ mpfr_set_inf (mpc_imagref (z2), +1);
+ break;
+ }
+ break;
+ case FC:
+ mpc_set_prec (z2, prec);
+ mpfr_set_prec (x1, prec);
+ mpfr_set_prec (x2, prec);
+ mpfr_set_prec (xxxx, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ }
+ break;
+ case CCU: case CUC:
+ mpc_set_prec (z2, 128);
+ do {
+ test_default_random (z2, 0, 64, 128, zero_probability);
+ } while (!mpfr_fits_ulong_p (mpc_realref (z2), GMP_RNDN));
+ ul1 = mpfr_get_ui (mpc_realref(z2), GMP_RNDN);
+ mpc_set_prec (z2, prec);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ case 5:
+ ul1 = 0;
+ break;
+ }
+ break;
+ case CUUC:
+ mpc_set_prec (z2, 128);
+ do {
+ test_default_random (z2, 0, 64, 128, zero_probability);
+ } while (!mpfr_fits_ulong_p (mpc_realref (z2), GMP_RNDN)
+ ||!mpfr_fits_ulong_p (mpc_imagref (z2), GMP_RNDN));
+ ul1 = mpfr_get_ui (mpc_realref(z2), GMP_RNDN);
+ ul2 = mpfr_get_ui (mpc_imagref(z2), GMP_RNDN);
+ mpc_set_prec (z2, prec);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ case 5:
+ ul1 = 0;
+ break;
+ case 6:
+ ul2 = 0;
+ break;
+ }
+ break;
+ case CCS:
+ mpc_set_prec (z2, 128);
+ do {
+ test_default_random (z2, 0, 64, 128, zero_probability);
+ } while (!mpfr_fits_slong_p (mpc_realref (z2), GMP_RNDN));
+ lo = mpfr_get_si (mpc_realref(z2), GMP_RNDN);
+ mpc_set_prec (z2, prec);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ case 5:
+ lo = 0;
+ break;
+ }
+ break;
+ case CCI:
+ mpc_set_prec (z2, 128);
+ do {
+ test_default_random (z2, 0, 64, 128, zero_probability);
+ } while (!mpfr_fits_slong_p (mpc_realref (z2), GMP_RNDN));
+ i = (int)mpfr_get_si (mpc_realref(z2), GMP_RNDN);
+ mpc_set_prec (z2, prec);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ case 5:
+ i = 0;
+ break;
+ }
+ break;
+ case CCF: case CFC:
+ mpfr_set_prec (x1, prec);
+ mpfr_set (x1, mpc_realref (z1), GMP_RNDN);
+ test_default_random (z1, exp_min, exp_max, 128, zero_probability);
+ mpc_set_prec (z2, prec);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ case 5:
+ mpfr_set_ui (x1, 0, GMP_RNDN);
+ break;
+ case 6:
+ mpfr_set_inf (x1, +1);
+ break;
+ }
+ break;
+ case CC_C:
+ mpc_set_prec (z2, prec);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (z4, prec);
+ mpc_set_prec (z5, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ mpc_set_prec (zzzz2, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ }
+ break;
+ case CC:
+ default:
+ mpc_set_prec (z2, prec);
+ mpc_set_prec (z3, prec);
+ mpc_set_prec (zzzz, 4*prec);
+ switch (special)
+ {
+ case 1:
+ mpfr_set_ui (mpc_realref (z1), 0, GMP_RNDN);
+ break;
+ case 2:
+ mpfr_set_inf (mpc_realref (z1), +1);
+ break;
+ case 3:
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ break;
+ case 4:
+ mpfr_set_inf (mpc_imagref (z1), -1);
+ break;
+ }
+ }
+
+ for (rnd_re = first_rnd_mode (); is_valid_rnd_mode (rnd_re); rnd_re = next_rnd_mode (rnd_re))
+ switch (function.type)
+ {
+ case C_CC:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_c_cc (&function, z1, z2, z3, zzzz, z4,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_c_cc (&function, z1, z2, z3, z4);
+ break;
+ case CCCC:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_cccc (&function, z1, z2, z3, z4, zzzz, z5,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_cccc (&function, z1, z2, z3, z4, z5);
+ break;
+ case FC:
+ tgeneric_fc (&function, z1, x1, xxxx, x2, rnd_re);
+ reuse_fc (&function, z1, z2, x1);
+ break;
+ case CC:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_cc (&function, z1, z2, zzzz, z3,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_cc (&function, z1, z2, z3);
+ break;
+ case CC_C:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ for (rnd2_re = first_rnd_mode (); is_valid_rnd_mode (rnd2_re); rnd2_re = next_rnd_mode (rnd2_re))
+ for (rnd2_im = first_rnd_mode (); is_valid_rnd_mode (rnd2_im); rnd2_im = next_rnd_mode (rnd2_im))
+ tgeneric_cc_c (&function, z1, z2, z3, zzzz, zzzz2, z4, z5,
+ MPC_RND (rnd_re, rnd_im), MPC_RND (rnd2_re, rnd2_im));
+ reuse_cc_c (&function, z1, z2, z3, z4, z5);
+ break;
+ case CFC:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_cfc (&function, x1, z1, z2, zzzz, z3,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_cfc (&function, z1, x1, z2, z3);
+ break;
+ case CCF:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_ccf (&function, z1, x1, z2, zzzz, z3,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_ccf (&function, z1, x1, z2, z3);
+ break;
+ case CCU:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_ccu (&function, z1, ul1, z2, zzzz, z3,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_ccu (&function, z1, ul1, z2, z3);
+ break;
+ case CUC:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_cuc (&function, ul1, z1, z2, zzzz, z3,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_cuc (&function, ul1, z1, z2, z3);
+ break;
+ case CCS:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_ccs (&function, z1, lo, z2, zzzz, z3,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_ccs (&function, z1, lo, z2, z3);
+ break;
+ case CCI:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_cci (&function, z1, i, z2, zzzz, z3,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_cci (&function, z1, i, z2, z3);
+ break;
+ case CUUC:
+ for (rnd_im = first_rnd_mode (); is_valid_rnd_mode (rnd_im); rnd_im = next_rnd_mode (rnd_im))
+ tgeneric_cuuc (&function, ul1, ul2, z1, z2, zzzz, z3,
+ MPC_RND (rnd_re, rnd_im));
+ reuse_cuuc (&function, ul1, ul2, z1, z2, z3);
+ break;
+ default:
+ printf ("tgeneric not yet implemented for this kind of"
+ "function\n");
+ exit (1);
+ }
+ }
+
+ mpc_clear (z1);
+ switch (function.type)
+ {
+ case C_CC:
+ mpc_clear (z2);
+ mpc_clear (z3);
+ mpc_clear (z4);
+ mpc_clear (zzzz);
+ break;
+ case CCCC:
+ mpc_clear (z2);
+ mpc_clear (z3);
+ mpc_clear (z4);
+ mpc_clear (z5);
+ mpc_clear (zzzz);
+ break;
+ case FC:
+ mpc_clear (z2);
+ mpfr_clear (x1);
+ mpfr_clear (x2);
+ mpfr_clear (xxxx);
+ break;
+ case CCF: case CFC:
+ mpfr_clear (x1);
+ mpc_clear (z2);
+ mpc_clear (z3);
+ mpc_clear (zzzz);
+ break;
+ case CC_C:
+ mpc_clear (z2);
+ mpc_clear (z3);
+ mpc_clear (z4);
+ mpc_clear (z5);
+ mpc_clear (zzzz);
+ mpc_clear (zzzz2);
+ break;
+ case CUUC:
+ case CCI: case CCS:
+ case CCU: case CUC:
+ case CC:
+ default:
+ mpc_clear (z2);
+ mpc_clear (z3);
+ mpc_clear (zzzz);
+ }
+}
diff --git a/mpc/tests/tget_version.c b/mpc/tests/tget_version.c
new file mode 100644
index 0000000000..2d42f3f848
--- /dev/null
+++ b/mpc/tests/tget_version.c
@@ -0,0 +1,62 @@
+/* tget_version -- Test file for mpc_get_version
+
+Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <string.h>
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+#ifdef __MPIR_VERSION
+ printf ("MPIR: include %d.%d.%d, lib %s\n",
+ __MPIR_VERSION, __MPIR_VERSION_MINOR, __MPIR_VERSION_PATCHLEVEL,
+ mpir_version);
+#else
+ printf ("GMP: include %d.%d.%d, lib %s\n",
+ __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, __GNU_MP_VERSION_PATCHLEVEL,
+ gmp_version);
+#endif
+ printf ("MPFR: include %s, lib %s\n",
+ MPFR_VERSION_STRING,
+ mpfr_get_version ());
+ printf ("MPC: include %s, lib %s\n", MPC_VERSION_STRING,
+ mpc_get_version ());
+
+ if (strcmp (mpc_get_version (), MPC_VERSION_STRING) != 0)
+ {
+ printf ("Error: header and library do not match\n"
+ "mpc_get_version: \"%s\"\nMPC_VERSION_STRING: \"%s\"\n",
+ mpc_get_version(), MPC_VERSION_STRING);
+ exit (1);
+ }
+
+#ifdef MPC_CC
+ printf ("C compiler: %s\n", MPC_CC);
+#endif
+#ifdef MPC_GCC
+ printf ("GCC: %s\n", MPC_GCC);
+#endif
+#ifdef MPC_GCC_VERSION
+ printf ("GCC version: %s\n", MPC_GCC_VERSION);
+#endif
+
+ return 0;
+}
diff --git a/mpc/tests/timag.c b/mpc/tests/timag.c
new file mode 100644
index 0000000000..47cf52c875
--- /dev/null
+++ b/mpc/tests/timag.c
@@ -0,0 +1,35 @@
+/* timag -- test file for mpc_imag.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (FC, f, mpc_imag);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 1, 4096);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tio_str.c b/mpc/tests/tio_str.c
new file mode 100644
index 0000000000..af5a6693e2
--- /dev/null
+++ b/mpc/tests/tio_str.c
@@ -0,0 +1,252 @@
+/* tio_str-- Test file for mpc_inp_str and mpc_out_str.
+
+Copyright (C) 2009, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+#ifdef HAVE_UNISTD_H
+#define _POSIX_C_SOURCE 1 /* apparently needed on Darwin */
+#include <unistd.h> /* for dup, dup2, STDIN_FILENO and STDOUT_FILENO */
+#else
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#endif
+
+extern unsigned long line_number;
+/* character appearing next in the file, may be EOF */
+extern int nextchar;
+extern const char *rnd_mode[];
+
+static void
+check_file (const char* file_name)
+{
+ FILE *fp;
+
+ int tmp;
+ int base;
+ int inex_re;
+ int inex_im;
+ mpc_t expected, got;
+ mpc_rnd_t rnd = MPC_RNDNN;
+ int inex = 0, expected_inex;
+ size_t expected_size, size;
+ known_signs_t ks = {1, 1};
+
+ fp = open_data_file (file_name);
+
+ mpc_init2 (expected, 53);
+ mpc_init2 (got, 53);
+
+ /* read data file */
+ line_number = 1;
+ nextchar = getc (fp);
+ skip_whitespace_comments (fp);
+
+ while (nextchar != EOF)
+ {
+ /* 1. read a line of data: expected result, base, rounding mode */
+ read_ternary (fp, &inex_re);
+ read_ternary (fp, &inex_im);
+ read_mpc (fp, expected, &ks);
+ if (inex_re == TERNARY_ERROR || inex_im == TERNARY_ERROR)
+ expected_inex = -1;
+ else
+ expected_inex = MPC_INEX (inex_re, inex_im);
+ read_int (fp, &tmp, "size");
+ expected_size = (size_t)tmp;
+ read_int (fp, &base, "base");
+ read_mpc_rounding_mode (fp, &rnd);
+
+ /* 2. read string at the same precision as the expected result */
+ while (nextchar != '"')
+ nextchar = getc (fp);
+ mpfr_set_prec (mpc_realref (got), MPC_PREC_RE (expected));
+ mpfr_set_prec (mpc_imagref (got), MPC_PREC_IM (expected));
+ inex = mpc_inp_str (got, fp, &size, base, rnd);
+
+ /* 3. compare this result with the expected one */
+ if (inex != expected_inex || !same_mpc_value (got, expected, ks)
+ || size != expected_size)
+ {
+ printf ("mpc_inp_str failed (line %lu) with rounding mode %s\n",
+ line_number, rnd_mode[rnd]);
+ if (inex != expected_inex)
+ printf(" got inexact value: %d\nexpected inexact value: %d\n",
+ inex, expected_inex);
+ if (size != expected_size)
+ printf (" got size: %lu\nexpected size: %lu\n ",
+ (unsigned long int) size, (unsigned long int) expected_size);
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+
+ while ((nextchar = getc (fp)) != '"');
+ nextchar = getc (fp);
+
+ skip_whitespace_comments (fp);
+ }
+
+ mpc_clear (expected);
+ mpc_clear (got);
+ close_data_file (fp);
+}
+
+static void
+check_io_str (mpc_ptr read_number, mpc_ptr expected)
+{
+ char tmp_file[] = "mpc_test";
+ FILE *fp;
+ size_t sz;
+
+ if (!(fp = fopen (tmp_file, "w")))
+ {
+ printf ("Error: Could not open file %s in write mode\n", tmp_file);
+ exit (1);
+ }
+
+ mpc_out_str (fp, 10, 0, expected, MPC_RNDNN);
+ fclose (fp);
+
+ if (!(fp = fopen (tmp_file, "r")))
+ {
+ printf ("Error: Could not open file %s in read mode\n", tmp_file);
+ exit (1);
+ };
+ if (mpc_inp_str (read_number, fp, &sz, 10, MPC_RNDNN) == -1)
+ {
+ printf ("Error: mpc_inp_str cannot correctly re-read number "
+ "in file %s\n", tmp_file);
+
+ exit (1);
+ }
+ fclose (fp);
+
+ /* mpc_cmp set erange flag when an operand is a NaN */
+ mpfr_clear_flags ();
+ if (mpc_cmp (read_number, expected) != 0 || mpfr_erangeflag_p())
+ {
+ printf ("Error: inp_str o out_str <> Id\n");
+ MPC_OUT (read_number);
+ MPC_OUT (expected);
+
+ exit (1);
+ }
+}
+
+#ifndef MPC_NO_STREAM_REDIRECTION
+/* test out_str with stream=NULL */
+static void
+check_stdout (mpc_ptr read_number, mpc_ptr expected)
+{
+ char tmp_file[] = "mpc_test";
+ int fd;
+ size_t sz;
+
+ fflush (stdout);
+ fd = dup (STDOUT_FILENO);
+ if (freopen (tmp_file, "w", stdout) == NULL)
+ {
+ printf ("mpc_inp_str cannot redirect stdout\n");
+ exit (1);
+ }
+ mpc_out_str (NULL, 2, 0, expected, MPC_RNDNN);
+ fflush (stdout);
+ dup2 (fd, STDOUT_FILENO);
+ close (fd);
+ clearerr (stdout);
+
+ fflush (stdin);
+ fd = dup (STDIN_FILENO);
+ if (freopen (tmp_file, "r", stdin) == NULL)
+ {
+ printf ("mpc_inp_str cannot redirect stdout\n");
+ exit (1);
+ }
+ if (mpc_inp_str (read_number, NULL, &sz, 2, MPC_RNDNN) == -1)
+ {
+ printf ("mpc_inp_str cannot correctly re-read number "
+ "in file %s\n", tmp_file);
+ exit (1);
+ }
+ mpfr_clear_flags (); /* mpc_cmp set erange flag when an operand is
+ a NaN */
+ if (mpc_cmp (read_number, expected) != 0 || mpfr_erangeflag_p())
+ {
+ printf ("mpc_inp_str did not read the number which was written by "
+ "mpc_out_str\n");
+ MPC_OUT (read_number);
+ MPC_OUT (expected);
+ exit (1);
+ }
+ fflush (stdin);
+ dup2 (fd, STDIN_FILENO);
+ close (fd);
+ clearerr (stdin);
+}
+#endif /* MPC_NO_STREAM_REDIRECTION */
+
+int
+main (void)
+{
+ mpc_t z, x;
+ mpfr_prec_t prec;
+
+ test_start ();
+
+ mpc_init2 (z, 1000);
+ mpc_init2 (x, 1000);
+
+ check_file ("inp_str.dat");
+
+ for (prec = 2; prec <= 1000; prec+=7)
+ {
+ mpc_set_prec (z, prec);
+ mpc_set_prec (x, prec);
+
+ mpc_set_si_si (x, 1, 1, MPC_RNDNN);
+ check_io_str (z, x);
+
+ mpc_set_si_si (x, -1, 1, MPC_RNDNN);
+ check_io_str (z, x);
+
+ mpfr_set_inf (mpc_realref(x), -1);
+ mpfr_set_inf (mpc_imagref(x), +1);
+ check_io_str (z, x);
+
+ test_default_random (x, -1024, 1024, 128, 25);
+ check_io_str (z, x);
+ }
+
+#ifndef MPC_NO_STREAM_REDIRECTION
+ mpc_set_si_si (x, 1, -4, MPC_RNDNN);
+ mpc_div_ui (x, x, 3, MPC_RNDDU);
+
+ check_stdout(z, x);
+#endif
+
+ mpc_clear (z);
+ mpc_clear (x);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tlog.c b/mpc/tests/tlog.c
new file mode 100644
index 0000000000..83f528dfdd
--- /dev/null
+++ b/mpc/tests/tlog.c
@@ -0,0 +1,37 @@
+/* tlog -- test file for mpc_log.
+
+Copyright (C) 2008, 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_log);
+
+ test_start ();
+
+ data_check (f, "log.dat");
+ tgeneric (f, 2, 512, 7, 128);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tlog10.c b/mpc/tests/tlog10.c
new file mode 100644
index 0000000000..5591b0622b
--- /dev/null
+++ b/mpc/tests/tlog10.c
@@ -0,0 +1,37 @@
+/* tlog10 -- test file for mpc_log10.
+
+Copyright (C) 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_log10);
+
+ test_start ();
+
+ data_check (f, "log10.dat");
+ tgeneric (f, 2, 512, 7, 128);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tmul.c b/mpc/tests/tmul.c
new file mode 100644
index 0000000000..46d3bb3244
--- /dev/null
+++ b/mpc/tests/tmul.c
@@ -0,0 +1,201 @@
+/* tmul -- test file for mpc_mul.
+
+Copyright (C) 2002, 2005, 2008, 2009, 2010, 2011, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#ifdef TIMING
+#include <sys/times.h>
+#endif
+#include "mpc-tests.h"
+
+static void
+cmpmul (mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
+ /* computes the product of x and y with the naive and Karatsuba methods */
+ /* using the rounding mode rnd and compares the results and return */
+ /* values. */
+ /* In our current test suite, the real and imaginary parts of x and y */
+ /* all have the same precision, and we use this precision also for the */
+ /* result. */
+{
+ mpc_t z, t;
+ int inex_z, inex_t;
+
+ mpc_init2 (z, MPC_MAX_PREC (x));
+ mpc_init2 (t, MPC_MAX_PREC (x));
+
+ inex_z = mpc_mul_naive (z, x, y, rnd);
+ inex_t = mpc_mul_karatsuba (t, x, y, rnd);
+
+ if (mpc_cmp (z, t) != 0 || inex_z != inex_t) {
+ fprintf (stderr, "mul_naive and mul_karatsuba differ for rnd=(%s,%s)\n",
+ mpfr_print_rnd_mode(MPC_RND_RE(rnd)),
+ mpfr_print_rnd_mode(MPC_RND_IM(rnd)));
+ MPC_OUT (x);
+ MPC_OUT (y);
+ MPC_OUT (z);
+ MPC_OUT (t);
+ if (inex_z != inex_t) {
+ fprintf (stderr, "inex_re (z): %s\n", MPC_INEX_STR (inex_z));
+ fprintf (stderr, "inex_re (t): %s\n", MPC_INEX_STR (inex_t));
+ }
+ exit (1);
+ }
+
+ mpc_clear (z);
+ mpc_clear (t);
+}
+
+
+static void
+testmul (long a, long b, long c, long d, mpfr_prec_t prec, mpc_rnd_t rnd)
+{
+ mpc_t x, y;
+
+ mpc_init2 (x, prec);
+ mpc_init2 (y, prec);
+
+ mpc_set_si_si (x, a, b, rnd);
+ mpc_set_si_si (y, c, d, rnd);
+
+ cmpmul (x, y, rnd);
+
+ mpc_clear (x);
+ mpc_clear (y);
+}
+
+
+static void
+check_regular (void)
+{
+ mpc_t x, y;
+ int rnd_re, rnd_im;
+ mpfr_prec_t prec;
+
+ testmul (247, -65, -223, 416, 8, 24);
+ testmul (5, -896, 5, -32, 3, 2);
+ testmul (-3, -512, -1, -1, 2, 16);
+ testmul (266013312, 121990769, 110585572, 116491059, 27, 0);
+ testmul (170, 9, 450, 251, 8, 0);
+ testmul (768, 85, 169, 440, 8, 16);
+ testmul (145, 1816, 848, 169, 8, 24);
+
+ mpc_init2 (x, 1000);
+ mpc_init2 (y, 1000);
+
+ /* Bug 20081114: mpc_mul_karatsuba returned wrong inexact value for
+ imaginary part */
+ mpc_set_prec (x, 7);
+ mpc_set_prec (y, 7);
+ mpfr_set_str (mpc_realref (x), "0xB4p+733", 16, GMP_RNDN);
+ mpfr_set_str (mpc_imagref (x), "0x90p+244", 16, GMP_RNDN);
+ mpfr_set_str (mpc_realref (y), "0xECp-146", 16, GMP_RNDN);
+ mpfr_set_str (mpc_imagref (y), "0xACp-471", 16, GMP_RNDN);
+ cmpmul (x, y, MPC_RNDNN);
+ mpfr_set_str (mpc_realref (x), "0xB4p+733", 16, GMP_RNDN);
+ mpfr_set_str (mpc_imagref (x), "0x90p+244", 16, GMP_RNDN);
+ mpfr_set_str (mpc_realref (y), "0xACp-471", 16, GMP_RNDN);
+ mpfr_set_str (mpc_imagref (y), "-0xECp-146", 16, GMP_RNDN);
+ cmpmul (x, y, MPC_RNDNN);
+
+ for (prec = 2; prec < 1000; prec = (mpfr_prec_t) (prec * 1.1 + 1))
+ {
+ mpc_set_prec (x, prec);
+ mpc_set_prec (y, prec);
+
+ test_default_random (x, -1024, 1024, 128, 0);
+ test_default_random (y, -1024, 1024, 128, 0);
+
+ for (rnd_re = 0; rnd_re < 4; rnd_re ++)
+ for (rnd_im = 0; rnd_im < 4; rnd_im ++)
+ cmpmul (x, y, MPC_RND (rnd_re, rnd_im));
+ }
+
+ mpc_clear (x);
+ mpc_clear (y);
+}
+
+
+#ifdef TIMING
+static void
+timemul (void)
+{
+ /* measures the time needed with different precisions for naive and */
+ /* Karatsuba multiplication */
+
+ mpc_t x, y, z;
+ unsigned long int i, j;
+ const unsigned long int tests = 10000;
+ struct tms time_old, time_new;
+ double passed1, passed2;
+
+ mpc_init (x);
+ mpc_init (y);
+ mpc_init_set_ui_ui (z, 1, 0, MPC_RNDNN);
+
+ for (i = 1; i < 50; i++)
+ {
+ mpc_set_prec (x, i * BITS_PER_MP_LIMB);
+ mpc_set_prec (y, i * BITS_PER_MP_LIMB);
+ mpc_set_prec (z, i * BITS_PER_MP_LIMB);
+ test_default_random (x, -1, 1, 128, 25);
+ test_default_random (y, -1, 1, 128, 25);
+
+ times (&time_old);
+ for (j = 0; j < tests; j++)
+ mpc_mul_naive (z, x, y, MPC_RNDNN);
+ times (&time_new);
+ passed1 = ((double) (time_new.tms_utime - time_old.tms_utime)) / 100;
+
+ times (&time_old);
+ for (j = 0; j < tests; j++)
+ mpc_mul_karatsuba (z, x, y, MPC_RNDNN);
+ times (&time_new);
+ passed2 = ((double) (time_new.tms_utime - time_old.tms_utime)) / 100;
+
+ printf ("Time for %3li limbs naive/Karatsuba: %5.2f %5.2f\n", i,
+ passed1, passed2);
+ }
+
+ mpc_clear (x);
+ mpc_clear (y);
+ mpc_clear (z);
+}
+#endif
+
+
+int
+main (void)
+{
+ DECL_FUNC (C_CC, f, mpc_mul);
+ f.properties = FUNC_PROP_SYMETRIC;
+
+ test_start ();
+
+#ifdef TIMING
+ timemul ();
+#endif
+
+ check_regular ();
+
+ data_check (f, "mul.dat");
+ tgeneric (f, 2, 4096, 41, 100);
+
+ test_end ();
+ return 0;
+}
diff --git a/mpc/tests/tmul_2si.c b/mpc/tests/tmul_2si.c
new file mode 100644
index 0000000000..bf86f18715
--- /dev/null
+++ b/mpc/tests/tmul_2si.c
@@ -0,0 +1,35 @@
+/* tmul_2si -- test file for mpc_mul_2si.
+
+Copyright (C) 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCS, f, mpc_mul_2si);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tmul_2ui.c b/mpc/tests/tmul_2ui.c
new file mode 100644
index 0000000000..97073db773
--- /dev/null
+++ b/mpc/tests/tmul_2ui.c
@@ -0,0 +1,35 @@
+/* tmul_2ui -- test file for mpc_mul_2ui.
+
+Copyright (C) 2008, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCU, f, mpc_mul_2ui);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tmul_fr.c b/mpc/tests/tmul_fr.c
new file mode 100644
index 0000000000..796ab28b55
--- /dev/null
+++ b/mpc/tests/tmul_fr.c
@@ -0,0 +1,36 @@
+/* tmul_fr -- test file for mpc_mul_fr.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCF, f, mpc_mul_fr);
+
+ test_start ();
+
+ data_check (f, "mul_fr.dat");
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tmul_i.c b/mpc/tests/tmul_i.c
new file mode 100644
index 0000000000..3cde4acf59
--- /dev/null
+++ b/mpc/tests/tmul_i.c
@@ -0,0 +1,96 @@
+/* tmul_i -- test file for mpc_mul_i.
+
+Copyright (C) 2008, 2009, 2010, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+check_different_precisions(void)
+{
+ /* check reuse when real and imaginary part have different precisions. */
+ mpc_t z, expected, got;
+ int res;
+
+ mpc_init2(z, 128);
+ mpc_init2(expected, 128);
+ mpc_init2(got, 128);
+
+ /* change precision of one part */
+ mpfr_set_prec (mpc_imagref (z), 32);
+ mpfr_set_prec (mpc_imagref (expected), 32);
+ mpfr_set_prec (mpc_imagref (got), 32);
+
+ mpfr_set_str (mpc_realref (z), "0x100000000fp-32", 16, GMP_RNDN);
+ mpfr_set_str (mpc_imagref (z), "-1", 2, GMP_RNDN);
+ mpfr_set_str (mpc_realref (expected), "+1", 2, GMP_RNDN);
+ mpfr_set_str (mpc_imagref (expected), "0x100000000fp-32", 16, GMP_RNDN);
+
+ mpc_set (got, z, MPC_RNDNN);
+ res = mpc_mul_i (got, got, +1, MPC_RNDNN);
+ if (MPC_INEX_RE(res) != 0 || MPC_INEX_IM(res) >=0)
+ {
+ printf("Wrong inexact flag for mpc_mul_i(z, z, n)\n"
+ " got (re=%2d, im=%2d)\nexpected (re= 0, im=-1)\n",
+ MPC_INEX_RE(res), MPC_INEX_IM(res));
+ exit(1);
+ }
+ if (mpc_cmp(got, expected) != 0)
+ {
+ printf ("Error for mpc_mul_i(z, z, n) for\n");
+ MPC_OUT (z);
+ printf ("n=+1\n");
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+
+ mpc_neg (expected, expected, MPC_RNDNN);
+ mpc_set (got, z, MPC_RNDNN);
+ mpc_mul_i (got, got, -1, MPC_RNDNN);
+ if (mpc_cmp(got, expected) != 0)
+ {
+ printf ("Error for mpc_mul_i(z, z, n) for\n");
+ MPC_OUT (z);
+ printf ("n=-1\n");
+ MPC_OUT (expected);
+ MPC_OUT (got);
+
+ exit (1);
+ }
+
+ mpc_clear (z);
+ mpc_clear (expected);
+ mpc_clear (got);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CCI, f, mpc_mul_i);
+
+ test_start ();
+
+ check_different_precisions ();
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tmul_si.c b/mpc/tests/tmul_si.c
new file mode 100644
index 0000000000..1d0e0d7ab6
--- /dev/null
+++ b/mpc/tests/tmul_si.c
@@ -0,0 +1,34 @@
+/* tmul_si -- test file for mpc_mul_si.
+
+Copyright (C) 2002, 2005, 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCS, f, mpc_mul_si);
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tmul_ui.c b/mpc/tests/tmul_ui.c
new file mode 100644
index 0000000000..e7f62f2600
--- /dev/null
+++ b/mpc/tests/tmul_ui.c
@@ -0,0 +1,35 @@
+/* tmul_ui -- test file for mpc_mul_ui.
+
+Copyright (C) 2002, 2005, 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCU, f, mpc_mul_ui);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tneg.c b/mpc/tests/tneg.c
new file mode 100644
index 0000000000..be1c90a85a
--- /dev/null
+++ b/mpc/tests/tneg.c
@@ -0,0 +1,35 @@
+/* tneg -- test file for mpc_neg.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_neg);
+ test_start ();
+
+ data_check (f, "neg.dat");
+ tgeneric (f, 2, 1024, 1, 0);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tnorm.c b/mpc/tests/tnorm.c
new file mode 100644
index 0000000000..3f4dccdcd0
--- /dev/null
+++ b/mpc/tests/tnorm.c
@@ -0,0 +1,110 @@
+/* tnorm -- test file for mpc_norm.
+
+Copyright (C) 2008, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+test_underflow (void)
+{
+ mpfr_exp_t emin = mpfr_get_emin ();
+ mpc_t z;
+ mpfr_t f;
+ int inex;
+
+ mpfr_set_emin (-1); /* smallest positive number is 0.5*2^emin = 0.25 */
+ mpc_init2 (z, 10);
+ mpfr_set_ui_2exp (mpc_realref (z), 1023, -11, GMP_RNDN); /* exact */
+ mpfr_set_ui_2exp (mpc_imagref (z), 1023, -11, GMP_RNDN); /* exact */
+ mpfr_init2 (f, 10);
+
+ inex = mpc_norm (f, z, GMP_RNDZ); /* should give 511/1024 */
+ if (inex >= 0)
+ {
+ printf ("Error in underflow case (1)\n");
+ printf ("expected inex < 0, got %d\n", inex);
+ exit (1);
+ }
+ if (mpfr_cmp_ui_2exp (f, 511, -10) != 0)
+ {
+ printf ("Error in underflow case (1)\n");
+ printf ("got ");
+ mpfr_dump (f);
+ printf ("expected ");
+ mpfr_set_ui_2exp (f, 511, -10, GMP_RNDZ);
+ mpfr_dump (f);
+ exit (1);
+ }
+
+ inex = mpc_norm (f, z, GMP_RNDN); /* should give 511/1024 */
+ if (inex >= 0)
+ {
+ printf ("Error in underflow case (2)\n");
+ printf ("expected inex < 0, got %d\n", inex);
+ exit (1);
+ }
+ if (mpfr_cmp_ui_2exp (f, 511, -10) != 0)
+ {
+ printf ("Error in underflow case (2)\n");
+ printf ("got ");
+ mpfr_dump (f);
+ printf ("expected ");
+ mpfr_set_ui_2exp (f, 511, -10, GMP_RNDZ);
+ mpfr_dump (f);
+ exit (1);
+ }
+
+ inex = mpc_norm (f, z, GMP_RNDU); /* should give 1023/2048 */
+ if (inex <= 0)
+ {
+ printf ("Error in underflow case (3)\n");
+ printf ("expected inex > 0, got %d\n", inex);
+ exit (1);
+ }
+ if (mpfr_cmp_ui_2exp (f, 1023, -11) != 0)
+ {
+ printf ("Error in underflow case (3)\n");
+ printf ("got ");
+ mpfr_dump (f);
+ printf ("expected ");
+ mpfr_set_ui_2exp (f, 1023, -11, GMP_RNDZ);
+ mpfr_dump (f);
+ exit (1);
+ }
+
+ mpc_clear (z);
+ mpfr_clear (f);
+ mpfr_set_emin (emin);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (FC, f, mpc_norm);
+
+ test_start ();
+
+ data_check (f, "norm.dat");
+ tgeneric (f, 2, 1024, 1, 4096);
+ test_underflow ();
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tpow.c b/mpc/tests/tpow.c
new file mode 100644
index 0000000000..3592209303
--- /dev/null
+++ b/mpc/tests/tpow.c
@@ -0,0 +1,71 @@
+/* tpow -- test file for mpc_pow.
+
+Copyright (C) 2009, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+reuse_bug (void)
+{
+ /* bug found by the automatic builds on
+ http://hydra.nixos.org/build/1469029/log/raw */
+ mpc_t x, y, z;
+ mp_prec_t prec = 2;
+
+ for (prec = 2; prec <= 20; prec ++)
+ {
+ mpc_init2 (x, prec);
+ mpc_init2 (y, prec);
+ mpc_init2 (z, prec);
+
+ mpfr_set_ui (mpc_realref (x), 0ul, GMP_RNDN);
+ mpfr_set_ui_2exp (mpc_imagref (x), 3ul, -2, GMP_RNDN);
+ mpc_set_ui (y, 8ul, MPC_RNDNN);
+
+ mpc_pow (z, x, y, MPC_RNDNN);
+ mpc_pow (y, x, y, MPC_RNDNN);
+ if (mpfr_signbit (mpc_imagref (y)) != mpfr_signbit (mpc_imagref (z)))
+ {
+ printf ("Error: regression, reuse_bug reproduced\n");
+ exit (1);
+ }
+
+ mpc_clear (x);
+ mpc_clear (y);
+ mpc_clear (z);
+ }
+}
+
+
+int
+main (void)
+{
+ DECL_FUNC (C_CC, f, mpc_pow);
+
+ test_start ();
+
+ reuse_bug ();
+
+ data_check (f, "pow.dat");
+ tgeneric (f, 2, 1024, 7, 10);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tpow_d.c b/mpc/tests/tpow_d.c
new file mode 100644
index 0000000000..22de27ed86
--- /dev/null
+++ b/mpc/tests/tpow_d.c
@@ -0,0 +1,61 @@
+/* tpow_d -- test file for mpc_pow_d.
+
+Copyright (C) 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ mpc_t z;
+
+ test_start ();
+
+ mpc_init2 (z, 11);
+
+ mpc_set_ui_ui (z, 2, 3, MPC_RNDNN);
+ mpc_pow_d (z, z, 3.0, MPC_RNDNN);
+ if (mpc_cmp_si_si (z, -46, 9) != 0)
+ {
+ printf ("Error for mpc_pow_d (1)\n");
+ exit (1);
+ }
+
+ mpc_set_si_si (z, -3, 4, MPC_RNDNN);
+ mpc_pow_d (z, z, 0.5, MPC_RNDNN);
+ if (mpc_cmp_si_si (z, 1, 2) != 0)
+ {
+ printf ("Error for mpc_pow_d (2)\n");
+ exit (1);
+ }
+
+ mpc_set_ui_ui (z, 2, 3, MPC_RNDNN);
+ mpc_pow_d (z, z, 6.0, MPC_RNDNN);
+ if (mpc_cmp_si_si (z, 2035, -828) != 0)
+ {
+ printf ("Error for mpc_pow_d (3)\n");
+ exit (1);
+ }
+
+ mpc_clear (z);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tpow_fr.c b/mpc/tests/tpow_fr.c
new file mode 100644
index 0000000000..47ef071292
--- /dev/null
+++ b/mpc/tests/tpow_fr.c
@@ -0,0 +1,63 @@
+/* tpow_fr -- test file for mpc_pow_fr.
+
+Copyright (C) 2009, 2011, 2012 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+test_reuse (void)
+{
+ mpc_t z;
+ mpfr_t y;
+ int inex;
+
+ mpfr_init2 (y, 2);
+ mpc_init2 (z, 2);
+ mpc_set_si_si (z, 0, -1, MPC_RNDNN);
+ mpfr_neg (mpc_realref (z), mpc_realref (z), GMP_RNDN);
+ mpc_div_2ui (z, z, 4, MPC_RNDNN);
+ mpfr_set_ui (y, 512, GMP_RNDN);
+ inex = mpc_pow_fr (z, z, y, MPC_RNDNN);
+ if (MPC_INEX_RE(inex) != 0 || MPC_INEX_IM(inex) != 0 ||
+ mpfr_cmp_ui_2exp (mpc_realref(z), 1, -2048) != 0 ||
+ mpfr_cmp_ui (mpc_imagref(z), 0) != 0 || mpfr_signbit (mpc_imagref(z)) == 0)
+ {
+ printf ("Error in test_reuse, wrong ternary value or output\n");
+ printf ("inex=(%d %d)\n", MPC_INEX_RE(inex), MPC_INEX_IM(inex));
+ printf ("z="); mpc_out_str (stdout, 2, 0, z, MPC_RNDNN); printf ("\n");
+ exit (1);
+ }
+ mpfr_clear (y);
+ mpc_clear (z);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CCF, f, mpc_pow_fr);
+ test_start ();
+
+ test_reuse ();
+ data_check (f, "pow_fr.dat");
+ tgeneric (f, 2, 1024, 7, 10);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tpow_ld.c b/mpc/tests/tpow_ld.c
new file mode 100644
index 0000000000..a02ea6ee90
--- /dev/null
+++ b/mpc/tests/tpow_ld.c
@@ -0,0 +1,43 @@
+/* tpow_ld -- test file for mpc_pow_ld.
+
+Copyright (C) 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ mpc_t z;
+
+ test_start ();
+
+ mpc_init2 (z, 5);
+ mpc_set_ui_ui (z, 3, 2, MPC_RNDNN);
+ mpc_pow_ld (z, z, (long double) 3.0, MPC_RNDNN);
+ if (mpc_cmp_si_si (z, -9, 46) != 0)
+ {
+ printf ("Error for mpc_pow_ld (1)\n");
+ exit (1);
+ }
+ mpc_clear (z);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tpow_si.c b/mpc/tests/tpow_si.c
new file mode 100644
index 0000000000..a3cbfb784d
--- /dev/null
+++ b/mpc/tests/tpow_si.c
@@ -0,0 +1,89 @@
+/* tpow_si -- test file for mpc_pow_si.
+
+Copyright (C) 2009, 2010, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <limits.h> /* for CHAR_BIT */
+#include "mpc-tests.h"
+
+static void
+compare_mpc_pow (mpfr_prec_t pmax, int iter, unsigned long nbits)
+ /* copied from tpow_ui.c and replaced unsigned by signed */
+{
+ mpfr_prec_t p;
+ mpc_t x, y, z, t;
+ long n;
+ int i, inex_pow, inex_pow_si;
+ mpc_rnd_t rnd;
+
+ mpc_init3 (y, sizeof (unsigned long) * CHAR_BIT, MPFR_PREC_MIN);
+ for (p = MPFR_PREC_MIN; p <= pmax; p++)
+ for (i = 0; i < iter; i++)
+ {
+ mpc_init2 (x, p);
+ mpc_init2 (z, p);
+ mpc_init2 (t, p);
+ mpc_urandom (x, rands);
+ n = (signed long) gmp_urandomb_ui (rands, nbits);
+ mpc_set_si (y, n, MPC_RNDNN);
+ for (rnd = 0; rnd < 16; rnd ++)
+ {
+ inex_pow = mpc_pow (z, x, y, rnd);
+ inex_pow_si = mpc_pow_si (t, x, n, rnd);
+ if (mpc_cmp (z, t) != 0)
+ {
+ printf ("mpc_pow and mpc_pow_si differ for x=");
+ mpc_out_str (stdout, 10, 0, x, MPC_RNDNN);
+ printf (" n=%li\n", n);
+ printf ("mpc_pow gives ");
+ mpc_out_str (stdout, 10, 0, z, MPC_RNDNN);
+ printf ("\nmpc_pow_si gives ");
+ mpc_out_str (stdout, 10, 0, t, MPC_RNDNN);
+ printf ("\n");
+ exit (1);
+ }
+ if (inex_pow != inex_pow_si)
+ {
+ printf ("mpc_pow and mpc_pow_si give different flags for x=");
+ mpc_out_str (stdout, 10, 0, x, MPC_RNDNN);
+ printf (" n=%li\n", n);
+ printf ("mpc_pow gives %d\n", inex_pow);
+ printf ("mpc_pow_si gives %d\n", inex_pow_si);
+ exit (1);
+ }
+ }
+ mpc_clear (x);
+ mpc_clear (z);
+ mpc_clear (t);
+ }
+ mpc_clear (y);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CCS, f, mpc_pow_si);
+ test_start ();
+ data_check (f, "pow_si.dat");
+
+ compare_mpc_pow (100, 5, 19);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tpow_ui.c b/mpc/tests/tpow_ui.c
new file mode 100644
index 0000000000..4e8cd31000
--- /dev/null
+++ b/mpc/tests/tpow_ui.c
@@ -0,0 +1,118 @@
+/* tpow_ui -- test file for mpc_pow_ui.
+
+Copyright (C) 2009, 2010 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <limits.h> /* for CHAR_BIT */
+#include "mpc-tests.h"
+
+static void
+compare_mpc_pow (mpfr_prec_t pmax, int iter, unsigned long nbits)
+{
+ mpfr_prec_t p;
+ mpc_t x, y, z, t;
+ unsigned long n;
+ int i, inex_pow, inex_pow_ui;
+ mpc_rnd_t rnd;
+
+ mpc_init3 (y, sizeof (unsigned long) * CHAR_BIT, MPFR_PREC_MIN);
+ for (p = MPFR_PREC_MIN; p <= pmax; p++)
+ for (i = 0; i < iter; i++)
+ {
+ mpc_init2 (x, p);
+ mpc_init2 (z, p);
+ mpc_init2 (t, p);
+ mpc_urandom (x, rands);
+ n = gmp_urandomb_ui (rands, nbits); /* 0 <= n < 2^nbits */
+ mpc_set_ui (y, n, MPC_RNDNN);
+ for (rnd = 0; rnd < 16; rnd ++)
+ {
+ inex_pow = mpc_pow (z, x, y, rnd);
+ inex_pow_ui = mpc_pow_ui (t, x, n, rnd);
+ if (mpc_cmp (z, t) != 0)
+ {
+ printf ("mpc_pow and mpc_pow_ui differ for x=");
+ mpc_out_str (stdout, 10, 0, x, MPC_RNDNN);
+ printf (" n=%lu\n", n);
+ printf ("mpc_pow gives ");
+ mpc_out_str (stdout, 10, 0, z, MPC_RNDNN);
+ printf ("\nmpc_pow_ui gives ");
+ mpc_out_str (stdout, 10, 0, t, MPC_RNDNN);
+ printf ("\n");
+ exit (1);
+ }
+ if (inex_pow != inex_pow_ui)
+ {
+ printf ("mpc_pow and mpc_pow_ui give different flags for x=");
+ mpc_out_str (stdout, 10, 0, x, MPC_RNDNN);
+ printf (" n=%lu\n", n);
+ printf ("mpc_pow gives %d\n", inex_pow);
+ printf ("mpc_pow_ui gives %d\n", inex_pow_ui);
+ exit (1);
+ }
+ }
+ mpc_clear (x);
+ mpc_clear (z);
+ mpc_clear (t);
+ }
+ mpc_clear (y);
+}
+
+int
+main (int argc, char *argv[])
+{
+ mpc_t z;
+
+ DECL_FUNC (CCU, f, mpc_pow_ui);
+
+ if (argc != 1)
+ {
+ mpfr_prec_t p;
+ long int n, k;
+ mpc_t res;
+ if (argc != 3 && argc != 4)
+ {
+ printf ("Usage: tpow_ui precision exponent [k]\n");
+ exit (1);
+ }
+ p = atoi (argv[1]);
+ n = atoi (argv[2]);
+ MPC_ASSERT (n >= 0);
+ k = (argc > 3) ? atoi (argv[3]) : 1;
+ MPC_ASSERT (k >= 0);
+ mpc_init2 (z, p);
+ mpc_init2 (res, p);
+ mpfr_const_pi (mpc_realref (z), GMP_RNDN);
+ mpfr_div_2exp (mpc_realref (z), mpc_realref (z), 2, GMP_RNDN);
+ mpfr_const_log2 (mpc_imagref (z), GMP_RNDN);
+ while (k--)
+ mpc_pow_ui (res, z, (unsigned long int) n, MPC_RNDNN);
+ mpc_clear (z);
+ mpc_clear (res);
+ return 0;
+ }
+
+ test_start ();
+ data_check (f, "pow_ui.dat");
+
+ compare_mpc_pow (100, 5, 19);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tpow_z.c b/mpc/tests/tpow_z.c
new file mode 100644
index 0000000000..2a897e6bee
--- /dev/null
+++ b/mpc/tests/tpow_z.c
@@ -0,0 +1,62 @@
+/* tpow_z -- test file for mpc_pow_z.
+
+Copyright (C) 2009, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <limits.h> /* for CHAR_BIT */
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ mpc_t z;
+ mpz_t t;
+
+ test_start ();
+
+ mpc_init2 (z, 5);
+ mpz_init_set_ui (t, 1ul);
+ mpc_set_ui_ui (z, 17ul, 42ul, MPC_RNDNN);
+ mpc_pow_z (z, z, t, MPC_RNDNN);
+ if (mpc_cmp_si_si (z, 17l, 42l) != 0) {
+ printf ("Error for mpc_pow_z (1)\n");
+ exit (1);
+ }
+ mpz_set_si (t, -1l);
+ mpc_set_ui_ui (z, 1ul, 1ul, MPC_RNDNN);
+ mpc_pow_z (z, z, t, MPC_RNDNN);
+ mpc_mul_ui (z, z, 2ul, MPC_RNDNN);
+ if (mpc_cmp_si_si (z, 1l, -1l) != 0) {
+ printf ("Error for mpc_pow_z (-1)\n");
+ exit (1);
+ }
+ mpz_set_ui (t, 1ul);
+ mpz_mul_2exp (t, t, sizeof (long) * CHAR_BIT);
+ mpc_set_ui_ui (z, 0ul, 1ul, MPC_RNDNN);
+ mpc_pow_z (z, z, t, MPC_RNDNN);
+ if (mpc_cmp_si_si (z, 1l, 0l) != 0) {
+ printf ("Error for mpc_pow_z (4*large)\n");
+ exit (1);
+ }
+ mpc_clear (z);
+ mpz_clear (t);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tprec.c b/mpc/tests/tprec.c
new file mode 100644
index 0000000000..18bba4e502
--- /dev/null
+++ b/mpc/tests/tprec.c
@@ -0,0 +1,69 @@
+/* tprec -- Test file for mpc_set_prec, mpc_get_prec and mpc_get_prec2.
+
+Copyright (C) 2009, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ mpc_t z;
+ mpfr_prec_t prec, pr, pi;
+
+ mpc_init2 (z, 1000);
+
+ for (prec = 2; prec <= 1000; prec++)
+ {
+ /* check set_prec/get_prec */
+ mpfr_set_prec (mpc_realref (z), prec);
+ mpfr_set_prec (mpc_imagref (z), prec + 1);
+ if (mpc_get_prec (z) != 0)
+ {
+ printf ("Error in mpc_get_prec for prec (re) = %lu, "
+ "prec (im) = %lu\n", (unsigned long int) prec,
+ (unsigned long int) prec + 1ul);
+
+ exit (1);
+ }
+
+ mpc_get_prec2 (&pr, &pi, z);
+ if (pr != prec || pi != prec + 1)
+ {
+ printf ("Error in mpc_get_prec2 for prec (re) = %lu, "
+ "prec (im) = %lu\n", (unsigned long int) prec,
+ (unsigned long int) prec + 1ul);
+
+ exit (1);
+ }
+
+ mpc_set_prec (z, prec);
+ if (mpc_get_prec (z) != prec)
+ {
+ printf ("Error in mpc_get_prec for prec = %lu\n",
+ (unsigned long int) prec);
+
+ exit (1);
+ }
+ }
+
+ mpc_clear (z);
+
+ return 0;
+}
diff --git a/mpc/tests/tproj.c b/mpc/tests/tproj.c
new file mode 100644
index 0000000000..222b697d98
--- /dev/null
+++ b/mpc/tests/tproj.c
@@ -0,0 +1,36 @@
+/* tproj -- test file for mpc_proj.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_proj);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 1, 4096);
+ data_check (f, "proj.dat");
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/treal.c b/mpc/tests/treal.c
new file mode 100644
index 0000000000..c3ab95fe46
--- /dev/null
+++ b/mpc/tests/treal.c
@@ -0,0 +1,35 @@
+/* treal -- test file for mpc_real.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (FC, f, mpc_real);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 1, 4096);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/treimref.c b/mpc/tests/treimref.c
new file mode 100644
index 0000000000..230d34c6df
--- /dev/null
+++ b/mpc/tests/treimref.c
@@ -0,0 +1,48 @@
+/* treimref -- test file for mpc_realref and mpc_imagref.
+
+Copyright (C) 2009 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ mpc_t z;
+
+ test_start ();
+ test_end ();
+
+ mpc_init2 (z, 6);
+ mpc_set_ui_ui (z, 17, 42, MPC_RNDNN);
+ mpfr_set_ui (mpc_realref (z), 18, GMP_RNDN);
+ if (mpfr_get_ui (mpc_realref (z), GMP_RNDN) != 18)
+ {
+ fprintf (stderr, "Error in mpfr_set_ui/mpc_realref\n");
+ exit (1);
+ }
+ mpfr_set_ui (mpc_imagref (z), 43, GMP_RNDN);
+ if (mpfr_get_ui (mpc_imagref (z), GMP_RNDN) != 43)
+ {
+ fprintf (stderr, "Error in mpfr_set_ui/mpc_imagref\n");
+ exit (1);
+ }
+ mpc_clear (z);
+
+ return 0;
+}
diff --git a/mpc/tests/tset.c b/mpc/tests/tset.c
new file mode 100644
index 0000000000..004943691b
--- /dev/null
+++ b/mpc/tests/tset.c
@@ -0,0 +1,447 @@
+/* tset -- Test file for mpc_set_x and mpc_set_x_x functions.
+
+Copyright (C) 2009, 2010, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "config.h"
+#include <limits.h> /* for LONG_MAX */
+
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h> /* for intmax_t */
+#else
+# ifdef HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+
+#ifdef HAVE_COMPLEX_H
+# include <complex.h>
+#endif
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#include "mpc-tests.h"
+
+#define PRINT_ERROR(function_name, precision, a) \
+ do { \
+ printf ("Error in "function_name" for prec = %lu\n", \
+ (unsigned long int) precision); \
+ MPC_OUT(a); \
+ exit (1); \
+ } while (0)
+
+/* test MPC_SET_X_Y through some functions */
+static int
+mpc_set_ui_fr (mpc_ptr z, unsigned long int a, mpfr_srcptr b, mpc_rnd_t rnd)
+ MPC_SET_X_Y (ui, fr, z, a, b, rnd)
+
+static int
+mpc_set_fr_ui (mpc_ptr z, mpfr_srcptr a, unsigned long int b, mpc_rnd_t rnd)
+ MPC_SET_X_Y (fr, ui, z, a, b, rnd)
+
+static int
+mpc_set_f_si (mpc_ptr z, mpf_t a, long int b, mpc_rnd_t rnd)
+ MPC_SET_X_Y (f, si, z, a, b, rnd)
+
+
+static void
+check_set (void)
+{
+ long int lo;
+ mpz_t mpz;
+ mpq_t mpq;
+ mpf_t mpf;
+ mpfr_t fr;
+ mpc_t x, z;
+ mpfr_prec_t prec;
+
+ mpz_init (mpz);
+ mpq_init (mpq);
+ mpf_init2 (mpf, 1000);
+ mpfr_init2 (fr, 1000);
+ mpc_init2 (x, 1000);
+ mpc_init2 (z, 1000);
+
+ mpz_set_ui (mpz, 0x4217);
+ mpq_set_si (mpq, -1, 0x4321);
+ mpf_set_q (mpf, mpq);
+
+ for (prec = 2; prec <= 1000; prec++)
+ {
+ unsigned long int u = (unsigned long int) prec;
+
+ mpc_set_prec (z, prec);
+ mpfr_set_prec (fr, prec);
+
+ lo = -prec;
+
+ mpfr_set_d (fr, 1.23456789, GMP_RNDN);
+
+ mpc_set_d (z, 1.23456789, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref(z), fr) != 0 || mpfr_cmp_si (mpc_imagref(z), 0) != 0)
+ PRINT_ERROR ("mpc_set_d", prec, z);
+
+#if defined HAVE_COMPLEX_H
+ mpc_set_dc (z, I*1.23456789+1.23456789, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref(z), fr) != 0 || mpfr_cmp (mpc_imagref(z), fr) != 0)
+ PRINT_ERROR ("mpc_set_c", prec, z);
+#endif
+
+ mpc_set_ui (z, u, MPC_RNDNN);
+ if (mpfr_cmp_ui (mpc_realref(z), u) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), 0) != 0)
+ PRINT_ERROR ("mpc_set_ui", prec, z);
+
+ mpc_set_d_d (z, 1.23456789, 1.23456789, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref(z), fr) != 0 || mpfr_cmp (mpc_imagref(z), fr) != 0)
+ PRINT_ERROR ("mpc_set_d_d", prec, z);
+
+ mpc_set_si (z, lo, MPC_RNDNN);
+ if (mpfr_cmp_si (mpc_realref(z), lo) != 0 || mpfr_cmp_ui (mpc_imagref(z), 0) != 0)
+ PRINT_ERROR ("mpc_set_si", prec, z);
+
+ mpfr_set_ld (fr, 1.23456789L, GMP_RNDN);
+
+ mpc_set_ld_ld (z, 1.23456789L, 1.23456789L, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref(z), fr) != 0 || mpfr_cmp (mpc_imagref(z), fr) != 0)
+ PRINT_ERROR ("mpc_set_ld_ld", prec, z);
+
+#if defined HAVE_COMPLEX_H
+ mpc_set_ldc (z, I*1.23456789L+1.23456789L, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref(z), fr) != 0 || mpfr_cmp (mpc_imagref(z), fr) != 0)
+ PRINT_ERROR ("mpc_set_lc", prec, z);
+#endif
+ mpc_set_ui_ui (z, u, u, MPC_RNDNN);
+ if (mpfr_cmp_ui (mpc_realref(z), u) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), u) != 0)
+ PRINT_ERROR ("mpc_set_ui_ui", prec, z);
+
+ mpc_set_ld (z, 1.23456789L, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), 0) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_ld", prec, z);
+
+ mpc_set_prec (x, prec);
+ mpfr_set_ui(fr, 1, GMP_RNDN);
+ mpfr_div_ui(fr, fr, 3, GMP_RNDN);
+ mpfr_set(mpc_realref(x), fr, GMP_RNDN);
+ mpfr_set(mpc_imagref(x), fr, GMP_RNDN);
+
+ mpc_set (z, x, MPC_RNDNN);
+ mpfr_clear_flags (); /* mpc_cmp set erange flag when an operand is a
+ NaN */
+ if (mpc_cmp (z, x) != 0 || mpfr_erangeflag_p())
+ {
+ printf ("Error in mpc_set for prec = %lu\n",
+ (unsigned long int) prec);
+ MPC_OUT(z);
+ MPC_OUT(x);
+ exit (1);
+ }
+
+ mpc_set_si_si (z, lo, lo, MPC_RNDNN);
+ if (mpfr_cmp_si (mpc_realref(z), lo) != 0
+ || mpfr_cmp_si (mpc_imagref(z), lo) != 0)
+ PRINT_ERROR ("mpc_set_si_si", prec, z);
+
+ mpc_set_fr (z, fr, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), 0) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_fr", prec, z);
+
+ mpfr_set_z (fr, mpz, GMP_RNDN);
+ mpc_set_z_z (z, mpz, mpz, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp (mpc_imagref(z), fr) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_z_z", prec, z);
+
+ mpc_set_fr_fr (z, fr, fr, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp (mpc_imagref(z), fr) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_fr_fr", prec, z);
+
+ mpc_set_z (z, mpz, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), 0) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_z", prec, z);
+
+ mpfr_set_q (fr, mpq, GMP_RNDN);
+ mpc_set_q_q (z, mpq, mpq, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp (mpc_imagref(z), fr) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_q_q", prec, z);
+
+ mpc_set_ui_fr (z, u, fr, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp_ui (mpc_realref (z), u) != 0
+ || mpfr_cmp (mpc_imagref (z), fr) != 0
+ || mpfr_erangeflag_p ())
+ PRINT_ERROR ("mpc_set_ui_fr", prec, z);
+
+ mpc_set_fr_ui (z, fr, u, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref (z), fr) != 0
+ || mpfr_cmp_ui (mpc_imagref (z), u) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_fr_ui", prec, z);
+
+ mpc_set_q (z, mpq, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), 0) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_q", prec, z);
+
+ mpfr_set_f (fr, mpf, GMP_RNDN);
+ mpc_set_f_f (z, mpf, mpf, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp (mpc_imagref(z), fr) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_f_f", prec, z);
+
+ mpc_set_f (z, mpf, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref(z), fr) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), 0) != 0
+ || mpfr_erangeflag_p())
+ PRINT_ERROR ("mpc_set_f", prec, z);
+
+ mpc_set_f_si (z, mpf, lo, MPC_RNDNN);
+ mpfr_clear_flags ();
+ if (mpfr_cmp (mpc_realref (z), fr) != 0
+ || mpfr_cmp_si (mpc_imagref (z), lo) != 0
+ || mpfr_erangeflag_p ())
+ PRINT_ERROR ("mpc_set_f", prec, z);
+
+ mpc_set_nan (z);
+ if (!mpfr_nan_p (mpc_realref(z)) || !mpfr_nan_p (mpc_imagref(z)))
+ PRINT_ERROR ("mpc_set_nan", prec, z);
+
+#ifdef _MPC_H_HAVE_INTMAX_T
+ {
+ uintmax_t uim = (uintmax_t) prec;
+ intmax_t im = (intmax_t) prec;
+
+ mpc_set_uj (z, uim, MPC_RNDNN);
+ if (mpfr_cmp_ui (mpc_realref(z), u) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), 0) != 0)
+ PRINT_ERROR ("mpc_set_uj", prec, z);
+
+ mpc_set_sj (z, im, MPC_RNDNN);
+ if (mpfr_cmp_ui (mpc_realref(z), u) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), 0) != 0)
+ PRINT_ERROR ("mpc_set_sj (1)", prec, z);
+
+ mpc_set_uj_uj (z, uim, uim, MPC_RNDNN);
+ if (mpfr_cmp_ui (mpc_realref(z), u) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), u) != 0)
+ PRINT_ERROR ("mpc_set_uj_uj", prec, z);
+
+ mpc_set_sj_sj (z, im, im, MPC_RNDNN);
+ if (mpfr_cmp_ui (mpc_realref(z), u) != 0
+ || mpfr_cmp_ui (mpc_imagref(z), u) != 0)
+ PRINT_ERROR ("mpc_set_sj_sj (1)", prec, z);
+
+ im = LONG_MAX;
+ if (sizeof (intmax_t) == 2 * sizeof (unsigned long))
+ im = 2 * im * im + 4 * im + 1; /* gives 2^(2n-1)-1 from 2^(n-1)-1 */
+
+ mpc_set_sj (z, im, MPC_RNDNN);
+ if (mpfr_get_sj (mpc_realref(z), GMP_RNDN) != im ||
+ mpfr_cmp_ui (mpc_imagref(z), 0) != 0)
+ PRINT_ERROR ("mpc_set_sj (2)", im, z);
+
+ mpc_set_sj_sj (z, im, im, MPC_RNDNN);
+ if (mpfr_get_sj (mpc_realref(z), GMP_RNDN) != im ||
+ mpfr_get_sj (mpc_imagref(z), GMP_RNDN) != im)
+ PRINT_ERROR ("mpc_set_sj_sj (2)", im, z);
+ }
+#endif /* _MPC_H_HAVE_INTMAX_T */
+
+#if defined HAVE_COMPLEX_H
+ {
+ double _Complex c = 1.0 - 2.0*I, d;
+ long double _Complex lc = c, ld;
+
+ mpc_set_dc (z, c, MPC_RNDNN);
+ if ((d = mpc_get_dc (z, MPC_RNDNN)) != c)
+ {
+ printf ("expected (%f,%f)\n", creal (c), cimag (c));
+ printf ("got (%f,%f)\n", creal (d), cimag (d));
+ PRINT_ERROR ("mpc_get_dc", prec, z);
+ }
+ mpc_set_ldc (z, lc, MPC_RNDNN);
+ if ((ld = mpc_get_ldc (z, MPC_RNDNN)) != lc)
+ {
+ printf ("expected (%Lf,%Lf)\n", creall (lc), cimagl (lc));
+ printf ("got (%Lf,%Lf)\n", creall (ld), cimagl (ld));
+ PRINT_ERROR ("mpc_get_ldc", prec, z);
+ }
+ }
+#endif
+ }
+
+ mpz_clear (mpz);
+ mpq_clear (mpq);
+ mpf_clear (mpf);
+ mpfr_clear (fr);
+ mpc_clear (x);
+ mpc_clear (z);
+}
+
+static void
+check_set_str (mpfr_exp_t exp_max)
+{
+ mpc_t expected;
+ mpc_t got;
+ char *str;
+
+ mpfr_prec_t prec;
+ mpfr_exp_t exp_min;
+ int base;
+
+ mpc_init2 (expected, 1024);
+ mpc_init2 (got, 1024);
+
+ exp_min = mpfr_get_emin ();
+ if (exp_max <= 0)
+ exp_max = mpfr_get_emax ();
+ else if (exp_max > mpfr_get_emax ())
+ exp_max = mpfr_get_emax();
+ if (-exp_max > exp_min)
+ exp_min = - exp_max;
+
+ for (prec = 2; prec < 1024; prec += 7)
+ {
+ mpc_set_prec (got, prec);
+ mpc_set_prec (expected, prec);
+
+ base = 2 + (int) gmp_urandomm_ui (rands, 35);
+ /* uses external variable rands from random.c */
+
+ mpfr_set_nan (mpc_realref (expected));
+ mpfr_set_inf (mpc_imagref (expected), prec % 2 - 1);
+ str = mpc_get_str (base, 0, expected, MPC_RNDNN);
+ if (mpfr_nan_p (mpc_realref (got)) == 0
+ || mpfr_cmp (mpc_imagref (got), mpc_imagref (expected)) != 0)
+ {
+ printf ("Error: mpc_set_str o mpc_get_str != Id\n"
+ "in base %u with str=\"%s\"\n", base, str);
+ MPC_OUT (expected);
+ printf (" ");
+ MPC_OUT (got);
+ exit (1);
+ }
+ mpc_free_str (str);
+
+ test_default_random (expected, exp_min, exp_max, 128, 25);
+ str = mpc_get_str (base, 0, expected, MPC_RNDNN);
+ if (mpc_set_str (got, str, base, MPC_RNDNN) == -1
+ || mpc_cmp (got, expected) != 0)
+ {
+ printf ("Error: mpc_set_str o mpc_get_str != Id\n"
+ "in base %u with str=\"%s\"\n", base, str);
+ MPC_OUT (expected);
+ printf (" ");
+ MPC_OUT (got);
+ exit (1);
+ }
+ mpc_free_str (str);
+ }
+
+#ifdef HAVE_SETLOCALE
+ {
+ /* Check with ',' as a decimal point */
+ char *old_locale;
+
+ old_locale = setlocale (LC_ALL, "de_DE");
+ if (old_locale != NULL)
+ {
+ str = mpc_get_str (10, 0, expected, MPC_RNDNN);
+ if (mpc_set_str (got, str, 10, MPC_RNDNN) == -1
+ || mpc_cmp (got, expected) != 0)
+ {
+ printf ("Error: mpc_set_str o mpc_get_str != Id\n"
+ "with str=\"%s\"\n", str);
+ MPC_OUT (expected);
+ printf (" ");
+ MPC_OUT (got);
+ exit (1);
+ }
+ mpc_free_str (str);
+
+ setlocale (LC_ALL, old_locale);
+ }
+ }
+#endif /* HAVE_SETLOCALE */
+
+ /* the real part has a zero exponent in base ten (fixed in r439) */
+ mpc_set_prec (expected, 37);
+ mpc_set_prec (got, 37);
+ mpc_set_str (expected, "921FC04EDp-35 ", 16, GMP_RNDN);
+ str = mpc_get_str (10, 0, expected, MPC_RNDNN);
+ if (mpc_set_str (got, str, 10, MPC_RNDNN) == -1
+ || mpc_cmp (got, expected) != 0)
+ {
+ printf ("Error: mpc_set_str o mpc_get_str != Id\n"
+ "with str=\"%s\"\n", str);
+ MPC_OUT (expected);
+ printf (" ");
+ MPC_OUT (got);
+ exit (1);
+ }
+ mpc_free_str (str);
+
+ str = mpc_get_str (1, 0, expected, MPC_RNDNN);
+ if (str != NULL)
+ {
+ printf ("Error: mpc_get_str with base==1 should fail\n");
+ exit (1);
+ }
+
+ mpc_clear (expected);
+ mpc_clear (got);
+}
+
+int
+main (void)
+{
+ test_start ();
+
+ check_set ();
+ check_set_str (1024);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tsin.c b/mpc/tests/tsin.c
new file mode 100644
index 0000000000..3b09c78dfe
--- /dev/null
+++ b/mpc/tests/tsin.c
@@ -0,0 +1,36 @@
+/* tsin -- test file for mpc_sin.
+
+Copyright (C) 2007, 2008, 2010 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_sin);
+
+ test_start ();
+
+ data_check (f, "sin.dat");
+ tgeneric (f, 2, 512, 7, 7);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tsin_cos.c b/mpc/tests/tsin_cos.c
new file mode 100644
index 0000000000..a1e74241df
--- /dev/null
+++ b/mpc/tests/tsin_cos.c
@@ -0,0 +1,35 @@
+/* tsin_cos -- test file for mpc_sin_cos.
+
+Copyright (C) 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC_C, f, mpc_sin_cos);
+
+ test_start ();
+
+ tgeneric (f, 2, 512, 13, 7);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tsinh.c b/mpc/tests/tsinh.c
new file mode 100644
index 0000000000..c12f0367e7
--- /dev/null
+++ b/mpc/tests/tsinh.c
@@ -0,0 +1,36 @@
+/* tsinh -- test file for mpc_sinh.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_sinh);
+
+ test_start ();
+
+ data_check (f, "sinh.dat");
+ tgeneric (f, 2, 512, 7, 7);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tsqr.c b/mpc/tests/tsqr.c
new file mode 100644
index 0000000000..02fea7ed50
--- /dev/null
+++ b/mpc/tests/tsqr.c
@@ -0,0 +1,191 @@
+/* tsqr -- test file for mpc_sqr.
+
+Copyright (C) 2002, 2005, 2008, 2010, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+static void
+cmpsqr (mpc_srcptr x, mpc_rnd_t rnd)
+ /* computes the square of x with the specific function or by simple */
+ /* multiplication using the rounding mode rnd and compares the results */
+ /* and return values. */
+ /* In our current test suite, the real and imaginary parts of x have */
+ /* the same precision, and we use this precision also for the result. */
+ /* Furthermore, we check whether computing the square in the same */
+ /* place yields the same result. */
+ /* We also compute the result with four times the precision and check */
+ /* whether the rounding is correct. Error reports in this part of the */
+ /* algorithm might still be wrong, though, since there are two */
+ /* consecutive roundings. */
+{
+ mpc_t z, t, u;
+ int inexact_z, inexact_t;
+
+ mpc_init2 (z, MPC_MAX_PREC (x));
+ mpc_init2 (t, MPC_MAX_PREC (x));
+ mpc_init2 (u, 4 * MPC_MAX_PREC (x));
+
+ inexact_z = mpc_sqr (z, x, rnd);
+ inexact_t = mpc_mul (t, x, x, rnd);
+
+ if (mpc_cmp (z, t))
+ {
+ fprintf (stderr, "sqr and mul differ for rnd=(%s,%s) \nx=",
+ mpfr_print_rnd_mode(MPC_RND_RE(rnd)),
+ mpfr_print_rnd_mode(MPC_RND_IM(rnd)));
+ mpc_out_str (stderr, 2, 0, x, MPC_RNDNN);
+ fprintf (stderr, "\nmpc_sqr gives ");
+ mpc_out_str (stderr, 2, 0, z, MPC_RNDNN);
+ fprintf (stderr, "\nmpc_mul gives ");
+ mpc_out_str (stderr, 2, 0, t, MPC_RNDNN);
+ fprintf (stderr, "\n");
+ exit (1);
+ }
+ if (inexact_z != inexact_t)
+ {
+ fprintf (stderr, "The return values of sqr and mul differ for rnd=(%s,%s) \nx= ",
+ mpfr_print_rnd_mode(MPC_RND_RE(rnd)),
+ mpfr_print_rnd_mode(MPC_RND_IM(rnd)));
+ mpc_out_str (stderr, 2, 0, x, MPC_RNDNN);
+ fprintf (stderr, "\nx^2=");
+ mpc_out_str (stderr, 2, 0, z, MPC_RNDNN);
+ fprintf (stderr, "\nmpc_sqr gives %i", inexact_z);
+ fprintf (stderr, "\nmpc_mul gives %i", inexact_t);
+ fprintf (stderr, "\n");
+ exit (1);
+ }
+
+ mpc_set (t, x, MPC_RNDNN);
+ inexact_t = mpc_sqr (t, t, rnd);
+ if (mpc_cmp (z, t))
+ {
+ fprintf (stderr, "sqr and sqr in place differ for rnd=(%s,%s) \nx=",
+ mpfr_print_rnd_mode(MPC_RND_RE(rnd)),
+ mpfr_print_rnd_mode(MPC_RND_IM(rnd)));
+ mpc_out_str (stderr, 2, 0, x, MPC_RNDNN);
+ fprintf (stderr, "\nmpc_sqr gives ");
+ mpc_out_str (stderr, 2, 0, z, MPC_RNDNN);
+ fprintf (stderr, "\nmpc_sqr in place gives ");
+ mpc_out_str (stderr, 2, 0, t, MPC_RNDNN);
+ fprintf (stderr, "\n");
+ exit (1);
+ }
+ if (inexact_z != inexact_t)
+ {
+ fprintf (stderr, "The return values of sqr and sqr in place differ for rnd=(%s,%s) \nx= ",
+ mpfr_print_rnd_mode(MPC_RND_RE(rnd)),
+ mpfr_print_rnd_mode(MPC_RND_IM(rnd)));
+ mpc_out_str (stderr, 2, 0, x, MPC_RNDNN);
+ fprintf (stderr, "\nx^2=");
+ mpc_out_str (stderr, 2, 0, z, MPC_RNDNN);
+ fprintf (stderr, "\nmpc_sqr gives %i", inexact_z);
+ fprintf (stderr, "\nmpc_sqr in place gives %i", inexact_t);
+ fprintf (stderr, "\n");
+ exit (1);
+ }
+
+ mpc_sqr (u, x, rnd);
+ mpc_set (t, u, rnd);
+ if (mpc_cmp (z, t))
+ {
+ fprintf (stderr, "rounding in sqr might be incorrect for rnd=(%s,%s) \nx=",
+ mpfr_print_rnd_mode(MPC_RND_RE(rnd)),
+ mpfr_print_rnd_mode(MPC_RND_IM(rnd)));
+ mpc_out_str (stderr, 2, 0, x, MPC_RNDNN);
+ fprintf (stderr, "\nmpc_sqr gives ");
+ mpc_out_str (stderr, 2, 0, z, MPC_RNDNN);
+ fprintf (stderr, "\nmpc_sqr quadruple precision gives ");
+ mpc_out_str (stderr, 2, 0, u, MPC_RNDNN);
+ fprintf (stderr, "\nand is rounded to ");
+ mpc_out_str (stderr, 2, 0, t, MPC_RNDNN);
+ fprintf (stderr, "\n");
+ exit (1);
+ }
+
+ mpc_clear (z);
+ mpc_clear (t);
+ mpc_clear (u);
+}
+
+
+static void
+testsqr (long a, long b, mpfr_prec_t prec, mpc_rnd_t rnd)
+{
+ mpc_t x;
+
+ mpc_init2 (x, prec);
+
+ mpc_set_si_si (x, a, b, rnd);
+
+ cmpsqr (x, rnd);
+
+ mpc_clear (x);
+}
+
+
+static void
+reuse_bug (void)
+{
+ mpc_t z1;
+
+ /* reuse bug found by Paul Zimmermann 20081021 */
+ mpc_init2 (z1, 2);
+ /* RE (z1^2) overflows, IM(z^2) = -0 */
+ mpfr_set_str (mpc_realref (z1), "0.11", 2, GMP_RNDN);
+ mpfr_mul_2si (mpc_realref (z1), mpc_realref (z1), mpfr_get_emax (), GMP_RNDN);
+ mpfr_set_ui (mpc_imagref (z1), 0, GMP_RNDN);
+ mpc_conj (z1, z1, MPC_RNDNN);
+ mpc_sqr (z1, z1, MPC_RNDNN);
+ if (!mpfr_inf_p (mpc_realref (z1)) || mpfr_signbit (mpc_realref (z1))
+ ||!mpfr_zero_p (mpc_imagref (z1)) || !mpfr_signbit (mpc_imagref (z1)))
+ {
+ printf ("Error: Regression, bug 20081021 reproduced\n");
+ MPC_OUT (z1);
+ exit (1);
+ }
+
+ mpc_clear (z1);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_sqr);
+ test_start ();
+
+ testsqr (247, -65, 8, 24);
+ testsqr (5, -896, 3, 2);
+ testsqr (-3, -512, 2, 16);
+ testsqr (266013312, 121990769, 27, 0);
+ testsqr (170, 9, 8, 0);
+ testsqr (768, 85, 8, 16);
+ testsqr (145, 1816, 8, 24);
+ testsqr (0, 1816, 8, 24);
+ testsqr (145, 0, 8, 24);
+
+ data_check (f, "sqr.dat");
+ tgeneric (f, 2, 1024, 1, 0);
+
+ reuse_bug ();
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tsqrt.c b/mpc/tests/tsqrt.c
new file mode 100644
index 0000000000..2da6842add
--- /dev/null
+++ b/mpc/tests/tsqrt.c
@@ -0,0 +1,36 @@
+/* tsqrt -- test file for mpc_sqrt.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_sqrt);
+
+ test_start ();
+
+ data_check (f, "sqrt.dat");
+ tgeneric (f, 2, 1024, 7, 256);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tstrtoc.c b/mpc/tests/tstrtoc.c
new file mode 100644
index 0000000000..77e34ee350
--- /dev/null
+++ b/mpc/tests/tstrtoc.c
@@ -0,0 +1,166 @@
+/* tstrtoc -- test file for mpc_strtoc.
+
+Copyright (C) 2009, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "mpc-tests.h"
+
+extern unsigned long line_number;
+extern int nextchar;
+extern char *pathname;
+
+/* names of rounding modes */
+extern const char *rnd_mode[];
+
+static void
+check_file (const char* file_name)
+{
+ FILE *fp;
+ unsigned long test_line_number;
+
+ size_t str_len = 255;
+ char *str = NULL;
+ size_t rstr_len = 255;
+ char *rstr = NULL;
+ char *end = NULL;
+
+ int base;
+ int inex_re;
+ int inex_im;
+ mpc_t expected, got;
+ mpc_rnd_t rnd = MPC_RNDNN;
+ int inex = 0, inex_expected;
+ known_signs_t ks = {1, 1};
+
+
+ fp = open_data_file (file_name);
+
+ /* initializations */
+ str = (char *) malloc (str_len);
+ if (str == NULL)
+ {
+ printf ("Cannot allocate memory\n");
+ exit (1);
+ }
+ rstr = (char *) malloc (rstr_len);
+ if (rstr == NULL)
+ {
+ printf ("Cannot allocate memory\n");
+ exit (1);
+ }
+ mpc_init2 (expected, 53);
+ mpc_init2 (got, 53);
+
+ /* read data file */
+ line_number = 1;
+ nextchar = getc (fp);
+ while (nextchar != EOF)
+ {
+ skip_whitespace_comments (fp);
+
+ /* 1. read a line of data: expected result, base, rounding mode */
+ test_line_number = line_number;
+ read_ternary (fp, &inex_re);
+ read_ternary (fp, &inex_im);
+ read_mpc (fp, expected, NULL);
+ if (inex_re == TERNARY_ERROR || inex_im == TERNARY_ERROR)
+ inex_expected = -1;
+ else
+ inex_expected = MPC_INEX (inex_re, inex_im);
+
+ str_len = read_string (fp, &str, str_len, "number string");
+ rstr_len = read_string (fp, &rstr, rstr_len, "string remainder");
+ read_int (fp, &base, "base");
+ read_mpc_rounding_mode (fp, &rnd);
+
+ /* 2. convert string at the same precision as the expected result */
+ mpfr_set_prec (mpc_realref (got), MPC_PREC_RE (expected));
+ mpfr_set_prec (mpc_imagref (got), MPC_PREC_IM (expected));
+ inex = mpc_strtoc (got, str, &end, base, rnd);
+
+ /* 3. compare this result with the expected one */
+ if (inex != inex_expected
+ || !same_mpc_value (got, expected, ks)
+ || strcmp (end, rstr) != 0)
+ {
+ printf ("mpc_strtoc(str) failed (line %lu)\nwith base=%d and "
+ "rounding mode %s\n", test_line_number, base,
+ rnd_mode[rnd]);
+ if (inex != MPC_INEX (inex_re, inex_im))
+ printf ("ternary value: got %s, expected (%s, %s)\n",
+ MPC_INEX_STR (inex),
+ (inex_re == +1 ? "+1" : (inex_re == -1 ? "-1" : "0")),
+ (inex_im == +1 ? "+1" : (inex_im == -1 ? "-1" : "0")));
+ printf ("str = \"%s\"\n", str);
+ if (strcmp (end, rstr) != 0)
+ printf ("string remainder expected \"%s\"\n"
+ " got \"%s\"\n",
+ rstr, end);
+ else
+ {
+ printf (" ");
+ MPC_OUT (got);
+ MPC_OUT (expected);
+ }
+ exit (1);
+ }
+
+ end = NULL;
+ }
+
+ mpc_clear (expected);
+ mpc_clear (got);
+ if (str != NULL)
+ free (str);
+ if (rstr != NULL)
+ free (rstr);
+ close_data_file (fp);
+}
+
+static void
+check_null (void)
+{
+ int inex;
+ char *end;
+ mpc_t z;
+
+ mpc_init2 (z, 53);
+
+ inex = mpc_strtoc (z, NULL, &end, 10, MPC_RNDNN);
+ if (end != NULL || inex != -1 || mpfr_nan_p (mpc_realref (z)) == 0
+ || mpfr_nan_p (mpc_imagref (z)) == 0)
+ {
+ printf ("Error: mpc_strtoc(z, NULL) with a NULL pointer should fail"
+ " and the z value should be set to NaN +I*NaN\ngot ");
+ MPC_OUT (z);
+ exit (1);
+ }
+
+ mpc_clear (z);
+}
+
+int
+main (void)
+{
+ check_null ();
+ check_file ("strtoc.dat");
+ return 0;
+}
diff --git a/mpc/tests/tsub.c b/mpc/tests/tsub.c
new file mode 100644
index 0000000000..658c81e2db
--- /dev/null
+++ b/mpc/tests/tsub.c
@@ -0,0 +1,36 @@
+/* tsub -- test file for mpc_sub.
+
+Copyright (C) 2008, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (C_CC, f, mpc_sub);
+
+ test_start ();
+
+ data_check (f, "sub.dat");
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tsub_fr.c b/mpc/tests/tsub_fr.c
new file mode 100644
index 0000000000..495fdeea75
--- /dev/null
+++ b/mpc/tests/tsub_fr.c
@@ -0,0 +1,36 @@
+/* tsub_fr -- test file for mpc_sub_fr.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCF, f, mpc_sub_fr);
+
+ test_start ();
+
+ data_check (f, "sub_fr.dat");
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tsub_ui.c b/mpc/tests/tsub_ui.c
new file mode 100644
index 0000000000..567ead5747
--- /dev/null
+++ b/mpc/tests/tsub_ui.c
@@ -0,0 +1,35 @@
+/* tsub_ui -- test file for mpc_sub_ui.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CCU, f, mpc_sub_ui);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tswap.c b/mpc/tests/tswap.c
new file mode 100644
index 0000000000..948c7f7e3e
--- /dev/null
+++ b/mpc/tests/tswap.c
@@ -0,0 +1,54 @@
+/* tswap -- Test file for mpc_swap.
+
+Copyright (C) 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ mpc_t x, y, x2, y2;
+
+ mpc_init2 (x, 50);
+ mpc_init2 (x2, 50);
+ mpc_init2 (y, 100);
+ mpc_init2 (y2, 100);
+
+ mpc_set_ui_ui (x, 1ul, 2ul, MPC_RNDNN);
+ mpc_set_ui_ui (x2, 1ul, 2ul, MPC_RNDNN);
+ mpc_set_ui_ui (y, 3ul, 4ul, MPC_RNDNN);
+ mpc_set_ui_ui (y2, 3ul, 4ul, MPC_RNDNN);
+
+ mpc_swap (x, y);
+
+ if ( mpfr_get_prec (mpc_realref (x)) != mpfr_get_prec (mpc_realref (y2))
+ || mpfr_get_prec (mpc_imagref (x)) != mpfr_get_prec (mpc_imagref (y2))
+ || mpfr_get_prec (mpc_realref (y)) != mpfr_get_prec (mpc_realref (x2))
+ || mpfr_get_prec (mpc_imagref (y)) != mpfr_get_prec (mpc_imagref (x2))
+ || mpc_cmp (x, y2) != 0
+ || mpc_cmp (y, x2) != 0)
+ exit (1);
+
+ mpc_clear (x);
+ mpc_clear (x2);
+ mpc_clear (y);
+ mpc_clear (y2);
+
+ return 0;
+}
diff --git a/mpc/tests/ttan.c b/mpc/tests/ttan.c
new file mode 100644
index 0000000000..f1d826a233
--- /dev/null
+++ b/mpc/tests/ttan.c
@@ -0,0 +1,216 @@
+/* ttan -- test file for mpc_tan.
+
+Copyright (C) 2008, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include <stdlib.h>
+#include "mpc-tests.h"
+
+static void
+pure_real_argument (void)
+{
+ /* tan(x -i*0) = tan(x) -i*0 */
+ /* tan(x +i*0) = tan(x) +i*0 */
+ mpfr_t x;
+ mpfr_t tan_x;
+ mpc_t z;
+ mpc_t tan_z;
+
+ mpfr_init2 (x, 79);
+ mpfr_init2 (tan_x, 113);
+ mpc_init2 (z, 79);
+ mpc_init2 (tan_z, 113);
+
+ /* tan(1 +i*0) = tan(1) +i*0 */
+ mpc_set_ui_ui (z, 1, 0, MPC_RNDNN);
+ mpfr_set_ui (x, 1, GMP_RNDN);
+ mpfr_tan (tan_x, x, GMP_RNDN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref (tan_z), tan_x) != 0
+ || !mpfr_zero_p (mpc_imagref (tan_z)) || mpfr_signbit (mpc_imagref (tan_z)))
+ {
+ printf ("mpc_tan(1 + i * 0) failed\n");
+ exit (1);
+ }
+
+ /* tan(1 -i*0) = tan(1) -i*0 */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref (tan_z), tan_x) != 0
+ || !mpfr_zero_p (mpc_imagref (tan_z)) || !mpfr_signbit (mpc_imagref (tan_z)))
+ {
+ printf ("mpc_tan(1 - i * 0) failed\n");
+ exit (1);
+ }
+
+ /* tan(Pi/2 +i*0) = +Inf +i*0 */
+ mpfr_const_pi (x, GMP_RNDN);
+ mpfr_div_2ui (x, x, 1, GMP_RNDN);
+ mpfr_set (mpc_realref (z), x, GMP_RNDN);
+ mpfr_set_ui (mpc_imagref (z), 0, GMP_RNDN);
+ mpfr_tan (tan_x, x, GMP_RNDN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref (tan_z), tan_x) != 0
+ || !mpfr_zero_p (mpc_imagref (tan_z)) || mpfr_signbit (mpc_imagref (tan_z)))
+ {
+ printf ("mpc_tan(Pi/2 + i * 0) failed\n");
+ exit (1);
+ }
+
+ /* tan(Pi/2 -i*0) = +Inf -i*0 */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref (tan_z), tan_x) != 0
+ || !mpfr_zero_p (mpc_imagref (tan_z)) || !mpfr_signbit (mpc_imagref (tan_z)))
+ {
+ printf ("mpc_tan(Pi/2 - i * 0) failed\n");
+ exit (1);
+ }
+
+ /* tan(-Pi/2 +i*0) = -Inf +i*0 */
+ mpfr_neg (x, x, GMP_RNDN);
+ mpc_neg (z, z, MPC_RNDNN);
+ mpfr_tan (tan_x, x, GMP_RNDN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref (tan_z), tan_x) != 0
+ || !mpfr_zero_p (mpc_imagref (tan_z)) || mpfr_signbit (mpc_imagref (tan_z)))
+ {
+ printf ("mpc_tan(-Pi/2 + i * 0) failed\n");
+ exit (1);
+ }
+
+ /* tan(-Pi/2 -i*0) = -Inf -i*0 */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_realref (tan_z), tan_x) != 0
+ || !mpfr_zero_p (mpc_imagref (tan_z)) || !mpfr_signbit (mpc_imagref (tan_z)))
+ {
+ printf ("mpc_tan(-Pi/2 - i * 0) failed\n");
+ exit (1);
+ }
+
+ mpc_clear (tan_z);
+ mpc_clear (z);
+ mpfr_clear (tan_x);
+ mpfr_clear (x);
+}
+
+static void
+pure_imaginary_argument (void)
+{
+ /* tan(-0 +i*y) = -0 +i*tanh(y) */
+ /* tan(+0 +i*y) = +0 +i*tanh(y) */
+ mpfr_t y;
+ mpfr_t tanh_y;
+ mpc_t z;
+ mpc_t tan_z;
+ mpfr_prec_t prec = (mpfr_prec_t) 111;
+
+ mpfr_init2 (y, 2);
+ mpfr_init2 (tanh_y, prec);
+ mpc_init2 (z, 2);
+ mpc_init2 (tan_z, prec);
+
+ /* tan(0 +i) = +0 +i*tanh(1) */
+ mpc_set_ui_ui (z, 0, 1, MPC_RNDNN);
+ mpfr_set_ui (y, 1, GMP_RNDN);
+ mpfr_tanh (tanh_y, y, GMP_RNDN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_imagref (tan_z), tanh_y) != 0
+ || !mpfr_zero_p (mpc_realref (tan_z)) || mpfr_signbit (mpc_realref (tan_z)))
+ {
+ mpc_t c99;
+
+ mpc_init2 (c99, prec);
+ mpfr_set_ui (mpc_realref (c99), 0, GMP_RNDN);
+ mpfr_set (mpc_imagref (c99), tanh_y, GMP_RNDN);
+
+ TEST_FAILED ("mpc_tan", z, tan_z, c99, MPC_RNDNN);
+ }
+
+ /* tan(0 -i) = +0 +i*tanh(-1) */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpfr_neg (tanh_y, tanh_y, GMP_RNDN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_imagref (tan_z), tanh_y) != 0
+ || !mpfr_zero_p (mpc_realref (tan_z)) || mpfr_signbit (mpc_realref (tan_z)))
+ {
+ mpc_t c99;
+
+ mpc_init2 (c99, prec);
+ mpfr_set_ui (mpc_realref (c99), 0, GMP_RNDN);
+ mpfr_set (mpc_imagref (c99), tanh_y, GMP_RNDN);
+
+ TEST_FAILED ("mpc_tan", z, tan_z, c99, MPC_RNDNN);
+ }
+
+ /* tan(-0 +i) = -0 +i*tanh(1) */
+ mpc_neg (z, z, MPC_RNDNN);
+ mpfr_neg (tanh_y, tanh_y, GMP_RNDN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_imagref (tan_z), tanh_y) != 0
+ || !mpfr_zero_p (mpc_realref (tan_z)) || !mpfr_signbit (mpc_realref (tan_z)))
+ {
+ mpc_t c99;
+
+ mpc_init2 (c99, prec);
+ mpfr_set_ui (mpc_realref (c99), 0, GMP_RNDN);
+ mpfr_set (mpc_imagref (c99), tanh_y, GMP_RNDN);
+
+ TEST_FAILED ("mpc_tan", z, tan_z, c99, MPC_RNDNN);
+ }
+
+ /* tan(-0 -i) = -0 +i*tanh(-1) */
+ mpc_conj (z, z, MPC_RNDNN);
+ mpfr_neg (tanh_y, tanh_y, GMP_RNDN);
+ mpc_tan (tan_z, z, MPC_RNDNN);
+ if (mpfr_cmp (mpc_imagref (tan_z), tanh_y) != 0
+ || !mpfr_zero_p (mpc_realref (tan_z)) || !mpfr_signbit (mpc_realref (tan_z)))
+ {
+ mpc_t c99;
+
+ mpc_init2 (c99, prec);
+ mpfr_set_ui (mpc_realref (c99), 0, GMP_RNDN);
+ mpfr_set (mpc_imagref (c99), tanh_y, GMP_RNDN);
+
+ TEST_FAILED ("mpc_tan", z, tan_z, c99, MPC_RNDNN);
+ }
+
+ mpc_clear (tan_z);
+ mpc_clear (z);
+ mpfr_clear (tanh_y);
+ mpfr_clear (y);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_tan);
+
+ test_start ();
+
+ data_check (f, "tan.dat");
+ tgeneric (f, 2, 512, 7, 4);
+
+ pure_real_argument ();
+ pure_imaginary_argument ();
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/ttanh.c b/mpc/tests/ttanh.c
new file mode 100644
index 0000000000..26d9fbe160
--- /dev/null
+++ b/mpc/tests/ttanh.c
@@ -0,0 +1,36 @@
+/* ttanh -- test file for mpc_tanh.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CC, f, mpc_tanh);
+
+ test_start ();
+
+ data_check (f, "tanh.dat");
+ tgeneric (f, 2, 512, 7, 4);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tui_div.c b/mpc/tests/tui_div.c
new file mode 100644
index 0000000000..c109189265
--- /dev/null
+++ b/mpc/tests/tui_div.c
@@ -0,0 +1,102 @@
+/* tui_div -- test file for mpc_ui_div.
+
+Copyright (C) 2008, 2011 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+static void
+special (void)
+{
+ mpc_t a, b;
+
+ mpc_init2 (a, 10);
+ mpc_init2 (b, 10);
+
+ mpc_set_ui_ui (a, 2, 4, MPC_RNDNN);
+ mpc_ui_div (b, 10, a, MPC_RNDNN);
+ if (mpc_cmp_si_si (b, 1, -2) != 0)
+ {
+ printf ("10/(2,4) failed\n");
+ printf ("expected (1,-2)\n");
+ printf ("got ");
+ mpc_out_str (stdout, 10, 0, b, MPC_RNDNN);
+ printf ("\n");
+ exit (1);
+ }
+
+ /* 0/(-1-0*I) should give (-0, +0) */
+ mpfr_set_str (mpc_realref(a), "-1", 10, GMP_RNDN);
+ mpfr_set_str (mpc_imagref(a), "-0", 10, GMP_RNDN);
+ mpc_ui_div (b, 0, a, MPC_RNDNN);
+ if ((mpc_cmp_si_si (b, 0, 0) != 0) || (MPFR_SIGN (mpc_realref(b)) > 0)
+ || (MPFR_SIGN (mpc_imagref(b)) < 0))
+ {
+ printf ("0/(-1,-0) failed\n");
+ printf ("expected (-0,+0)\n");
+ printf ("got ");
+ mpc_out_str (stdout, 10, 0, b, MPC_RNDNN);
+ printf ("\n");
+ exit (1);
+ }
+
+ mpc_set_ui_ui (a, 1, 0, MPC_RNDNN);
+ mpc_ui_div (b, 1, a, MPC_RNDNN);
+ if (mpc_cmp_si_si (b, 1, 0) != 0)
+ {
+ printf ("1/(1,0) failed\n");
+ printf ("expected (1,0)\n");
+ printf ("got ");
+ mpc_out_str (stdout, 10, 0, b, MPC_RNDNN);
+ printf ("\n");
+ exit (1);
+ }
+
+ /* problem reported by Timo Hartmann with mpc-0.7, 21 Oct 2009 */
+ mpc_set_ui_ui (a, 4, 0, MPC_RNDNN);
+ mpc_ui_div (b, 1, a, MPC_RNDNN);
+ if (mpfr_cmp_ui_2exp (mpc_realref(b), 1, -2) != 0 ||
+ mpfr_cmp_ui (mpc_imagref(b), 0) != 0 || mpfr_signbit (mpc_imagref(b)) != 0)
+ {
+ printf ("1/(4,0) failed\n");
+ printf ("expected (1/4,0)\n");
+ printf ("got ");
+ mpc_out_str (stdout, 10, 0, b, MPC_RNDNN);
+ printf ("\n");
+ exit (1);
+ }
+
+ mpc_clear (a);
+ mpc_clear (b);
+}
+
+int
+main (void)
+{
+ DECL_FUNC (CUC, f, mpc_ui_div);
+
+ test_start ();
+
+ special ();
+
+ tgeneric (f, 2, 1024, 7, 4096);
+
+ test_end ();
+
+ return 0;
+}
diff --git a/mpc/tests/tui_ui_sub.c b/mpc/tests/tui_ui_sub.c
new file mode 100644
index 0000000000..67c9071cdc
--- /dev/null
+++ b/mpc/tests/tui_ui_sub.c
@@ -0,0 +1,35 @@
+/* tui_ui_sub -- test file for mpc_ui_ui_sub.
+
+Copyright (C) 2008 INRIA
+
+This file is part of GNU MPC.
+
+GNU MPC 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 3 of the License, or (at your
+option) any later version.
+
+GNU MPC 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 this program. If not, see http://www.gnu.org/licenses/ .
+*/
+
+#include "mpc-tests.h"
+
+int
+main (void)
+{
+ DECL_FUNC (CUUC, f, mpc_ui_ui_sub);
+
+ test_start ();
+
+ tgeneric (f, 2, 1024, 7, -1);
+
+ test_end ();
+
+ return 0;
+}