mpc-1.0.3/ 0000755 0001751 0001751 00000000000 12470362544 007304 5 0000000 0000000 mpc-1.0.3/config.guess 0000555 0001751 0001751 00000123671 12470361151 011545 0000000 0000000 #!/bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2014-11-04'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches to .
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_SYSTEM}" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
eval $set_cc_for_build
cat <<-EOF > $dummy.c
#include
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux${UNAME_RELEASE}
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/lslpp ] ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
8664:Windows_NT:*)
echo x86_64-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-${LIBC}
exit ;;
ppc64le:Linux:*:*)
echo powerpc64le-unknown-linux-${LIBC}
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
eval $set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
# that puts up a graphical alert prompting to install
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
mpc-1.0.3/AUTHORS 0000644 0001751 0001751 00000000200 12426164730 010262 0000000 0000000 Main authors:
Andreas Enge
Philippe Théveny
Paul Zimmermann
Mickaël Gastineau has contributed the file Makefile.vc.
mpc-1.0.3/Makefile.am 0000644 0001751 0001751 00000002066 12470362212 011254 0000000 0000000 ## Makefile.am -- Process this file with automake to produce Makefile.in
##
## 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
## 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/ .
ACLOCAL_AMFLAGS = -I m4
# version number for distribution tarball
VERSION = @VERSION@@GITVERSION@
SUBDIRS = src tests doc
EXTRA_HEADERS = src/mpc-log.h
include_HEADERS = src/mpc.h @MPC_LOG_H@
EXTRA_DIST = doc/fdl-1.3.texi src/mpc-log.h tests/tgeneric.c Makefile.vc
mpc-1.0.3/config.h.in 0000644 0001751 0001751 00000006014 12470361150 011240 0000000 0000000 /* config.h.in. Generated from configure.ac by autoheader. */
/* complex.h present and usable */
#undef HAVE_COMPLEX_H
/* Define to 1 if you have the header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `dup' function. */
#undef HAVE_DUP
/* Define to 1 if you have the `dup2' function. */
#undef HAVE_DUP2
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if the system has the type `intptr_t'. */
#undef HAVE_INTPTR_T
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
/* Library dl present */
#undef HAVE_LIBDL
/* Define to 1 if you have the header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the `localeconv' function. */
#undef HAVE_LOCALECONV
/* Define to 1 if you have the header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if you have the header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
/* Define to 1 if you have the header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* C compiler */
#undef MPC_CC
/* Gcc yes or no */
#undef MPC_GCC
/* Version of gcc */
#undef MPC_GCC_VERSION
/* Do not check mpc_out_str on stdout */
#undef MPC_NO_STREAM_REDIRECTION
/* Use valgrind for make check */
#undef MPC_USE_VALGRIND
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both and . */
#undef TIME_WITH_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to the type of a signed integer type wide enough to hold a pointer,
if such a type exists, and if the system does not define it. */
#undef intptr_t
/* Define to `unsigned int' if does not define. */
#undef size_t
mpc-1.0.3/depcomp 0000555 0001751 0001751 00000056015 12470361151 010577 0000000 0000000 #!/bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva .
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
mpc-1.0.3/Makefile.vc 0000644 0001751 0001751 00000035253 12470362312 011274 0000000 0000000 # Makefile for the MPC library (Windows version).
#
# Copyright (C) INRIA - CNRS, 2002, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012, 2014, 2015
#
# This file is part of the MPC Library.
#
# The MPC Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.
#
# The MPC Library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with the MPC Library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
#
# usage:
# nmake /f Makefile.vc clean
# clean the temporaries objects
#
# nmake /f Makefile.vc STATIC=0|1 GMPDIR=gmpdirectory MPFRDIR=mpfrdirectory
# compile MPC
#
# nmake /f Makefile.vc STATIC=0|1 install GMPDIR=gmpdirectory MPFRDIR=mpfrdirectory DESTDIR=installdirectory
# install MPC to installdirectory
#
# nmake /f Makefile.vc STATIC=0|1 check GMPDIR=gmpdirectory MPFRDIR=mpfrdirectory
# perform tests on MPC
#
# GMPDIR : specify the location where GMP is installed
# MPFRDIR : specify the location where MPFR is installed
# DESTDIR : specify the location where MPC will be installed
# STATIC : specify if a static or dynamic library of MPC will be created
# STATIC=1 : build a static library
# STATIC=0 : build a dynamic library (DLL)
# A dynamic library is created by default if STATIC is omitted (STATIC=0)
# ENABLELOGGING : specify if MPC functions calls are logged
# ENABLELOGGING=1 : MPC functions calls are logged
# ENABLELOGGING=0 : MPC functions calls are not logged (default)
# Functions calls are not logged by default if ENABLELOGGING is omitted (ENABLELOGGING=0)
CPP = cl.exe
CC = cl.exe
CDEFAULTFLAGS=/O2 /GR- /MD /nologo /EHs
VERSION=1.0.3
######################## do not edit below this line ##########################
DIRMPC=.\src
DIRMPCTESTS=.\tests\\
!if "$(STATIC)" == "0"
LIBRARY = libmpc.dll
LINKER = link.exe /DLL
GMPMUSTBEDLL=/D__GMP_LIBGMP_DLL
!else
LIBRARY = libmpc.lib
LINKER = lib.exe
GMPMUSTBEDLL=
!endif
#check for logging. if yes then add logging.c to the library
!if "$(ENABLELOGGING)" == "1"
CPPOBJECTS_LOGGING = $(DIRMPC)\logging.obj
CPPLINKOBJECTS_LOGGING = logging.obj
LIBS_LOGGING = kernel32.lib
!else
CPPOBJECTS_LOGGING =
CPPLINKOBJECTS_LOGGING =
LIBS_LOGGING =
!endif
INCLUDES = /I$(DIRMPC) /I$(GMPDIR)\include /I$(MPFR)\include
CKERNELFLAGS = $(CDEFAULTFLAGS) $(GMPMUSTBEDLL) $(INCLUDES)
CFLAGS = $(CKERNELFLAGS) /D__MPC_WITHIN_MPC /D_GMP_IEEE_FLOATS /DHAVE_CONFIG_H
TESTCOMPILE=$(CC) $(CKERNELFLAGS) $(DIRMPCTESTS)\tgeneric.c $(DIRMPCTESTS)\comparisons.c $(DIRMPCTESTS)\read_data.c $(DIRMPCTESTS)\random.c $(DIRMPCTESTS)
MIDTESTCOMPILE=/link /out:$(DIRMPCTESTS)
ENDTESTCOMPILE=/LIBPATH:"$(GMPDIR)\lib" libmpc.lib libmpfr.lib libgmp.lib $(LIBS_LOGGING)
#generate the CPPOBJECTS : goto src and execute
# ls *.c | sed "s/\.c/\.obj/" | awk ' { printf("$(DIRMPC)\\%s \\\n",$1); } '
#generate the CPPLINKOBJECTS : goto src and execute
# ls *.c | sed "s/\.c/\.obj/" | awk ' { printf("%s \\\n",$1); } '
#generate the list for tests : goto tests and execute
# ls t*.c | sed "s/\.c//" | grep -v tgeneric| grep -v comparisons | grep -v read_data | grep -v random | awk ' { printf("\t$(TESTCOMPILE)%s.c $(MIDTESTCOMPILE)%s.exe $(ENDTESTCOMPILE)\n\tcd $(DIRMPCTESTS) && %s.exe && cd ..\n",$1,$1,$1,$1); } '
LIBRARYLIB = libmpc.lib
CPPOBJECTS =$(DIRMPC)\abs.obj \
$(DIRMPC)\acos.obj \
$(DIRMPC)\acosh.obj \
$(DIRMPC)\add.obj \
$(DIRMPC)\add_fr.obj \
$(DIRMPC)\add_si.obj \
$(DIRMPC)\add_ui.obj \
$(DIRMPC)\arg.obj \
$(DIRMPC)\asin.obj \
$(DIRMPC)\asinh.obj \
$(DIRMPC)\atan.obj \
$(DIRMPC)\atanh.obj \
$(DIRMPC)\clear.obj \
$(DIRMPC)\cmp.obj \
$(DIRMPC)\cmp_si_si.obj \
$(DIRMPC)\conj.obj \
$(DIRMPC)\cos.obj \
$(DIRMPC)\cosh.obj \
$(DIRMPC)\div.obj \
$(DIRMPC)\div_2ui.obj \
$(DIRMPC)\div_fr.obj \
$(DIRMPC)\div_ui.obj \
$(DIRMPC)\exp.obj \
$(DIRMPC)\fma.obj \
$(DIRMPC)\fr_div.obj \
$(DIRMPC)\fr_sub.obj \
$(DIRMPC)\get_prec.obj \
$(DIRMPC)\get_prec2.obj \
$(DIRMPC)\get_version.obj \
$(DIRMPC)\get_x.obj \
$(DIRMPC)\imag.obj \
$(DIRMPC)\init2.obj \
$(DIRMPC)\init3.obj \
$(DIRMPC)\inp_str.obj \
$(DIRMPC)\log.obj \
$(DIRMPC)\log10.obj \
$(DIRMPC)\mem.obj \
$(DIRMPC)\mul.obj \
$(DIRMPC)\mul_2ui.obj \
$(DIRMPC)\mul_fr.obj \
$(DIRMPC)\mul_i.obj \
$(DIRMPC)\mul_si.obj \
$(DIRMPC)\mul_ui.obj \
$(DIRMPC)\neg.obj \
$(DIRMPC)\norm.obj \
$(DIRMPC)\out_str.obj \
$(DIRMPC)\pow.obj \
$(DIRMPC)\pow_d.obj \
$(DIRMPC)\pow_fr.obj \
$(DIRMPC)\pow_ld.obj \
$(DIRMPC)\pow_si.obj \
$(DIRMPC)\pow_ui.obj \
$(DIRMPC)\pow_z.obj \
$(DIRMPC)\proj.obj \
$(DIRMPC)\real.obj \
$(DIRMPC)\set.obj \
$(DIRMPC)\set_prec.obj \
$(DIRMPC)\set_str.obj \
$(DIRMPC)\set_x.obj \
$(DIRMPC)\set_x_x.obj \
$(DIRMPC)\sin.obj \
$(DIRMPC)\sin_cos.obj \
$(DIRMPC)\sinh.obj \
$(DIRMPC)\sqr.obj \
$(DIRMPC)\sqrt.obj \
$(DIRMPC)\strtoc.obj \
$(DIRMPC)\sub.obj \
$(DIRMPC)\sub_fr.obj \
$(DIRMPC)\sub_ui.obj \
$(DIRMPC)\swap.obj \
$(DIRMPC)\tan.obj \
$(DIRMPC)\tanh.obj \
$(DIRMPC)\uceil_log2.obj \
$(DIRMPC)\ui_div.obj \
$(DIRMPC)\ui_ui_sub.obj $(CPPOBJECTS_LOGGING) \
$(DIRMPC)\urandom.obj
CPPLINKOBJECTS = abs.obj \
acos.obj \
acosh.obj \
add.obj \
add_fr.obj \
add_si.obj \
add_ui.obj \
arg.obj \
asin.obj \
asinh.obj \
atan.obj \
atanh.obj \
clear.obj \
cmp.obj \
cmp_si_si.obj \
conj.obj \
cos.obj \
cosh.obj \
div.obj \
div_2ui.obj \
div_fr.obj \
div_ui.obj \
exp.obj \
fma.obj \
fr_div.obj \
fr_sub.obj \
get_prec.obj \
get_prec2.obj \
get_version.obj \
get_x.obj \
imag.obj \
init2.obj \
init3.obj \
inp_str.obj \
log.obj \
log10.obj \
mem.obj \
mul.obj \
mul_2ui.obj \
mul_fr.obj \
mul_i.obj \
mul_si.obj \
mul_ui.obj \
neg.obj \
norm.obj \
out_str.obj \
pow.obj \
pow_d.obj \
pow_fr.obj \
pow_ld.obj \
pow_si.obj \
pow_ui.obj \
pow_z.obj \
proj.obj \
real.obj \
set.obj \
set_prec.obj \
set_str.obj \
set_x.obj \
set_x_x.obj \
sin.obj \
sin_cos.obj \
sinh.obj \
sqr.obj \
sqrt.obj \
strtoc.obj \
sub.obj \
sub_fr.obj \
sub_ui.obj \
swap.obj \
tan.obj \
tanh.obj \
uceil_log2.obj \
ui_div.obj \
ui_ui_sub.obj $(CPPLINKOBJECTS_LOGGING) \
urandom.obj
#
# Link target: automatically builds its object dependencies before
# executing its link command.
#
$(LIBRARY): $(DIRMPC)config.h $(CPPOBJECTS)
$(LINKER) /out:$@ $(CPPLINKOBJECTS) /LIBPATH:"$(GMPDIR)\lib" libmpfr.lib libgmp.lib $(LIBS_LOGGING)
$(DIRMPC)config.h :
echo #define PACKAGE_STRING "mpc" >$(DIRMPC)\config.h
echo #define PACKAGE_VERSION "$(VERSION)" >>$(DIRMPC)\config.h
echo #define STDC_HEADERS 1 >>$(DIRMPC)\config.h
echo #define dlsym(handle, name) GetProcAddress(GetModuleHandle(handle), name) >>$(DIRMPC)\config.h
echo #include "windows.h" >>$(DIRMPC)\config.h
#
# Clean target: "nmake /f Makefile.vc clean" to remove unwanted
# objects and executables.
#
clean:
del *.obj $(CPPLINKOBJECTS) $(LIBRARY) *.tlh $(DIRMPC)config.h *.dll *.lib *.exe
#
# install target: "nmake /f Makefile.vc install DESTDIR=xxx" to perform the installation.
#
install: $(LIBRARY)
-mkdir $(DESTDIR)
-mkdir $(DESTDIR)\include
copy $(DIRMPC)\mpc.h $(DESTDIR)\include
-mkdir $(DESTDIR)\lib
copy $(LIBRARY) $(DESTDIR)\lib
copy $(LIBRARYLIB) $(DESTDIR)\lib
#
# check target: "nmake /f Makefile.vc check GMPDIR=xxx MPFRDIR=xxx" to perform the installation.
#
check : test
test :
-copy $(GMPDIR)\lib\*gmp*.dll $(DIRMPCTESTS)
-copy $(MPFRDIR)\lib\*mpfr*.dll $(DIRMPCTESTS)
copy $(LIBRARY) $(DIRMPCTESTS)
$(TESTCOMPILE)tabs.c $(MIDTESTCOMPILE)tabs.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tabs.exe && cd ..
$(TESTCOMPILE)tacos.c $(MIDTESTCOMPILE)tacos.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tacos.exe && cd ..
$(TESTCOMPILE)tacosh.c $(MIDTESTCOMPILE)tacosh.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tacosh.exe && cd ..
$(TESTCOMPILE)tadd.c $(MIDTESTCOMPILE)tadd.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tadd.exe && cd ..
$(TESTCOMPILE)tadd_fr.c $(MIDTESTCOMPILE)tadd_fr.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tadd_fr.exe && cd ..
$(TESTCOMPILE)tadd_si.c $(MIDTESTCOMPILE)tadd_si.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tadd_si.exe && cd ..
$(TESTCOMPILE)tadd_ui.c $(MIDTESTCOMPILE)tadd_ui.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tadd_ui.exe && cd ..
$(TESTCOMPILE)targ.c $(MIDTESTCOMPILE)targ.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && targ.exe && cd ..
$(TESTCOMPILE)tasin.c $(MIDTESTCOMPILE)tasin.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tasin.exe && cd ..
$(TESTCOMPILE)tasinh.c $(MIDTESTCOMPILE)tasinh.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tasinh.exe && cd ..
$(TESTCOMPILE)tatan.c $(MIDTESTCOMPILE)tatan.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tatan.exe && cd ..
$(TESTCOMPILE)tatanh.c $(MIDTESTCOMPILE)tatanh.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tatanh.exe && cd ..
$(TESTCOMPILE)tconj.c $(MIDTESTCOMPILE)tconj.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tconj.exe && cd ..
$(TESTCOMPILE)tcos.c $(MIDTESTCOMPILE)tcos.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tcos.exe && cd ..
$(TESTCOMPILE)tcosh.c $(MIDTESTCOMPILE)tcosh.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tcosh.exe && cd ..
$(TESTCOMPILE)tdiv.c $(MIDTESTCOMPILE)tdiv.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tdiv.exe && cd ..
$(TESTCOMPILE)tdiv_2ui.c $(MIDTESTCOMPILE)tdiv_2ui.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tdiv_2ui.exe && cd ..
$(TESTCOMPILE)tdiv_fr.c $(MIDTESTCOMPILE)tdiv_fr.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tdiv_fr.exe && cd ..
$(TESTCOMPILE)tdiv_ui.c $(MIDTESTCOMPILE)tdiv_ui.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tdiv_ui.exe && cd ..
$(TESTCOMPILE)texp.c $(MIDTESTCOMPILE)texp.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && texp.exe && cd ..
$(TESTCOMPILE)tfma.c $(MIDTESTCOMPILE)tfma.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tfma.exe && cd ..
$(TESTCOMPILE)tfr_div.c $(MIDTESTCOMPILE)tfr_div.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tfr_div.exe && cd ..
$(TESTCOMPILE)tfr_sub.c $(MIDTESTCOMPILE)tfr_sub.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tfr_sub.exe && cd ..
$(TESTCOMPILE)tget_version.c $(MIDTESTCOMPILE)tget_version.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tget_version.exe && cd ..
$(TESTCOMPILE)timag.c $(MIDTESTCOMPILE)timag.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && timag.exe && cd ..
$(TESTCOMPILE)tio_str.c $(MIDTESTCOMPILE)tio_str.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tio_str.exe && cd ..
$(TESTCOMPILE)tlog.c $(MIDTESTCOMPILE)tlog.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tlog.exe && cd ..
$(TESTCOMPILE)tlog10.c $(MIDTESTCOMPILE)tlog10.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tlog10.exe && cd ..
$(TESTCOMPILE)tmul.c $(MIDTESTCOMPILE)tmul.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tmul.exe && cd ..
$(TESTCOMPILE)tmul_2ui.c $(MIDTESTCOMPILE)tmul_2ui.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tmul_2ui.exe && cd ..
$(TESTCOMPILE)tmul_fr.c $(MIDTESTCOMPILE)tmul_fr.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tmul_fr.exe && cd ..
$(TESTCOMPILE)tmul_i.c $(MIDTESTCOMPILE)tmul_i.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tmul_i.exe && cd ..
$(TESTCOMPILE)tmul_si.c $(MIDTESTCOMPILE)tmul_si.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tmul_si.exe && cd ..
$(TESTCOMPILE)tmul_ui.c $(MIDTESTCOMPILE)tmul_ui.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tmul_ui.exe && cd ..
$(TESTCOMPILE)tneg.c $(MIDTESTCOMPILE)tneg.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tneg.exe && cd ..
$(TESTCOMPILE)tnorm.c $(MIDTESTCOMPILE)tnorm.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tnorm.exe && cd ..
$(TESTCOMPILE)tpow.c $(MIDTESTCOMPILE)tpow.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tpow.exe && cd ..
$(TESTCOMPILE)tpow_d.c $(MIDTESTCOMPILE)tpow_d.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tpow_d.exe && cd ..
$(TESTCOMPILE)tpow_fr.c $(MIDTESTCOMPILE)tpow_fr.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tpow_fr.exe && cd ..
$(TESTCOMPILE)tpow_ld.c $(MIDTESTCOMPILE)tpow_ld.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tpow_ld.exe && cd ..
$(TESTCOMPILE)tpow_si.c $(MIDTESTCOMPILE)tpow_si.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tpow_si.exe && cd ..
$(TESTCOMPILE)tpow_ui.c $(MIDTESTCOMPILE)tpow_ui.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tpow_ui.exe && cd ..
$(TESTCOMPILE)tpow_z.c $(MIDTESTCOMPILE)tpow_z.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tpow_z.exe && cd ..
$(TESTCOMPILE)tprec.c $(MIDTESTCOMPILE)tprec.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tprec.exe && cd ..
$(TESTCOMPILE)tproj.c $(MIDTESTCOMPILE)tproj.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tproj.exe && cd ..
$(TESTCOMPILE)treal.c $(MIDTESTCOMPILE)treal.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && treal.exe && cd ..
$(TESTCOMPILE)treimref.c $(MIDTESTCOMPILE)treimref.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && treimref.exe && cd ..
$(TESTCOMPILE)tset.c $(MIDTESTCOMPILE)tset.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tset.exe && cd ..
$(TESTCOMPILE)tsin.c $(MIDTESTCOMPILE)tsin.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsin.exe && cd ..
$(TESTCOMPILE)tsin_cos.c $(MIDTESTCOMPILE)tsin_cos.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsin_cos.exe && cd ..
$(TESTCOMPILE)tsinh.c $(MIDTESTCOMPILE)tsinh.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsinh.exe && cd ..
$(TESTCOMPILE)tsqr.c $(MIDTESTCOMPILE)tsqr.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsqr.exe && cd ..
$(TESTCOMPILE)tsqrt.c $(MIDTESTCOMPILE)tsqrt.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsqrt.exe && cd ..
$(TESTCOMPILE)tstrtoc.c $(MIDTESTCOMPILE)tstrtoc.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tstrtoc.exe && cd ..
$(TESTCOMPILE)tsub.c $(MIDTESTCOMPILE)tsub.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsub.exe && cd ..
$(TESTCOMPILE)tsub_fr.c $(MIDTESTCOMPILE)tsub_fr.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsub_fr.exe && cd ..
$(TESTCOMPILE)tsub_ui.c $(MIDTESTCOMPILE)tsub_ui.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tsub_ui.exe && cd ..
$(TESTCOMPILE)tswap.c $(MIDTESTCOMPILE)tswap.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tswap.exe && cd ..
$(TESTCOMPILE)ttan.c $(MIDTESTCOMPILE)ttan.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && ttan.exe && cd ..
$(TESTCOMPILE)ttanh.c $(MIDTESTCOMPILE)ttanh.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && ttanh.exe && cd ..
$(TESTCOMPILE)tui_div.c $(MIDTESTCOMPILE)tui_div.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tui_div.exe && cd ..
$(TESTCOMPILE)tui_ui_sub.c $(MIDTESTCOMPILE)tui_ui_sub.exe $(ENDTESTCOMPILE)
cd $(DIRMPCTESTS) && tui_ui_sub.exe && cd ..
@echo --------------------------------------------------
@echo All tests passed
@echo --------------------------------------------------
mpc-1.0.3/tests/ 0000755 0001751 0001751 00000000000 12470362544 010446 5 0000000 0000000 mpc-1.0.3/tests/div.dat 0000644 0001751 0001751 00000377540 12426164730 011660 0000000 0000000 # 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
mpc-1.0.3/tests/fr_sub.dat 0000644 0001751 0001751 00000041340 12426164730 012340 0000000 0000000 # 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
mpc-1.0.3/tests/tproj.c 0000644 0001751 0001751 00000001611 12470362212 011657 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/fr_div.dat 0000644 0001751 0001751 00000041430 12426164730 012331 0000000 0000000 # 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
mpc-1.0.3/tests/tmul_2ui.c 0000644 0001751 0001751 00000001571 12470362212 012266 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tget_version.c 0000644 0001751 0001751 00000003512 12426164730 013241 0000000 0000000 /* 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
#include
#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;
}
mpc-1.0.3/tests/exp.dat 0000644 0001751 0001751 00000015625 12426164730 011663 0000000 0000000 # 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
mpc-1.0.3/tests/add.dat 0000644 0001751 0001751 00000013103 12426164730 011604 0000000 0000000 # 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
mpc-1.0.3/tests/tacos.c 0000644 0001751 0001751 00000001605 12470362212 011635 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/neg.dat 0000644 0001751 0001751 00000012401 12426164730 011625 0000000 0000000 # 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
mpc-1.0.3/tests/pow_ui.dat 0000644 0001751 0001751 00000010651 12426164730 012363 0000000 0000000 # 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
mpc-1.0.3/tests/mul_fr.dat 0000644 0001751 0001751 00000041106 12426164730 012344 0000000 0000000 # 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
mpc-1.0.3/tests/acosh.dat 0000644 0001751 0001751 00000015051 12426164730 012155 0000000 0000000 # 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
mpc-1.0.3/tests/tatanh.c 0000644 0001751 0001751 00000002433 12470362212 012003 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tmul_ui.c 0000644 0001751 0001751 00000001574 12470362212 012207 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tpow_ld.c 0000644 0001751 0001751 00000002046 12470362212 012174 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tdiv.c 0000644 0001751 0001751 00000001654 12470362212 011476 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/tpow_si.c 0000644 0001751 0001751 00000005231 12470362212 012207 0000000 0000000 /* 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 /* 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;
}
mpc-1.0.3/tests/texp.c 0000644 0001751 0001751 00000001611 12470362212 011501 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tacosh.c 0000644 0001751 0001751 00000002434 12470362212 012006 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tsin_cos.c 0000644 0001751 0001751 00000001563 12470362212 012350 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/read_data.c 0000644 0001751 0001751 00000077125 12470362212 012442 0000000 0000000 /* 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
#include
#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);
}
mpc-1.0.3/tests/Makefile.am 0000644 0001751 0001751 00000004710 12470362212 012414 0000000 0000000 ## 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
mpc-1.0.3/tests/tdiv_ui.c 0000644 0001751 0001751 00000001545 12470362212 012172 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tcosh.c 0000644 0001751 0001751 00000007362 12470362212 011652 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/comparisons.c 0000644 0001751 0001751 00000003103 12426164730 013062 0000000 0000000 /* 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);
}
mpc-1.0.3/tests/ttan.c 0000644 0001751 0001751 00000013354 12470362212 011476 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/sinh.dat 0000644 0001751 0001751 00000006312 12426164730 012021 0000000 0000000 # 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
mpc-1.0.3/tests/treal.c 0000644 0001751 0001751 00000001553 12470362212 011635 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tmul.c 0000644 0001751 0001751 00000012575 12470362212 011515 0000000 0000000 /* 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
#ifdef TIMING
#include
#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;
}
mpc-1.0.3/tests/sqrt.dat 0000644 0001751 0001751 00000022527 12426164730 012057 0000000 0000000 # 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
mpc-1.0.3/tests/tadd_fr.c 0000644 0001751 0001751 00000003364 12470362212 012133 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/tfma.c 0000644 0001751 0001751 00000005326 12470362212 011457 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/pow.dat 0000644 0001751 0001751 00000064021 12433375662 011674 0000000 0000000 # 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
mpc-1.0.3/tests/tui_ui_sub.c 0000644 0001751 0001751 00000001572 12470362212 012676 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/conj.dat 0000644 0001751 0001751 00000012612 12426164730 012011 0000000 0000000 # 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
mpc-1.0.3/tests/tabs.c 0000644 0001751 0001751 00000001602 12470362212 011452 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tneg.c 0000644 0001751 0001751 00000001601 12470362212 011455 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tconj.c 0000644 0001751 0001751 00000001606 12470362212 011642 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/proj.dat 0000644 0001751 0001751 00000005661 12426164730 012040 0000000 0000000 # 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
mpc-1.0.3/tests/tlog.c 0000644 0001751 0001751 00000001635 12470362212 011474 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/tpow_fr.c 0000644 0001751 0001751 00000003315 12470362212 012204 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tstrtoc.c 0000644 0001751 0001751 00000010512 12470362212 012223 0000000 0000000 /* 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
#include
#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;
}
mpc-1.0.3/tests/log.dat 0000644 0001751 0001751 00000023027 12426164730 011643 0000000 0000000 # 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
mpc-1.0.3/tests/log10.dat 0000644 0001751 0001751 00000021762 12433365705 012013 0000000 0000000 # 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
mpc-1.0.3/tests/tdiv_2ui.c 0000644 0001751 0001751 00000001571 12470362212 012253 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tfr_sub.c 0000644 0001751 0001751 00000001614 12470362212 012170 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tsin.c 0000644 0001751 0001751 00000001615 12470362212 011502 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/strtoc.dat 0000644 0001751 0001751 00000024153 12426164730 012401 0000000 0000000 # 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
mpc-1.0.3/tests/pow_si.dat 0000644 0001751 0001751 00000002120 12426164730 012351 0000000 0000000 # 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
mpc-1.0.3/tests/random.c 0000644 0001751 0001751 00000010672 12470362212 012010 0000000 0000000 /* 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
#include "mpc-tests.h"
#ifdef TIME_WITH_SYS_TIME
# include
# include
#else
# ifdef HAVE_SYS_TIME_H
# include
# else
# include
# 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);
}
mpc-1.0.3/tests/tmul_fr.c 0000644 0001751 0001751 00000001620 12470362212 012171 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/mul.dat 0000755 0001751 0001751 00000031206 12426164730 011660 0000000 0000000 # 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
mpc-1.0.3/tests/tdiv_2si.c 0000644 0001751 0001751 00000001563 12470362212 012252 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/pow_fr.dat 0000644 0001751 0001751 00000006276 12426164730 012365 0000000 0000000 # 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
mpc-1.0.3/tests/treimref.c 0000644 0001751 0001751 00000002423 12470362212 012340 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/Makefile.in 0000644 0001751 0001751 00000232161 12470362457 012443 0000000 0000000 # 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='[0;31m'; \
grn='[0;32m'; \
lgn='[1;32m'; \
blu='[1;34m'; \
mgn='[0;35m'; \
brg='[1m'; \
std='[m'; \
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:
mpc-1.0.3/tests/tadd.c 0000644 0001751 0001751 00000003110 12470362212 011431 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/tpow_d.c 0000644 0001751 0001751 00000002614 12470362212 012021 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/acos.dat 0000644 0001751 0001751 00000015367 12426164730 012017 0000000 0000000 # 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
mpc-1.0.3/tests/tsub_fr.c 0000644 0001751 0001751 00000001620 12470362212 012165 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/ttanh.c 0000644 0001751 0001751 00000001605 12470362212 011642 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/sin.dat 0000644 0001751 0001751 00000020115 12426164730 011646 0000000 0000000 # 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
mpc-1.0.3/tests/tswap.c 0000644 0001751 0001751 00000003025 12426164730 011666 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tpow_z.c 0000644 0001751 0001751 00000003230 12470362212 012042 0000000 0000000 /* 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 /* 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;
}
mpc-1.0.3/tests/fma.dat 0000644 0001751 0001751 00000003445 12426164730 011627 0000000 0000000 # 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
mpc-1.0.3/tests/tgeneric.c 0000644 0001751 0001751 00000125745 12470362212 012340 0000000 0000000 /* 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);
}
}
mpc-1.0.3/tests/tdiv_fr.c 0000644 0001751 0001751 00000001605 12470362212 012161 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/add_fr.dat 0000644 0001751 0001751 00000012547 12426164730 012306 0000000 0000000 # 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
mpc-1.0.3/tests/targ.c 0000644 0001751 0001751 00000001605 12470362212 011461 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tprec.c 0000644 0001751 0001751 00000003511 12426164730 011645 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/arg.dat 0000644 0001751 0001751 00000006076 12426164730 011640 0000000 0000000 # 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
mpc-1.0.3/tests/tasinh.c 0000644 0001751 0001751 00000002431 12470362212 012010 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/abs.dat 0000644 0001751 0001751 00000006045 12426164730 011630 0000000 0000000 # 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
mpc-1.0.3/tests/tpow_ui.c 0000644 0001751 0001751 00000006543 12470362212 012220 0000000 0000000 /* 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 /* 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;
}
mpc-1.0.3/tests/tsqr.c 0000644 0001751 0001751 00000013770 12470362212 011523 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/atanh.dat 0000644 0001751 0001751 00000013327 12433365705 012162 0000000 0000000 # 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
mpc-1.0.3/tests/tatan.c 0000644 0001751 0001751 00000003314 12470362212 011632 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/atan.dat 0000644 0001751 0001751 00000021470 12433365705 012010 0000000 0000000 # 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
mpc-1.0.3/tests/tio_str.c 0000644 0001751 0001751 00000014470 12470362212 012213 0000000 0000000 /* 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 /* 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;
}
mpc-1.0.3/tests/tmul_2si.c 0000644 0001751 0001751 00000001563 12470362212 012265 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tmul_i.c 0000644 0001751 0001751 00000004720 12470362212 012016 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tadd_ui.c 0000644 0001751 0001751 00000003047 12470362212 012137 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/sub.dat 0000644 0001751 0001751 00000010612 12426164730 011647 0000000 0000000 # 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
mpc-1.0.3/tests/tcos.c 0000644 0001751 0001751 00000003616 12470362212 011500 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tan.dat 0000644 0001751 0001751 00000017442 12426164730 011650 0000000 0000000 # 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
mpc-1.0.3/tests/tanh.dat 0000644 0001751 0001751 00000006073 12426164730 012016 0000000 0000000 # 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
mpc-1.0.3/tests/tui_div.c 0000644 0001751 0001751 00000005072 12470362212 012171 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tadd_si.c 0000644 0001751 0001751 00000003224 12470362212 012132 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/mpc-tests.h 0000644 0001751 0001751 00000022404 12470362212 012450 0000000 0000000 /* 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
#include
#include
#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 */
mpc-1.0.3/tests/tlog10.c 0000644 0001751 0001751 00000001637 12470362212 011637 0000000 0000000 /* 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
#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;
}
mpc-1.0.3/tests/tsub.c 0000644 0001751 0001751 00000001613 12470362212 011500 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/sub_fr.dat 0000644 0001751 0001751 00000041753 12426164730 012350 0000000 0000000 # 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
mpc-1.0.3/tests/tnorm.c 0000644 0001751 0001751 00000005347 12470362212 011672 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tsqrt.c 0000644 0001751 0001751 00000001610 12470362212 011675 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/cosh.dat 0000644 0001751 0001751 00000011036 12426164730 012013 0000000 0000000 # 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
mpc-1.0.3/tests/asinh.dat 0000644 0001751 0001751 00000014507 12426164730 012167 0000000 0000000 # 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
mpc-1.0.3/tests/tfr_div.c 0000644 0001751 0001751 00000001620 12470362212 012156 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/div_fr.dat 0000644 0001751 0001751 00000041106 12426164730 012331 0000000 0000000 # 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
mpc-1.0.3/tests/cos.dat 0000644 0001751 0001751 00000006363 12426164730 011652 0000000 0000000 # 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
mpc-1.0.3/tests/norm.dat 0000644 0001751 0001751 00000016004 12426164730 012032 0000000 0000000 # 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
mpc-1.0.3/tests/tasin.c 0000644 0001751 0001751 00000001605 12470362212 011642 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/asin.dat 0000644 0001751 0001751 00000015361 12470362212 012010 0000000 0000000 # 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
mpc-1.0.3/tests/inp_str.dat 0000644 0001751 0001751 00000020565 12426164730 012544 0000000 0000000 # 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 ) "
mpc-1.0.3/tests/tsinh.c 0000644 0001751 0001751 00000001605 12470362212 011651 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/sqr.dat 0000644 0001751 0001751 00000023604 12426164730 011670 0000000 0000000 # 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
mpc-1.0.3/tests/tsub_ui.c 0000644 0001751 0001751 00000001560 12470362212 012176 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/timag.c 0000644 0001751 0001751 00000001553 12470362212 011627 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tpow.c 0000644 0001751 0001751 00000003270 12470362212 011515 0000000 0000000 /* 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;
}
mpc-1.0.3/tests/tset.c 0000644 0001751 0001751 00000032536 12470362212 011512 0000000 0000000 /* 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 /* for LONG_MAX */
#ifdef HAVE_INTTYPES_H
# include /* for intmax_t */
#else
# ifdef HAVE_STDINT_H
# include
# endif
#endif
#ifdef HAVE_COMPLEX_H
# include
#endif
#ifdef HAVE_LOCALE_H
#include
#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;
}
mpc-1.0.3/tests/tmul_si.c 0000644 0001751 0001751 00000001573 12470362212 012204 0000000 0000000 /* 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;
}
mpc-1.0.3/COPYING.LESSER 0000644 0001751 0001751 00000016743 12426164730 011264 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
mpc-1.0.3/config.sub 0000555 0001751 0001751 00000106222 12470361151 011201 0000000 0000000 #!/bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2014-12-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to .
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
leon|leon[3-9])
basic_machine=sparc-$basic_machine
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aros)
basic_machine=i386-pc
os=-aros
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
leon-*|leon[3-9]-*)
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
moxiebox)
basic_machine=moxie-unknown
os=-moxiebox
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i686-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tile*)
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
c8051-*)
os=-elf
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-cnk*|-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
mpc-1.0.3/configure.ac 0000644 0001751 0001751 00000017706 12470362312 011516 0000000 0000000 # Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014, 2015 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/ .
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(mpc, 1.0.3, mpc-discuss@lists.gforge.inria.fr)
AC_CONFIG_SRCDIR([src/mpc-impl.h])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.9 -Wall -Werror])
AM_MAINTAINER_MODE
USER_CC=$CC
USER_CFLAGS=$CFLAGS
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
# Extra arguments to configure
AC_ARG_WITH([mpfr_include],
[AC_HELP_STRING([--with-mpfr-include=DIR],
[MPFR include directory])],
[CPPFLAGS="-I$withval $CPPFLAGS"])
AC_ARG_WITH([mpfr_lib],
[AC_HELP_STRING([--with-mpfr-lib=DIR],
[MPFR lib directory])],
[LDFLAGS="-L$withval $LDFLAGS"])
AC_ARG_WITH([mpfr],
[AC_HELP_STRING([--with-mpfr=DIR],
[MPFR install directory])],
[
if test -z "$with_mpfr_include" -a -z "$with_mpfr_lib" ; then
CPPFLAGS="-I$withval/include $CPPFLAGS"
LDFLAGS="-L$withval/lib $LDFLAGS"
else
AC_MSG_FAILURE([Do not use --with-mpfr and --with-mpfr-include/--with-mpfr-lib options simultaneously.])
fi
])
AC_ARG_WITH([gmp_include],
[AC_HELP_STRING([--with-gmp-include=DIR],
[GMP include directory])],
[CPPFLAGS="-I$withval $CPPFLAGS"])
AC_ARG_WITH([gmp_lib],
[AC_HELP_STRING([--with-gmp-lib=DIR],
[GMP lib directory])],
[LDFLAGS="-L$withval $LDFLAGS"])
AC_ARG_WITH([gmp],
[AC_HELP_STRING([--with-gmp=DIR],
[GMP install directory])],
[
if test -z "$with_gmp_lib" -a -z "$with_gmp_include" ; then
CPPFLAGS="-I$withval/include $CPPFLAGS"
LDFLAGS="-L$withval/lib $LDFLAGS"
else
AC_MSG_FAILURE([Do not use --with-gmp and --with-gmp-include/--with-gmp-lib options simultaneously.])
fi
])
AC_ARG_ENABLE([logging],
[AC_HELP_STRING([--enable-logging],
[enable logging of function calls to stderr (default = no)])],
[case $enableval in
yes) AS_IF([test "x$enable_shared" = "xno"],
AC_MSG_ERROR([Logging works only with shared libraries; do not mix --enable-logging and --disable-shared])) ;;
no) ;;
*) AC_MSG_ERROR([Bad value for --enable-logging: Use yes or no]) ;;
esac
]
)
AC_ARG_ENABLE([valgrind-tests],
[AC_HELP_STRING([--enable-valgrind-tests],
[run checks through valgrind (default = no)])],
[case $enableval in
yes) gl_VALGRIND_TESTS ;;
no) ;;
*) AC_MSG_ERROR([Bad value for --enable-valgrind-tests: Use yes or no]) ;;
esac
]
)
# Check for CC and CFLAGS in gmp.h unless the user specified one of them
# look for EGREP and SED here, see continued problem
# at http://lists.gforge.inria.fr/pipermail/mpc-discuss/2012-January/001056.html
AC_PROG_EGREP
AC_PROG_SED
if test -z "$USER_CC" && test -z "$USER_CFLAGS"; then
MPC_GMP_CC_CFLAGS
fi
# Setup CC and CFLAGS
AC_PROG_CC
AC_LANG(C)
# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# Set up LibTool
LT_INIT
# Check GMP Header
AC_MSG_CHECKING(for gmp.h)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include "gmp.h"
]])],[AC_MSG_RESULT(yes)],[
AC_MSG_RESULT(no)
AC_MSG_ERROR([gmp.h cannot be found or is unusable.])
])
# Check (only in development versions) if the compiler accepts warning
# flags and add them to CFLAGS
# Note: don't do this if the user defined CFLAGS, since adding new flags
# might override the user's settings, see
# http://lists.gforge.inria.fr/pipermail/mpc-discuss/2012-May/001115.html
if test -z "$USER_CFLAGS"; then
MPC_C_CHECK_WARNINGCFLAGS
fi
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([locale.h inttypes.h stdint.h limits.h unistd.h sys/time.h])
AC_HEADER_TIME
MPC_COMPLEX_H
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for libraries.
AC_CHECK_FUNCS([gettimeofday localeconv setlocale])
AC_CHECK_FUNCS([dup dup2],,
[AC_DEFINE([MPC_NO_STREAM_REDIRECTION],1,[Do not check mpc_out_str on stdout])])
AC_CHECK_LIB([gmp], [__gmpz_init],
[LIBS="-lgmp $LIBS"],
[AC_MSG_ERROR([libgmp not found or uses a different ABI (including static vs shared).])])
AC_MSG_CHECKING(for MPFR)
LIBS="-lmpfr $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include "mpfr.h"]],
[[mpfr_t x; mpfr_init(x) ; mpfr_clear(x);]]
)],
[AC_MSG_RESULT(yes)],
[
AC_MSG_RESULT(no)
AC_MSG_ERROR([libmpfr not found or uses a different ABI (including static vs shared).])
])
# Check for a recent GMP
# We only guarantee that with a *functional* and recent enough GMP version,
# MPC will compile; we do not guarantee that GMP will compile.
# In particular fat builds are broken in GMP 4.3.2 and GMP 5.0.0
# (at least on 64-bit Core 2 under GNU/Linux),
# see http://gmplib.org/list-archives/gmp-bugs/2011-August/002345.html.
AC_MSG_CHECKING(for recent GMP)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[
#include "gmp.h"
#if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL < 432)
# error "Minimal GMP version is 4.3.2"
error
#endif
]])],
[AC_MSG_RESULT(yes)],
[
AC_MSG_RESULT(no)
AC_MSG_ERROR([GMP version >= 4.3.2 required])
])
# Check for a recent MPFR: we require MPFR 2.4.2 so that the tests
# in log.dat pass
# The same remark as above for GMP applies.
AC_MSG_CHECKING(for recent MPFR)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
[[
#include "mpfr.h"
#if (MPFR_VERSION < MPFR_VERSION_NUM (2,4,2))
# error "Minimal MPFR version is 2.4.2"
error
#endif
]])],
[AC_MSG_RESULT(yes)],
[
AC_MSG_RESULT(no)
AC_MSG_ERROR([MPFR version >= 2.4.2 required])
])
# Check for logging feature
AS_IF([test "x$enable_logging" = "xyes"],
[AC_CHECK_HEADERS([dlfcn.h])
AC_CHECK_LIB([dl],[dlsym],
[
AC_DEFINE(HAVE_LIBDL, 1, [Library dl present])
LIBS="-ldl $LIBS"
AC_TYPE_INTPTR_T
AC_LIBOBJ([logging])
AC_SUBST([MPC_LOG_H],[src/mpc-log.h])
],
[AC_MSG_ERROR([Library dl not found, logging impossible])])
]
)
# Configs for Windows DLLs
AC_SUBST(MPC_LDFLAGS)
AC_LIBTOOL_WIN32_DLL
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
MPC_WINDOWS
esac
# Checks for gcc version, result in variables MPC_GCC etc. inside config.log
AX_GCC_VERSION
AC_DEFINE_UNQUOTED([MPC_GCC], ["$GCC"], [Gcc yes or no])
AC_DEFINE_UNQUOTED([MPC_CC], ["$CC"], [C compiler])
AC_DEFINE_UNQUOTED([MPC_GCC_VERSION], ["$GCC_VERSION"], [Version of gcc])
# Looks for short git hash if the version string contains "dev"
MPC_GITVERSION
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile doc/Makefile])
AC_OUTPUT
mpc-1.0.3/src/ 0000755 0001751 0001751 00000000000 12470362544 010073 5 0000000 0000000 mpc-1.0.3/src/get_x.c 0000644 0001751 0001751 00000012152 12426164730 011264 0000000 0000000 /* mpc_get_dc, mpc_get_ldc -- Transform mpc number into C complex number
mpc_get_str -- Convert a complex number into a string.
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"
#ifdef HAVE_COMPLEX_H
#include
#endif
#ifdef HAVE_LOCALE_H
#include
#endif
#include /* for sprintf, fprintf */
#include
#include
#include "mpc-impl.h"
#ifdef HAVE_COMPLEX_H
double _Complex
mpc_get_dc (mpc_srcptr op, mpc_rnd_t rnd) {
return I * mpfr_get_d (mpc_imagref (op), MPC_RND_IM (rnd))
+ mpfr_get_d (mpc_realref (op), MPC_RND_RE (rnd));
}
long double _Complex
mpc_get_ldc (mpc_srcptr op, mpc_rnd_t rnd) {
return I * mpfr_get_ld (mpc_imagref (op), MPC_RND_IM (rnd))
+ mpfr_get_ld (mpc_realref (op), MPC_RND_RE (rnd));
}
#endif
/* Code for mpc_get_str. The output format is "(real imag)", the decimal point
of the locale is used. */
/* mpfr_prec_t can be either int or long int */
#if (__GMP_MP_SIZE_T_INT == 1)
#define MPC_EXP_FORMAT_SPEC "i"
#elif (__GMP_MP_SIZE_T_INT == 0)
#define MPC_EXP_FORMAT_SPEC "li"
#else
#error "mpfr_exp_t size not supported"
#endif
static char *
pretty_zero (mpfr_srcptr zero)
{
char *pretty;
pretty = mpc_alloc_str (3);
pretty[0] = mpfr_signbit (zero) ? '-' : '+';
pretty[1] = '0';
pretty[2] = '\0';
return pretty;
}
static char *
prettify (const char *str, const mp_exp_t expo, int base, int special)
{
size_t sz;
char *pretty;
char *p;
const char *s;
mp_exp_t x;
int sign;
sz = strlen (str) + 1; /* + terminal '\0' */
if (special)
{
/* special number: nan or inf */
pretty = mpc_alloc_str (sz);
strcpy (pretty, str);
return pretty;
}
/* regular number */
sign = (str[0] == '-' || str[0] == '+');
x = expo - 1; /* expo is the exponent value with decimal point BEFORE
the first digit, we wants decimal point AFTER the first
digit */
if (base == 16)
x <<= 2; /* the output exponent is a binary exponent */
++sz; /* + decimal point */
if (x != 0)
{
/* augment sz with the size needed for an exponent written in base
ten */
mp_exp_t xx;
sz += 3; /* + exponent char + sign + 1 digit */
if (x < 0)
{
/* avoid overflow when changing sign (assuming that, for the
mp_exp_t type, (max value) is greater than (- min value / 10)) */
if (x < -10)
{
xx = - (x / 10);
sz++;
}
else
xx = -x;
}
else
xx = x;
/* compute sz += floor(log(expo)/log(10)) without using libm
functions */
while (xx > 9)
{
sz++;
xx /= 10;
}
}
pretty = mpc_alloc_str (sz);
p = pretty;
/* 1. optional sign plus first digit */
s = str;
*p++ = *s++;
if (sign)
*p++ = *s++;
/* 2. decimal point */
#ifdef HAVE_LOCALECONV
*p++ = *localeconv ()->decimal_point;
#else
*p++ = '.';
#endif
*p = '\0';
/* 3. other significant digits */
strcat (pretty, s);
/* 4. exponent (in base ten) */
if (x == 0)
return pretty;
p = pretty + strlen (str) + 1;
switch (base)
{
case 10:
*p++ = 'e';
break;
case 2:
case 16:
*p++ = 'p';
break;
default:
*p++ = '@';
}
*p = '\0';
sprintf (p, "%+"MPC_EXP_FORMAT_SPEC, x);
return pretty;
}
static char *
get_pretty_str (const int base, const size_t n, mpfr_srcptr x, mpfr_rnd_t rnd)
{
mp_exp_t expo;
char *ugly;
char *pretty;
if (mpfr_zero_p (x))
return pretty_zero (x);
ugly = mpfr_get_str (NULL, &expo, base, n, x, rnd);
MPC_ASSERT (ugly != NULL);
pretty = prettify (ugly, expo, base, !mpfr_number_p (x));
mpfr_free_str (ugly);
return pretty;
}
char *
mpc_get_str (int base, size_t n, mpc_srcptr op, mpc_rnd_t rnd)
{
size_t needed_size;
char *real_str;
char *imag_str;
char *complex_str = NULL;
if (base < 2 || base > 36)
return NULL;
real_str = get_pretty_str (base, n, mpc_realref (op), MPC_RND_RE (rnd));
imag_str = get_pretty_str (base, n, mpc_imagref (op), MPC_RND_IM (rnd));
needed_size = strlen (real_str) + strlen (imag_str) + 4;
complex_str = mpc_alloc_str (needed_size);
MPC_ASSERT (complex_str != NULL);
strcpy (complex_str, "(");
strcat (complex_str, real_str);
strcat (complex_str, " ");
strcat (complex_str, imag_str);
strcat (complex_str, ")");
mpc_free_str (real_str);
mpc_free_str (imag_str);
return complex_str;
}
mpc-1.0.3/src/set_x_x.c 0000644 0001751 0001751 00000004236 12426164730 011633 0000000 0000000 /* mpc_set_x_x -- Set complex number real and imaginary parts from parameters
whose type is known by mpfr.
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 "config.h"
#ifdef HAVE_INTTYPES_H
# include /* for intmax_t */
#else
# ifdef HAVE_STDINT_H
# include
# endif
#endif
#include "mpc-impl.h"
#define MPC_SET_X_X(type, z, real_value, imag_value, rnd) \
MPC_SET_X_Y (type, type, z, real_value, imag_value, rnd)
int
mpc_set_d_d (mpc_ptr z, double a, double b, mpc_rnd_t rnd)
MPC_SET_X_X (d, z, a, b, rnd)
int
mpc_set_f_f (mpc_ptr z, mpf_srcptr a, mpf_srcptr b, mpc_rnd_t rnd)
MPC_SET_X_X (f, z, a, b, rnd)
int
mpc_set_fr_fr (mpc_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpc_rnd_t rnd)
MPC_SET_X_X (fr, z, a, b, rnd)
int
mpc_set_ld_ld (mpc_ptr z, long double a, long double b, mpc_rnd_t rnd)
MPC_SET_X_X (ld, z, a, b, rnd)
int
mpc_set_q_q (mpc_ptr z, mpq_srcptr a, mpq_srcptr b, mpc_rnd_t rnd)
MPC_SET_X_X (q, z, a, b, rnd)
int
mpc_set_si_si (mpc_ptr z, long int a, long int b, mpc_rnd_t rnd)
MPC_SET_X_X (si, z, a, b, rnd)
int
mpc_set_ui_ui (mpc_ptr z, unsigned long int a, unsigned long int b,
mpc_rnd_t rnd)
MPC_SET_X_X (ui, z, a, b, rnd)
int
mpc_set_z_z (mpc_ptr z, mpz_srcptr a, mpz_srcptr b, mpc_rnd_t rnd)
MPC_SET_X_X (z, z, a, b, rnd)
#ifdef _MPC_H_HAVE_INTMAX_T
int
mpc_set_uj_uj (mpc_ptr z, uintmax_t a, uintmax_t b, mpc_rnd_t rnd)
MPC_SET_X_X (uj, z, a, b, rnd)
int
mpc_set_sj_sj (mpc_ptr z, intmax_t a, intmax_t b, mpc_rnd_t rnd)
MPC_SET_X_X (sj, z, a, b, rnd)
#endif
mpc-1.0.3/src/div_ui.c 0000644 0001751 0001751 00000002074 12426164730 011437 0000000 0000000 /* mpc_div_ui -- Divide a complex number by a nonnegative integer.
Copyright (C) 2002, 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-impl.h"
int
mpc_div_ui (mpc_ptr a, mpc_srcptr b, unsigned long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_div_ui (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_div_ui (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/out_str.c 0000644 0001751 0001751 00000002435 12426164730 011660 0000000 0000000 /* mpc_out_str -- Output a complex number on a given stream.
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 /* for FILE */
#include
#include "mpc-impl.h"
size_t
mpc_out_str (FILE *stream, int base, size_t n, mpc_srcptr op, mpc_rnd_t rnd) {
size_t size = 3; /* for '(', ' ' and ')' */
if (stream == NULL)
stream = stdout; /* fprintf does not allow NULL as first argument */
fprintf (stream, "(");
size += mpfr_out_str (stream, base, n, mpc_realref(op), MPC_RND_RE(rnd));
fprintf (stream, " ");
size += mpfr_out_str (stream, base, n, mpc_imagref(op), MPC_RND_RE(rnd));
fprintf (stream, ")");
return size;
}
mpc-1.0.3/src/ui_ui_sub.c 0000644 0001751 0001751 00000002272 12426164730 012143 0000000 0000000 /* mpc_ui_ui_sub -- Subtract a complex number from another one given
implicitly by its real and imaginary parts of type unsigned long int.
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-impl.h"
int
mpc_ui_ui_sub (mpc_ptr rop, unsigned long int re, unsigned long int im,
mpc_srcptr op, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_ui_sub (mpc_realref (rop), re, mpc_realref (op), MPC_RND_RE (rnd));
inex_im = mpfr_ui_sub (mpc_imagref (rop), im, mpc_imagref (op), MPC_RND_IM (rnd));
return MPC_INEX (inex_re, inex_im);
}
mpc-1.0.3/src/asinh.c 0000644 0001751 0001751 00000003141 12426164730 011256 0000000 0000000 /* mpc_asinh -- inverse hyperbolic sine of a complex number.
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-impl.h"
int
mpc_asinh (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
/* asinh(op) = -i*asin(i*op) */
int inex;
mpc_t z, a;
mpfr_t tmp;
/* z = i*op */
mpc_realref (z)[0] = mpc_imagref (op)[0];
mpc_imagref (z)[0] = mpc_realref (op)[0];
MPFR_CHANGE_SIGN (mpc_realref (z));
/* Note reversal of precisions due to later multiplication by -i */
mpc_init3 (a, MPC_PREC_IM(rop), MPC_PREC_RE(rop));
inex = mpc_asin (a, z,
MPC_RND (INV_RND (MPC_RND_IM (rnd)), MPC_RND_RE (rnd)));
/* if a = asin(i*op) = x+i*y, and we want y-i*x */
/* change a to -i*a */
tmp[0] = mpc_realref (a)[0];
mpc_realref (a)[0] = mpc_imagref (a)[0];
mpc_imagref (a)[0] = tmp[0];
MPFR_CHANGE_SIGN (mpc_imagref (a));
mpc_set (rop, a, MPC_RNDNN); /* exact */
mpc_clear (a);
return MPC_INEX (MPC_INEX_IM (inex), -MPC_INEX_RE (inex));
}
mpc-1.0.3/src/log.c 0000644 0001751 0001751 00000017502 12470362212 010735 0000000 0000000 /* mpc_log -- Take the logarithm of a complex number.
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 /* for MPC_ASSERT */
#include "mpc-impl.h"
int
mpc_log (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd){
int ok, underflow = 0;
mpfr_srcptr x, y;
mpfr_t v, w;
mpfr_prec_t prec;
int loops;
int re_cmp, im_cmp;
int inex_re, inex_im;
int err;
mpfr_exp_t expw;
int sgnw;
/* special values: NaN and infinities */
if (!mpc_fin_p (op)) {
if (mpfr_nan_p (mpc_realref (op))) {
if (mpfr_inf_p (mpc_imagref (op)))
mpfr_set_inf (mpc_realref (rop), +1);
else
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
inex_im = 0; /* Inf/NaN is exact */
}
else if (mpfr_nan_p (mpc_imagref (op))) {
if (mpfr_inf_p (mpc_realref (op)))
mpfr_set_inf (mpc_realref (rop), +1);
else
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
inex_im = 0; /* Inf/NaN is exact */
}
else /* We have an infinity in at least one part. */ {
inex_im = mpfr_atan2 (mpc_imagref (rop), mpc_imagref (op), mpc_realref (op),
MPC_RND_IM (rnd));
mpfr_set_inf (mpc_realref (rop), +1);
}
return MPC_INEX(0, inex_im);
}
/* special cases: real and purely imaginary numbers */
re_cmp = mpfr_cmp_ui (mpc_realref (op), 0);
im_cmp = mpfr_cmp_ui (mpc_imagref (op), 0);
if (im_cmp == 0) {
if (re_cmp == 0) {
inex_im = mpfr_atan2 (mpc_imagref (rop), mpc_imagref (op), mpc_realref (op),
MPC_RND_IM (rnd));
mpfr_set_inf (mpc_realref (rop), -1);
inex_re = 0; /* -Inf is exact */
}
else if (re_cmp > 0) {
inex_re = mpfr_log (mpc_realref (rop), mpc_realref (op), MPC_RND_RE (rnd));
inex_im = mpfr_set (mpc_imagref (rop), mpc_imagref (op), MPC_RND_IM (rnd));
}
else {
/* op = x + 0*y; let w = -x = |x| */
int negative_zero;
mpfr_rnd_t rnd_im;
negative_zero = mpfr_signbit (mpc_imagref (op));
if (negative_zero)
rnd_im = INV_RND (MPC_RND_IM (rnd));
else
rnd_im = MPC_RND_IM (rnd);
w [0] = *mpc_realref (op);
MPFR_CHANGE_SIGN (w);
inex_re = mpfr_log (mpc_realref (rop), w, MPC_RND_RE (rnd));
inex_im = mpfr_const_pi (mpc_imagref (rop), rnd_im);
if (negative_zero) {
mpc_conj (rop, rop, MPC_RNDNN);
inex_im = -inex_im;
}
}
return MPC_INEX(inex_re, inex_im);
}
else if (re_cmp == 0) {
if (im_cmp > 0) {
inex_re = mpfr_log (mpc_realref (rop), mpc_imagref (op), MPC_RND_RE (rnd));
inex_im = mpfr_const_pi (mpc_imagref (rop), MPC_RND_IM (rnd));
/* division by 2 does not change the ternary flag */
mpfr_div_2ui (mpc_imagref (rop), mpc_imagref (rop), 1, GMP_RNDN);
}
else {
w [0] = *mpc_imagref (op);
MPFR_CHANGE_SIGN (w);
inex_re = mpfr_log (mpc_realref (rop), w, MPC_RND_RE (rnd));
inex_im = mpfr_const_pi (mpc_imagref (rop), INV_RND (MPC_RND_IM (rnd)));
/* division by 2 does not change the ternary flag */
mpfr_div_2ui (mpc_imagref (rop), mpc_imagref (rop), 1, GMP_RNDN);
mpfr_neg (mpc_imagref (rop), mpc_imagref (rop), GMP_RNDN);
inex_im = -inex_im; /* negate the ternary flag */
}
return MPC_INEX(inex_re, inex_im);
}
prec = MPC_PREC_RE(rop);
mpfr_init2 (w, 2);
/* let op = x + iy; log = 1/2 log (x^2 + y^2) + i atan2 (y, x) */
/* loop for the real part: 1/2 log (x^2 + y^2), fast, but unsafe */
/* implementation */
ok = 0;
for (loops = 1; !ok && loops <= 2; loops++) {
prec += mpc_ceil_log2 (prec) + 4;
mpfr_set_prec (w, prec);
mpc_abs (w, op, GMP_RNDN);
/* error 0.5 ulp */
if (mpfr_inf_p (w))
/* intermediate overflow; the logarithm may be representable.
Intermediate underflow is impossible. */
break;
mpfr_log (w, w, GMP_RNDN);
/* generic error of log: (2^(- exp(w)) + 0.5) ulp */
if (mpfr_zero_p (w))
/* impossible to round, switch to second algorithm */
break;
err = MPC_MAX (-mpfr_get_exp (w), 0) + 1;
/* number of lost digits */
ok = mpfr_can_round (w, prec - err, GMP_RNDN, GMP_RNDZ,
mpfr_get_prec (mpc_realref (rop)) + (MPC_RND_RE (rnd) == GMP_RNDN));
}
if (!ok) {
prec = MPC_PREC_RE(rop);
mpfr_init2 (v, 2);
/* compute 1/2 log (x^2 + y^2) = log |x| + 1/2 * log (1 + (y/x)^2)
if |x| >= |y|; otherwise, exchange x and y */
if (mpfr_cmpabs (mpc_realref (op), mpc_imagref (op)) >= 0) {
x = mpc_realref (op);
y = mpc_imagref (op);
}
else {
x = mpc_imagref (op);
y = mpc_realref (op);
}
do {
prec += mpc_ceil_log2 (prec) + 4;
mpfr_set_prec (v, prec);
mpfr_set_prec (w, prec);
mpfr_div (v, y, x, GMP_RNDD); /* error 1 ulp */
mpfr_sqr (v, v, GMP_RNDD);
/* generic error of multiplication:
1 + 2*1*(2+1*2^(1-prec)) <= 5.0625 since prec >= 6 */
mpfr_log1p (v, v, GMP_RNDD);
/* error 1 + 4*5.0625 = 21.25 , see algorithms.tex */
mpfr_div_2ui (v, v, 1, GMP_RNDD);
/* If the result is 0, then there has been an underflow somewhere. */
mpfr_abs (w, x, GMP_RNDN); /* exact */
mpfr_log (w, w, GMP_RNDN); /* error 0.5 ulp */
expw = mpfr_get_exp (w);
sgnw = mpfr_signbit (w);
mpfr_add (w, w, v, GMP_RNDN);
if (!sgnw) /* v is positive, so no cancellation;
error 22.25 ulp; error counts lost bits */
err = 5;
else
err = MPC_MAX (5 + mpfr_get_exp (v),
/* 21.25 ulp (v) rewritten in ulp (result, now in w) */
-1 + expw - mpfr_get_exp (w)
/* 0.5 ulp (previous w), rewritten in ulp (result) */
) + 2;
/* handle one special case: |x|=1, and (y/x)^2 underflows;
then 1/2*log(x^2+y^2) \approx 1/2*y^2 also underflows. */
if ( (mpfr_cmp_si (x, -1) == 0 || mpfr_cmp_ui (x, 1) == 0)
&& mpfr_zero_p (w))
underflow = 1;
} while (!underflow &&
!mpfr_can_round (w, prec - err, GMP_RNDN, GMP_RNDZ,
mpfr_get_prec (mpc_realref (rop)) + (MPC_RND_RE (rnd) == GMP_RNDN)));
mpfr_clear (v);
}
/* imaginary part */
inex_im = mpfr_atan2 (mpc_imagref (rop), mpc_imagref (op), mpc_realref (op),
MPC_RND_IM (rnd));
/* set the real part; cannot be done before if rop==op */
if (underflow)
/* create underflow in result */
inex_re = mpfr_set_ui_2exp (mpc_realref (rop), 1,
mpfr_get_emin_min () - 2, MPC_RND_RE (rnd));
else
inex_re = mpfr_set (mpc_realref (rop), w, MPC_RND_RE (rnd));
mpfr_clear (w);
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/tanh.c 0000644 0001751 0001751 00000003200 12426164730 011102 0000000 0000000 /* mpc_tanh -- hyperbolic tangent of a complex number.
Copyright (C) 2008, 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-impl.h"
int
mpc_tanh (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
/* tanh(op) = -i*tan(i*op) = conj(-i*tan(conj(-i*op))) */
mpc_t z;
mpc_t tan_z;
int inex;
/* z := conj(-i * op) and rop = conj(-i * tan(z)), in other words, we have
to switch real and imaginary parts. Let us set them without copying
significands. */
mpc_realref (z)[0] = mpc_imagref (op)[0];
mpc_imagref (z)[0] = mpc_realref (op)[0];
mpc_realref (tan_z)[0] = mpc_imagref (rop)[0];
mpc_imagref (tan_z)[0] = mpc_realref (rop)[0];
inex = mpc_tan (tan_z, z, MPC_RND (MPC_RND_IM (rnd), MPC_RND_RE (rnd)));
/* tan_z and rop parts share the same significands, copy the rest now. */
mpc_realref (rop)[0] = mpc_imagref (tan_z)[0];
mpc_imagref (rop)[0] = mpc_realref (tan_z)[0];
/* swap inexact flags for real and imaginary parts */
return MPC_INEX (MPC_INEX_IM (inex), MPC_INEX_RE (inex));
}
mpc-1.0.3/src/mul_i.c 0000644 0001751 0001751 00000004712 12470362212 011260 0000000 0000000 /* mpc_mul_i -- Multiply a complex number by plus or minus i.
Copyright (C) 2005, 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-impl.h"
int
mpc_mul_i (mpc_ptr a, mpc_srcptr b, int sign, mpc_rnd_t rnd)
/* if sign is >= 0, multiply by i, otherwise by -i */
{
int inex_re, inex_im;
mpfr_t tmp;
/* Treat the most probable case of compatible precisions first */
if ( MPC_PREC_RE (b) == MPC_PREC_IM (a)
&& MPC_PREC_IM (b) == MPC_PREC_RE (a))
{
if (a == b)
mpfr_swap (mpc_realref (a), mpc_imagref (a));
else
{
mpfr_set (mpc_realref (a), mpc_imagref (b), GMP_RNDN);
mpfr_set (mpc_imagref (a), mpc_realref (b), GMP_RNDN);
}
if (sign >= 0)
MPFR_CHANGE_SIGN (mpc_realref (a));
else
MPFR_CHANGE_SIGN (mpc_imagref (a));
inex_re = 0;
inex_im = 0;
}
else
{
if (a == b)
{
mpfr_init2 (tmp, MPC_PREC_RE (a));
if (sign >= 0)
{
inex_re = mpfr_neg (tmp, mpc_imagref (b), MPC_RND_RE (rnd));
inex_im = mpfr_set (mpc_imagref (a), mpc_realref (b), MPC_RND_IM (rnd));
}
else
{
inex_re = mpfr_set (tmp, mpc_imagref (b), MPC_RND_RE (rnd));
inex_im = mpfr_neg (mpc_imagref (a), mpc_realref (b), MPC_RND_IM (rnd));
}
mpfr_clear (mpc_realref (a));
mpc_realref (a)[0] = tmp [0];
}
else
if (sign >= 0)
{
inex_re = mpfr_neg (mpc_realref (a), mpc_imagref (b), MPC_RND_RE (rnd));
inex_im = mpfr_set (mpc_imagref (a), mpc_realref (b), MPC_RND_IM (rnd));
}
else
{
inex_re = mpfr_set (mpc_realref (a), mpc_imagref (b), MPC_RND_RE (rnd));
inex_im = mpfr_neg (mpc_imagref (a), mpc_realref (b), MPC_RND_IM (rnd));
}
}
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/add_fr.c 0000644 0001751 0001751 00000002154 12426164730 011376 0000000 0000000 /* mpc_add_fr -- Add a complex number and a floating-point number.
Copyright (C) 2002, 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-impl.h"
/* return 0 iff both the real and imaginary parts are exact */
int
mpc_add_fr (mpc_ptr a, mpc_srcptr b, mpfr_srcptr c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_add (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref(a), mpc_imagref(b), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/fr_sub.c 0000644 0001751 0001751 00000002177 12426164730 011444 0000000 0000000 /* mpc_fr_sub -- Substract a complex number from a floating-point number.
Copyright (C) 2008, 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-impl.h"
/* return 0 iff both the real and imaginary parts are exact */
int
mpc_fr_sub (mpc_ptr a, mpfr_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_sub (mpc_realref (a), b, mpc_realref (c), MPC_RND_RE (rnd));
inex_im = mpfr_neg (mpc_imagref (a), mpc_imagref (c), MPC_RND_IM (rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/real.c 0000644 0001751 0001751 00000001554 12426164730 011105 0000000 0000000 /* mpc_real -- Get the real part of a complex number.
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-impl.h"
int
mpc_real (mpfr_ptr a, mpc_srcptr b, mpfr_rnd_t rnd)
{
return mpfr_set (a, mpc_realref (b), rnd);
}
mpc-1.0.3/src/neg.c 0000644 0001751 0001751 00000001774 12426164730 010737 0000000 0000000 /* mpc_neg -- Negate a complex number.
Copyright (C) 2002, 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-impl.h"
int
mpc_neg (mpc_ptr a, mpc_srcptr b, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_neg (mpc_realref(a), mpc_realref(b), MPC_RND_RE(rnd));
inex_im = mpfr_neg (mpc_imagref(a), mpc_imagref(b), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/ui_div.c 0000644 0001751 0001751 00000002052 12426164730 011433 0000000 0000000 /* mpc_ui_div -- Divide an unsigned long int by a complex number.
Copyright (C) 2002, 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
#include "mpc-impl.h"
int
mpc_ui_div (mpc_ptr a, unsigned long int b, mpc_srcptr c, mpc_rnd_t rnd)
{
int inex;
mpc_t bb;
mpc_init2 (bb, sizeof(unsigned long int) * CHAR_BIT);
mpc_set_ui (bb, b, rnd); /* exact */
inex = mpc_div (a, bb, c, rnd);
mpc_clear (bb);
return inex;
}
mpc-1.0.3/src/pow_ui.c 0000644 0001751 0001751 00000012412 12470362212 011451 0000000 0000000 /* mpc_pow_ui -- Raise a complex number to an integer power.
Copyright (C) 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 /* for CHAR_BIT */
#include "mpc-impl.h"
static int
mpc_pow_usi_naive (mpc_ptr z, mpc_srcptr x, unsigned long y, int sign,
mpc_rnd_t rnd)
{
int inex;
mpc_t t;
mpc_init3 (t, sizeof (unsigned long) * CHAR_BIT, MPFR_PREC_MIN);
if (sign > 0)
mpc_set_ui (t, y, MPC_RNDNN); /* exact */
else
mpc_set_si (t, - (signed long) y, MPC_RNDNN);
inex = mpc_pow (z, x, t, rnd);
mpc_clear (t);
return inex;
}
int
mpc_pow_usi (mpc_ptr z, mpc_srcptr x, unsigned long y, int sign,
mpc_rnd_t rnd)
/* computes z = x^(sign*y) */
{
int inex;
mpc_t t, x3;
mpfr_prec_t p, l, l0;
long unsigned int u;
int has3; /* non-zero if y has '11' in its binary representation */
int loop, done;
/* let mpc_pow deal with special values */
if (!mpc_fin_p (x) || mpfr_zero_p (mpc_realref (x)) || mpfr_zero_p (mpc_imagref(x))
|| y == 0)
return mpc_pow_usi_naive (z, x, y, sign, rnd);
/* easy special cases */
else if (y == 1) {
if (sign > 0)
return mpc_set (z, x, rnd);
else
return mpc_ui_div (z, 1ul, x, rnd);
}
else if (y == 2 && sign > 0)
return mpc_sqr (z, x, rnd);
/* let mpc_pow treat potential over- and underflows */
else {
mpfr_exp_t exp_r = mpfr_get_exp (mpc_realref (x)),
exp_i = mpfr_get_exp (mpc_imagref (x));
if ( MPC_MAX (exp_r, exp_i) > mpfr_get_emax () / (mpfr_exp_t) y
/* heuristic for overflow */
|| MPC_MAX (-exp_r, -exp_i) > (-mpfr_get_emin ()) / (mpfr_exp_t) y
/* heuristic for underflow */
)
return mpc_pow_usi_naive (z, x, y, sign, rnd);
}
has3 = (y & (y >> 1)) != 0;
for (l = 0, u = y; u > 3; l ++, u >>= 1);
/* l>0 is the number of bits of y, minus 2, thus y has bits:
y_{l+1} y_l y_{l-1} ... y_1 y_0 */
l0 = l + 2;
p = MPC_MAX_PREC(z) + l0 + 32; /* l0 ensures that y*2^{-p} <= 1 below */
mpc_init2 (t, p);
if (has3)
mpc_init2 (x3, p);
loop = 0;
done = 0;
while (!done) {
loop++;
mpc_sqr (t, x, MPC_RNDNN);
if (has3) {
mpc_mul (x3, t, x, MPC_RNDNN);
if ((y >> l) & 1) /* y starts with 11... */
mpc_set (t, x3, MPC_RNDNN);
}
while (l-- > 0) {
mpc_sqr (t, t, MPC_RNDNN);
if ((y >> l) & 1) {
if ((l > 0) && ((y >> (l-1)) & 1)) /* implies has3 <> 0 */ {
l--;
mpc_sqr (t, t, MPC_RNDNN);
mpc_mul (t, t, x3, MPC_RNDNN);
}
else
mpc_mul (t, t, x, MPC_RNDNN);
}
}
if (sign < 0)
mpc_ui_div (t, 1ul, t, MPC_RNDNN);
if (mpfr_zero_p (mpc_realref(t)) || mpfr_zero_p (mpc_imagref(t))) {
inex = mpc_pow_usi_naive (z, x, y, sign, rnd);
/* since mpfr_get_exp() is not defined for zero */
done = 1;
}
else {
/* see error bound in algorithms.tex; we use y<2^l0 instead of y-1
also when sign>0 */
mpfr_exp_t diff;
mpfr_prec_t er, ei;
diff = mpfr_get_exp (mpc_realref(t)) - mpfr_get_exp (mpc_imagref(t));
/* the factor on the real part is 2+2^(-diff+2) <= 4 for diff >= 1
and < 2^(-diff+3) for diff <= 0 */
er = (diff >= 1) ? l0 + 3 : l0 + (-diff) + 3;
/* the factor on the imaginary part is 2+2^(diff+2) <= 4 for diff <= -1
and < 2^(diff+3) for diff >= 0 */
ei = (diff <= -1) ? l0 + 3 : l0 + diff + 3;
if (mpfr_can_round (mpc_realref(t), p - er, GMP_RNDN, GMP_RNDZ,
MPC_PREC_RE(z) + (MPC_RND_RE(rnd) == GMP_RNDN))
&& mpfr_can_round (mpc_imagref(t), p - ei, GMP_RNDN, GMP_RNDZ,
MPC_PREC_IM(z) + (MPC_RND_IM(rnd) == GMP_RNDN))) {
inex = mpc_set (z, t, rnd);
done = 1;
}
else if (loop == 1 && SAFE_ABS(mpfr_prec_t, diff) < MPC_MAX_PREC(z)) {
/* common case, make a second trial at higher precision */
p += MPC_MAX_PREC(x);
mpc_set_prec (t, p);
if (has3)
mpc_set_prec (x3, p);
l = l0 - 2;
}
else {
/* stop the loop and use mpc_pow */
inex = mpc_pow_usi_naive (z, x, y, sign, rnd);
done = 1;
}
}
}
mpc_clear (t);
if (has3)
mpc_clear (x3);
return inex;
}
int
mpc_pow_ui (mpc_ptr z, mpc_srcptr x, unsigned long y, mpc_rnd_t rnd)
{
return mpc_pow_usi (z, x, y, 1, rnd);
}
mpc-1.0.3/src/Makefile.am 0000644 0001751 0001751 00000003243 12433365705 012052 0000000 0000000 ## src/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/ .
lib_LTLIBRARIES = libmpc.la
libmpc_la_LDFLAGS = $(MPC_LDFLAGS) -version-info 3:0:0
libmpc_la_SOURCES = mpc-impl.h abs.c acos.c acosh.c add.c add_fr.c \
add_si.c add_ui.c arg.c asin.c asinh.c atan.c atanh.c clear.c cmp.c \
cmp_si_si.c conj.c cos.c cosh.c div_2si.c div_2ui.c div.c div_fr.c \
div_ui.c exp.c fma.c fr_div.c fr_sub.c get_prec2.c get_prec.c \
get_version.c get_x.c imag.c init2.c init3.c inp_str.c log.c log10.c \
mem.c mul_2si.c mul_2ui.c mul.c mul_fr.c mul_i.c mul_si.c mul_ui.c \
neg.c norm.c out_str.c pow.c pow_fr.c \
pow_ld.c pow_d.c pow_si.c pow_ui.c pow_z.c proj.c real.c urandom.c set.c \
set_prec.c set_str.c set_x.c set_x_x.c sin.c sin_cos.c sinh.c sqr.c \
sqrt.c strtoc.c sub.c sub_fr.c sub_ui.c swap.c tan.c tanh.c uceil_log2.c \
ui_div.c ui_ui_sub.c
libmpc_la_LIBADD = @LTLIBOBJS@
mpc-1.0.3/src/proj.c 0000644 0001751 0001751 00000002162 12426164730 011130 0000000 0000000 /* mpc_proj -- projection of a complex number onto the Riemann sphere.
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-impl.h"
int
mpc_proj (mpc_ptr a, mpc_srcptr b, mpc_rnd_t rnd)
{
if (mpc_inf_p (b)) {
/* infinities project to +Inf +i* copysign(0.0, cimag(z)) */
mpfr_set_inf (mpc_realref (a), +1);
mpfr_set_zero (mpc_imagref (a), (mpfr_signbit (mpc_imagref (b)) ? -1 : 1));
return MPC_INEX (0, 0);
}
else
return mpc_set (a, b, rnd);
}
mpc-1.0.3/src/conj.c 0000644 0001751 0001751 00000002004 12426164730 011102 0000000 0000000 /* mpc_conj -- Conjugate of a complex number.
Copyright (C) 2002, 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-impl.h"
int
mpc_conj (mpc_ptr a, mpc_srcptr b, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_set (mpc_realref(a), mpc_realref(b), MPC_RND_RE(rnd));
inex_im = mpfr_neg (mpc_imagref(a), mpc_imagref(b), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/mul_2si.c 0000644 0001751 0001751 00000002033 12426164730 011525 0000000 0000000 /* mpc_mul_2si -- Multiply a complex number by 2^e.
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-impl.h"
int
mpc_mul_2si (mpc_ptr a, mpc_srcptr b, long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_mul_2si (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_mul_2si (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/cosh.c 0000644 0001751 0001751 00000002066 12426164730 011115 0000000 0000000 /* mpc_cosh -- hyperbolic cosine of a complex number.
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-impl.h"
int
mpc_cosh (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
/* cosh(op) = cos(i*op) */
mpc_t z;
/* z = i*op without copying significand */
mpc_realref (z)[0] = mpc_imagref (op)[0];
mpc_imagref (z)[0] = mpc_realref (op)[0];
MPFR_CHANGE_SIGN (mpc_realref (z));
return mpc_cos (rop, z, rnd);
}
mpc-1.0.3/src/sin_cos.c 0000644 0001751 0001751 00000034775 12470362212 011624 0000000 0000000 /* mpc_sin_cos -- combined sine and cosine of a complex number.
Copyright (C) 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-impl.h"
static int
mpc_sin_cos_nonfinite (mpc_ptr rop_sin, mpc_ptr rop_cos, mpc_srcptr op,
mpc_rnd_t rnd_sin, mpc_rnd_t rnd_cos)
/* assumes that op (that is, its real or imaginary part) is not finite */
{
int overlap;
mpc_t op_loc;
overlap = (rop_sin == op || rop_cos == op);
if (overlap) {
mpc_init3 (op_loc, MPC_PREC_RE (op), MPC_PREC_IM (op));
mpc_set (op_loc, op, MPC_RNDNN);
}
else
op_loc [0] = op [0];
if (rop_sin != NULL) {
if (mpfr_nan_p (mpc_realref (op_loc)) || mpfr_nan_p (mpc_imagref (op_loc))) {
mpc_set (rop_sin, op_loc, rnd_sin);
if (mpfr_nan_p (mpc_imagref (op_loc))) {
/* sin(x +i*NaN) = NaN +i*NaN, except for x=0 */
/* sin(-0 +i*NaN) = -0 +i*NaN */
/* sin(+0 +i*NaN) = +0 +i*NaN */
if (!mpfr_zero_p (mpc_realref (op_loc)))
mpfr_set_nan (mpc_realref (rop_sin));
}
else /* op = NaN + i*y */
if (!mpfr_inf_p (mpc_imagref (op_loc)) && !mpfr_zero_p (mpc_imagref (op_loc)))
/* sin(NaN -i*Inf) = NaN -i*Inf */
/* sin(NaN -i*0) = NaN -i*0 */
/* sin(NaN +i*0) = NaN +i*0 */
/* sin(NaN +i*Inf) = NaN +i*Inf */
/* sin(NaN +i*y) = NaN +i*NaN, when 0<|y| 0 */
inex_cos_re = mpfr_cosh (mpc_realref (rop_cos), mpc_imagref (op_loc), MPC_RND_RE (rnd_cos));
mpfr_set_ui (mpc_imagref (rop_cos), 0ul, MPC_RND_IM (rnd_cos));
if (mpfr_signbit (mpc_realref (op_loc)) == mpfr_signbit (mpc_imagref (op_loc)))
MPFR_CHANGE_SIGN (mpc_imagref (rop_cos));
}
if (overlap)
mpc_clear (op_loc);
return MPC_INEX12 (MPC_INEX (0, inex_sin_im), MPC_INEX (inex_cos_re, 0));
}
int
mpc_sin_cos (mpc_ptr rop_sin, mpc_ptr rop_cos, mpc_srcptr op,
mpc_rnd_t rnd_sin, mpc_rnd_t rnd_cos)
/* Feature not documented in the texinfo file: One of rop_sin or
rop_cos may be NULL, in which case it is not computed, and the
corresponding ternary inexact value is set to 0 (exact). */
{
if (!mpc_fin_p (op))
return mpc_sin_cos_nonfinite (rop_sin, rop_cos, op, rnd_sin, rnd_cos);
else if (mpfr_zero_p (mpc_imagref (op)))
return mpc_sin_cos_real (rop_sin, rop_cos, op, rnd_sin, rnd_cos);
else if (mpfr_zero_p (mpc_realref (op)))
return mpc_sin_cos_imag (rop_sin, rop_cos, op, rnd_sin, rnd_cos);
else {
/* let op = a + i*b, then sin(op) = sin(a)*cosh(b) + i*cos(a)*sinh(b)
and cos(op) = cos(a)*cosh(b) - i*sin(a)*sinh(b).
For Re(sin(op)) (and analogously, the other parts), we use the
following algorithm, with rounding to nearest for all operations
and working precision w:
(1) x = o(sin(a))
(2) y = o(cosh(b))
(3) r = o(x*y)
then the error on r is at most 4 ulps, since we can write
r = sin(a)*cosh(b)*(1+t)^3 with |t| <= 2^(-w),
thus for w >= 2, r = sin(a)*cosh(b)*(1+4*t) with |t| <= 2^(-w),
thus the relative error is bounded by 4*2^(-w) <= 4*ulp(r).
*/
mpfr_t s, c, sh, ch, sch, csh;
mpfr_prec_t prec;
int ok;
int inex_re, inex_im, inex_sin, inex_cos;
prec = 2;
if (rop_sin != NULL)
prec = MPC_MAX (prec, MPC_MAX_PREC (rop_sin));
if (rop_cos != NULL)
prec = MPC_MAX (prec, MPC_MAX_PREC (rop_cos));
mpfr_init2 (s, 2);
mpfr_init2 (c, 2);
mpfr_init2 (sh, 2);
mpfr_init2 (ch, 2);
mpfr_init2 (sch, 2);
mpfr_init2 (csh, 2);
do {
ok = 1;
prec += mpc_ceil_log2 (prec) + 5;
mpfr_set_prec (s, prec);
mpfr_set_prec (c, prec);
mpfr_set_prec (sh, prec);
mpfr_set_prec (ch, prec);
mpfr_set_prec (sch, prec);
mpfr_set_prec (csh, prec);
mpfr_sin_cos (s, c, mpc_realref(op), GMP_RNDN);
mpfr_sinh_cosh (sh, ch, mpc_imagref(op), GMP_RNDN);
if (rop_sin != NULL) {
/* real part of sine */
mpfr_mul (sch, s, ch, GMP_RNDN);
ok = (!mpfr_number_p (sch))
|| mpfr_can_round (sch, prec - 2, GMP_RNDN, GMP_RNDZ,
MPC_PREC_RE (rop_sin)
+ (MPC_RND_RE (rnd_sin) == GMP_RNDN));
if (ok) {
/* imaginary part of sine */
mpfr_mul (csh, c, sh, GMP_RNDN);
ok = (!mpfr_number_p (csh))
|| mpfr_can_round (csh, prec - 2, GMP_RNDN, GMP_RNDZ,
MPC_PREC_IM (rop_sin)
+ (MPC_RND_IM (rnd_sin) == GMP_RNDN));
}
}
if (rop_cos != NULL && ok) {
/* real part of cosine */
mpfr_mul (c, c, ch, GMP_RNDN);
ok = (!mpfr_number_p (c))
|| mpfr_can_round (c, prec - 2, GMP_RNDN, GMP_RNDZ,
MPC_PREC_RE (rop_cos)
+ (MPC_RND_RE (rnd_cos) == GMP_RNDN));
if (ok) {
/* imaginary part of cosine */
mpfr_mul (s, s, sh, GMP_RNDN);
mpfr_neg (s, s, GMP_RNDN);
ok = (!mpfr_number_p (s))
|| mpfr_can_round (s, prec - 2, GMP_RNDN, GMP_RNDZ,
MPC_PREC_IM (rop_cos)
+ (MPC_RND_IM (rnd_cos) == GMP_RNDN));
}
}
} while (ok == 0);
if (rop_sin != NULL) {
inex_re = mpfr_set (mpc_realref (rop_sin), sch, MPC_RND_RE (rnd_sin));
if (mpfr_inf_p (sch))
inex_re = mpfr_sgn (sch);
inex_im = mpfr_set (mpc_imagref (rop_sin), csh, MPC_RND_IM (rnd_sin));
if (mpfr_inf_p (csh))
inex_im = mpfr_sgn (csh);
inex_sin = MPC_INEX (inex_re, inex_im);
}
else
inex_sin = MPC_INEX (0,0); /* return exact if not computed */
if (rop_cos != NULL) {
inex_re = mpfr_set (mpc_realref (rop_cos), c, MPC_RND_RE (rnd_cos));
if (mpfr_inf_p (c))
inex_re = mpfr_sgn (c);
inex_im = mpfr_set (mpc_imagref (rop_cos), s, MPC_RND_IM (rnd_cos));
if (mpfr_inf_p (s))
inex_im = mpfr_sgn (s);
inex_cos = MPC_INEX (inex_re, inex_im);
}
else
inex_cos = MPC_INEX (0,0); /* return exact if not computed */
mpfr_clear (s);
mpfr_clear (c);
mpfr_clear (sh);
mpfr_clear (ch);
mpfr_clear (sch);
mpfr_clear (csh);
return (MPC_INEX12 (inex_sin, inex_cos));
}
}
mpc-1.0.3/src/urandom.c 0000644 0001751 0001751 00000001737 12426164730 011632 0000000 0000000 /* mpc_urandom -- Generate a random complex number uniformly distributed in
the interval [0,1[.
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-impl.h"
int
mpc_urandom (mpc_ptr a, gmp_randstate_t state)
{
int r, i;
r = mpfr_urandomb (mpc_realref(a), state);
i = mpfr_urandomb (mpc_imagref(a), state);
return r && i;
}
mpc-1.0.3/src/mem.c 0000644 0001751 0001751 00000002522 12426164730 010734 0000000 0000000 /* wrapper functions to allocate, reallocate and free memory
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 /* for strlen */
#include "mpc-impl.h"
char *
mpc_alloc_str (size_t len)
{
void * (*allocfunc) (size_t);
mp_get_memory_functions (&allocfunc, NULL, NULL);
return (char *) ((*allocfunc) (len));
}
char *
mpc_realloc_str (char * str, size_t oldlen, size_t newlen)
{
void * (*reallocfunc) (void *, size_t, size_t);
mp_get_memory_functions (NULL, &reallocfunc, NULL);
return (char *) ((*reallocfunc) (str, oldlen, newlen));
}
void
mpc_free_str (char *str)
{
void (*freefunc) (void *, size_t);
mp_get_memory_functions (NULL, NULL, &freefunc);
(*freefunc) (str, strlen (str) + 1);
}
mpc-1.0.3/src/sinh.c 0000644 0001751 0001751 00000003174 12426164730 011123 0000000 0000000 /* mpc_sinh -- hyperbolic sine of a complex number.
Copyright (C)2008, 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-impl.h"
int
mpc_sinh (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
/* sinh(op) = -i*sin(i*op) = conj(-i*sin(conj(-i*op))) */
mpc_t z;
mpc_t sin_z;
int inex;
/* z := conj(-i * op) and rop = conj(-i * sin(z)), in other words, we have
to switch real and imaginary parts. Let us set them without copying
significands. */
mpc_realref (z)[0] = mpc_imagref (op)[0];
mpc_imagref (z)[0] = mpc_realref (op)[0];
mpc_realref (sin_z)[0] = mpc_imagref (rop)[0];
mpc_imagref (sin_z)[0] = mpc_realref (rop)[0];
inex = mpc_sin (sin_z, z, MPC_RND (MPC_RND_IM (rnd), MPC_RND_RE (rnd)));
/* sin_z and rop parts share the same significands, copy the rest now. */
mpc_realref (rop)[0] = mpc_imagref (sin_z)[0];
mpc_imagref (rop)[0] = mpc_realref (sin_z)[0];
/* swap inexact flags for real and imaginary parts */
return MPC_INEX (MPC_INEX_IM (inex), MPC_INEX_RE (inex));
}
mpc-1.0.3/src/fr_div.c 0000644 0001751 0001751 00000002207 12470362212 011421 0000000 0000000 /* mpc_fr_div -- Divide a floating-point number by a complex number.
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-impl.h"
int
mpc_fr_div (mpc_ptr a, mpfr_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
mpc_t bc;
int inexact;
mpc_realref (bc)[0] = b [0];
mpfr_init (mpc_imagref (bc));
/* we consider the operand b to have imaginary part +0 */
mpfr_set_ui (mpc_imagref (bc), 0, GMP_RNDN);
inexact = mpc_div (a, bc, c, rnd);
mpfr_clear (mpc_imagref (bc));
return inexact;
}
mpc-1.0.3/src/mpc-log.h 0000644 0001751 0001751 00000003013 12426164730 011515 0000000 0000000 /* mpc-log.h -- Include file to enable function call logging; replaces mpc.h.
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/ .
*/
#define mpc_sqr mpc_log_sqr
#define mpc_conj mpc_log_conj
#define mpc_neg mpc_log_neg
#define mpc_sqrt mpc_log_sqrt
#define mpc_proj mpc_log_proj
#define mpc_exp mpc_log_exp
#define mpc_log mpc_log_log
#define mpc_sin mpc_log_sin
#define mpc_cos mpc_log_cos
#define mpc_tan mpc_log_tan
#define mpc_sinh mpc_log_sinh
#define mpc_cosh mpc_log_cosh
#define mpc_tanh mpc_log_tanh
#define mpc_asin mpc_log_asin
#define mpc_acos mpc_log_acos
#define mpc_atan mpc_log_atan
#define mpc_asinh mpc_log_asinh
#define mpc_acosh mpc_log_acosh
#define mpc_atanh mpc_log_atanh
#define mpc_add mpc_log_add
#define mpc_sub mpc_log_sub
#define mpc_mul mpc_log_mul
#define mpc_div mpc_log_div
#define mpc_pow mpc_log_pow
#define mpc_fma mpc_log_fma
#define mpc_sin_cos mpc_log_sin_cos
#include "mpc.h"
mpc-1.0.3/src/set_x.c 0000644 0001751 0001751 00000005273 12426164730 011306 0000000 0000000 /* mpc_set_x -- Set the real part of a complex number
(imaginary part equals +0 regardless of rounding mode).
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 "config.h"
#ifdef HAVE_INTTYPES_H
# include /* for intmax_t */
#else
# ifdef HAVE_STDINT_H
# include
# endif
#endif
#ifdef HAVE_COMPLEX_H
# include
#endif
#include "mpc-impl.h"
#define MPC_SET_X(real_t, z, real_value, rnd) \
{ \
int _inex_re, _inex_im; \
_inex_re = (mpfr_set_ ## real_t) (mpc_realref (z), (real_value), MPC_RND_RE (rnd)); \
_inex_im = mpfr_set_ui (mpc_imagref (z), 0, MPC_RND_IM (rnd)); \
return MPC_INEX (_inex_re, _inex_im); \
}
int
mpc_set_fr (mpc_ptr a, mpfr_srcptr b, mpc_rnd_t rnd)
MPC_SET_X (fr, a, b, rnd)
int
mpc_set_d (mpc_ptr a, double b, mpc_rnd_t rnd)
MPC_SET_X (d, a, b, rnd)
int
mpc_set_ld (mpc_ptr a, long double b, mpc_rnd_t rnd)
MPC_SET_X (ld, a, b, rnd)
int
mpc_set_ui (mpc_ptr a, unsigned long int b, mpc_rnd_t rnd)
MPC_SET_X (ui, a, b, rnd)
int
mpc_set_si (mpc_ptr a, long int b, mpc_rnd_t rnd)
MPC_SET_X (si, a, b, rnd)
int
mpc_set_z (mpc_ptr a, mpz_srcptr b, mpc_rnd_t rnd)
MPC_SET_X (z, a, b, rnd)
int
mpc_set_q (mpc_ptr a, mpq_srcptr b, mpc_rnd_t rnd)
MPC_SET_X (q, a, b, rnd)
int
mpc_set_f (mpc_ptr a, mpf_srcptr b, mpc_rnd_t rnd)
MPC_SET_X (f, a, b, rnd)
#ifdef _MPC_H_HAVE_INTMAX_T
int
mpc_set_uj (mpc_ptr a, uintmax_t b, mpc_rnd_t rnd)
MPC_SET_X (uj, a, b, rnd)
int
mpc_set_sj (mpc_ptr a, intmax_t b, mpc_rnd_t rnd)
MPC_SET_X (sj, a, b, rnd)
#endif
#ifdef HAVE_COMPLEX_H
int
mpc_set_dc (mpc_ptr a, double _Complex b, mpc_rnd_t rnd) {
return mpc_set_d_d (a, creal (b), cimag (b), rnd);
}
int
mpc_set_ldc (mpc_ptr a, long double _Complex b, mpc_rnd_t rnd) {
return mpc_set_ld_ld (a, creall (b), cimagl (b), rnd);
}
#endif
void
mpc_set_nan (mpc_ptr a) {
mpfr_set_nan (mpc_realref (a));
mpfr_set_nan (mpc_imagref (a));
}
mpc-1.0.3/src/asin.c 0000644 0001751 0001751 00000020110 12470362212 011073 0000000 0000000 /* mpc_asin -- arcsine of a complex number.
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 "mpc-impl.h"
int
mpc_asin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
mpfr_prec_t p, p_re, p_im, incr_p = 0;
mpfr_rnd_t rnd_re, rnd_im;
mpc_t z1;
int inex;
/* special values */
if (mpfr_nan_p (mpc_realref (op)) || mpfr_nan_p (mpc_imagref (op)))
{
if (mpfr_inf_p (mpc_realref (op)) || mpfr_inf_p (mpc_imagref (op)))
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_inf (mpc_imagref (rop), mpfr_signbit (mpc_imagref (op)) ? -1 : +1);
}
else if (mpfr_zero_p (mpc_realref (op)))
{
mpfr_set (mpc_realref (rop), mpc_realref (op), GMP_RNDN);
mpfr_set_nan (mpc_imagref (rop));
}
else
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
}
return 0;
}
if (mpfr_inf_p (mpc_realref (op)) || mpfr_inf_p (mpc_imagref (op)))
{
int inex_re;
if (mpfr_inf_p (mpc_realref (op)))
{
int inf_im = mpfr_inf_p (mpc_imagref (op));
inex_re = set_pi_over_2 (mpc_realref (rop),
(mpfr_signbit (mpc_realref (op)) ? -1 : 1), MPC_RND_RE (rnd));
mpfr_set_inf (mpc_imagref (rop), (mpfr_signbit (mpc_imagref (op)) ? -1 : 1));
if (inf_im)
mpfr_div_2ui (mpc_realref (rop), mpc_realref (rop), 1, GMP_RNDN);
}
else
{
mpfr_set_zero (mpc_realref (rop), (mpfr_signbit (mpc_realref (op)) ? -1 : 1));
inex_re = 0;
mpfr_set_inf (mpc_imagref (rop), (mpfr_signbit (mpc_imagref (op)) ? -1 : 1));
}
return MPC_INEX (inex_re, 0);
}
/* pure real argument */
if (mpfr_zero_p (mpc_imagref (op)))
{
int inex_re;
int inex_im;
int s_im;
s_im = mpfr_signbit (mpc_imagref (op));
if (mpfr_cmp_ui (mpc_realref (op), 1) > 0)
{
if (s_im)
inex_im = -mpfr_acosh (mpc_imagref (rop), mpc_realref (op),
INV_RND (MPC_RND_IM (rnd)));
else
inex_im = mpfr_acosh (mpc_imagref (rop), mpc_realref (op),
MPC_RND_IM (rnd));
inex_re = set_pi_over_2 (mpc_realref (rop),
(mpfr_signbit (mpc_realref (op)) ? -1 : 1), MPC_RND_RE (rnd));
if (s_im)
mpc_conj (rop, rop, MPC_RNDNN);
}
else if (mpfr_cmp_si (mpc_realref (op), -1) < 0)
{
mpfr_t minus_op_re;
minus_op_re[0] = mpc_realref (op)[0];
MPFR_CHANGE_SIGN (minus_op_re);
if (s_im)
inex_im = -mpfr_acosh (mpc_imagref (rop), minus_op_re,
INV_RND (MPC_RND_IM (rnd)));
else
inex_im = mpfr_acosh (mpc_imagref (rop), minus_op_re,
MPC_RND_IM (rnd));
inex_re = set_pi_over_2 (mpc_realref (rop),
(mpfr_signbit (mpc_realref (op)) ? -1 : 1), MPC_RND_RE (rnd));
if (s_im)
mpc_conj (rop, rop, MPC_RNDNN);
}
else
{
inex_im = mpfr_set_ui (mpc_imagref (rop), 0, MPC_RND_IM (rnd));
if (s_im)
mpfr_neg (mpc_imagref (rop), mpc_imagref (rop), GMP_RNDN);
inex_re = mpfr_asin (mpc_realref (rop), mpc_realref (op), MPC_RND_RE (rnd));
}
return MPC_INEX (inex_re, inex_im);
}
/* pure imaginary argument */
if (mpfr_zero_p (mpc_realref (op)))
{
int inex_im;
int s;
s = mpfr_signbit (mpc_realref (op));
mpfr_set_ui (mpc_realref (rop), 0, GMP_RNDN);
if (s)
mpfr_neg (mpc_realref (rop), mpc_realref (rop), GMP_RNDN);
inex_im = mpfr_asinh (mpc_imagref (rop), mpc_imagref (op), MPC_RND_IM (rnd));
return MPC_INEX (0, inex_im);
}
/* regular complex: asin(z) = -i*log(i*z+sqrt(1-z^2)) */
p_re = mpfr_get_prec (mpc_realref(rop));
p_im = mpfr_get_prec (mpc_imagref(rop));
rnd_re = MPC_RND_RE(rnd);
rnd_im = MPC_RND_IM(rnd);
p = p_re >= p_im ? p_re : p_im;
mpc_init2 (z1, p);
while (1)
{
mpfr_exp_t ex, ey, err;
p += mpc_ceil_log2 (p) + 3 + incr_p; /* incr_p is zero initially */
incr_p = p / 2;
mpfr_set_prec (mpc_realref(z1), p);
mpfr_set_prec (mpc_imagref(z1), p);
/* z1 <- z^2 */
mpc_sqr (z1, op, MPC_RNDNN);
/* err(x) <= 1/2 ulp(x), err(y) <= 1/2 ulp(y) */
/* z1 <- 1-z1 */
ex = mpfr_get_exp (mpc_realref(z1));
mpfr_ui_sub (mpc_realref(z1), 1, mpc_realref(z1), GMP_RNDN);
mpfr_neg (mpc_imagref(z1), mpc_imagref(z1), GMP_RNDN);
ex = ex - mpfr_get_exp (mpc_realref(z1));
ex = (ex <= 0) ? 0 : ex;
/* err(x) <= 2^ex * ulp(x) */
ex = ex + mpfr_get_exp (mpc_realref(z1)) - p;
/* err(x) <= 2^ex */
ey = mpfr_get_exp (mpc_imagref(z1)) - p - 1;
/* err(y) <= 2^ey */
ex = (ex >= ey) ? ex : ey; /* err(x), err(y) <= 2^ex, i.e., the norm
of the error is bounded by |h|<=2^(ex+1/2) */
/* z1 <- sqrt(z1): if z1 = z + h, then sqrt(z1) = sqrt(z) + h/2/sqrt(t) */
ey = mpfr_get_exp (mpc_realref(z1)) >= mpfr_get_exp (mpc_imagref(z1))
? mpfr_get_exp (mpc_realref(z1)) : mpfr_get_exp (mpc_imagref(z1));
/* we have |z1| >= 2^(ey-1) thus 1/|z1| <= 2^(1-ey) */
mpc_sqrt (z1, z1, MPC_RNDNN);
ex = (2 * ex + 1) - 2 - (ey - 1); /* |h^2/4/|t| <= 2^ex */
ex = (ex + 1) / 2; /* ceil(ex/2) */
/* express ex in terms of ulp(z1) */
ey = mpfr_get_exp (mpc_realref(z1)) <= mpfr_get_exp (mpc_imagref(z1))
? mpfr_get_exp (mpc_realref(z1)) : mpfr_get_exp (mpc_imagref(z1));
ex = ex - ey + p;
/* take into account the rounding error in the mpc_sqrt call */
err = (ex <= 0) ? 1 : ex + 1;
/* err(x) <= 2^err * ulp(x), err(y) <= 2^err * ulp(y) */
/* z1 <- i*z + z1 */
ex = mpfr_get_exp (mpc_realref(z1));
ey = mpfr_get_exp (mpc_imagref(z1));
mpfr_sub (mpc_realref(z1), mpc_realref(z1), mpc_imagref(op), GMP_RNDN);
mpfr_add (mpc_imagref(z1), mpc_imagref(z1), mpc_realref(op), GMP_RNDN);
if (mpfr_cmp_ui (mpc_realref(z1), 0) == 0 || mpfr_cmp_ui (mpc_imagref(z1), 0) == 0)
continue;
ex -= mpfr_get_exp (mpc_realref(z1)); /* cancellation in x */
ey -= mpfr_get_exp (mpc_imagref(z1)); /* cancellation in y */
ex = (ex >= ey) ? ex : ey; /* maximum cancellation */
err += ex;
err = (err <= 0) ? 1 : err + 1; /* rounding error in sub/add */
/* z1 <- log(z1): if z1 = z + h, then log(z1) = log(z) + h/t with
|t| >= min(|z1|,|z|) */
ex = mpfr_get_exp (mpc_realref(z1));
ey = mpfr_get_exp (mpc_imagref(z1));
ex = (ex >= ey) ? ex : ey;
err += ex - p; /* revert to absolute error <= 2^err */
mpc_log (z1, z1, GMP_RNDN);
err -= ex - 1; /* 1/|t| <= 1/|z| <= 2^(1-ex) */
/* express err in terms of ulp(z1) */
ey = mpfr_get_exp (mpc_realref(z1)) <= mpfr_get_exp (mpc_imagref(z1))
? mpfr_get_exp (mpc_realref(z1)) : mpfr_get_exp (mpc_imagref(z1));
err = err - ey + p;
/* take into account the rounding error in the mpc_log call */
err = (err <= 0) ? 1 : err + 1;
/* z1 <- -i*z1 */
mpfr_swap (mpc_realref(z1), mpc_imagref(z1));
mpfr_neg (mpc_imagref(z1), mpc_imagref(z1), GMP_RNDN);
if (mpfr_can_round (mpc_realref(z1), p - err, GMP_RNDN, GMP_RNDZ,
p_re + (rnd_re == GMP_RNDN)) &&
mpfr_can_round (mpc_imagref(z1), p - err, GMP_RNDN, GMP_RNDZ,
p_im + (rnd_im == GMP_RNDN)))
break;
}
inex = mpc_set (rop, z1, rnd);
mpc_clear (z1);
return inex;
}
mpc-1.0.3/src/mul_si.c 0000644 0001751 0001751 00000002064 12426164730 011447 0000000 0000000 /* mpc_mul_si -- Multiply a complex number by a signed integer.
Copyright (C) 2005, 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-impl.h"
int
mpc_mul_si (mpc_ptr a, mpc_srcptr b, long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_mul_si (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_mul_si (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/pow_ld.c 0000644 0001751 0001751 00000002177 12426164730 011450 0000000 0000000 /* mpc_pow_ld -- Raise a complex number to a long double power.
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 /* for MPC_ASSERT */
#include /* for LDBL_MANT_DIG */
#include "mpc-impl.h"
int
mpc_pow_ld (mpc_ptr z, mpc_srcptr x, long double y, mpc_rnd_t rnd)
{
mpc_t yy;
int inex;
MPC_ASSERT(FLT_RADIX == 2);
mpc_init3 (yy, LDBL_MANT_DIG, MPFR_PREC_MIN);
mpc_set_ld (yy, y, MPC_RNDNN); /* exact */
inex = mpc_pow (z, x, yy, rnd);
mpc_clear (yy);
return inex;
}
mpc-1.0.3/src/mul_fr.c 0000644 0001751 0001751 00000002522 12470362212 011434 0000000 0000000 /* mpc_mul_fr -- Multiply a complex number by a floating-point number.
Copyright (C) 2002, 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-impl.h"
int
mpc_mul_fr (mpc_ptr a, mpc_srcptr b, mpfr_srcptr c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
mpfr_t real;
if (c == mpc_realref (a))
/* We have to use a temporary variable. */
mpfr_init2 (real, MPC_PREC_RE (a));
else
real [0] = mpc_realref (a) [0];
inex_re = mpfr_mul (real, mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_mul (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
mpfr_set (mpc_realref (a), real, GMP_RNDN); /* exact */
if (c == mpc_realref (a))
mpfr_clear (real);
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/set_str.c 0000644 0001751 0001751 00000002164 12426164730 011643 0000000 0000000 /* mpc_set_str -- Convert a string into a complex number.
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
#include "mpc-impl.h"
int
mpc_set_str (mpc_t z, const char *str, int base, mpc_rnd_t rnd)
{
char *p;
int inex;
inex = mpc_strtoc (z, str, &p, base, rnd);
if (inex != -1){
while (isspace ((unsigned char) (*p)))
p++;
if (*p == '\0')
return inex;
}
mpfr_set_nan (mpc_realref (z));
mpfr_set_nan (mpc_imagref (z));
return -1;
}
mpc-1.0.3/src/get_version.c 0000644 0001751 0001751 00000002447 12470362312 012503 0000000 0000000 /* mpc_get_version -- MPC version
Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014, 2015 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-impl.h"
#if MPFR_VERSION_MAJOR < 3
/* The following are functions defined for compatibility with mpfr < 3;
logically, they should be defined in a separate file, but then gcc
complains about an empty translation unit with mpfr >= 3. */
void
mpfr_set_zero (mpfr_ptr z, int s)
{
mpfr_set_ui (z, 0ul, GMP_RNDN);
if (s < 0)
mpfr_neg (z, z, GMP_RNDN);
}
int
mpfr_regular_p (mpfr_srcptr z)
{
return (mpfr_number_p (z) && !mpfr_zero_p (z));
}
#endif /* mpfr < 3 */
const char *
mpc_get_version (void)
{
return "1.0.3";
}
mpc-1.0.3/src/pow_fr.c 0000644 0001751 0001751 00000002200 12470362212 011435 0000000 0000000 /* mpc_pow_fr -- Raise a complex number to a floating-point power.
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-impl.h"
int
mpc_pow_fr (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd)
{
mpc_t yy;
int inex;
/* avoid copying the significand of y by copying only the struct */
mpc_realref(yy)[0] = y[0];
mpfr_init2 (mpc_imagref(yy), MPFR_PREC_MIN);
mpfr_set_ui (mpc_imagref(yy), 0, GMP_RNDN);
inex = mpc_pow (z, x, yy, rnd);
mpfr_clear (mpc_imagref(yy));
return inex;
}
mpc-1.0.3/src/abs.c 0000644 0001751 0001751 00000001703 12426164730 010723 0000000 0000000 /* mpc_abs -- Absolute value of a complex number.
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-impl.h"
/* the rounding mode is mpfr_rnd_t here since we return an mpfr number */
int
mpc_abs (mpfr_ptr a, mpc_srcptr b, mpfr_rnd_t rnd)
{
return mpfr_hypot (a, mpc_realref(b), mpc_imagref(b), rnd);
}
mpc-1.0.3/src/div_2si.c 0000644 0001751 0001751 00000002031 12426164730 011510 0000000 0000000 /* mpc_div_2si -- Divide a complex number by 2^e.
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-impl.h"
int
mpc_div_2si (mpc_ptr a, mpc_srcptr b, long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_div_2si (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_div_2si (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/init2.c 0000644 0001751 0001751 00000001614 12426164730 011204 0000000 0000000 /* mpc_init2 -- Initialize a complex variable with a given precision.
Copyright (C) 2002, 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-impl.h"
void
mpc_init2 (mpc_t x, mpfr_prec_t prec)
{
mpfr_init2 (mpc_realref(x), prec);
mpfr_init2 (mpc_imagref(x), prec);
}
mpc-1.0.3/src/atanh.c 0000644 0001751 0001751 00000003037 12426164730 011253 0000000 0000000 /* mpc_atanh -- inverse hyperbolic tangent of a complex number.
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-impl.h"
int
mpc_atanh (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
/* atanh(op) = -i*atan(i*op) */
int inex;
mpfr_t tmp;
mpc_t z, a;
mpc_realref (z)[0] = mpc_imagref (op)[0];
mpc_imagref (z)[0] = mpc_realref (op)[0];
MPFR_CHANGE_SIGN (mpc_realref (z));
/* Note reversal of precisions due to later multiplication by -i */
mpc_init3 (a, MPC_PREC_IM(rop), MPC_PREC_RE(rop));
inex = mpc_atan (a, z,
MPC_RND (INV_RND (MPC_RND_IM (rnd)), MPC_RND_RE (rnd)));
/* change a to -i*a, i.e., x+i*y to y-i*x */
tmp[0] = mpc_realref (a)[0];
mpc_realref (a)[0] = mpc_imagref (a)[0];
mpc_imagref (a)[0] = tmp[0];
MPFR_CHANGE_SIGN (mpc_imagref (a));
mpc_set (rop, a, rnd);
mpc_clear (a);
return MPC_INEX (MPC_INEX_IM (inex), -MPC_INEX_RE (inex));
}
mpc-1.0.3/src/sin.c 0000644 0001751 0001751 00000001546 12426164730 010754 0000000 0000000 /* mpc_sin -- sine of a complex number.
Copyright (C) 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-impl.h"
int
mpc_sin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
return MPC_INEX1 (mpc_sin_cos (rop, NULL, op, rnd, 0));
}
mpc-1.0.3/src/Makefile.in 0000644 0001751 0001751 00000065436 12470362457 012101 0000000 0000000 # 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@
subdir = src
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 =
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__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libmpc_la_DEPENDENCIES = @LTLIBOBJS@
am_libmpc_la_OBJECTS = abs.lo acos.lo acosh.lo add.lo add_fr.lo \
add_si.lo add_ui.lo arg.lo asin.lo asinh.lo atan.lo atanh.lo \
clear.lo cmp.lo cmp_si_si.lo conj.lo cos.lo cosh.lo div_2si.lo \
div_2ui.lo div.lo div_fr.lo div_ui.lo exp.lo fma.lo fr_div.lo \
fr_sub.lo get_prec2.lo get_prec.lo get_version.lo get_x.lo \
imag.lo init2.lo init3.lo inp_str.lo log.lo log10.lo mem.lo \
mul_2si.lo mul_2ui.lo mul.lo mul_fr.lo mul_i.lo mul_si.lo \
mul_ui.lo neg.lo norm.lo out_str.lo pow.lo pow_fr.lo pow_ld.lo \
pow_d.lo pow_si.lo pow_ui.lo pow_z.lo proj.lo real.lo \
urandom.lo set.lo set_prec.lo set_str.lo set_x.lo set_x_x.lo \
sin.lo sin_cos.lo sinh.lo sqr.lo sqrt.lo strtoc.lo sub.lo \
sub_fr.lo sub_ui.lo swap.lo tan.lo tanh.lo uceil_log2.lo \
ui_div.lo ui_ui_sub.lo
libmpc_la_OBJECTS = $(am_libmpc_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 =
libmpc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libmpc_la_LDFLAGS) $(LDFLAGS) -o $@
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_la_SOURCES)
DIST_SOURCES = $(libmpc_la_SOURCES)
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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
logging.c
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@
lib_LTLIBRARIES = libmpc.la
libmpc_la_LDFLAGS = $(MPC_LDFLAGS) -version-info 3:0:0
libmpc_la_SOURCES = mpc-impl.h abs.c acos.c acosh.c add.c add_fr.c \
add_si.c add_ui.c arg.c asin.c asinh.c atan.c atanh.c clear.c cmp.c \
cmp_si_si.c conj.c cos.c cosh.c div_2si.c div_2ui.c div.c div_fr.c \
div_ui.c exp.c fma.c fr_div.c fr_sub.c get_prec2.c get_prec.c \
get_version.c get_x.c imag.c init2.c init3.c inp_str.c log.c log10.c \
mem.c mul_2si.c mul_2ui.c mul.c mul_fr.c mul_i.c mul_si.c mul_ui.c \
neg.c norm.c out_str.c pow.c pow_fr.c \
pow_ld.c pow_d.c pow_si.c pow_ui.c pow_z.c proj.c real.c urandom.c set.c \
set_prec.c set_str.c set_x.c set_x_x.c sin.c sin_cos.c sinh.c sqr.c \
sqrt.c strtoc.c sub.c sub_fr.c sub_ui.c swap.c tan.c tanh.c uceil_log2.c \
ui_div.c ui_ui_sub.c
libmpc_la_LIBADD = @LTLIBOBJS@
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(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 src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/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):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_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.la: $(libmpc_la_OBJECTS) $(libmpc_la_DEPENDENCIES) $(EXTRA_libmpc_la_DEPENDENCIES)
$(AM_V_CCLD)$(libmpc_la_LINK) -rpath $(libdir) $(libmpc_la_OBJECTS) $(libmpc_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/logging.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acos.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acosh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_fr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_si.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_ui.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asin.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asinh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atan.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atanh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clear.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmp_si_si.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conj.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cos.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cosh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_2si.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_2ui.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_fr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_ui.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fma.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fr_div.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fr_sub.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_prec.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_prec2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_version.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imag.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init3.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inp_str.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log10.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_2si.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_2ui.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_fr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_i.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_si.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_ui.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/neg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/out_str.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_d.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_fr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_ld.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_si.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_ui.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_z.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proj.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/real.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_prec.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_str.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_x_x.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sin.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sin_cos.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sinh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqrt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub_fr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub_ui.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tan.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tanh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uceil_log2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ui_div.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ui_ui_sub.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/urandom.Plo@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
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
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
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:
clean-generic:
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-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf $(DEPDIR) ./$(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-libLTLIBRARIES
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) ./$(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: uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES 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-libLTLIBRARIES 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 \
tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
.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:
mpc-1.0.3/src/acosh.c 0000644 0001751 0001751 00000004366 12426164730 011263 0000000 0000000 /* mpc_acosh -- inverse hyperbolic cosine of a complex number.
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-impl.h"
int
mpc_acosh (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
/* acosh(z) =
NaN + i*NaN, if z=0+i*NaN
-i*acos(z), if sign(Im(z)) = -
i*acos(z), if sign(Im(z)) = +
http://functions.wolfram.com/ElementaryFunctions/ArcCosh/27/02/03/01/01/
*/
mpc_t a;
mpfr_t tmp;
int inex;
if (mpfr_zero_p (mpc_realref (op)) && mpfr_nan_p (mpc_imagref (op)))
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
return 0;
}
/* Note reversal of precisions due to later multiplication by i or -i */
mpc_init3 (a, MPC_PREC_IM(rop), MPC_PREC_RE(rop));
if (mpfr_signbit (mpc_imagref (op)))
{
inex = mpc_acos (a, op,
MPC_RND (INV_RND (MPC_RND_IM (rnd)), MPC_RND_RE (rnd)));
/* change a to -i*a, i.e., -y+i*x to x+i*y */
tmp[0] = mpc_realref (a)[0];
mpc_realref (a)[0] = mpc_imagref (a)[0];
mpc_imagref (a)[0] = tmp[0];
MPFR_CHANGE_SIGN (mpc_imagref (a));
inex = MPC_INEX (MPC_INEX_IM (inex), -MPC_INEX_RE (inex));
}
else
{
inex = mpc_acos (a, op,
MPC_RND (MPC_RND_IM (rnd), INV_RND(MPC_RND_RE (rnd))));
/* change a to i*a, i.e., y-i*x to x+i*y */
tmp[0] = mpc_realref (a)[0];
mpc_realref (a)[0] = mpc_imagref (a)[0];
mpc_imagref (a)[0] = tmp[0];
MPFR_CHANGE_SIGN (mpc_realref (a));
inex = MPC_INEX (-MPC_INEX_IM (inex), MPC_INEX_RE (inex));
}
mpc_set (rop, a, rnd);
mpc_clear (a);
return inex;
}
mpc-1.0.3/src/div.c 0000644 0001751 0001751 00000041705 12470362212 010740 0000000 0000000 /* mpc_div -- Divide two complex numbers.
Copyright (C) 2002, 2003, 2004, 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 "mpc-impl.h"
/* this routine deals with the case where w is zero */
static int
mpc_div_zero (mpc_ptr a, mpc_srcptr z, mpc_srcptr w, mpc_rnd_t rnd)
/* Assumes w==0, implementation according to C99 G.5.1.8 */
{
int sign = MPFR_SIGNBIT (mpc_realref (w));
mpfr_t infty;
mpfr_init2 (infty, MPFR_PREC_MIN);
mpfr_set_inf (infty, sign);
mpfr_mul (mpc_realref (a), infty, mpc_realref (z), MPC_RND_RE (rnd));
mpfr_mul (mpc_imagref (a), infty, mpc_imagref (z), MPC_RND_IM (rnd));
mpfr_clear (infty);
return MPC_INEX (0, 0); /* exact */
}
/* this routine deals with the case where z is infinite and w finite */
static int
mpc_div_inf_fin (mpc_ptr rop, mpc_srcptr z, mpc_srcptr w)
/* Assumes w finite and non-zero and z infinite; implementation
according to C99 G.5.1.8 */
{
int a, b, x, y;
a = (mpfr_inf_p (mpc_realref (z)) ? MPFR_SIGNBIT (mpc_realref (z)) : 0);
b = (mpfr_inf_p (mpc_imagref (z)) ? MPFR_SIGNBIT (mpc_imagref (z)) : 0);
/* a is -1 if Re(z) = -Inf, 1 if Re(z) = +Inf, 0 if Re(z) is finite
b is -1 if Im(z) = -Inf, 1 if Im(z) = +Inf, 0 if Im(z) is finite */
/* x = MPC_MPFR_SIGN (a * mpc_realref (w) + b * mpc_imagref (w)) */
/* y = MPC_MPFR_SIGN (b * mpc_realref (w) - a * mpc_imagref (w)) */
if (a == 0 || b == 0) {
/* only one of a or b can be zero, since z is infinite */
x = a * MPC_MPFR_SIGN (mpc_realref (w)) + b * MPC_MPFR_SIGN (mpc_imagref (w));
y = b * MPC_MPFR_SIGN (mpc_realref (w)) - a * MPC_MPFR_SIGN (mpc_imagref (w));
}
else {
/* Both parts of z are infinite; x could be determined by sign
considerations and comparisons. Since operations with non-finite
numbers are not considered time-critical, we let mpfr do the work. */
mpfr_t sign;
mpfr_init2 (sign, 2);
/* This is enough to determine the sign of sums and differences. */
if (a == 1)
if (b == 1) {
mpfr_add (sign, mpc_realref (w), mpc_imagref (w), GMP_RNDN);
x = MPC_MPFR_SIGN (sign);
mpfr_sub (sign, mpc_realref (w), mpc_imagref (w), GMP_RNDN);
y = MPC_MPFR_SIGN (sign);
}
else { /* b == -1 */
mpfr_sub (sign, mpc_realref (w), mpc_imagref (w), GMP_RNDN);
x = MPC_MPFR_SIGN (sign);
mpfr_add (sign, mpc_realref (w), mpc_imagref (w), GMP_RNDN);
y = -MPC_MPFR_SIGN (sign);
}
else /* a == -1 */
if (b == 1) {
mpfr_sub (sign, mpc_imagref (w), mpc_realref (w), GMP_RNDN);
x = MPC_MPFR_SIGN (sign);
mpfr_add (sign, mpc_realref (w), mpc_imagref (w), GMP_RNDN);
y = MPC_MPFR_SIGN (sign);
}
else { /* b == -1 */
mpfr_add (sign, mpc_realref (w), mpc_imagref (w), GMP_RNDN);
x = -MPC_MPFR_SIGN (sign);
mpfr_sub (sign, mpc_imagref (w), mpc_realref (w), GMP_RNDN);
y = MPC_MPFR_SIGN (sign);
}
mpfr_clear (sign);
}
if (x == 0)
mpfr_set_nan (mpc_realref (rop));
else
mpfr_set_inf (mpc_realref (rop), x);
if (y == 0)
mpfr_set_nan (mpc_imagref (rop));
else
mpfr_set_inf (mpc_imagref (rop), y);
return MPC_INEX (0, 0); /* exact */
}
/* this routine deals with the case where z if finite and w infinite */
static int
mpc_div_fin_inf (mpc_ptr rop, mpc_srcptr z, mpc_srcptr w)
/* Assumes z finite and w infinite; implementation according to
C99 G.5.1.8 */
{
mpfr_t c, d, a, b, x, y, zero;
mpfr_init2 (c, 2); /* needed to hold a signed zero, +1 or -1 */
mpfr_init2 (d, 2);
mpfr_init2 (x, 2);
mpfr_init2 (y, 2);
mpfr_init2 (zero, 2);
mpfr_set_ui (zero, 0ul, GMP_RNDN);
mpfr_init2 (a, mpfr_get_prec (mpc_realref (z)));
mpfr_init2 (b, mpfr_get_prec (mpc_imagref (z)));
mpfr_set_ui (c, (mpfr_inf_p (mpc_realref (w)) ? 1 : 0), GMP_RNDN);
MPFR_COPYSIGN (c, c, mpc_realref (w), GMP_RNDN);
mpfr_set_ui (d, (mpfr_inf_p (mpc_imagref (w)) ? 1 : 0), GMP_RNDN);
MPFR_COPYSIGN (d, d, mpc_imagref (w), GMP_RNDN);
mpfr_mul (a, mpc_realref (z), c, GMP_RNDN); /* exact */
mpfr_mul (b, mpc_imagref (z), d, GMP_RNDN);
mpfr_add (x, a, b, GMP_RNDN);
mpfr_mul (b, mpc_imagref (z), c, GMP_RNDN);
mpfr_mul (a, mpc_realref (z), d, GMP_RNDN);
mpfr_sub (y, b, a, GMP_RNDN);
MPFR_COPYSIGN (mpc_realref (rop), zero, x, GMP_RNDN);
MPFR_COPYSIGN (mpc_imagref (rop), zero, y, GMP_RNDN);
mpfr_clear (c);
mpfr_clear (d);
mpfr_clear (x);
mpfr_clear (y);
mpfr_clear (zero);
mpfr_clear (a);
mpfr_clear (b);
return MPC_INEX (0, 0); /* exact */
}
static int
mpc_div_real (mpc_ptr rop, mpc_srcptr z, mpc_srcptr w, mpc_rnd_t rnd)
/* Assumes z finite and w finite and non-zero, with imaginary part
of w a signed zero. */
{
int inex_re, inex_im;
/* save signs of operands in case there are overlaps */
int zrs = MPFR_SIGNBIT (mpc_realref (z));
int zis = MPFR_SIGNBIT (mpc_imagref (z));
int wrs = MPFR_SIGNBIT (mpc_realref (w));
int wis = MPFR_SIGNBIT (mpc_imagref (w));
/* warning: rop may overlap with z,w so treat the imaginary part first */
inex_im = mpfr_div (mpc_imagref(rop), mpc_imagref(z), mpc_realref(w), MPC_RND_IM(rnd));
inex_re = mpfr_div (mpc_realref(rop), mpc_realref(z), mpc_realref(w), MPC_RND_RE(rnd));
/* correct signs of zeroes if necessary, which does not affect the
inexact flags */
if (mpfr_zero_p (mpc_realref (rop)))
mpfr_setsign (mpc_realref (rop), mpc_realref (rop), (zrs != wrs && zis != wis),
GMP_RNDN); /* exact */
if (mpfr_zero_p (mpc_imagref (rop)))
mpfr_setsign (mpc_imagref (rop), mpc_imagref (rop), (zis != wrs && zrs == wis),
GMP_RNDN);
return MPC_INEX(inex_re, inex_im);
}
static int
mpc_div_imag (mpc_ptr rop, mpc_srcptr z, mpc_srcptr w, mpc_rnd_t rnd)
/* Assumes z finite and w finite and non-zero, with real part
of w a signed zero. */
{
int inex_re, inex_im;
int overlap = (rop == z) || (rop == w);
int imag_z = mpfr_zero_p (mpc_realref (z));
mpfr_t wloc;
mpc_t tmprop;
mpc_ptr dest = (overlap) ? tmprop : rop;
/* save signs of operands in case there are overlaps */
int zrs = MPFR_SIGNBIT (mpc_realref (z));
int zis = MPFR_SIGNBIT (mpc_imagref (z));
int wrs = MPFR_SIGNBIT (mpc_realref (w));
int wis = MPFR_SIGNBIT (mpc_imagref (w));
if (overlap)
mpc_init3 (tmprop, MPC_PREC_RE (rop), MPC_PREC_IM (rop));
wloc[0] = mpc_imagref(w)[0]; /* copies mpfr struct IM(w) into wloc */
inex_re = mpfr_div (mpc_realref(dest), mpc_imagref(z), wloc, MPC_RND_RE(rnd));
mpfr_neg (wloc, wloc, GMP_RNDN);
/* changes the sign only in wloc, not in w; no need to correct later */
inex_im = mpfr_div (mpc_imagref(dest), mpc_realref(z), wloc, MPC_RND_IM(rnd));
if (overlap) {
/* Note: we could use mpc_swap here, but this might cause problems
if rop and tmprop have been allocated using different methods, since
it will swap the significands of rop and tmprop. See
http://lists.gforge.inria.fr/pipermail/mpc-discuss/2009-August/000504.html */
mpc_set (rop, tmprop, MPC_RNDNN); /* exact */
mpc_clear (tmprop);
}
/* correct signs of zeroes if necessary, which does not affect the
inexact flags */
if (mpfr_zero_p (mpc_realref (rop)))
mpfr_setsign (mpc_realref (rop), mpc_realref (rop), (zrs != wrs && zis != wis),
GMP_RNDN); /* exact */
if (imag_z)
mpfr_setsign (mpc_imagref (rop), mpc_imagref (rop), (zis != wrs && zrs == wis),
GMP_RNDN);
return MPC_INEX(inex_re, inex_im);
}
int
mpc_div (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
int ok_re = 0, ok_im = 0;
mpc_t res, c_conj;
mpfr_t q;
mpfr_prec_t prec;
int inex, inexact_prod, inexact_norm, inexact_re, inexact_im, loops = 0;
int underflow_norm, overflow_norm, underflow_prod, overflow_prod;
int underflow_re = 0, overflow_re = 0, underflow_im = 0, overflow_im = 0;
mpfr_rnd_t rnd_re = MPC_RND_RE (rnd), rnd_im = MPC_RND_IM (rnd);
int saved_underflow, saved_overflow;
int tmpsgn;
/* According to the C standard G.3, there are three types of numbers: */
/* finite (both parts are usual real numbers; contains 0), infinite */
/* (at least one part is a real infinity) and all others; the latter */
/* are numbers containing a nan, but no infinity, and could reasonably */
/* be called nan. */
/* By G.5.1.4, infinite/finite=infinite; finite/infinite=0; */
/* all other divisions that are not finite/finite return nan+i*nan. */
/* Division by 0 could be handled by the following case of division by */
/* a real; we handle it separately instead. */
if (mpc_zero_p (c))
return mpc_div_zero (a, b, c, rnd);
else if (mpc_inf_p (b) && mpc_fin_p (c))
return mpc_div_inf_fin (a, b, c);
else if (mpc_fin_p (b) && mpc_inf_p (c))
return mpc_div_fin_inf (a, b, c);
else if (!mpc_fin_p (b) || !mpc_fin_p (c)) {
mpc_set_nan (a);
return MPC_INEX (0, 0);
}
else if (mpfr_zero_p(mpc_imagref(c)))
return mpc_div_real (a, b, c, rnd);
else if (mpfr_zero_p(mpc_realref(c)))
return mpc_div_imag (a, b, c, rnd);
prec = MPC_MAX_PREC(a);
mpc_init2 (res, 2);
mpfr_init (q);
/* create the conjugate of c in c_conj without allocating new memory */
mpc_realref (c_conj)[0] = mpc_realref (c)[0];
mpc_imagref (c_conj)[0] = mpc_imagref (c)[0];
MPFR_CHANGE_SIGN (mpc_imagref (c_conj));
/* save the underflow or overflow flags from MPFR */
saved_underflow = mpfr_underflow_p ();
saved_overflow = mpfr_overflow_p ();
do {
loops ++;
prec += loops <= 2 ? mpc_ceil_log2 (prec) + 5 : prec / 2;
mpc_set_prec (res, prec);
mpfr_set_prec (q, prec);
/* first compute norm(c) */
mpfr_clear_underflow ();
mpfr_clear_overflow ();
inexact_norm = mpc_norm (q, c, GMP_RNDU);
underflow_norm = mpfr_underflow_p ();
overflow_norm = mpfr_overflow_p ();
if (underflow_norm)
mpfr_set_ui (q, 0ul, GMP_RNDN);
/* to obtain divisions by 0 later on */
/* now compute b*conjugate(c) */
mpfr_clear_underflow ();
mpfr_clear_overflow ();
inexact_prod = mpc_mul (res, b, c_conj, MPC_RNDZZ);
inexact_re = MPC_INEX_RE (inexact_prod);
inexact_im = MPC_INEX_IM (inexact_prod);
underflow_prod = mpfr_underflow_p ();
overflow_prod = mpfr_overflow_p ();
/* unfortunately, does not distinguish between under-/overflow
in real or imaginary parts
hopefully, the side-effects of mpc_mul do indeed raise the
mpfr exceptions */
if (overflow_prod) {
int isinf = 0;
tmpsgn = mpfr_sgn (mpc_realref(res));
if (tmpsgn > 0)
{
mpfr_nextabove (mpc_realref(res));
isinf = mpfr_inf_p (mpc_realref(res));
mpfr_nextbelow (mpc_realref(res));
}
else if (tmpsgn < 0)
{
mpfr_nextbelow (mpc_realref(res));
isinf = mpfr_inf_p (mpc_realref(res));
mpfr_nextabove (mpc_realref(res));
}
if (isinf)
{
mpfr_set_inf (mpc_realref(res), tmpsgn);
overflow_re = 1;
}
tmpsgn = mpfr_sgn (mpc_imagref(res));
isinf = 0;
if (tmpsgn > 0)
{
mpfr_nextabove (mpc_imagref(res));
isinf = mpfr_inf_p (mpc_imagref(res));
mpfr_nextbelow (mpc_imagref(res));
}
else if (tmpsgn < 0)
{
mpfr_nextbelow (mpc_imagref(res));
isinf = mpfr_inf_p (mpc_imagref(res));
mpfr_nextabove (mpc_imagref(res));
}
if (isinf)
{
mpfr_set_inf (mpc_imagref(res), tmpsgn);
overflow_im = 1;
}
mpc_set (a, res, rnd);
goto end;
}
/* divide the product by the norm */
if (inexact_norm == 0 && (inexact_re == 0 || inexact_im == 0)) {
/* The division has good chances to be exact in at least one part. */
/* Since this can cause problems when not rounding to the nearest, */
/* we use the division code of mpfr, which handles the situation. */
mpfr_clear_underflow ();
mpfr_clear_overflow ();
inexact_re |= mpfr_div (mpc_realref (res), mpc_realref (res), q, GMP_RNDZ);
underflow_re = mpfr_underflow_p ();
overflow_re = mpfr_overflow_p ();
ok_re = !inexact_re || underflow_re || overflow_re
|| mpfr_can_round (mpc_realref (res), prec - 4, GMP_RNDN,
GMP_RNDZ, MPC_PREC_RE(a) + (rnd_re == GMP_RNDN));
if (ok_re) /* compute imaginary part */ {
mpfr_clear_underflow ();
mpfr_clear_overflow ();
inexact_im |= mpfr_div (mpc_imagref (res), mpc_imagref (res), q, GMP_RNDZ);
underflow_im = mpfr_underflow_p ();
overflow_im = mpfr_overflow_p ();
ok_im = !inexact_im || underflow_im || overflow_im
|| mpfr_can_round (mpc_imagref (res), prec - 4, GMP_RNDN,
GMP_RNDZ, MPC_PREC_IM(a) + (rnd_im == GMP_RNDN));
}
}
else {
/* The division is inexact, so for efficiency reasons we invert q */
/* only once and multiply by the inverse. */
if (mpfr_ui_div (q, 1ul, q, GMP_RNDZ) || inexact_norm) {
/* if 1/q is inexact, the approximations of the real and
imaginary part below will be inexact, unless RE(res)
or IM(res) is zero */
inexact_re |= ~mpfr_zero_p (mpc_realref (res));
inexact_im |= ~mpfr_zero_p (mpc_imagref (res));
}
mpfr_clear_underflow ();
mpfr_clear_overflow ();
inexact_re |= mpfr_mul (mpc_realref (res), mpc_realref (res), q, GMP_RNDZ);
underflow_re = mpfr_underflow_p ();
overflow_re = mpfr_overflow_p ();
ok_re = !inexact_re || underflow_re || overflow_re
|| mpfr_can_round (mpc_realref (res), prec - 4, GMP_RNDN,
GMP_RNDZ, MPC_PREC_RE(a) + (rnd_re == GMP_RNDN));
if (ok_re) /* compute imaginary part */ {
mpfr_clear_underflow ();
mpfr_clear_overflow ();
inexact_im |= mpfr_mul (mpc_imagref (res), mpc_imagref (res), q, GMP_RNDZ);
underflow_im = mpfr_underflow_p ();
overflow_im = mpfr_overflow_p ();
ok_im = !inexact_im || underflow_im || overflow_im
|| mpfr_can_round (mpc_imagref (res), prec - 4, GMP_RNDN,
GMP_RNDZ, MPC_PREC_IM(a) + (rnd_im == GMP_RNDN));
}
}
} while ((!ok_re || !ok_im) && !underflow_norm && !overflow_norm
&& !underflow_prod && !overflow_prod);
inex = mpc_set (a, res, rnd);
inexact_re = MPC_INEX_RE (inex);
inexact_im = MPC_INEX_IM (inex);
end:
/* fix values and inexact flags in case of overflow/underflow */
/* FIXME: heuristic, certainly does not cover all cases */
if (overflow_re || (underflow_norm && !underflow_prod)) {
mpfr_set_inf (mpc_realref (a), mpfr_sgn (mpc_realref (res)));
inexact_re = mpfr_sgn (mpc_realref (res));
}
else if (underflow_re || (overflow_norm && !overflow_prod)) {
inexact_re = mpfr_signbit (mpc_realref (res)) ? 1 : -1;
mpfr_set_zero (mpc_realref (a), -inexact_re);
}
if (overflow_im || (underflow_norm && !underflow_prod)) {
mpfr_set_inf (mpc_imagref (a), mpfr_sgn (mpc_imagref (res)));
inexact_im = mpfr_sgn (mpc_imagref (res));
}
else if (underflow_im || (overflow_norm && !overflow_prod)) {
inexact_im = mpfr_signbit (mpc_imagref (res)) ? 1 : -1;
mpfr_set_zero (mpc_imagref (a), -inexact_im);
}
mpc_clear (res);
mpfr_clear (q);
/* restore underflow and overflow flags from MPFR */
if (saved_underflow)
mpfr_set_underflow ();
if (saved_overflow)
mpfr_set_overflow ();
return MPC_INEX (inexact_re, inexact_im);
}
mpc-1.0.3/src/set.c 0000644 0001751 0001751 00000002025 12426164730 010747 0000000 0000000 /* mpc_set -- Set a complex number from another complex number.
Copyright (C) 2002, 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-impl.h"
int
mpc_set (mpc_ptr a, mpc_srcptr b, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_set (mpc_realref(a), mpc_realref(b), MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref(a), mpc_imagref(b), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/add_ui.c 0000644 0001751 0001751 00000002162 12426164730 011403 0000000 0000000 /* mpc_add_ui -- Add a complex number and an unsigned long int.
Copyright (C) 2002, 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-impl.h"
/* return 0 iff both the real and imaginary parts are exact */
int
mpc_add_ui (mpc_ptr a, mpc_srcptr b, unsigned long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_add_ui (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref(a), mpc_imagref(b), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/init3.c 0000644 0001751 0001751 00000001651 12426164730 011206 0000000 0000000 /* mpc_init3 -- Initialize a complex variable with given precisions.
Copyright (C) 2002, 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-impl.h"
void
mpc_init3 (mpc_t x, mpfr_prec_t prec_re, mpfr_prec_t prec_im)
{
mpfr_init2 (mpc_realref(x), prec_re);
mpfr_init2 (mpc_imagref(x), prec_im);
}
mpc-1.0.3/src/add_si.c 0000644 0001751 0001751 00000002066 12426164730 011404 0000000 0000000 /* mpc_add_si -- Add a complex number and a signed long int.
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-impl.h"
int
mpc_add_si (mpc_ptr rop, mpc_srcptr op1, long int op2, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_add_si (mpc_realref (rop), mpc_realref (op1), op2, MPC_RND_RE (rnd));
inex_im = mpfr_set (mpc_imagref (rop), mpc_imagref (op1), MPC_RND_IM (rnd));
return MPC_INEX (inex_re, inex_im);
}
mpc-1.0.3/src/cmp_si_si.c 0000644 0001751 0001751 00000002042 12426164730 012120 0000000 0000000 /* mpc_cmp_si_si -- Compare a complex number to a number of the form
b+c*i with b and c signed integers.
Copyright (C) 2005, 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-impl.h"
/* return 0 iff a = b */
int
mpc_cmp_si_si (mpc_srcptr a, long int b, long int c)
{
int cmp_re, cmp_im;
cmp_re = mpfr_cmp_si (mpc_realref(a), b);
cmp_im = mpfr_cmp_si (mpc_imagref(a), c);
return MPC_INEX(cmp_re, cmp_im);
}
mpc-1.0.3/src/pow_z.c 0000644 0001751 0001751 00000002744 12426164730 011322 0000000 0000000 /* mpc_pow_z -- Raise a complex number to an integer power.
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 "mpc-impl.h"
int
mpc_pow_z (mpc_ptr z, mpc_srcptr x, mpz_srcptr y, mpc_rnd_t rnd)
{
mpc_t yy;
int inex;
mpfr_prec_t n = (mpfr_prec_t) mpz_sizeinbase (y, 2);
/* if y fits in an unsigned long or long, call the corresponding functions,
which are supposed to be more efficient */
if (mpz_cmp_ui (y, 0ul) >= 0) {
if (mpz_fits_ulong_p (y))
return mpc_pow_usi (z, x, mpz_get_ui (y), 1, rnd);
}
else {
if (mpz_fits_slong_p (y))
return mpc_pow_usi (z, x, (unsigned long) (-mpz_get_si (y)), -1, rnd);
}
mpc_init3 (yy, (n < MPFR_PREC_MIN) ? MPFR_PREC_MIN : n, MPFR_PREC_MIN);
mpc_set_z (yy, y, MPC_RNDNN); /* exact */
inex = mpc_pow (z, x, yy, rnd);
mpc_clear (yy);
return inex;
}
mpc-1.0.3/src/sub_fr.c 0000644 0001751 0001751 00000002205 12426164730 011434 0000000 0000000 /* mpc_sub_fr -- Substract a floating-point number to the real part of a
complex number.
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-impl.h"
/* return 0 iff both the real and imaginary parts are exact */
int
mpc_sub_fr (mpc_ptr a, mpc_srcptr b, mpfr_srcptr c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_sub (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref(a), mpc_imagref(b), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/tan.c 0000644 0001751 0001751 00000022446 12470362212 010741 0000000 0000000 /* mpc_tan -- tangent of a complex number.
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 /* for MPC_ASSERT */
#include
#include "mpc-impl.h"
int
mpc_tan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
mpc_t x, y;
mpfr_prec_t prec;
mpfr_exp_t err;
int ok = 0;
int inex;
/* special values */
if (!mpc_fin_p (op))
{
if (mpfr_nan_p (mpc_realref (op)))
{
if (mpfr_inf_p (mpc_imagref (op)))
/* tan(NaN -i*Inf) = +/-0 -i */
/* tan(NaN +i*Inf) = +/-0 +i */
{
/* exact unless 1 is not in exponent range */
inex = mpc_set_si_si (rop, 0,
(MPFR_SIGN (mpc_imagref (op)) < 0) ? -1 : +1,
rnd);
}
else
/* tan(NaN +i*y) = NaN +i*NaN, when y is finite */
/* tan(NaN +i*NaN) = NaN +i*NaN */
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
inex = MPC_INEX (0, 0); /* always exact */
}
}
else if (mpfr_nan_p (mpc_imagref (op)))
{
if (mpfr_cmp_ui (mpc_realref (op), 0) == 0)
/* tan(-0 +i*NaN) = -0 +i*NaN */
/* tan(+0 +i*NaN) = +0 +i*NaN */
{
mpc_set (rop, op, rnd);
inex = MPC_INEX (0, 0); /* always exact */
}
else
/* tan(x +i*NaN) = NaN +i*NaN, when x != 0 */
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
inex = MPC_INEX (0, 0); /* always exact */
}
}
else if (mpfr_inf_p (mpc_realref (op)))
{
if (mpfr_inf_p (mpc_imagref (op)))
/* tan(-Inf -i*Inf) = -/+0 -i */
/* tan(-Inf +i*Inf) = -/+0 +i */
/* tan(+Inf -i*Inf) = +/-0 -i */
/* tan(+Inf +i*Inf) = +/-0 +i */
{
const int sign_re = mpfr_signbit (mpc_realref (op));
int inex_im;
mpfr_set_ui (mpc_realref (rop), 0, MPC_RND_RE (rnd));
mpfr_setsign (mpc_realref (rop), mpc_realref (rop), sign_re, GMP_RNDN);
/* exact, unless 1 is not in exponent range */
inex_im = mpfr_set_si (mpc_imagref (rop),
mpfr_signbit (mpc_imagref (op)) ? -1 : +1,
MPC_RND_IM (rnd));
inex = MPC_INEX (0, inex_im);
}
else
/* tan(-Inf +i*y) = tan(+Inf +i*y) = NaN +i*NaN, when y is
finite */
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
inex = MPC_INEX (0, 0); /* always exact */
}
}
else
/* tan(x -i*Inf) = +0*sin(x)*cos(x) -i, when x is finite */
/* tan(x +i*Inf) = +0*sin(x)*cos(x) +i, when x is finite */
{
mpfr_t c;
mpfr_t s;
int inex_im;
mpfr_init (c);
mpfr_init (s);
mpfr_sin_cos (s, c, mpc_realref (op), GMP_RNDN);
mpfr_set_ui (mpc_realref (rop), 0, MPC_RND_RE (rnd));
mpfr_setsign (mpc_realref (rop), mpc_realref (rop),
mpfr_signbit (c) != mpfr_signbit (s), GMP_RNDN);
/* exact, unless 1 is not in exponent range */
inex_im = mpfr_set_si (mpc_imagref (rop),
(mpfr_signbit (mpc_imagref (op)) ? -1 : +1),
MPC_RND_IM (rnd));
inex = MPC_INEX (0, inex_im);
mpfr_clear (s);
mpfr_clear (c);
}
return inex;
}
if (mpfr_zero_p (mpc_realref (op)))
/* tan(-0 -i*y) = -0 +i*tanh(y), when y is finite. */
/* tan(+0 +i*y) = +0 +i*tanh(y), when y is finite. */
{
int inex_im;
mpfr_set (mpc_realref (rop), mpc_realref (op), MPC_RND_RE (rnd));
inex_im = mpfr_tanh (mpc_imagref (rop), mpc_imagref (op), MPC_RND_IM (rnd));
return MPC_INEX (0, inex_im);
}
if (mpfr_zero_p (mpc_imagref (op)))
/* tan(x -i*0) = tan(x) -i*0, when x is finite. */
/* tan(x +i*0) = tan(x) +i*0, when x is finite. */
{
int inex_re;
inex_re = mpfr_tan (mpc_realref (rop), mpc_realref (op), MPC_RND_RE (rnd));
mpfr_set (mpc_imagref (rop), mpc_imagref (op), MPC_RND_IM (rnd));
return MPC_INEX (inex_re, 0);
}
/* ordinary (non-zero) numbers */
/* tan(op) = sin(op) / cos(op).
We use the following algorithm with rounding away from 0 for all
operations, and working precision w:
(1) x = A(sin(op))
(2) y = A(cos(op))
(3) z = A(x/y)
the error on Im(z) is at most 81 ulp,
the error on Re(z) is at most
7 ulp if k < 2,
8 ulp if k = 2,
else 5+k ulp, where
k = Exp(Re(x))+Exp(Re(y))-2min{Exp(Re(y)), Exp(Im(y))}-Exp(Re(x/y))
see proof in algorithms.tex.
*/
prec = MPC_MAX_PREC(rop);
mpc_init2 (x, 2);
mpc_init2 (y, 2);
err = 7;
do
{
mpfr_exp_t k, exr, eyr, eyi, ezr;
ok = 0;
/* FIXME: prevent addition overflow */
prec += mpc_ceil_log2 (prec) + err;
mpc_set_prec (x, prec);
mpc_set_prec (y, prec);
/* rounding away from zero: except in the cases x=0 or y=0 (processed
above), sin x and cos y are never exact, so rounding away from 0 is
rounding towards 0 and adding one ulp to the absolute value */
mpc_sin_cos (x, y, op, MPC_RNDZZ, MPC_RNDZZ);
MPFR_ADD_ONE_ULP (mpc_realref (x));
MPFR_ADD_ONE_ULP (mpc_imagref (x));
MPFR_ADD_ONE_ULP (mpc_realref (y));
MPFR_ADD_ONE_ULP (mpc_imagref (y));
MPC_ASSERT (mpfr_zero_p (mpc_realref (x)) == 0);
if ( mpfr_inf_p (mpc_realref (x)) || mpfr_inf_p (mpc_imagref (x))
|| mpfr_inf_p (mpc_realref (y)) || mpfr_inf_p (mpc_imagref (y))) {
/* If the real or imaginary part of x is infinite, it means that
Im(op) was large, in which case the result is
sign(tan(Re(op)))*0 + sign(Im(op))*I,
where sign(tan(Re(op))) = sign(Re(x))*sign(Re(y)). */
int inex_re, inex_im;
mpfr_set_ui (mpc_realref (rop), 0, GMP_RNDN);
if (mpfr_sgn (mpc_realref (x)) * mpfr_sgn (mpc_realref (y)) < 0)
{
mpfr_neg (mpc_realref (rop), mpc_realref (rop), GMP_RNDN);
inex_re = 1;
}
else
inex_re = -1; /* +0 is rounded down */
if (mpfr_sgn (mpc_imagref (op)) > 0)
{
mpfr_set_ui (mpc_imagref (rop), 1, GMP_RNDN);
inex_im = 1;
}
else
{
mpfr_set_si (mpc_imagref (rop), -1, GMP_RNDN);
inex_im = -1;
}
inex = MPC_INEX(inex_re, inex_im);
goto end;
}
exr = mpfr_get_exp (mpc_realref (x));
eyr = mpfr_get_exp (mpc_realref (y));
eyi = mpfr_get_exp (mpc_imagref (y));
/* some parts of the quotient may be exact */
inex = mpc_div (x, x, y, MPC_RNDZZ);
/* OP is no pure real nor pure imaginary, so in theory the real and
imaginary parts of its tangent cannot be null. However due to
rouding errors this might happen. Consider for example
tan(1+14*I) = 1.26e-10 + 1.00*I. For small precision sin(op) and
cos(op) differ only by a factor I, thus after mpc_div x = I and
its real part is zero. */
if (mpfr_zero_p (mpc_realref (x)) || mpfr_zero_p (mpc_imagref (x)))
{
err = prec; /* double precision */
continue;
}
if (MPC_INEX_RE (inex))
MPFR_ADD_ONE_ULP (mpc_realref (x));
if (MPC_INEX_IM (inex))
MPFR_ADD_ONE_ULP (mpc_imagref (x));
MPC_ASSERT (mpfr_zero_p (mpc_realref (x)) == 0);
ezr = mpfr_get_exp (mpc_realref (x));
/* FIXME: compute
k = Exp(Re(x))+Exp(Re(y))-2min{Exp(Re(y)), Exp(Im(y))}-Exp(Re(x/y))
avoiding overflow */
k = exr - ezr + MPC_MAX(-eyr, eyr - 2 * eyi);
err = k < 2 ? 7 : (k == 2 ? 8 : (5 + k));
/* Can the real part be rounded? */
ok = (!mpfr_number_p (mpc_realref (x)))
|| mpfr_can_round (mpc_realref(x), prec - err, GMP_RNDN, GMP_RNDZ,
MPC_PREC_RE(rop) + (MPC_RND_RE(rnd) == GMP_RNDN));
if (ok)
{
/* Can the imaginary part be rounded? */
ok = (!mpfr_number_p (mpc_imagref (x)))
|| mpfr_can_round (mpc_imagref(x), prec - 6, GMP_RNDN, GMP_RNDZ,
MPC_PREC_IM(rop) + (MPC_RND_IM(rnd) == GMP_RNDN));
}
}
while (ok == 0);
inex = mpc_set (rop, x, rnd);
end:
mpc_clear (x);
mpc_clear (y);
return inex;
}
mpc-1.0.3/src/cos.c 0000644 0001751 0001751 00000001547 12426164730 010750 0000000 0000000 /* mpc_cos -- cosine of a complex number.
Copyright (C) 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-impl.h"
int
mpc_cos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
return MPC_INEX2 (mpc_sin_cos (NULL, rop, op, 0, rnd));
}
mpc-1.0.3/src/norm.c 0000644 0001751 0001751 00000015621 12470362212 011127 0000000 0000000 /* mpc_norm -- Square of the norm of a complex number.
Copyright (C) 2002, 2005, 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 /* for MPC_ASSERT */
#include "mpc-impl.h"
/* a <- norm(b) = b * conj(b)
(the rounding mode is mpfr_rnd_t here since we return an mpfr number) */
int
mpc_norm (mpfr_ptr a, mpc_srcptr b, mpfr_rnd_t rnd)
{
int inexact;
int saved_underflow, saved_overflow;
/* handling of special values; consistent with abs in that
norm = abs^2; so norm (+-inf, xxx) = norm (xxx, +-inf) = +inf */
if (!mpc_fin_p (b))
return mpc_abs (a, b, rnd);
else if (mpfr_zero_p (mpc_realref (b))) {
if (mpfr_zero_p (mpc_imagref (b)))
return mpfr_set_ui (a, 0, rnd); /* +0 */
else
return mpfr_sqr (a, mpc_imagref (b), rnd);
}
else if (mpfr_zero_p (mpc_imagref (b)))
return mpfr_sqr (a, mpc_realref (b), rnd); /* Re(b) <> 0 */
else /* everything finite and non-zero */ {
mpfr_t u, v, res;
mpfr_prec_t prec, prec_u, prec_v;
int loops;
const int max_loops = 2;
/* switch to exact squarings when loops==max_loops */
prec = mpfr_get_prec (a);
mpfr_init (u);
mpfr_init (v);
mpfr_init (res);
/* save the underflow or overflow flags from MPFR */
saved_underflow = mpfr_underflow_p ();
saved_overflow = mpfr_overflow_p ();
loops = 0;
mpfr_clear_underflow ();
mpfr_clear_overflow ();
do {
loops++;
prec += mpc_ceil_log2 (prec) + 3;
if (loops >= max_loops) {
prec_u = 2 * MPC_PREC_RE (b);
prec_v = 2 * MPC_PREC_IM (b);
}
else {
prec_u = MPC_MIN (prec, 2 * MPC_PREC_RE (b));
prec_v = MPC_MIN (prec, 2 * MPC_PREC_IM (b));
}
mpfr_set_prec (u, prec_u);
mpfr_set_prec (v, prec_v);
inexact = mpfr_sqr (u, mpc_realref(b), GMP_RNDD); /* err <= 1 ulp in prec */
inexact |= mpfr_sqr (v, mpc_imagref(b), GMP_RNDD); /* err <= 1 ulp in prec */
/* If loops = max_loops, inexact should be 0 here, except in case
of underflow or overflow.
If loops < max_loops and inexact is zero, we can exit the
while-loop since it only remains to add u and v into a. */
if (inexact) {
mpfr_set_prec (res, prec);
mpfr_add (res, u, v, GMP_RNDD); /* err <= 3 ulp in prec */
}
} while (loops < max_loops && inexact != 0
&& !mpfr_can_round (res, prec - 2, GMP_RNDD, GMP_RNDU,
mpfr_get_prec (a) + (rnd == GMP_RNDN)));
if (!inexact)
/* squarings were exact, neither underflow nor overflow */
inexact = mpfr_add (a, u, v, rnd);
/* if there was an overflow in Re(b)^2 or Im(b)^2 or their sum,
since the norm is larger, there is an overflow for the norm */
else if (mpfr_overflow_p ()) {
/* replace by "correctly rounded overflow" */
mpfr_set_ui (a, 1ul, GMP_RNDN);
inexact = mpfr_mul_2ui (a, a, mpfr_get_emax (), rnd);
}
else if (mpfr_underflow_p ()) {
/* necessarily one of the squarings did underflow (otherwise their
sum could not underflow), thus one of u, v is zero. */
mpfr_exp_t emin = mpfr_get_emin ();
/* Now either both u and v are zero, or u is zero and v exact,
or v is zero and u exact.
In the latter case, Im(b)^2 < 2^(emin-1).
If ulp(u) >= 2^(emin+1) and norm(b) is not exactly
representable at the target precision, then rounding u+Im(b)^2
is equivalent to rounding u+2^(emin-1).
For instance, if exp(u)>0 and the target precision is smaller
than about |emin|, the norm is not representable. To make the
scaling in the "else" case work without underflow, we test
whether exp(u) is larger than a small negative number instead.
The second case is handled analogously. */
if (!mpfr_zero_p (u)
&& mpfr_get_exp (u) - 2 * (mpfr_exp_t) prec_u > emin
&& mpfr_get_exp (u) > -10) {
mpfr_set_prec (v, MPFR_PREC_MIN);
mpfr_set_ui_2exp (v, 1, emin - 1, GMP_RNDZ);
inexact = mpfr_add (a, u, v, rnd);
}
else if (!mpfr_zero_p (v)
&& mpfr_get_exp (v) - 2 * (mpfr_exp_t) prec_v > emin
&& mpfr_get_exp (v) > -10) {
mpfr_set_prec (u, MPFR_PREC_MIN);
mpfr_set_ui_2exp (u, 1, emin - 1, GMP_RNDZ);
inexact = mpfr_add (a, u, v, rnd);
}
else {
unsigned long int scale, exp_re, exp_im;
int inex_underflow;
/* scale the input to an average exponent close to 0 */
exp_re = (unsigned long int) (-mpfr_get_exp (mpc_realref (b)));
exp_im = (unsigned long int) (-mpfr_get_exp (mpc_imagref (b)));
scale = exp_re / 2 + exp_im / 2 + (exp_re % 2 + exp_im % 2) / 2;
/* (exp_re + exp_im) / 2, computed in a way avoiding
integer overflow */
if (mpfr_zero_p (u)) {
/* recompute the scaled value exactly */
mpfr_mul_2ui (u, mpc_realref (b), scale, GMP_RNDN);
mpfr_sqr (u, u, GMP_RNDN);
}
else /* just scale */
mpfr_mul_2ui (u, u, 2*scale, GMP_RNDN);
if (mpfr_zero_p (v)) {
mpfr_mul_2ui (v, mpc_imagref (b), scale, GMP_RNDN);
mpfr_sqr (v, v, GMP_RNDN);
}
else
mpfr_mul_2ui (v, v, 2*scale, GMP_RNDN);
inexact = mpfr_add (a, u, v, rnd);
mpfr_clear_underflow ();
inex_underflow = mpfr_div_2ui (a, a, 2*scale, rnd);
if (mpfr_underflow_p ())
inexact = inex_underflow;
}
}
else /* no problems, ternary value due to mpfr_can_round trick */
inexact = mpfr_set (a, res, rnd);
/* restore underflow and overflow flags from MPFR */
if (saved_underflow)
mpfr_set_underflow ();
if (saved_overflow)
mpfr_set_overflow ();
mpfr_clear (u);
mpfr_clear (v);
mpfr_clear (res);
}
return inexact;
}
mpc-1.0.3/src/get_prec.c 0000644 0001751 0001751 00000001664 12426164730 011754 0000000 0000000 /* mpc_get_prec -- returns the common precision of real and imaginary part, or 0 if they differ
Copyright (C) 2007, 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 "mpc-impl.h"
mpfr_prec_t
mpc_get_prec (mpc_srcptr x)
{
mpfr_prec_t precre = MPC_PREC_RE (x);
return (MPC_PREC_IM (x) == precre ? precre : 0);
}
mpc-1.0.3/src/imag.c 0000644 0001751 0001751 00000001561 12426164730 011075 0000000 0000000 /* mpc_imag -- Get the imaginary part of a complex number.
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-impl.h"
int
mpc_imag (mpfr_ptr a, mpc_srcptr b, mpfr_rnd_t rnd)
{
return mpfr_set (a, mpc_imagref (b), rnd);
}
mpc-1.0.3/src/div_2ui.c 0000644 0001751 0001751 00000002064 12426164730 011520 0000000 0000000 /* mpc_div_2ui -- Divide a complex number by 2^e.
Copyright (C) 2002, 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-impl.h"
int
mpc_div_2ui (mpc_ptr a, mpc_srcptr b, unsigned long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_div_2ui (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_div_2ui (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/get_prec2.c 0000644 0001751 0001751 00000001675 12426164730 012040 0000000 0000000 /* mpc_get_prec2 -- returns the precisions of the real and of the imaginary
part through the first two arguments
Copyright (C) 2007, 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 "mpc-impl.h"
void
mpc_get_prec2 (mpfr_prec_t *pr, mpfr_prec_t *pi, mpc_srcptr x)
{
*pr = MPC_PREC_RE (x);
*pi = MPC_PREC_IM (x);
}
mpc-1.0.3/src/strtoc.c 0000644 0001751 0001751 00000004205 12470362212 011466 0000000 0000000 /* mpc_strtoc -- Read a complex number from a string.
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
#include
#include "mpc-impl.h"
static void
skip_whitespace (const char **p)
{
/* TODO: This function had better be inlined, but it is unclear whether
the hassle to get this implemented across all platforms is worth it. */
while (isspace ((unsigned char) **p))
(*p)++;
}
int
mpc_strtoc (mpc_ptr rop, const char *nptr, char **endptr, int base, mpc_rnd_t rnd)
{
const char *p;
char *end;
int bracketed = 0;
int inex_re = 0, inex_im = 0;
if (nptr == NULL || base > 36 || base == 1)
goto error;
p = nptr;
skip_whitespace (&p);
if (*p == '('){
bracketed = 1;
++p;
}
inex_re = mpfr_strtofr (mpc_realref(rop), p, &end, base, MPC_RND_RE (rnd));
if (end == p)
goto error;
p = end;
if (!bracketed)
inex_im = mpfr_set_ui (mpc_imagref (rop), 0ul, GMP_RNDN);
else {
if (!isspace ((unsigned char)*p))
goto error;
skip_whitespace (&p);
inex_im = mpfr_strtofr (mpc_imagref(rop), p, &end, base, MPC_RND_IM (rnd));
if (end == p)
goto error;
p = end;
skip_whitespace (&p);
if (*p != ')')
goto error;
p++;
}
if (endptr != NULL)
*endptr = (char*) p;
return MPC_INEX (inex_re, inex_im);
error:
if (endptr != NULL)
*endptr = (char*) nptr;
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
return -1;
}
mpc-1.0.3/src/arg.c 0000644 0001751 0001751 00000001574 12426164730 010735 0000000 0000000 /* mpc_arg -- Get the argument of a complex number.
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-impl.h"
int
mpc_arg (mpfr_ptr a, mpc_srcptr b, mpfr_rnd_t rnd)
{
return mpfr_atan2 (a, mpc_imagref (b), mpc_realref (b), rnd);
}
mpc-1.0.3/src/mul_2ui.c 0000644 0001751 0001751 00000002066 12426164730 011535 0000000 0000000 /* mpc_mul_2ui -- Multiply a complex number by 2^e.
Copyright (C) 2002, 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-impl.h"
int
mpc_mul_2ui (mpc_ptr a, mpc_srcptr b, unsigned long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_mul_2ui (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_mul_2ui (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/pow.c 0000644 0001751 0001751 00000063170 12470362212 010763 0000000 0000000 /* mpc_pow -- Raise a complex number to the power of another complex number.
Copyright (C) 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 /* for MPC_ASSERT */
#include "mpc-impl.h"
/* Return non-zero iff c+i*d is an exact square (a+i*b)^2,
with a, b both of the form m*2^e with m, e integers.
If so, returns in a+i*b the corresponding square root, with a >= 0.
The variables a, b must not overlap with c, d.
We have c = a^2 - b^2 and d = 2*a*b.
If one of a, b is exact, then both are (see algorithms.tex).
Case 1: a <> 0 and b <> 0.
Let a = m*2^e and b = n*2^f with m, e, n, f integers, m and n odd
(we will treat apart the case a = 0 or b = 0).
Then 2*a*b = m*n*2^(e+f+1), thus necessarily e+f >= -1.
Assume e < 0, then f >= 0, then a^2 - b^2 = m^2*2^(2e) - n^2*2^(2f) cannot
be an integer, since n^2*2^(2f) is an integer, and m^2*2^(2e) is not.
Similarly when f < 0 (and thus e >= 0).
Thus we have e, f >= 0, and a, b are both integers.
Let A = 2a^2, then eliminating b between c = a^2 - b^2 and d = 2*a*b
gives A^2 - 2c*A - d^2 = 0, which has solutions c +/- sqrt(c^2+d^2).
We thus need c^2+d^2 to be a square, and c + sqrt(c^2+d^2) --- the solution
we are interested in --- to be two times a square. Then b = d/(2a) is
necessarily an integer.
Case 2: a = 0. Then d is necessarily zero, thus it suffices to check
whether c = -b^2, i.e., if -c is a square.
Case 3: b = 0. Then d is necessarily zero, thus it suffices to check
whether c = a^2, i.e., if c is a square.
*/
static int
mpc_perfect_square_p (mpz_t a, mpz_t b, mpz_t c, mpz_t d)
{
if (mpz_cmp_ui (d, 0) == 0) /* case a = 0 or b = 0 */
{
/* necessarily c < 0 here, since we have already considered the case
where x is real non-negative and y is real */
MPC_ASSERT (mpz_cmp_ui (c, 0) < 0);
mpz_neg (b, c);
if (mpz_perfect_square_p (b)) /* case 2 above */
{
mpz_sqrt (b, b);
mpz_set_ui (a, 0);
return 1; /* c + i*d = (0 + i*b)^2 */
}
}
else /* both a and b are non-zero */
{
if (mpz_divisible_2exp_p (d, 1) == 0)
return 0; /* d must be even */
mpz_mul (a, c, c);
mpz_addmul (a, d, d); /* c^2 + d^2 */
if (mpz_perfect_square_p (a))
{
mpz_sqrt (a, a);
mpz_add (a, c, a); /* c + sqrt(c^2+d^2) */
if (mpz_divisible_2exp_p (a, 1))
{
mpz_tdiv_q_2exp (a, a, 1);
if (mpz_perfect_square_p (a))
{
mpz_sqrt (a, a);
mpz_tdiv_q_2exp (b, d, 1); /* d/2 */
mpz_divexact (b, b, a); /* d/(2a) */
return 1;
}
}
}
}
return 0; /* not a square */
}
/* fix the sign of Re(z) or Im(z) in case it is zero,
and Re(x) is zero.
sign_eps is 0 if Re(x) = +0, 1 if Re(x) = -0
sign_a is the sign bit of Im(x).
Assume y is an integer (does nothing otherwise).
*/
static void
fix_sign (mpc_ptr z, int sign_eps, int sign_a, mpfr_srcptr y)
{
int ymod4 = -1;
mpfr_exp_t ey;
mpz_t my;
unsigned long int t;
mpz_init (my);
ey = mpfr_get_z_exp (my, y);
/* normalize so that my is odd */
t = mpz_scan1 (my, 0);
ey += (mpfr_exp_t) t;
mpz_tdiv_q_2exp (my, my, t);
/* y = my*2^ey */
/* compute y mod 4 (in case y is an integer) */
if (ey >= 2)
ymod4 = 0;
else if (ey == 1)
ymod4 = mpz_tstbit (my, 0) * 2; /* correct if my < 0 */
else if (ey == 0)
{
ymod4 = mpz_tstbit (my, 1) * 2 + mpz_tstbit (my, 0);
if (mpz_cmp_ui (my , 0) < 0)
ymod4 = 4 - ymod4;
}
else /* y is not an integer */
goto end;
if (mpfr_zero_p (mpc_realref(z)))
{
/* we assume y is always integer in that case (FIXME: prove it):
(eps+I*a)^y = +0 + I*a^y for y = 1 mod 4 and sign_eps = 0
(eps+I*a)^y = -0 - I*a^y for y = 3 mod 4 and sign_eps = 0 */
MPC_ASSERT (ymod4 == 1 || ymod4 == 3);
if ((ymod4 == 3 && sign_eps == 0) ||
(ymod4 == 1 && sign_eps == 1))
mpfr_neg (mpc_realref(z), mpc_realref(z), GMP_RNDZ);
}
else if (mpfr_zero_p (mpc_imagref(z)))
{
/* we assume y is always integer in that case (FIXME: prove it):
(eps+I*a)^y = a^y - 0*I for y = 0 mod 4 and sign_a = sign_eps
(eps+I*a)^y = -a^y +0*I for y = 2 mod 4 and sign_a = sign_eps */
MPC_ASSERT (ymod4 == 0 || ymod4 == 2);
if ((ymod4 == 0 && sign_a == sign_eps) ||
(ymod4 == 2 && sign_a != sign_eps))
mpfr_neg (mpc_imagref(z), mpc_imagref(z), GMP_RNDZ);
}
end:
mpz_clear (my);
}
/* If x^y is exactly representable (with maybe a larger precision than z),
round it in z and return the (mpc) inexact flag in [0, 10].
If x^y is not exactly representable, return -1.
If intermediate computations lead to numbers of more than maxprec bits,
then abort and return -2 (in that case, to avoid loops, mpc_pow_exact
should be called again with a larger value of maxprec).
Assume one of Re(x) or Im(x) is non-zero, and y is non-zero (y is real).
Warning: z and x might be the same variable, same for Re(z) or Im(z) and y.
In case -1 or -2 is returned, z is not modified.
*/
static int
mpc_pow_exact (mpc_ptr z, mpc_srcptr x, mpfr_srcptr y, mpc_rnd_t rnd,
mpfr_prec_t maxprec)
{
mpfr_exp_t ec, ed, ey;
mpz_t my, a, b, c, d, u;
unsigned long int t;
int ret = -2;
int sign_rex = mpfr_signbit (mpc_realref(x));
int sign_imx = mpfr_signbit (mpc_imagref(x));
int x_imag = mpfr_zero_p (mpc_realref(x));
int z_is_y = 0;
mpfr_t copy_of_y;
if (mpc_realref (z) == y || mpc_imagref (z) == y)
{
z_is_y = 1;
mpfr_init2 (copy_of_y, mpfr_get_prec (y));
mpfr_set (copy_of_y, y, GMP_RNDN);
}
mpz_init (my);
mpz_init (a);
mpz_init (b);
mpz_init (c);
mpz_init (d);
mpz_init (u);
ey = mpfr_get_z_exp (my, y);
/* normalize so that my is odd */
t = mpz_scan1 (my, 0);
ey += (mpfr_exp_t) t;
mpz_tdiv_q_2exp (my, my, t);
/* y = my*2^ey with my odd */
if (x_imag)
{
mpz_set_ui (c, 0);
ec = 0;
}
else
ec = mpfr_get_z_exp (c, mpc_realref(x));
if (mpfr_zero_p (mpc_imagref(x)))
{
mpz_set_ui (d, 0);
ed = ec;
}
else
{
ed = mpfr_get_z_exp (d, mpc_imagref(x));
if (x_imag)
ec = ed;
}
/* x = c*2^ec + I * d*2^ed */
/* equalize the exponents of x */
if (ec < ed)
{
mpz_mul_2exp (d, d, (unsigned long int) (ed - ec));
if ((mpfr_prec_t) mpz_sizeinbase (d, 2) > maxprec)
goto end;
}
else if (ed < ec)
{
mpz_mul_2exp (c, c, (unsigned long int) (ec - ed));
if ((mpfr_prec_t) mpz_sizeinbase (c, 2) > maxprec)
goto end;
ec = ed;
}
/* now ec=ed and x = (c + I * d) * 2^ec */
/* divide by two if possible */
if (mpz_cmp_ui (c, 0) == 0)
{
t = mpz_scan1 (d, 0);
mpz_tdiv_q_2exp (d, d, t);
ec += (mpfr_exp_t) t;
}
else if (mpz_cmp_ui (d, 0) == 0)
{
t = mpz_scan1 (c, 0);
mpz_tdiv_q_2exp (c, c, t);
ec += (mpfr_exp_t) t;
}
else /* neither c nor d is zero */
{
unsigned long v;
t = mpz_scan1 (c, 0);
v = mpz_scan1 (d, 0);
if (v < t)
t = v;
mpz_tdiv_q_2exp (c, c, t);
mpz_tdiv_q_2exp (d, d, t);
ec += (mpfr_exp_t) t;
}
/* now either one of c, d is odd */
while (ey < 0)
{
/* check if x is a square */
if (ec & 1)
{
mpz_mul_2exp (c, c, 1);
mpz_mul_2exp (d, d, 1);
ec --;
}
/* now ec is even */
if (mpc_perfect_square_p (a, b, c, d) == 0)
break;
mpz_swap (a, c);
mpz_swap (b, d);
ec /= 2;
ey ++;
}
if (ey < 0)
{
ret = -1; /* not representable */
goto end;
}
/* Now ey >= 0, it thus suffices to check that x^my is representable.
If my > 0, this is always true. If my < 0, we first try to invert
(c+I*d)*2^ec.
*/
if (mpz_cmp_ui (my, 0) < 0)
{
/* If my < 0, 1 / (c + I*d) = (c - I*d)/(c^2 + d^2), thus a sufficient
condition is that c^2 + d^2 is a power of two, assuming |c| <> |d|.
Assume a prime p <> 2 divides c^2 + d^2,
then if p does not divide c or d, 1 / (c + I*d) cannot be exact.
If p divides both c and d, then we can write c = p*c', d = p*d',
and 1 / (c + I*d) = 1/p * 1/(c' + I*d'). This shows that if 1/(c+I*d)
is exact, then 1/(c' + I*d') is exact too, and we are back to the
previous case. In conclusion, a necessary and sufficient condition
is that c^2 + d^2 is a power of two.
*/
/* FIXME: we could first compute c^2+d^2 mod a limb for example */
mpz_mul (a, c, c);
mpz_addmul (a, d, d);
t = mpz_scan1 (a, 0);
if (mpz_sizeinbase (a, 2) != 1 + t) /* a is not a power of two */
{
ret = -1; /* not representable */
goto end;
}
/* replace (c,d) by (c/(c^2+d^2), -d/(c^2+d^2)) */
mpz_neg (d, d);
ec = -ec - (mpfr_exp_t) t;
mpz_neg (my, my);
}
/* now ey >= 0 and my >= 0, and we want to compute
[(c + I * d) * 2^ec] ^ (my * 2^ey).
We first compute [(c + I * d) * 2^ec]^my, then square ey times. */
t = mpz_sizeinbase (my, 2) - 1;
mpz_set (a, c);
mpz_set (b, d);
ed = ec;
/* invariant: (a + I*b) * 2^ed = ((c + I*d) * 2^ec)^trunc(my/2^t) */
while (t-- > 0)
{
unsigned long int v, w;
/* square a + I*b */
mpz_mul (u, a, b);
mpz_mul (a, a, a);
mpz_submul (a, b, b);
mpz_mul_2exp (b, u, 1);
ed *= 2;
if (mpz_tstbit (my, t)) /* multiply by c + I*d */
{
mpz_mul (u, a, c);
mpz_submul (u, b, d); /* ac-bd */
mpz_mul (b, b, c);
mpz_addmul (b, a, d); /* bc+ad */
mpz_swap (a, u);
ed += ec;
}
/* remove powers of two in (a,b) */
if (mpz_cmp_ui (a, 0) == 0)
{
w = mpz_scan1 (b, 0);
mpz_tdiv_q_2exp (b, b, w);
ed += (mpfr_exp_t) w;
}
else if (mpz_cmp_ui (b, 0) == 0)
{
w = mpz_scan1 (a, 0);
mpz_tdiv_q_2exp (a, a, w);
ed += (mpfr_exp_t) w;
}
else
{
w = mpz_scan1 (a, 0);
v = mpz_scan1 (b, 0);
if (v < w)
w = v;
mpz_tdiv_q_2exp (a, a, w);
mpz_tdiv_q_2exp (b, b, w);
ed += (mpfr_exp_t) w;
}
if ( (mpfr_prec_t) mpz_sizeinbase (a, 2) > maxprec
|| (mpfr_prec_t) mpz_sizeinbase (b, 2) > maxprec)
goto end;
}
/* now a+I*b = (c+I*d)^my */
while (ey-- > 0)
{
unsigned long sa, sb;
/* square a + I*b */
mpz_mul (u, a, b);
mpz_mul (a, a, a);
mpz_submul (a, b, b);
mpz_mul_2exp (b, u, 1);
ed *= 2;
/* divide by largest 2^n possible, to avoid many loops for e.g.,
(2+2*I)^16777216 */
sa = mpz_scan1 (a, 0);
sb = mpz_scan1 (b, 0);
sa = (sa <= sb) ? sa : sb;
mpz_tdiv_q_2exp (a, a, sa);
mpz_tdiv_q_2exp (b, b, sa);
ed += (mpfr_exp_t) sa;
if ( (mpfr_prec_t) mpz_sizeinbase (a, 2) > maxprec
|| (mpfr_prec_t) mpz_sizeinbase (b, 2) > maxprec)
goto end;
}
ret = mpfr_set_z (mpc_realref(z), a, MPC_RND_RE(rnd));
ret = MPC_INEX(ret, mpfr_set_z (mpc_imagref(z), b, MPC_RND_IM(rnd)));
mpfr_mul_2si (mpc_realref(z), mpc_realref(z), ed, MPC_RND_RE(rnd));
mpfr_mul_2si (mpc_imagref(z), mpc_imagref(z), ed, MPC_RND_IM(rnd));
end:
mpz_clear (my);
mpz_clear (a);
mpz_clear (b);
mpz_clear (c);
mpz_clear (d);
mpz_clear (u);
if (ret >= 0 && x_imag)
fix_sign (z, sign_rex, sign_imx, (z_is_y) ? copy_of_y : y);
if (z_is_y)
mpfr_clear (copy_of_y);
return ret;
}
/* Return 1 if y*2^k is an odd integer, 0 otherwise.
Adapted from MPFR, file pow.c.
Examples: with k=0, check if y is an odd integer,
with k=1, check if y is half-an-integer,
with k=-1, check if y/2 is an odd integer.
*/
#define MPFR_LIMB_HIGHBIT ((mp_limb_t) 1 << (BITS_PER_MP_LIMB - 1))
static int
is_odd (mpfr_srcptr y, mpfr_exp_t k)
{
mpfr_exp_t expo;
mpfr_prec_t prec;
mp_size_t yn;
mp_limb_t *yp;
expo = mpfr_get_exp (y) + k;
if (expo <= 0)
return 0; /* |y| < 1 and not 0 */
prec = mpfr_get_prec (y);
if ((mpfr_prec_t) expo > prec)
return 0; /* y is a multiple of 2^(expo-prec), thus not odd */
/* 0 < expo <= prec:
y = 1xxxxxxxxxt.zzzzzzzzzzzzzzzzzz[000]
expo bits (prec-expo) bits
We have to check that:
(a) the bit 't' is set
(b) all the 'z' bits are zero
*/
prec = ((prec - 1) / BITS_PER_MP_LIMB + 1) * BITS_PER_MP_LIMB - expo;
/* number of z+0 bits */
yn = prec / BITS_PER_MP_LIMB;
/* yn is the index of limb containing the 't' bit */
yp = y->_mpfr_d;
/* if expo is a multiple of BITS_PER_MP_LIMB, t is bit 0 */
if (expo % BITS_PER_MP_LIMB == 0 ? (yp[yn] & 1) == 0
: yp[yn] << ((expo % BITS_PER_MP_LIMB) - 1) != MPFR_LIMB_HIGHBIT)
return 0;
while (--yn >= 0)
if (yp[yn] != 0)
return 0;
return 1;
}
/* Put in z the value of x^y, rounded according to 'rnd'.
Return the inexact flag in [0, 10]. */
int
mpc_pow (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
{
int ret = -2, loop, x_real, x_imag, y_real, z_real = 0, z_imag = 0;
mpc_t t, u;
mpfr_prec_t p, pr, pi, maxprec;
int saved_underflow, saved_overflow;
/* save the underflow or overflow flags from MPFR */
saved_underflow = mpfr_underflow_p ();
saved_overflow = mpfr_overflow_p ();
x_real = mpfr_zero_p (mpc_imagref(x));
y_real = mpfr_zero_p (mpc_imagref(y));
if (y_real && mpfr_zero_p (mpc_realref(y))) /* case y zero */
{
if (x_real && mpfr_zero_p (mpc_realref(x)))
{
/* we define 0^0 to be (1, +0) since the real part is
coherent with MPFR where 0^0 gives 1, and the sign of the
imaginary part cannot be determined */
mpc_set_ui_ui (z, 1, 0, MPC_RNDNN);
return 0;
}
else /* x^0 = 1 +/- i*0 even for x=NaN see algorithms.tex for the
sign of zero */
{
mpfr_t n;
int inex, cx1;
int sign_zi;
/* cx1 < 0 if |x| < 1
cx1 = 0 if |x| = 1
cx1 > 0 if |x| > 1
*/
mpfr_init (n);
inex = mpc_norm (n, x, GMP_RNDN);
cx1 = mpfr_cmp_ui (n, 1);
if (cx1 == 0 && inex != 0)
cx1 = -inex;
sign_zi = (cx1 < 0 && mpfr_signbit (mpc_imagref (y)) == 0)
|| (cx1 == 0
&& mpfr_signbit (mpc_imagref (x)) != mpfr_signbit (mpc_realref (y)))
|| (cx1 > 0 && mpfr_signbit (mpc_imagref (y)));
/* warning: mpc_set_ui_ui does not set Im(z) to -0 if Im(rnd)=RNDD */
ret = mpc_set_ui_ui (z, 1, 0, rnd);
if (MPC_RND_IM (rnd) == GMP_RNDD || sign_zi)
mpc_conj (z, z, MPC_RNDNN);
mpfr_clear (n);
return ret;
}
}
if (!mpc_fin_p (x) || !mpc_fin_p (y))
{
/* special values: exp(y*log(x)) */
mpc_init2 (u, 2);
mpc_log (u, x, MPC_RNDNN);
mpc_mul (u, u, y, MPC_RNDNN);
ret = mpc_exp (z, u, rnd);
mpc_clear (u);
goto end;
}
if (x_real) /* case x real */
{
if (mpfr_zero_p (mpc_realref(x))) /* x is zero */
{
/* special values: exp(y*log(x)) */
mpc_init2 (u, 2);
mpc_log (u, x, MPC_RNDNN);
mpc_mul (u, u, y, MPC_RNDNN);
ret = mpc_exp (z, u, rnd);
mpc_clear (u);
goto end;
}
/* Special case 1^y = 1 */
if (mpfr_cmp_ui (mpc_realref(x), 1) == 0)
{
int s1, s2;
s1 = mpfr_signbit (mpc_realref (y));
s2 = mpfr_signbit (mpc_imagref (x));
ret = mpc_set_ui (z, +1, rnd);
/* the sign of the zero imaginary part is known in some cases (see
algorithm.tex). In such cases we have
(x +s*0i)^(y+/-0i) = x^y + s*sign(y)*0i
where s = +/-1. We extend here this rule to fix the sign of the
zero part.
Note that the sign must also be set explicitly when rnd=RNDD
because mpfr_set_ui(z_i, 0, rnd) always sets z_i to +0.
*/
if (MPC_RND_IM (rnd) == GMP_RNDD || s1 != s2)
mpc_conj (z, z, MPC_RNDNN);
goto end;
}
/* x^y is real when:
(a) x is real and y is integer
(b) x is real non-negative and y is real */
if (y_real && (mpfr_integer_p (mpc_realref(y)) ||
mpfr_cmp_ui (mpc_realref(x), 0) >= 0))
{
int s1, s2;
s1 = mpfr_signbit (mpc_realref (y));
s2 = mpfr_signbit (mpc_imagref (x));
ret = mpfr_pow (mpc_realref(z), mpc_realref(x), mpc_realref(y), MPC_RND_RE(rnd));
ret = MPC_INEX(ret, mpfr_set_ui (mpc_imagref(z), 0, MPC_RND_IM(rnd)));
/* the sign of the zero imaginary part is known in some cases
(see algorithm.tex). In such cases we have (x +s*0i)^(y+/-0i)
= x^y + s*sign(y)*0i where s = +/-1.
We extend here this rule to fix the sign of the zero part.
Note that the sign must also be set explicitly when rnd=RNDD
because mpfr_set_ui(z_i, 0, rnd) always sets z_i to +0.
*/
if (MPC_RND_IM(rnd) == GMP_RNDD || s1 != s2)
mpfr_neg (mpc_imagref(z), mpc_imagref(z), MPC_RND_IM(rnd));
goto end;
}
/* (-1)^(n+I*t) is real for n integer and t real */
if (mpfr_cmp_si (mpc_realref(x), -1) == 0 && mpfr_integer_p (mpc_realref(y)))
z_real = 1;
/* for x real, x^y is imaginary when:
(a) x is negative and y is half-an-integer
(b) x = -1 and Re(y) is half-an-integer
*/
if ((mpfr_cmp_ui (mpc_realref(x), 0) < 0) && is_odd (mpc_realref(y), 1)
&& (y_real || mpfr_cmp_si (mpc_realref(x), -1) == 0))
z_imag = 1;
}
else /* x non real */
/* I^(t*I) and (-I)^(t*I) are real for t real,
I^(n+t*I) and (-I)^(n+t*I) are real for n even and t real, and
I^(n+t*I) and (-I)^(n+t*I) are imaginary for n odd and t real
(s*I)^n is real for n even and imaginary for n odd */
if ((mpc_cmp_si_si (x, 0, 1) == 0 || mpc_cmp_si_si (x, 0, -1) == 0 ||
(mpfr_cmp_ui (mpc_realref(x), 0) == 0 && y_real)) &&
mpfr_integer_p (mpc_realref(y)))
{ /* x is I or -I, and Re(y) is an integer */
if (is_odd (mpc_realref(y), 0))
z_imag = 1; /* Re(y) odd: z is imaginary */
else
z_real = 1; /* Re(y) even: z is real */
}
else /* (t+/-t*I)^(2n) is imaginary for n odd and real for n even */
if (mpfr_cmpabs (mpc_realref(x), mpc_imagref(x)) == 0 && y_real &&
mpfr_integer_p (mpc_realref(y)) && is_odd (mpc_realref(y), 0) == 0)
{
if (is_odd (mpc_realref(y), -1)) /* y/2 is odd */
z_imag = 1;
else
z_real = 1;
}
pr = mpfr_get_prec (mpc_realref(z));
pi = mpfr_get_prec (mpc_imagref(z));
p = (pr > pi) ? pr : pi;
p += 12; /* experimentally, seems to give less than 10% of failures in
Ziv's strategy; probably wrong now since q is not computed */
if (p < 64)
p = 64;
mpc_init2 (u, p);
mpc_init2 (t, p);
pr += MPC_RND_RE(rnd) == GMP_RNDN;
pi += MPC_RND_IM(rnd) == GMP_RNDN;
maxprec = MPC_MAX_PREC (z);
x_imag = mpfr_zero_p (mpc_realref(x));
for (loop = 0;; loop++)
{
int ret_exp;
mpfr_exp_t dr, di;
mpfr_prec_t q;
mpc_log (t, x, MPC_RNDNN);
mpc_mul (t, t, y, MPC_RNDNN);
/* Compute q such that |Re (y log x)|, |Im (y log x)| < 2^q.
We recompute it at each loop since we might get different
bounds if the precision is not enough. */
q = mpfr_get_exp (mpc_realref(t)) > 0 ? mpfr_get_exp (mpc_realref(t)) : 0;
if (mpfr_get_exp (mpc_imagref(t)) > (mpfr_exp_t) q)
q = mpfr_get_exp (mpc_imagref(t));
mpfr_clear_overflow ();
mpfr_clear_underflow ();
ret_exp = mpc_exp (u, t, MPC_RNDNN);
if (mpfr_underflow_p () || mpfr_overflow_p ()) {
/* under- and overflow flags are set by mpc_exp */
mpc_set (z, u, MPC_RNDNN);
ret = ret_exp;
goto exact;
}
/* Since the error bound is global, we have to take into account the
exponent difference between the real and imaginary parts. We assume
either the real or the imaginary part of u is not zero.
*/
dr = mpfr_zero_p (mpc_realref(u)) ? mpfr_get_exp (mpc_imagref(u))
: mpfr_get_exp (mpc_realref(u));
di = mpfr_zero_p (mpc_imagref(u)) ? dr : mpfr_get_exp (mpc_imagref(u));
if (dr > di)
{
di = dr - di;
dr = 0;
}
else
{
dr = di - dr;
di = 0;
}
/* the term -3 takes into account the factor 4 in the complex error
(see algorithms.tex) plus one due to the exponent difference: if
z = a + I*b, where the relative error on z is at most 2^(-p), and
EXP(a) = EXP(b) + k, the relative error on b is at most 2^(k-p) */
if ((z_imag || (p > q + 3 + dr && mpfr_can_round (mpc_realref(u), p - q - 3 - dr, GMP_RNDN, GMP_RNDZ, pr))) &&
(z_real || (p > q + 3 + di && mpfr_can_round (mpc_imagref(u), p - q - 3 - di, GMP_RNDN, GMP_RNDZ, pi))))
break;
/* if Re(u) is not known to be zero, assume it is a normal number, i.e.,
neither zero, Inf or NaN, otherwise we might enter an infinite loop */
MPC_ASSERT (z_imag || mpfr_number_p (mpc_realref(u)));
/* idem for Im(u) */
MPC_ASSERT (z_real || mpfr_number_p (mpc_imagref(u)));
if (ret == -2) /* we did not yet call mpc_pow_exact, or it aborted
because intermediate computations had > maxprec bits */
{
/* check exact cases (see algorithms.tex) */
if (y_real)
{
maxprec *= 2;
ret = mpc_pow_exact (z, x, mpc_realref(y), rnd, maxprec);
if (ret != -1 && ret != -2)
goto exact;
}
p += dr + di + 64;
}
else
p += p / 2;
mpc_set_prec (t, p);
mpc_set_prec (u, p);
}
if (z_real)
{
/* When the result is real (see algorithm.tex for details),
Im(x^y) =
+ sign(imag(y))*0i, if |x| > 1
+ sign(imag(x))*sign(real(y))*0i, if |x| = 1
- sign(imag(y))*0i, if |x| < 1
*/
mpfr_t n;
int inex, cx1;
int sign_zi, sign_rex, sign_imx;
/* cx1 < 0 if |x| < 1
cx1 = 0 if |x| = 1
cx1 > 0 if |x| > 1
*/
sign_rex = mpfr_signbit (mpc_realref (x));
sign_imx = mpfr_signbit (mpc_imagref (x));
mpfr_init (n);
inex = mpc_norm (n, x, GMP_RNDN);
cx1 = mpfr_cmp_ui (n, 1);
if (cx1 == 0 && inex != 0)
cx1 = -inex;
sign_zi = (cx1 < 0 && mpfr_signbit (mpc_imagref (y)) == 0)
|| (cx1 == 0 && sign_imx != mpfr_signbit (mpc_realref (y)))
|| (cx1 > 0 && mpfr_signbit (mpc_imagref (y)));
/* copy RE(y) to n since if z==y we will destroy Re(y) below */
mpfr_set_prec (n, mpfr_get_prec (mpc_realref (y)));
mpfr_set (n, mpc_realref (y), GMP_RNDN);
ret = mpfr_set (mpc_realref(z), mpc_realref(u), MPC_RND_RE(rnd));
if (y_real && (x_real || x_imag))
{
/* FIXME: with y_real we assume Im(y) is really 0, which is the case
for example when y comes from pow_fr, but in case Im(y) is +0 or
-0, we might get different results */
mpfr_set_ui (mpc_imagref (z), 0, MPC_RND_IM (rnd));
fix_sign (z, sign_rex, sign_imx, n);
ret = MPC_INEX(ret, 0); /* imaginary part is exact */
}
else
{
ret = MPC_INEX (ret, mpfr_set_ui (mpc_imagref (z), 0, MPC_RND_IM (rnd)));
/* warning: mpfr_set_ui does not set Im(z) to -0 if Im(rnd) = RNDD */
if (MPC_RND_IM (rnd) == GMP_RNDD || sign_zi)
mpc_conj (z, z, MPC_RNDNN);
}
mpfr_clear (n);
}
else if (z_imag)
{
ret = mpfr_set (mpc_imagref(z), mpc_imagref(u), MPC_RND_IM(rnd));
/* if z is imaginary and y real, then x cannot be real */
if (y_real && x_imag)
{
int sign_rex = mpfr_signbit (mpc_realref (x));
/* If z overlaps with y we set Re(z) before checking Re(y) below,
but in that case y=0, which was dealt with above. */
mpfr_set_ui (mpc_realref (z), 0, MPC_RND_RE (rnd));
/* Note: fix_sign only does something when y is an integer,
then necessarily y = 1 or 3 (mod 4), and in that case the
sign of Im(x) is irrelevant. */
fix_sign (z, sign_rex, 0, mpc_realref (y));
ret = MPC_INEX(0, ret);
}
else
ret = MPC_INEX(mpfr_set_ui (mpc_realref(z), 0, MPC_RND_RE(rnd)), ret);
}
else
ret = mpc_set (z, u, rnd);
exact:
mpc_clear (t);
mpc_clear (u);
/* restore underflow and overflow flags from MPFR */
if (saved_underflow)
mpfr_set_underflow ();
if (saved_overflow)
mpfr_set_overflow ();
end:
return ret;
}
mpc-1.0.3/src/cmp.c 0000644 0001751 0001751 00000001753 12426164730 010742 0000000 0000000 /* mpc_cmp -- Compare two complex numbers.
Copyright (C) 2002, 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-impl.h"
/* return 0 iff a = b */
int
mpc_cmp (mpc_srcptr a, mpc_srcptr b)
{
int cmp_re, cmp_im;
cmp_re = mpfr_cmp (mpc_realref(a), mpc_realref(b));
cmp_im = mpfr_cmp (mpc_imagref(a), mpc_imagref(b));
return MPC_INEX(cmp_re, cmp_im);
}
mpc-1.0.3/src/pow_si.c 0000644 0001751 0001751 00000001731 12426164730 011457 0000000 0000000 /* mpc_pow_si -- Raise a complex number to an integer power.
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 "mpc-impl.h"
int
mpc_pow_si (mpc_ptr z, mpc_srcptr x, long y, mpc_rnd_t rnd)
{
if (y >= 0)
return mpc_pow_usi (z, x, (unsigned long) y, 1, rnd);
else
return mpc_pow_usi (z, x, (unsigned long) (-y), -1, rnd);
}
mpc-1.0.3/src/sqrt.c 0000644 0001751 0001751 00000027145 12470362212 011151 0000000 0000000 /* mpc_sqrt -- Take the square root of a complex number.
Copyright (C) 2002, 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-impl.h"
#if MPFR_VERSION_MAJOR < 3
#define mpfr_min_prec(x) \
( ((prec + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB) * BITS_PER_MP_LIMB \
- mpn_scan1 (x->_mpfr_d, 0))
#endif
int
mpc_sqrt (mpc_ptr a, mpc_srcptr b, mpc_rnd_t rnd)
{
int ok_w, ok_t = 0;
mpfr_t w, t;
mpfr_rnd_t rnd_w, rnd_t;
mpfr_prec_t prec_w, prec_t;
/* the rounding mode and the precision required for w and t, which can */
/* be either the real or the imaginary part of a */
mpfr_prec_t prec;
int inex_w, inex_t = 1, inex_re, inex_im, loops = 0;
const int re_cmp = mpfr_cmp_ui (mpc_realref (b), 0),
im_cmp = mpfr_cmp_ui (mpc_imagref (b), 0);
/* comparison of the real/imaginary part of b with 0 */
int repr_w, repr_t = 0 /* to avoid gcc warning */ ;
/* flag indicating whether the computed value is already representable
at the target precision */
const int im_sgn = mpfr_signbit (mpc_imagref (b)) == 0 ? 0 : -1;
/* we need to know the sign of Im(b) when it is +/-0 */
const mpfr_rnd_t r = im_sgn ? GMP_RNDD : GMP_RNDU;
/* rounding mode used when computing t */
/* special values */
if (!mpc_fin_p (b)) {
/* sqrt(x +i*Inf) = +Inf +I*Inf, even if x = NaN */
/* sqrt(x -i*Inf) = +Inf -I*Inf, even if x = NaN */
if (mpfr_inf_p (mpc_imagref (b)))
{
mpfr_set_inf (mpc_realref (a), +1);
mpfr_set_inf (mpc_imagref (a), im_sgn);
return MPC_INEX (0, 0);
}
if (mpfr_inf_p (mpc_realref (b)))
{
if (mpfr_signbit (mpc_realref (b)))
{
if (mpfr_number_p (mpc_imagref (b)))
{
/* sqrt(-Inf +i*y) = +0 +i*Inf, when y positive */
/* sqrt(-Inf +i*y) = +0 -i*Inf, when y positive */
mpfr_set_ui (mpc_realref (a), 0, GMP_RNDN);
mpfr_set_inf (mpc_imagref (a), im_sgn);
return MPC_INEX (0, 0);
}
else
{
/* sqrt(-Inf +i*NaN) = NaN +/-i*Inf */
mpfr_set_nan (mpc_realref (a));
mpfr_set_inf (mpc_imagref (a), im_sgn);
return MPC_INEX (0, 0);
}
}
else
{
if (mpfr_number_p (mpc_imagref (b)))
{
/* sqrt(+Inf +i*y) = +Inf +i*0, when y positive */
/* sqrt(+Inf +i*y) = +Inf -i*0, when y positive */
mpfr_set_inf (mpc_realref (a), +1);
mpfr_set_ui (mpc_imagref (a), 0, GMP_RNDN);
if (im_sgn)
mpc_conj (a, a, MPC_RNDNN);
return MPC_INEX (0, 0);
}
else
{
/* sqrt(+Inf -i*Inf) = +Inf -i*Inf */
/* sqrt(+Inf +i*Inf) = +Inf +i*Inf */
/* sqrt(+Inf +i*NaN) = +Inf +i*NaN */
return mpc_set (a, b, rnd);
}
}
}
/* sqrt(x +i*NaN) = NaN +i*NaN, if x is not infinite */
/* sqrt(NaN +i*y) = NaN +i*NaN, if y is not infinite */
if (mpfr_nan_p (mpc_realref (b)) || mpfr_nan_p (mpc_imagref (b)))
{
mpfr_set_nan (mpc_realref (a));
mpfr_set_nan (mpc_imagref (a));
return MPC_INEX (0, 0);
}
}
/* purely real */
if (im_cmp == 0)
{
if (re_cmp == 0)
{
mpc_set_ui_ui (a, 0, 0, MPC_RNDNN);
if (im_sgn)
mpc_conj (a, a, MPC_RNDNN);
return MPC_INEX (0, 0);
}
else if (re_cmp > 0)
{
inex_w = mpfr_sqrt (mpc_realref (a), mpc_realref (b), MPC_RND_RE (rnd));
mpfr_set_ui (mpc_imagref (a), 0, GMP_RNDN);
if (im_sgn)
mpc_conj (a, a, MPC_RNDNN);
return MPC_INEX (inex_w, 0);
}
else
{
mpfr_init2 (w, MPC_PREC_RE (b));
mpfr_neg (w, mpc_realref (b), GMP_RNDN);
if (im_sgn)
{
inex_w = -mpfr_sqrt (mpc_imagref (a), w, INV_RND (MPC_RND_IM (rnd)));
mpfr_neg (mpc_imagref (a), mpc_imagref (a), GMP_RNDN);
}
else
inex_w = mpfr_sqrt (mpc_imagref (a), w, MPC_RND_IM (rnd));
mpfr_set_ui (mpc_realref (a), 0, GMP_RNDN);
mpfr_clear (w);
return MPC_INEX (0, inex_w);
}
}
/* purely imaginary */
if (re_cmp == 0)
{
mpfr_t y;
y[0] = mpc_imagref (b)[0];
/* If y/2 underflows, so does sqrt(y/2) */
mpfr_div_2ui (y, y, 1, GMP_RNDN);
if (im_cmp > 0)
{
inex_w = mpfr_sqrt (mpc_realref (a), y, MPC_RND_RE (rnd));
inex_t = mpfr_sqrt (mpc_imagref (a), y, MPC_RND_IM (rnd));
}
else
{
mpfr_neg (y, y, GMP_RNDN);
inex_w = mpfr_sqrt (mpc_realref (a), y, MPC_RND_RE (rnd));
inex_t = -mpfr_sqrt (mpc_imagref (a), y, INV_RND (MPC_RND_IM (rnd)));
mpfr_neg (mpc_imagref (a), mpc_imagref (a), GMP_RNDN);
}
return MPC_INEX (inex_w, inex_t);
}
prec = MPC_MAX_PREC(a);
mpfr_init (w);
mpfr_init (t);
if (re_cmp > 0) {
rnd_w = MPC_RND_RE (rnd);
prec_w = MPC_PREC_RE (a);
rnd_t = MPC_RND_IM(rnd);
if (rnd_t == GMP_RNDZ)
/* force GMP_RNDD or GMP_RNDUP, using sign(t) = sign(y) */
rnd_t = (im_cmp > 0 ? GMP_RNDD : GMP_RNDU);
prec_t = MPC_PREC_IM (a);
}
else {
prec_w = MPC_PREC_IM (a);
prec_t = MPC_PREC_RE (a);
if (im_cmp > 0) {
rnd_w = MPC_RND_IM(rnd);
rnd_t = MPC_RND_RE(rnd);
if (rnd_t == GMP_RNDZ)
rnd_t = GMP_RNDD;
}
else {
rnd_w = INV_RND(MPC_RND_IM (rnd));
rnd_t = INV_RND(MPC_RND_RE (rnd));
if (rnd_t == GMP_RNDZ)
rnd_t = GMP_RNDU;
}
}
do
{
loops ++;
prec += (loops <= 2) ? mpc_ceil_log2 (prec) + 4 : prec / 2;
mpfr_set_prec (w, prec);
mpfr_set_prec (t, prec);
/* let b = x + iy */
/* w = sqrt ((|x| + sqrt (x^2 + y^2)) / 2), rounded down */
/* total error bounded by 3 ulps */
inex_w = mpc_abs (w, b, GMP_RNDD);
if (re_cmp < 0)
inex_w |= mpfr_sub (w, w, mpc_realref (b), GMP_RNDD);
else
inex_w |= mpfr_add (w, w, mpc_realref (b), GMP_RNDD);
inex_w |= mpfr_div_2ui (w, w, 1, GMP_RNDD);
inex_w |= mpfr_sqrt (w, w, GMP_RNDD);
repr_w = mpfr_min_prec (w) <= prec_w;
if (!repr_w)
/* use the usual trick for obtaining the ternary value */
ok_w = mpfr_can_round (w, prec - 2, GMP_RNDD, GMP_RNDU,
prec_w + (rnd_w == GMP_RNDN));
else {
/* w is representable in the target precision and thus cannot be
rounded up */
if (rnd_w == GMP_RNDN)
/* If w can be rounded to nearest, then actually no rounding
occurs, and the ternary value is known from inex_w. */
ok_w = mpfr_can_round (w, prec - 2, GMP_RNDD, GMP_RNDN, prec_w);
else
/* If w can be rounded down, then any direct rounding and the
ternary flag can be determined from inex_w. */
ok_w = mpfr_can_round (w, prec - 2, GMP_RNDD, GMP_RNDD, prec_w);
}
if (!inex_w || ok_w) {
/* t = y / 2w, rounded away */
/* total error bounded by 7 ulps */
inex_t = mpfr_div (t, mpc_imagref (b), w, r);
if (!inex_t && inex_w)
/* The division was exact, but w was not. */
inex_t = im_sgn ? -1 : 1;
inex_t |= mpfr_div_2ui (t, t, 1, r);
repr_t = mpfr_min_prec (t) <= prec_t;
if (!repr_t)
/* As for w; since t was rounded away, we check whether rounding to 0
is possible. */
ok_t = mpfr_can_round (t, prec - 3, r, GMP_RNDZ,
prec_t + (rnd_t == GMP_RNDN));
else {
if (rnd_t == GMP_RNDN)
ok_t = mpfr_can_round (t, prec - 3, r, GMP_RNDN, prec_t);
else
ok_t = mpfr_can_round (t, prec - 3, r, r, prec_t);
}
}
}
while ((inex_w && !ok_w) || (inex_t && !ok_t));
if (re_cmp > 0) {
inex_re = mpfr_set (mpc_realref (a), w, MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref (a), t, MPC_RND_IM(rnd));
}
else if (im_cmp > 0) {
inex_re = mpfr_set (mpc_realref(a), t, MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref(a), w, MPC_RND_IM(rnd));
}
else {
inex_re = mpfr_neg (mpc_realref (a), t, MPC_RND_RE(rnd));
inex_im = mpfr_neg (mpc_imagref (a), w, MPC_RND_IM(rnd));
}
if (repr_w && inex_w) {
if (rnd_w == GMP_RNDN) {
/* w has not been rounded with mpfr_set/mpfr_neg, determine ternary
value from inex_w instead */
if (re_cmp > 0)
inex_re = inex_w;
else if (im_cmp > 0)
inex_im = inex_w;
else
inex_im = -inex_w;
}
else {
/* determine ternary value, but also potentially add 1 ulp; can only
be done now when we are in the target precision */
if (re_cmp > 0) {
if (rnd_w == GMP_RNDU) {
MPFR_ADD_ONE_ULP (mpc_realref (a));
inex_re = +1;
}
else
inex_re = -1;
}
else if (im_cmp > 0) {
if (rnd_w == GMP_RNDU) {
MPFR_ADD_ONE_ULP (mpc_imagref (a));
inex_im = +1;
}
else
inex_im = -1;
}
else {
if (rnd_w == GMP_RNDU) {
MPFR_ADD_ONE_ULP (mpc_imagref (a));
inex_im = -1;
}
else
inex_im = +1;
}
}
}
if (repr_t && inex_t) {
if (rnd_t == GMP_RNDN) {
if (re_cmp > 0)
inex_im = inex_t;
else if (im_cmp > 0)
inex_re = inex_t;
else
inex_re = -inex_t;
}
else {
if (re_cmp > 0) {
if (rnd_t == r)
inex_im = inex_t;
else {
inex_im = -inex_t;
/* im_cmp > 0 implies that Im(b) > 0, thus im_sgn = 0
and r = GMP_RNDU.
im_cmp < 0 implies that Im(b) < 0, thus im_sgn = -1
and r = GMP_RNDD. */
MPFR_SUB_ONE_ULP (mpc_imagref (a));
}
}
else if (im_cmp > 0) {
if (rnd_t == r)
inex_re = inex_t;
else {
inex_re = -inex_t;
/* im_cmp > 0 implies r = GMP_RNDU (see above) */
MPFR_SUB_ONE_ULP (mpc_realref (a));
}
}
else { /* im_cmp < 0 */
if (rnd_t == r)
inex_re = -inex_t;
else {
inex_re = inex_t;
/* im_cmp < 0 implies r = GMP_RNDD (see above) */
MPFR_SUB_ONE_ULP (mpc_realref (a));
}
}
}
}
mpfr_clear (w);
mpfr_clear (t);
return MPC_INEX (inex_re, inex_im);
}
mpc-1.0.3/src/set_prec.c 0000644 0001751 0001751 00000001615 12426164730 011764 0000000 0000000 /* mpc_set_prec -- reset the precision of a complex variable.
Copyright (C) 2002, 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-impl.h"
void
mpc_set_prec (mpc_t x, mpfr_prec_t prec)
{
mpfr_set_prec (mpc_realref(x), prec);
mpfr_set_prec (mpc_imagref(x), prec);
}
mpc-1.0.3/src/log10.c 0000644 0001751 0001751 00000026040 12470362212 011073 0000000 0000000 /* mpc_log10 -- Take the base-10 logarithm of a complex number.
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 /* for CHAR_BIT */
#include "mpc-impl.h"
/* Auxiliary functions which implement Ziv's strategy for special cases.
if flag = 0: compute only real part
if flag = 1: compute only imaginary
Exact cases should be dealt with separately. */
static int
mpc_log10_aux (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd, int flag, int nb)
{
mp_prec_t prec = (MPFR_PREC_MIN > 4) ? MPFR_PREC_MIN : 4;
mpc_t tmp;
mpfr_t log10;
int ok = 0, ret;
prec = mpfr_get_prec ((flag == 0) ? mpc_realref (rop) : mpc_imagref (rop));
prec += 10;
mpc_init2 (tmp, prec);
mpfr_init2 (log10, prec);
while (ok == 0)
{
mpfr_set_ui (log10, 10, GMP_RNDN); /* exact since prec >= 4 */
mpfr_log (log10, log10, GMP_RNDN);
/* In each case we have two roundings, thus the final value is
x * (1+u)^2 where x is the exact value, and |u| <= 2^(-prec-1).
Thus the error is always less than 3 ulps. */
switch (nb)
{
case 0: /* imag <- atan2(y/x) */
mpfr_atan2 (mpc_imagref (tmp), mpc_imagref (op), mpc_realref (op),
MPC_RND_IM (rnd));
mpfr_div (mpc_imagref (tmp), mpc_imagref (tmp), log10, GMP_RNDN);
ok = mpfr_can_round (mpc_imagref (tmp), prec - 2, GMP_RNDN,
GMP_RNDZ, MPC_PREC_IM(rop) +
(MPC_RND_IM (rnd) == GMP_RNDN));
if (ok)
ret = mpfr_set (mpc_imagref (rop), mpc_imagref (tmp),
MPC_RND_IM (rnd));
break;
case 1: /* real <- log(x) */
mpfr_log (mpc_realref (tmp), mpc_realref (op), MPC_RND_RE (rnd));
mpfr_div (mpc_realref (tmp), mpc_realref (tmp), log10, GMP_RNDN);
ok = mpfr_can_round (mpc_realref (tmp), prec - 2, GMP_RNDN,
GMP_RNDZ, MPC_PREC_RE(rop) +
(MPC_RND_RE (rnd) == GMP_RNDN));
if (ok)
ret = mpfr_set (mpc_realref (rop), mpc_realref (tmp),
MPC_RND_RE (rnd));
break;
case 2: /* imag <- pi */
mpfr_const_pi (mpc_imagref (tmp), MPC_RND_IM (rnd));
mpfr_div (mpc_imagref (tmp), mpc_imagref (tmp), log10, GMP_RNDN);
ok = mpfr_can_round (mpc_imagref (tmp), prec - 2, GMP_RNDN,
GMP_RNDZ, MPC_PREC_IM(rop) +
(MPC_RND_IM (rnd) == GMP_RNDN));
if (ok)
ret = mpfr_set (mpc_imagref (rop), mpc_imagref (tmp),
MPC_RND_IM (rnd));
break;
}
prec += prec / 2;
mpc_set_prec (tmp, prec);
mpfr_set_prec (log10, prec);
}
mpc_clear (tmp);
mpfr_clear (log10);
return ret;
}
int
mpc_log10 (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
int ok = 0, loops = 0, re_cmp, im_cmp, inex_re, inex_im, negative_zero;
mpfr_t w;
mpfr_prec_t prec;
mpfr_rnd_t rnd_im;
mpc_t ww;
mpc_rnd_t invrnd;
/* special values: NaN and infinities: same as mpc_log */
if (!mpc_fin_p (op)) /* real or imaginary parts are NaN or Inf */
{
if (mpfr_nan_p (mpc_realref (op)))
{
if (mpfr_inf_p (mpc_imagref (op)))
/* (NaN, Inf) -> (+Inf, NaN) */
mpfr_set_inf (mpc_realref (rop), +1);
else
/* (NaN, xxx) -> (NaN, NaN) */
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
inex_im = 0; /* Inf/NaN is exact */
}
else if (mpfr_nan_p (mpc_imagref (op)))
{
if (mpfr_inf_p (mpc_realref (op)))
/* (Inf, NaN) -> (+Inf, NaN) */
mpfr_set_inf (mpc_realref (rop), +1);
else
/* (xxx, NaN) -> (NaN, NaN) */
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
inex_im = 0; /* Inf/NaN is exact */
}
else /* We have an infinity in at least one part. */
{
/* (+Inf, y) -> (+Inf, 0) for finite positive-signed y */
if (mpfr_inf_p (mpc_realref (op)) && mpfr_signbit (mpc_realref (op))
== 0 && mpfr_number_p (mpc_imagref (op)))
inex_im = mpfr_atan2 (mpc_imagref (rop), mpc_imagref (op),
mpc_realref (op), MPC_RND_IM (rnd));
else
/* (xxx, Inf) -> (+Inf, atan2(Inf/xxx))
(Inf, yyy) -> (+Inf, atan2(yyy/Inf)) */
inex_im = mpc_log10_aux (rop, op, rnd, 1, 0);
mpfr_set_inf (mpc_realref (rop), +1);
}
return MPC_INEX(0, inex_im);
}
/* special cases: real and purely imaginary numbers */
re_cmp = mpfr_cmp_ui (mpc_realref (op), 0);
im_cmp = mpfr_cmp_ui (mpc_imagref (op), 0);
if (im_cmp == 0) /* Im(op) = 0 */
{
if (re_cmp == 0) /* Re(op) = 0 */
{
if (mpfr_signbit (mpc_realref (op)) == 0)
inex_im = mpfr_atan2 (mpc_imagref (rop), mpc_imagref (op),
mpc_realref (op), MPC_RND_IM (rnd));
else
inex_im = mpc_log10_aux (rop, op, rnd, 1, 0);
mpfr_set_inf (mpc_realref (rop), -1);
inex_re = 0; /* -Inf is exact */
}
else if (re_cmp > 0)
{
inex_re = mpfr_log10 (mpc_realref (rop), mpc_realref (op),
MPC_RND_RE (rnd));
inex_im = mpfr_set (mpc_imagref (rop), mpc_imagref (op),
MPC_RND_IM (rnd));
}
else /* log10(x + 0*i) for negative x */
{ /* op = x + 0*i; let w = -x = |x| */
negative_zero = mpfr_signbit (mpc_imagref (op));
if (negative_zero)
rnd_im = INV_RND (MPC_RND_IM (rnd));
else
rnd_im = MPC_RND_IM (rnd);
ww->re[0] = *mpc_realref (op);
MPFR_CHANGE_SIGN (ww->re);
ww->im[0] = *mpc_imagref (op);
if (mpfr_cmp_ui (ww->re, 1) == 0)
inex_re = mpfr_set_ui (mpc_realref (rop), 0, MPC_RND_RE (rnd));
else
inex_re = mpc_log10_aux (rop, ww, rnd, 0, 1);
inex_im = mpc_log10_aux (rop, op, MPC_RND (0,rnd_im), 1, 2);
if (negative_zero)
{
mpc_conj (rop, rop, MPC_RNDNN);
inex_im = -inex_im;
}
}
return MPC_INEX(inex_re, inex_im);
}
else if (re_cmp == 0)
{
if (im_cmp > 0)
{
inex_re = mpfr_log10 (mpc_realref (rop), mpc_imagref (op), MPC_RND_RE (rnd));
inex_im = mpc_log10_aux (rop, op, rnd, 1, 2);
/* division by 2 does not change the ternary flag */
mpfr_div_2ui (mpc_imagref (rop), mpc_imagref (rop), 1, GMP_RNDN);
}
else
{
w [0] = *mpc_imagref (op);
MPFR_CHANGE_SIGN (w);
inex_re = mpfr_log10 (mpc_realref (rop), w, MPC_RND_RE (rnd));
invrnd = MPC_RND (0, INV_RND (MPC_RND_IM (rnd)));
inex_im = mpc_log10_aux (rop, op, invrnd, 1, 2);
/* division by 2 does not change the ternary flag */
mpfr_div_2ui (mpc_imagref (rop), mpc_imagref (rop), 1, GMP_RNDN);
mpfr_neg (mpc_imagref (rop), mpc_imagref (rop), GMP_RNDN);
inex_im = -inex_im; /* negate the ternary flag */
}
return MPC_INEX(inex_re, inex_im);
}
/* generic case: neither Re(op) nor Im(op) is NaN, Inf or zero */
prec = MPC_PREC_RE(rop);
mpfr_init2 (w, prec);
mpc_init2 (ww, prec);
/* let op = x + iy; compute log(op)/log(10) */
while (ok == 0)
{
loops ++;
prec += (loops <= 2) ? mpc_ceil_log2 (prec) + 4 : prec / 2;
mpfr_set_prec (w, prec);
mpc_set_prec (ww, prec);
mpc_log (ww, op, MPC_RNDNN);
mpfr_set_ui (w, 10, GMP_RNDN); /* exact since prec >= 4 */
mpfr_log (w, w, GMP_RNDN);
mpc_div_fr (ww, ww, w, MPC_RNDNN);
ok = mpfr_can_round (mpc_realref (ww), prec - 2, GMP_RNDN, GMP_RNDZ,
MPC_PREC_RE(rop) + (MPC_RND_RE (rnd) == GMP_RNDN));
/* Special code to deal with cases where the real part of log10(x+i*y)
is exact, like x=3 and y=1. Since Re(log10(x+i*y)) = log10(x^2+y^2)/2
this happens whenever x^2+y^2 is a nonnegative power of 10.
Indeed x^2+y^2 cannot equal 10^(a/2^b) for a, b integers, a odd, b>0,
since x^2+y^2 is rational, and 10^(a/2^b) is irrational.
Similarly, for b=0, x^2+y^2 cannot equal 10^a for a < 0 since x^2+y^2
is a rational with denominator a power of 2.
Now let x^2+y^2 = 10^s. Without loss of generality we can assume
x = u/2^e and y = v/2^e with u, v, e integers: u^2+v^2 = 10^s*2^(2e)
thus u^2+v^2 = 0 mod 2^(2e). By recurrence on e, necessarily
u = v = 0 mod 2^e, thus x and y are necessarily integers.
*/
if ((ok == 0) && (loops == 1) && mpfr_integer_p (mpc_realref (op)) &&
mpfr_integer_p (mpc_imagref (op)))
{
mpz_t x, y;
unsigned long s, v;
mpz_init (x);
mpz_init (y);
mpfr_get_z (x, mpc_realref (op), GMP_RNDN); /* exact */
mpfr_get_z (y, mpc_imagref (op), GMP_RNDN); /* exact */
mpz_mul (x, x, x);
mpz_mul (y, y, y);
mpz_add (x, x, y); /* x^2+y^2 */
v = mpz_scan1 (x, 0);
/* if x = 10^s then necessarily s = v */
s = mpz_sizeinbase (x, 10);
/* since s is either the number of digits of x or one more,
then x = 10^(s-1) or 10^(s-2) */
if (s == v + 1 || s == v + 2)
{
mpz_div_2exp (x, x, v);
mpz_ui_pow_ui (y, 5, v);
if (mpz_cmp (y, x) == 0) /* Re(log10(x+i*y)) is exactly v/2 */
{
/* we reset the precision of Re(ww) so that v can be
represented exactly */
mpfr_set_prec (mpc_realref (ww), sizeof(unsigned long)*CHAR_BIT);
mpfr_set_ui_2exp (mpc_realref (ww), v, -1, GMP_RNDN); /* exact */
ok = 1;
}
}
mpz_clear (x);
mpz_clear (y);
}
ok = ok && mpfr_can_round (mpc_imagref (ww), prec-2, GMP_RNDN, GMP_RNDZ,
MPC_PREC_IM(rop) + (MPC_RND_IM (rnd) == GMP_RNDN));
}
inex_re = mpfr_set (mpc_realref(rop), mpc_realref (ww), MPC_RND_RE (rnd));
inex_im = mpfr_set (mpc_imagref(rop), mpc_imagref (ww), MPC_RND_IM (rnd));
mpfr_clear (w);
mpc_clear (ww);
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/acos.c 0000644 0001751 0001751 00000017232 12470362212 011101 0000000 0000000 /* mpc_acos -- arccosine of a complex number.
Copyright (C) 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 /* for MPC_ASSERT */
#include "mpc-impl.h"
int
mpc_acos (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
int inex_re, inex_im, inex;
mpfr_prec_t p_re, p_im, p;
mpc_t z1;
mpfr_t pi_over_2;
mpfr_exp_t e1, e2;
mpfr_rnd_t rnd_im;
mpc_rnd_t rnd1;
inex_re = 0;
inex_im = 0;
/* special values */
if (mpfr_nan_p (mpc_realref (op)) || mpfr_nan_p (mpc_imagref (op)))
{
if (mpfr_inf_p (mpc_realref (op)) || mpfr_inf_p (mpc_imagref (op)))
{
mpfr_set_inf (mpc_imagref (rop), mpfr_signbit (mpc_imagref (op)) ? +1 : -1);
mpfr_set_nan (mpc_realref (rop));
}
else if (mpfr_zero_p (mpc_realref (op)))
{
inex_re = set_pi_over_2 (mpc_realref (rop), +1, MPC_RND_RE (rnd));
mpfr_set_nan (mpc_imagref (rop));
}
else
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
}
return MPC_INEX (inex_re, 0);
}
if (mpfr_inf_p (mpc_realref (op)) || mpfr_inf_p (mpc_imagref (op)))
{
if (mpfr_inf_p (mpc_realref (op)))
{
if (mpfr_inf_p (mpc_imagref (op)))
{
if (mpfr_sgn (mpc_realref (op)) > 0)
{
inex_re =
set_pi_over_2 (mpc_realref (rop), +1, MPC_RND_RE (rnd));
mpfr_div_2ui (mpc_realref (rop), mpc_realref (rop), 1, GMP_RNDN);
}
else
{
/* the real part of the result is 3*pi/4
a = o(pi) error(a) < 1 ulp(a)
b = o(3*a) error(b) < 2 ulp(b)
c = b/4 exact
thus 1 bit is lost */
mpfr_t x;
mpfr_prec_t prec;
int ok;
mpfr_init (x);
prec = mpfr_get_prec (mpc_realref (rop));
p = prec;
do
{
p += mpc_ceil_log2 (p);
mpfr_set_prec (x, p);
mpfr_const_pi (x, GMP_RNDD);
mpfr_mul_ui (x, x, 3, GMP_RNDD);
ok =
mpfr_can_round (x, p - 1, GMP_RNDD, MPC_RND_RE (rnd),
prec+(MPC_RND_RE (rnd) == GMP_RNDN));
} while (ok == 0);
inex_re =
mpfr_div_2ui (mpc_realref (rop), x, 2, MPC_RND_RE (rnd));
mpfr_clear (x);
}
}
else
{
if (mpfr_sgn (mpc_realref (op)) > 0)
mpfr_set_ui (mpc_realref (rop), 0, GMP_RNDN);
else
inex_re = mpfr_const_pi (mpc_realref (rop), MPC_RND_RE (rnd));
}
}
else
inex_re = set_pi_over_2 (mpc_realref (rop), +1, MPC_RND_RE (rnd));
mpfr_set_inf (mpc_imagref (rop), mpfr_signbit (mpc_imagref (op)) ? +1 : -1);
return MPC_INEX (inex_re, 0);
}
/* pure real argument */
if (mpfr_zero_p (mpc_imagref (op)))
{
int s_im;
s_im = mpfr_signbit (mpc_imagref (op));
if (mpfr_cmp_ui (mpc_realref (op), 1) > 0)
{
if (s_im)
inex_im = mpfr_acosh (mpc_imagref (rop), mpc_realref (op),
MPC_RND_IM (rnd));
else
inex_im = -mpfr_acosh (mpc_imagref (rop), mpc_realref (op),
INV_RND (MPC_RND_IM (rnd)));
mpfr_set_ui (mpc_realref (rop), 0, GMP_RNDN);
}
else if (mpfr_cmp_si (mpc_realref (op), -1) < 0)
{
mpfr_t minus_op_re;
minus_op_re[0] = mpc_realref (op)[0];
MPFR_CHANGE_SIGN (minus_op_re);
if (s_im)
inex_im = mpfr_acosh (mpc_imagref (rop), minus_op_re,
MPC_RND_IM (rnd));
else
inex_im = -mpfr_acosh (mpc_imagref (rop), minus_op_re,
INV_RND (MPC_RND_IM (rnd)));
inex_re = mpfr_const_pi (mpc_realref (rop), MPC_RND_RE (rnd));
}
else
{
inex_re = mpfr_acos (mpc_realref (rop), mpc_realref (op), MPC_RND_RE (rnd));
mpfr_set_ui (mpc_imagref (rop), 0, MPC_RND_IM (rnd));
}
if (!s_im)
mpc_conj (rop, rop, MPC_RNDNN);
return MPC_INEX (inex_re, inex_im);
}
/* pure imaginary argument */
if (mpfr_zero_p (mpc_realref (op)))
{
inex_re = set_pi_over_2 (mpc_realref (rop), +1, MPC_RND_RE (rnd));
inex_im = -mpfr_asinh (mpc_imagref (rop), mpc_imagref (op),
INV_RND (MPC_RND_IM (rnd)));
mpc_conj (rop,rop, MPC_RNDNN);
return MPC_INEX (inex_re, inex_im);
}
/* regular complex argument: acos(z) = Pi/2 - asin(z) */
p_re = mpfr_get_prec (mpc_realref(rop));
p_im = mpfr_get_prec (mpc_imagref(rop));
p = p_re;
mpc_init3 (z1, p, p_im); /* we round directly the imaginary part to p_im,
with rounding mode opposite to rnd_im */
rnd_im = MPC_RND_IM(rnd);
/* the imaginary part of asin(z) has the same sign as Im(z), thus if
Im(z) > 0 and rnd_im = RNDZ, we want to round the Im(asin(z)) to -Inf
so that -Im(asin(z)) is rounded to zero */
if (rnd_im == GMP_RNDZ)
rnd_im = mpfr_sgn (mpc_imagref(op)) > 0 ? GMP_RNDD : GMP_RNDU;
else
rnd_im = rnd_im == GMP_RNDU ? GMP_RNDD
: rnd_im == GMP_RNDD ? GMP_RNDU
: rnd_im; /* both RNDZ and RNDA map to themselves for -asin(z) */
rnd1 = MPC_RND (GMP_RNDN, rnd_im);
mpfr_init2 (pi_over_2, p);
for (;;)
{
p += mpc_ceil_log2 (p) + 3;
mpfr_set_prec (mpc_realref(z1), p);
mpfr_set_prec (pi_over_2, p);
set_pi_over_2 (pi_over_2, +1, GMP_RNDN);
e1 = 1; /* Exp(pi_over_2) */
inex = mpc_asin (z1, op, rnd1); /* asin(z) */
MPC_ASSERT (mpfr_sgn (mpc_imagref(z1)) * mpfr_sgn (mpc_imagref(op)) > 0);
inex_im = MPC_INEX_IM(inex); /* inex_im is in {-1, 0, 1} */
e2 = mpfr_get_exp (mpc_realref(z1));
mpfr_sub (mpc_realref(z1), pi_over_2, mpc_realref(z1), GMP_RNDN);
if (!mpfr_zero_p (mpc_realref(z1)))
{
/* the error on x=Re(z1) is bounded by 1/2 ulp(x) + 2^(e1-p-1) +
2^(e2-p-1) */
e1 = e1 >= e2 ? e1 + 1 : e2 + 1;
/* the error on x is bounded by 1/2 ulp(x) + 2^(e1-p-1) */
e1 -= mpfr_get_exp (mpc_realref(z1));
/* the error on x is bounded by 1/2 ulp(x) [1 + 2^e1] */
e1 = e1 <= 0 ? 0 : e1;
/* the error on x is bounded by 2^e1 * ulp(x) */
mpfr_neg (mpc_imagref(z1), mpc_imagref(z1), GMP_RNDN); /* exact */
inex_im = -inex_im;
if (mpfr_can_round (mpc_realref(z1), p - e1, GMP_RNDN, GMP_RNDZ,
p_re + (MPC_RND_RE(rnd) == GMP_RNDN)))
break;
}
}
inex = mpc_set (rop, z1, rnd);
inex_re = MPC_INEX_RE(inex);
mpc_clear (z1);
mpfr_clear (pi_over_2);
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/logging.c 0000644 0001751 0001751 00000010632 12426164730 011605 0000000 0000000 /* logging.c -- "Dummy" functions logging calls to real mpc functions.
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 "config.h"
#include
#ifdef HAVE_INTTYPES_H
#include
#endif
#ifdef HAVE_STDINT_H
#include
#endif
#define __MPC_LIBRARY_BUILD
/* to indicate we are inside the library build; needed here since mpc-log.h
includes mpc.h and not mpc-impl.h */
#include "mpc-log.h"
#ifdef HAVE_DLFCN_H
#include
#endif
typedef int (*c_c_func_ptr) (mpc_ptr, mpc_srcptr, mpc_rnd_t);
typedef int (*c_cc_func_ptr) (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
typedef int (*c_ccc_func_ptr) (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
typedef int (*cc_c_func_ptr) (mpc_ptr, mpc_ptr, mpc_srcptr, mpc_rnd_t, mpc_rnd_t);
#define MPC_LOGGING_OUT_PREC(z) \
do { \
fprintf (stderr, " %li %li", (long) mpfr_get_prec (mpc_realref (z)), \
(long) mpfr_get_prec (mpc_imagref (z))); \
} while (0);
#define MPC_LOGGING_OUT_C(z) \
do { \
MPC_LOGGING_OUT_PREC (z); \
fprintf (stderr, " "); \
mpc_out_str (stderr, 16, 0, z, MPC_RNDNN); \
} while (0);
#define MPC_LOGGING_FUNC_TYPE(funcname, type) \
do { \
fprintf (stderr, "mpc_"#funcname" "#type); \
} while (0);
#define MPC_LOGGING_C_C(funcname) \
__MPC_DECLSPEC int mpc_log_##funcname (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) \
{ \
static c_c_func_ptr func = NULL; \
if (func == NULL) \
func = (c_c_func_ptr) (intptr_t) dlsym (NULL, "mpc_"#funcname); \
MPC_LOGGING_FUNC_TYPE (funcname, c_c); \
MPC_LOGGING_OUT_PREC (rop); \
MPC_LOGGING_OUT_C (op); \
fprintf (stderr, "\n"); \
return func (rop, op, rnd); \
}
#define MPC_LOGGING_C_CC(funcname) \
__MPC_DECLSPEC int mpc_log_##funcname (mpc_ptr rop, mpc_srcptr op1, mpc_srcptr op2, mpc_rnd_t rnd) \
{ \
static c_cc_func_ptr func = NULL; \
if (func == NULL) \
func = (c_cc_func_ptr) (intptr_t) dlsym (NULL, "mpc_"#funcname); \
MPC_LOGGING_FUNC_TYPE (funcname, c_cc); \
MPC_LOGGING_OUT_PREC (rop); \
MPC_LOGGING_OUT_C (op1); \
MPC_LOGGING_OUT_C (op2); \
fprintf (stderr, "\n"); \
return func (rop, op1, op2, rnd); \
}
#define MPC_LOGGING_C_CCC(funcname) \
__MPC_DECLSPEC int mpc_log_##funcname (mpc_ptr rop, mpc_srcptr op1, mpc_srcptr op2, mpc_srcptr op3, mpc_rnd_t rnd) \
{ \
static c_ccc_func_ptr func = NULL; \
if (func == NULL) \
func = (c_ccc_func_ptr) (intptr_t) dlsym (NULL, "mpc_"#funcname); \
MPC_LOGGING_FUNC_TYPE (funcname, c_ccc); \
MPC_LOGGING_OUT_PREC (rop); \
MPC_LOGGING_OUT_C (op1); \
MPC_LOGGING_OUT_C (op2); \
MPC_LOGGING_OUT_C (op3); \
fprintf (stderr, "\n"); \
return func (rop, op1, op2, op3, rnd); \
}
#define MPC_LOGGING_CC_C(funcname) \
__MPC_DECLSPEC int mpc_log_##funcname (mpc_ptr rop1, mpc_ptr rop2, mpc_srcptr op, mpc_rnd_t rnd1, mpc_rnd_t rnd2) \
{ \
static cc_c_func_ptr func = NULL; \
if (func == NULL) \
func = (cc_c_func_ptr) (intptr_t) dlsym (NULL, "mpc_"#funcname); \
MPC_LOGGING_FUNC_TYPE (funcname, cc_c); \
MPC_LOGGING_OUT_PREC (rop1); \
MPC_LOGGING_OUT_PREC (rop2); \
MPC_LOGGING_OUT_C (op); \
fprintf (stderr, "\n"); \
return func (rop1, rop2, op, rnd1, rnd2); \
}
MPC_LOGGING_C_C (sqr)
MPC_LOGGING_C_C (conj)
MPC_LOGGING_C_C (neg)
MPC_LOGGING_C_C (sqrt)
MPC_LOGGING_C_C (proj)
MPC_LOGGING_C_C (exp)
MPC_LOGGING_C_C (log)
MPC_LOGGING_C_C (sin)
MPC_LOGGING_C_C (cos)
MPC_LOGGING_C_C (tan)
MPC_LOGGING_C_C (sinh)
MPC_LOGGING_C_C (cosh)
MPC_LOGGING_C_C (tanh)
MPC_LOGGING_C_C (asin)
MPC_LOGGING_C_C (acos)
MPC_LOGGING_C_C (atan)
MPC_LOGGING_C_C (asinh)
MPC_LOGGING_C_C (acosh)
MPC_LOGGING_C_C (atanh)
MPC_LOGGING_C_CC (add)
MPC_LOGGING_C_CC (sub)
MPC_LOGGING_C_CC (mul)
MPC_LOGGING_C_CC (div)
MPC_LOGGING_C_CC (pow)
MPC_LOGGING_C_CCC (fma)
MPC_LOGGING_CC_C (sin_cos)
mpc-1.0.3/src/mpc-impl.h 0000644 0001751 0001751 00000014355 12470362212 011702 0000000 0000000 /* mpc-impl.h -- Internal include file for mpc.
Copyright (C) 2002, 2004, 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/ .
*/
#ifndef __MPC_IMPL_H
#define __MPC_IMPL_H
#define __MPC_LIBRARY_BUILD
/* to indicate we are inside the library build */
#include "config.h"
#ifdef HAVE_STDLIB_H
#include
#endif
#include "mpc.h"
/*
* Miscellaneous useful macros
*/
#define MPC_MIN(h,i) ((h) < (i) ? (h) : (i))
#define MPC_MAX(h,i) ((h) > (i) ? (h) : (i))
/* Safe absolute value (to avoid possible integer overflow) */
/* type is the target (unsigned) type (copied from mpfr-impl.h) */
#ifdef SAFE_ABS
#undef SAFE_ABS
#endif
#define SAFE_ABS(type,x) ((x) >= 0 ? (type)(x) : -(type)(x))
/*
* MPFR constants and macros
*/
#ifndef BITS_PER_MP_LIMB
#define BITS_PER_MP_LIMB mp_bits_per_limb
#endif
#define MPFR_SIGNBIT(x) (mpfr_signbit (x) ? -1 : 1)
#define MPC_MPFR_SIGN(x) (mpfr_zero_p (x) ? 0 : MPFR_SIGNBIT (x))
/* should be called MPFR_SIGN, but this is taken in mpfr.h */
#define MPFR_CHANGE_SIGN(x) mpfr_neg(x,x,GMP_RNDN)
#define MPFR_COPYSIGN(x,y,z,rnd) (mpfr_nan_p (z) ? \
mpfr_setsign (x, y, 0, rnd) : \
mpfr_copysign (x, y, z, rnd))
/* work around spurious signs in nan */
#define MPFR_ADD_ONE_ULP(x) mpfr_add_one_ulp (x, GMP_RNDN)
#define MPFR_SUB_ONE_ULP(x) mpfr_sub_one_ulp (x, GMP_RNDN)
/* drop unused rounding mode from macroes */
#define MPFR_SWAP(a,b) do { mpfr_srcptr tmp; tmp = a; a = b; b = tmp; } while (0)
/*
* Macro implementing rounding away from zero, to ease compatibility with
* mpfr < 3. f is the complete function call with a rounding mode of
* MPFR_RNDA, rop the name of the variable containing the result; it is
* already contained in f, but needs to be repeated so that the macro can
* modify the variable.
* Usage: replace each call to a function such as
* mpfr_add (rop, a, b, MPFR_RNDA)
* by
* ROUND_AWAY (mpfr_add (rop, a, b, MPFR_RNDA), rop)
*/
#if MPFR_VERSION_MAJOR < 3
/* round towards zero, add 1 ulp if not exact */
#define MPFR_RNDA GMP_RNDZ
#define ROUND_AWAY(f,rop) \
((f) ? MPFR_ADD_ONE_ULP (rop), MPFR_SIGNBIT (rop) : 0)
#else
#define ROUND_AWAY(f,rop) \
(f)
#endif /* mpfr < 3 */
#if MPFR_VERSION_MAJOR < 3
/* declare missing functions, defined in get_version.c */
__MPC_DECLSPEC void mpfr_set_zero (mpfr_ptr, int);
__MPC_DECLSPEC int mpfr_regular_p (mpfr_srcptr);
#endif /* mpfr < 3 */
/*
* MPC macros
*/
#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 INV_RND(r) \
(((r) == GMP_RNDU) ? GMP_RNDD : (((r) == GMP_RNDD) ? GMP_RNDU : (r)))
#define mpc_inf_p(z) (mpfr_inf_p(mpc_realref(z))||mpfr_inf_p(mpc_imagref(z)))
/* Convention in C99 (G.3): z is regarded as an infinity if at least one of
its parts is infinite */
#define mpc_zero_p(z) (mpfr_zero_p(mpc_realref(z))&&mpfr_zero_p(mpc_imagref(z)))
/* Convention in C99 (G.3): z is regarded as a zero if each of its parts is
a zero */
#define mpc_fin_p(z) (mpfr_number_p(mpc_realref(z))&&mpfr_number_p(mpc_imagref(z)))
/* Convention in C99 (G.3): z is regarded as finite if both its parts are */
#define mpc_nan_p(z) ((mpfr_nan_p(mpc_realref(z)) && !mpfr_inf_p(mpc_imagref(z))) || (mpfr_nan_p(mpc_imagref(z)) && !mpfr_inf_p(mpc_realref(z))))
/* Consider as NaN all other numbers containing at least one NaN */
/*
* ASSERT macros
*/
#ifdef NDEBUG
#define MPC_ASSERT(expr) \
do { \
} while (0)
#else
#define MPC_ASSERT(expr) \
do { \
if (!(expr)) \
{ \
fprintf (stderr, "%s:%d: MPC assertion failed: %s\n", \
__FILE__, __LINE__, #expr); \
abort(); \
} \
} while (0)
#endif
/*
* Debug macros
*/
#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)
/*
* Constants
*/
#ifndef MUL_KARATSUBA_THRESHOLD
#define MUL_KARATSUBA_THRESHOLD 23
#endif
/*
* Define internal functions
*/
#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);
__MPC_DECLSPEC int mpc_pow_usi (mpc_ptr, mpc_srcptr, unsigned long, int, mpc_rnd_t);
__MPC_DECLSPEC char* mpc_alloc_str (size_t);
__MPC_DECLSPEC char* mpc_realloc_str (char*, size_t, size_t);
__MPC_DECLSPEC void mpc_free_str (char*);
__MPC_DECLSPEC mpfr_prec_t mpc_ceil_log2 (mpfr_prec_t);
__MPC_DECLSPEC int set_pi_over_2 (mpfr_ptr, int, mpfr_rnd_t);
#if defined (__cplusplus)
}
#endif
#endif
mpc-1.0.3/src/clear.c 0000644 0001751 0001751 00000001522 12426164730 011243 0000000 0000000 /* mpc_clear -- Clear a complex variable.
Copyright (C) 2002, 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-impl.h"
void
mpc_clear (mpc_t x)
{
mpfr_clear (mpc_realref(x));
mpfr_clear (mpc_imagref(x));
}
mpc-1.0.3/src/sub.c 0000644 0001751 0001751 00000002057 12426164730 010752 0000000 0000000 /* mpc_sub -- Subtract two complex numbers.
Copyright (C) 2002, 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-impl.h"
int
mpc_sub (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_sub (mpc_realref(a), mpc_realref(b), mpc_realref(c), MPC_RND_RE(rnd));
inex_im = mpfr_sub (mpc_imagref(a), mpc_imagref(b), mpc_imagref(c), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/atan.c 0000644 0001751 0001751 00000031122 12470362212 011071 0000000 0000000 /* mpc_atan -- arctangent of a complex number.
Copyright (C) 2009, 2010, 2011, 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
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
#include "mpc-impl.h"
/* set rop to
-pi/2 if s < 0
+pi/2 else
rounded in the direction rnd
*/
int
set_pi_over_2 (mpfr_ptr rop, int s, mpfr_rnd_t rnd)
{
int inex;
inex = mpfr_const_pi (rop, s < 0 ? INV_RND (rnd) : rnd);
mpfr_div_2ui (rop, rop, 1, GMP_RNDN);
if (s < 0)
{
inex = -inex;
mpfr_neg (rop, rop, GMP_RNDN);
}
return inex;
}
int
mpc_atan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
int s_re;
int s_im;
int inex_re;
int inex_im;
int inex;
inex_re = 0;
inex_im = 0;
s_re = mpfr_signbit (mpc_realref (op));
s_im = mpfr_signbit (mpc_imagref (op));
/* special values */
if (mpfr_nan_p (mpc_realref (op)) || mpfr_nan_p (mpc_imagref (op)))
{
if (mpfr_nan_p (mpc_realref (op)))
{
mpfr_set_nan (mpc_realref (rop));
if (mpfr_zero_p (mpc_imagref (op)) || mpfr_inf_p (mpc_imagref (op)))
{
mpfr_set_ui (mpc_imagref (rop), 0, GMP_RNDN);
if (s_im)
mpc_conj (rop, rop, MPC_RNDNN);
}
else
mpfr_set_nan (mpc_imagref (rop));
}
else
{
if (mpfr_inf_p (mpc_realref (op)))
{
inex_re = set_pi_over_2 (mpc_realref (rop), -s_re, MPC_RND_RE (rnd));
mpfr_set_ui (mpc_imagref (rop), 0, GMP_RNDN);
}
else
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
}
}
return MPC_INEX (inex_re, 0);
}
if (mpfr_inf_p (mpc_realref (op)) || mpfr_inf_p (mpc_imagref (op)))
{
inex_re = set_pi_over_2 (mpc_realref (rop), -s_re, MPC_RND_RE (rnd));
mpfr_set_ui (mpc_imagref (rop), 0, GMP_RNDN);
if (s_im)
mpc_conj (rop, rop, GMP_RNDN);
return MPC_INEX (inex_re, 0);
}
/* pure real argument */
if (mpfr_zero_p (mpc_imagref (op)))
{
inex_re = mpfr_atan (mpc_realref (rop), mpc_realref (op), MPC_RND_RE (rnd));
mpfr_set_ui (mpc_imagref (rop), 0, GMP_RNDN);
if (s_im)
mpc_conj (rop, rop, GMP_RNDN);
return MPC_INEX (inex_re, 0);
}
/* pure imaginary argument */
if (mpfr_zero_p (mpc_realref (op)))
{
int cmp_1;
if (s_im)
cmp_1 = -mpfr_cmp_si (mpc_imagref (op), -1);
else
cmp_1 = mpfr_cmp_ui (mpc_imagref (op), +1);
if (cmp_1 < 0)
{
/* atan(+0+iy) = +0 +i*atanh(y), if |y| < 1
atan(-0+iy) = -0 +i*atanh(y), if |y| < 1 */
mpfr_set_ui (mpc_realref (rop), 0, GMP_RNDN);
if (s_re)
mpfr_neg (mpc_realref (rop), mpc_realref (rop), GMP_RNDN);
inex_im = mpfr_atanh (mpc_imagref (rop), mpc_imagref (op), MPC_RND_IM (rnd));
}
else if (cmp_1 == 0)
{
/* atan(+/-0 +i) = +/-0 +i*inf
atan(+/-0 -i) = +/-0 -i*inf */
mpfr_set_zero (mpc_realref (rop), s_re ? -1 : +1);
mpfr_set_inf (mpc_imagref (rop), s_im ? -1 : +1);
}
else
{
/* atan(+0+iy) = +pi/2 +i*atanh(1/y), if |y| > 1
atan(-0+iy) = -pi/2 +i*atanh(1/y), if |y| > 1 */
mpfr_rnd_t rnd_im, rnd_away;
mpfr_t y;
mpfr_prec_t p, p_im;
int ok;
rnd_im = MPC_RND_IM (rnd);
mpfr_init (y);
p_im = mpfr_get_prec (mpc_imagref (rop));
p = p_im;
/* a = o(1/y) with error(a) < 1 ulp(a)
b = o(atanh(a)) with error(b) < (1+2^{1+Exp(a)-Exp(b)}) ulp(b)
As |atanh (1/y)| > |1/y| we have Exp(a)-Exp(b) <=0 so, at most,
2 bits of precision are lost.
We round atanh(1/y) away from 0.
*/
do
{
p += mpc_ceil_log2 (p) + 2;
mpfr_set_prec (y, p);
rnd_away = s_im == 0 ? GMP_RNDU : GMP_RNDD;
inex_im = mpfr_ui_div (y, 1, mpc_imagref (op), rnd_away);
/* FIXME: should we consider the case with unreasonably huge
precision prec(y)>3*exp_min, where atanh(1/Im(op)) could be
representable while 1/Im(op) underflows ?
This corresponds to |y| = 0.5*2^emin, in which case the
result may be wrong. */
/* atanh cannot underflow: |atanh(x)| > |x| for |x| < 1 */
inex_im |= mpfr_atanh (y, y, rnd_away);
ok = inex_im == 0
|| mpfr_can_round (y, p - 2, rnd_away, GMP_RNDZ,
p_im + (rnd_im == GMP_RNDN));
} while (ok == 0);
inex_re = set_pi_over_2 (mpc_realref (rop), -s_re, MPC_RND_RE (rnd));
inex_im = mpfr_set (mpc_imagref (rop), y, rnd_im);
mpfr_clear (y);
}
return MPC_INEX (inex_re, inex_im);
}
/* regular number argument */
{
mpfr_t a, b, x, y;
mpfr_prec_t prec, p;
mpfr_exp_t err, expo;
int ok = 0;
mpfr_t minus_op_re;
mpfr_exp_t op_re_exp, op_im_exp;
mpfr_rnd_t rnd1, rnd2;
mpfr_inits2 (MPFR_PREC_MIN, a, b, x, y, (mpfr_ptr) 0);
/* real part: Re(arctan(x+i*y)) = [arctan2(x,1-y) - arctan2(-x,1+y)]/2 */
minus_op_re[0] = mpc_realref (op)[0];
MPFR_CHANGE_SIGN (minus_op_re);
op_re_exp = mpfr_get_exp (mpc_realref (op));
op_im_exp = mpfr_get_exp (mpc_imagref (op));
prec = mpfr_get_prec (mpc_realref (rop)); /* result precision */
/* a = o(1-y) error(a) < 1 ulp(a)
b = o(atan2(x,a)) error(b) < [1+2^{3+Exp(x)-Exp(a)-Exp(b)}] ulp(b)
= kb ulp(b)
c = o(1+y) error(c) < 1 ulp(c)
d = o(atan2(-x,c)) error(d) < [1+2^{3+Exp(x)-Exp(c)-Exp(d)}] ulp(d)
= kd ulp(d)
e = o(b - d) error(e) < [1 + kb*2^{Exp(b}-Exp(e)}
+ kd*2^{Exp(d)-Exp(e)}] ulp(e)
error(e) < [1 + 2^{4+Exp(x)-Exp(a)-Exp(e)}
+ 2^{4+Exp(x)-Exp(c)-Exp(e)}] ulp(e)
because |atan(u)| < |u|
< [1 + 2^{5+Exp(x)-min(Exp(a),Exp(c))
-Exp(e)}] ulp(e)
f = e/2 exact
*/
/* p: working precision */
p = (op_im_exp > 0 || prec > SAFE_ABS (mpfr_prec_t, op_im_exp)) ? prec
: (prec - op_im_exp);
rnd1 = mpfr_sgn (mpc_realref (op)) > 0 ? GMP_RNDD : GMP_RNDU;
rnd2 = mpfr_sgn (mpc_realref (op)) < 0 ? GMP_RNDU : GMP_RNDD;
do
{
p += mpc_ceil_log2 (p) + 2;
mpfr_set_prec (a, p);
mpfr_set_prec (b, p);
mpfr_set_prec (x, p);
/* x = upper bound for atan (x/(1-y)). Since atan is increasing, we
need an upper bound on x/(1-y), i.e., a lower bound on 1-y for
x positive, and an upper bound on 1-y for x negative */
mpfr_ui_sub (a, 1, mpc_imagref (op), rnd1);
if (mpfr_sgn (a) == 0) /* y is near 1, thus 1+y is near 2, and
expo will be 1 or 2 below */
{
MPC_ASSERT (mpfr_cmp_ui (mpc_imagref(op), 1) == 0);
/* check for intermediate underflow */
err = 2; /* ensures err will be expo below */
}
else
err = mpfr_get_exp (a); /* err = Exp(a) with the notations above */
mpfr_atan2 (x, mpc_realref (op), a, GMP_RNDU);
/* b = lower bound for atan (-x/(1+y)): for x negative, we need a
lower bound on -x/(1+y), i.e., an upper bound on 1+y */
mpfr_add_ui (a, mpc_imagref(op), 1, rnd2);
/* if a is exactly zero, i.e., Im(op) = -1, then the error on a is 0,
and we can simply ignore the terms involving Exp(a) in the error */
if (mpfr_sgn (a) == 0)
{
MPC_ASSERT (mpfr_cmp_si (mpc_imagref(op), -1) == 0);
/* check for intermediate underflow */
expo = err; /* will leave err unchanged below */
}
else
expo = mpfr_get_exp (a); /* expo = Exp(c) with the notations above */
mpfr_atan2 (b, minus_op_re, a, GMP_RNDD);
err = err < expo ? err : expo; /* err = min(Exp(a),Exp(c)) */
mpfr_sub (x, x, b, GMP_RNDU);
err = 5 + op_re_exp - err - mpfr_get_exp (x);
/* error is bounded by [1 + 2^err] ulp(e) */
err = err < 0 ? 1 : err + 1;
mpfr_div_2ui (x, x, 1, GMP_RNDU);
/* Note: using RND2=RNDD guarantees that if x is exactly representable
on prec + ... bits, mpfr_can_round will return 0 */
ok = mpfr_can_round (x, p - err, GMP_RNDU, GMP_RNDD,
prec + (MPC_RND_RE (rnd) == GMP_RNDN));
} while (ok == 0);
/* Imaginary part
Im(atan(x+I*y)) = 1/4 * [log(x^2+(1+y)^2) - log (x^2 +(1-y)^2)] */
prec = mpfr_get_prec (mpc_imagref (rop)); /* result precision */
/* a = o(1+y) error(a) < 1 ulp(a)
b = o(a^2) error(b) < 5 ulp(b)
c = o(x^2) error(c) < 1 ulp(c)
d = o(b+c) error(d) < 7 ulp(d)
e = o(log(d)) error(e) < [1 + 7*2^{2-Exp(e)}] ulp(e) = ke ulp(e)
f = o(1-y) error(f) < 1 ulp(f)
g = o(f^2) error(g) < 5 ulp(g)
h = o(c+f) error(h) < 7 ulp(h)
i = o(log(h)) error(i) < [1 + 7*2^{2-Exp(i)}] ulp(i) = ki ulp(i)
j = o(e-i) error(j) < [1 + ke*2^{Exp(e)-Exp(j)}
+ ki*2^{Exp(i)-Exp(j)}] ulp(j)
error(j) < [1 + 2^{Exp(e)-Exp(j)} + 2^{Exp(i)-Exp(j)}
+ 7*2^{3-Exp(j)}] ulp(j)
< [1 + 2^{max(Exp(e),Exp(i))-Exp(j)+1}
+ 7*2^{3-Exp(j)}] ulp(j)
k = j/4 exact
*/
err = 2;
p = prec; /* working precision */
do
{
p += mpc_ceil_log2 (p) + err;
mpfr_set_prec (a, p);
mpfr_set_prec (b, p);
mpfr_set_prec (y, p);
/* a = upper bound for log(x^2 + (1+y)^2) */
ROUND_AWAY (mpfr_add_ui (a, mpc_imagref (op), 1, MPFR_RNDA), a);
mpfr_sqr (a, a, GMP_RNDU);
mpfr_sqr (y, mpc_realref (op), GMP_RNDU);
mpfr_add (a, a, y, GMP_RNDU);
mpfr_log (a, a, GMP_RNDU);
/* b = lower bound for log(x^2 + (1-y)^2) */
mpfr_ui_sub (b, 1, mpc_imagref (op), GMP_RNDZ); /* round to zero */
mpfr_sqr (b, b, GMP_RNDZ);
/* we could write mpfr_sqr (y, mpc_realref (op), GMP_RNDZ) but it is
more efficient to reuse the value of y (x^2) above and subtract
one ulp */
mpfr_nextbelow (y);
mpfr_add (b, b, y, GMP_RNDZ);
mpfr_log (b, b, GMP_RNDZ);
mpfr_sub (y, a, b, GMP_RNDU);
if (mpfr_zero_p (y))
/* FIXME: happens when x and y have very different magnitudes;
could be handled more efficiently */
ok = 0;
else
{
expo = MPC_MAX (mpfr_get_exp (a), mpfr_get_exp (b));
expo = expo - mpfr_get_exp (y) + 1;
err = 3 - mpfr_get_exp (y);
/* error(j) <= [1 + 2^expo + 7*2^err] ulp(j) */
if (expo <= err) /* error(j) <= [1 + 2^{err+1}] ulp(j) */
err = (err < 0) ? 1 : err + 2;
else
err = (expo < 0) ? 1 : expo + 2;
mpfr_div_2ui (y, y, 2, GMP_RNDN);
MPC_ASSERT (!mpfr_zero_p (y));
/* FIXME: underflow. Since the main term of the Taylor series
in y=0 is 1/(x^2+1) * y, this means that y is very small
and/or x very large; but then the mpfr_zero_p (y) above
should be true. This needs a proof, or better yet,
special code. */
ok = mpfr_can_round (y, p - err, GMP_RNDU, GMP_RNDD,
prec + (MPC_RND_IM (rnd) == GMP_RNDN));
}
} while (ok == 0);
inex = mpc_set_fr_fr (rop, x, y, rnd);
mpfr_clears (a, b, x, y, (mpfr_ptr) 0);
return inex;
}
}
mpc-1.0.3/src/mul_ui.c 0000644 0001751 0001751 00000002076 12426164730 011454 0000000 0000000 /* mpc_mul_ui -- Multiply a complex number by a nonnegative integer.
Copyright (C) 2002, 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-impl.h"
int
mpc_mul_ui (mpc_ptr a, mpc_srcptr b, unsigned long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_mul_ui (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_mul_ui (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/uceil_log2.c 0000644 0001751 0001751 00000001750 12426164730 012204 0000000 0000000 /* mpc_ceil_log2 - returns ceil(log(d)/log(2))
Copyright (C) 2004, 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 "mpc-impl.h"
/* returns ceil(log(d)/log(2)) if d > 0 */
/* Don't use count_leading_zeros since it is in longlong.h */
mpfr_prec_t
mpc_ceil_log2 (mpfr_prec_t d)
{
mpfr_prec_t exp;
for (exp = 0; d > 1; d = (d + 1) / 2)
exp++;
return exp;
}
mpc-1.0.3/src/pow_d.c 0000644 0001751 0001751 00000002174 12426164730 011271 0000000 0000000 /* mpc_pow_d -- Raise a complex number to a double-precision power.
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 /* for MPC_ASSERT */
#include /* for DBL_MANT_DIG */
#include "mpc-impl.h"
int
mpc_pow_d (mpc_ptr z, mpc_srcptr x, double y, mpc_rnd_t rnd)
{
mpc_t yy;
int inex;
MPC_ASSERT(FLT_RADIX == 2);
mpc_init3 (yy, DBL_MANT_DIG, MPFR_PREC_MIN);
mpc_set_d (yy, y, MPC_RNDNN); /* exact */
inex = mpc_pow (z, x, yy, rnd);
mpc_clear (yy);
return inex;
}
mpc-1.0.3/src/div_fr.c 0000644 0001751 0001751 00000002363 12470362212 011424 0000000 0000000 /* mpc_div_fr -- Divide a complex number by a floating-point number.
Copyright (C) 2002, 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-impl.h"
int
mpc_div_fr (mpc_ptr a, mpc_srcptr b, mpfr_srcptr c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
mpfr_t real;
/* We have to use temporary variable in case c=mpc_realref (a). */
mpfr_init2 (real, MPC_PREC_RE (a));
inex_re = mpfr_div (real, mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_div (mpc_imagref(a), mpc_imagref(b), c, MPC_RND_IM(rnd));
mpfr_set (mpc_realref (a), real, GMP_RNDN);
mpfr_clear (real);
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/swap.c 0000644 0001751 0001751 00000001655 12426164730 011136 0000000 0000000 /* mpc_swap -- Swap two complex numbers.
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-impl.h"
void
mpc_swap (mpc_ptr a, mpc_ptr b)
{
/* assumes real and imaginary parts do not overlap */
mpfr_swap (mpc_realref(a), mpc_realref(b));
mpfr_swap (mpc_imagref(a), mpc_imagref(b));
}
mpc-1.0.3/src/exp.c 0000644 0001751 0001751 00000014600 12470362212 010744 0000000 0000000 /* mpc_exp -- exponential of a complex number.
Copyright (C) 2002, 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-impl.h"
int
mpc_exp (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
mpfr_t x, y, z;
mpfr_prec_t prec;
int ok = 0;
int inex_re, inex_im;
int saved_underflow, saved_overflow;
/* special values */
if (mpfr_nan_p (mpc_realref (op)) || mpfr_nan_p (mpc_imagref (op)))
/* NaNs
exp(nan +i*y) = nan -i*0 if y = -0,
nan +i*0 if y = +0,
nan +i*nan otherwise
exp(x+i*nan) = +/-0 +/-i*0 if x=-inf,
+/-inf +i*nan if x=+inf,
nan +i*nan otherwise */
{
if (mpfr_zero_p (mpc_imagref (op)))
return mpc_set (rop, op, MPC_RNDNN);
if (mpfr_inf_p (mpc_realref (op)))
{
if (mpfr_signbit (mpc_realref (op)))
return mpc_set_ui_ui (rop, 0, 0, MPC_RNDNN);
else
{
mpfr_set_inf (mpc_realref (rop), +1);
mpfr_set_nan (mpc_imagref (rop));
return MPC_INEX(0, 0); /* Inf/NaN are exact */
}
}
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
return MPC_INEX(0, 0); /* NaN is exact */
}
if (mpfr_zero_p (mpc_imagref(op)))
/* special case when the input is real
exp(x-i*0) = exp(x) -i*0, even if x is NaN
exp(x+i*0) = exp(x) +i*0, even if x is NaN */
{
inex_re = mpfr_exp (mpc_realref(rop), mpc_realref(op), MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref(rop), mpc_imagref(op), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
if (mpfr_zero_p (mpc_realref (op)))
/* special case when the input is imaginary */
{
inex_re = mpfr_cos (mpc_realref (rop), mpc_imagref (op), MPC_RND_RE(rnd));
inex_im = mpfr_sin (mpc_imagref (rop), mpc_imagref (op), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
if (mpfr_inf_p (mpc_realref (op)))
/* real part is an infinity,
exp(-inf +i*y) = 0*(cos y +i*sin y)
exp(+inf +i*y) = +/-inf +i*nan if y = +/-inf
+inf*(cos y +i*sin y) if 0 < |y| < inf */
{
mpfr_t n;
mpfr_init2 (n, 2);
if (mpfr_signbit (mpc_realref (op)))
mpfr_set_ui (n, 0, GMP_RNDN);
else
mpfr_set_inf (n, +1);
if (mpfr_inf_p (mpc_imagref (op)))
{
inex_re = mpfr_set (mpc_realref (rop), n, GMP_RNDN);
if (mpfr_signbit (mpc_realref (op)))
inex_im = mpfr_set (mpc_imagref (rop), n, GMP_RNDN);
else
{
mpfr_set_nan (mpc_imagref (rop));
inex_im = 0; /* NaN is exact */
}
}
else
{
mpfr_t c, s;
mpfr_init2 (c, 2);
mpfr_init2 (s, 2);
mpfr_sin_cos (s, c, mpc_imagref (op), GMP_RNDN);
inex_re = mpfr_copysign (mpc_realref (rop), n, c, GMP_RNDN);
inex_im = mpfr_copysign (mpc_imagref (rop), n, s, GMP_RNDN);
mpfr_clear (s);
mpfr_clear (c);
}
mpfr_clear (n);
return MPC_INEX(inex_re, inex_im);
}
if (mpfr_inf_p (mpc_imagref (op)))
/* real part is finite non-zero number, imaginary part is an infinity */
{
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
return MPC_INEX(0, 0); /* NaN is exact */
}
/* from now on, both parts of op are regular numbers */
prec = MPC_MAX_PREC(rop)
+ MPC_MAX (MPC_MAX (-mpfr_get_exp (mpc_realref (op)), 0),
-mpfr_get_exp (mpc_imagref (op)));
/* When op is close to 0, then exp is close to 1+Re(op), while
cos is close to 1-Im(op); to decide on the ternary value of exp*cos,
we need a high enough precision so that none of exp or cos is
computed as 1. */
mpfr_init2 (x, 2);
mpfr_init2 (y, 2);
mpfr_init2 (z, 2);
/* save the underflow or overflow flags from MPFR */
saved_underflow = mpfr_underflow_p ();
saved_overflow = mpfr_overflow_p ();
do
{
prec += mpc_ceil_log2 (prec) + 5;
mpfr_set_prec (x, prec);
mpfr_set_prec (y, prec);
mpfr_set_prec (z, prec);
/* FIXME: x may overflow so x.y does overflow too, while Re(exp(op))
could be represented in the precision of rop. */
mpfr_clear_overflow ();
mpfr_clear_underflow ();
mpfr_exp (x, mpc_realref(op), GMP_RNDN); /* error <= 0.5ulp */
mpfr_sin_cos (z, y, mpc_imagref(op), GMP_RNDN); /* errors <= 0.5ulp */
mpfr_mul (y, y, x, GMP_RNDN); /* error <= 2ulp */
ok = mpfr_overflow_p () || mpfr_zero_p (x)
|| mpfr_can_round (y, prec - 2, GMP_RNDN, GMP_RNDZ,
MPC_PREC_RE(rop) + (MPC_RND_RE(rnd) == GMP_RNDN));
if (ok) /* compute imaginary part */
{
mpfr_mul (z, z, x, GMP_RNDN);
ok = mpfr_overflow_p () || mpfr_zero_p (x)
|| mpfr_can_round (z, prec - 2, GMP_RNDN, GMP_RNDZ,
MPC_PREC_IM(rop) + (MPC_RND_IM(rnd) == GMP_RNDN));
}
}
while (ok == 0);
inex_re = mpfr_set (mpc_realref(rop), y, MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref(rop), z, MPC_RND_IM(rnd));
if (mpfr_overflow_p ()) {
/* overflow in real exponential, inex is sign of infinite result */
inex_re = mpfr_sgn (y);
inex_im = mpfr_sgn (z);
}
else if (mpfr_underflow_p ()) {
/* underflow in real exponential, inex is opposite of sign of 0 result */
inex_re = (mpfr_signbit (y) ? +1 : -1);
inex_im = (mpfr_signbit (z) ? +1 : -1);
}
mpfr_clear (x);
mpfr_clear (y);
mpfr_clear (z);
/* restore underflow and overflow flags from MPFR */
if (saved_underflow)
mpfr_set_underflow ();
if (saved_overflow)
mpfr_set_overflow ();
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/inp_str.c 0000644 0001751 0001751 00000013445 12426164730 011642 0000000 0000000 /* mpc_inp_str -- Input a complex number from a given stream.
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 /* for FILE */
#include
#include
#include "mpc-impl.h"
static size_t
skip_whitespace (FILE *stream)
{
int c = getc (stream);
size_t size = 0;
while (c != EOF && isspace ((unsigned char) c)) {
c = getc (stream);
size++;
}
if (c != EOF)
ungetc (c, stream);
return size;
}
/* Extract from stream the longest string made up of alphanumeric char and
'_' (i.e. n-char-sequence).
The user must free the returned string. */
static char *
extract_suffix (FILE *stream)
{
int c;
size_t nread = 0;
size_t strsize = 100;
char *str = mpc_alloc_str (strsize);
c = getc (stream);
while (isalnum ((unsigned char) c) || c == '_') {
str [nread] = (char) c;
nread++;
if (nread == strsize) {
str = mpc_realloc_str (str, strsize, 2 * strsize);
strsize *= 2;
}
c = getc (stream);
}
str = mpc_realloc_str (str, strsize, nread + 1);
strsize = nread + 1;
str [nread] = '\0';
if (c != EOF)
ungetc (c, stream);
return str;
}
/* Extract from the stream the longest string of characters which are neither
whitespace nor brackets (except for an optional bracketed n-char_sequence
directly following nan or @nan@ independently of case).
The user must free the returned string. */
static char *
extract_string (FILE *stream)
{
int c;
size_t nread = 0;
size_t strsize = 100;
char *str = mpc_alloc_str (strsize);
size_t lenstr;
c = getc (stream);
while (c != EOF && c != '\n'
&& !isspace ((unsigned char) c)
&& c != '(' && c != ')') {
str [nread] = (char) c;
nread++;
if (nread == strsize) {
str = mpc_realloc_str (str, strsize, 2 * strsize);
strsize *= 2;
}
c = getc (stream);
}
str = mpc_realloc_str (str, strsize, nread + 1);
strsize = nread + 1;
str [nread] = '\0';
if (nread == 0)
return str;
lenstr = nread;
if (c == '(') {
size_t n;
char *suffix;
int ret;
/* (n-char-sequence) only after a NaN */
if ((nread != 3
|| tolower ((unsigned char) (str[0])) != 'n'
|| tolower ((unsigned char) (str[1])) != 'a'
|| tolower ((unsigned char) (str[2])) != 'n')
&& (nread != 5
|| str[0] != '@'
|| tolower ((unsigned char) (str[1])) != 'n'
|| tolower ((unsigned char) (str[2])) != 'a'
|| tolower ((unsigned char) (str[3])) != 'n'
|| str[4] != '@')) {
ungetc (c, stream);
return str;
}
suffix = extract_suffix (stream);
nread += strlen (suffix) + 1;
if (nread >= strsize) {
str = mpc_realloc_str (str, strsize, nread + 1);
strsize = nread + 1;
}
/* Warning: the sprintf does not allow overlap between arguments. */
ret = sprintf (str + lenstr, "(%s", suffix);
MPC_ASSERT (ret >= 0);
n = lenstr + (size_t) ret;
MPC_ASSERT (n == nread);
c = getc (stream);
if (c == ')') {
str = mpc_realloc_str (str, strsize, nread + 2);
strsize = nread + 2;
str [nread] = (char) c;
str [nread+1] = '\0';
nread++;
}
else if (c != EOF)
ungetc (c, stream);
mpc_free_str (suffix);
}
else if (c != EOF)
ungetc (c, stream);
return str;
}
int
mpc_inp_str (mpc_ptr rop, FILE *stream, size_t *read, int base,
mpc_rnd_t rnd_mode)
{
size_t white, nread = 0;
int inex = -1;
int c;
char *str;
if (stream == NULL)
stream = stdin;
white = skip_whitespace (stream);
c = getc (stream);
if (c != EOF) {
if (c == '(') {
char *real_str;
char *imag_str;
size_t n;
int ret;
nread++; /* the opening parenthesis */
white = skip_whitespace (stream);
real_str = extract_string (stream);
nread += strlen(real_str);
c = getc (stream);
if (!isspace ((unsigned int) c)) {
if (c != EOF)
ungetc (c, stream);
mpc_free_str (real_str);
goto error;
}
else
ungetc (c, stream);
white += skip_whitespace (stream);
imag_str = extract_string (stream);
nread += strlen (imag_str);
str = mpc_alloc_str (nread + 2);
ret = sprintf (str, "(%s %s", real_str, imag_str);
MPC_ASSERT (ret >= 0);
n = (size_t) ret;
MPC_ASSERT (n == nread + 1);
mpc_free_str (real_str);
mpc_free_str (imag_str);
white += skip_whitespace (stream);
c = getc (stream);
if (c == ')') {
str = mpc_realloc_str (str, nread +2, nread + 3);
str [nread+1] = (char) c;
str [nread+2] = '\0';
nread++;
}
else if (c != EOF)
ungetc (c, stream);
}
else {
if (c != EOF)
ungetc (c, stream);
str = extract_string (stream);
nread += strlen (str);
}
inex = mpc_set_str (rop, str, base, rnd_mode);
mpc_free_str (str);
}
error:
if (inex == -1) {
mpfr_set_nan (mpc_realref(rop));
mpfr_set_nan (mpc_imagref(rop));
}
if (read != NULL)
*read = white + nread;
return inex;
}
mpc-1.0.3/src/fma.c 0000644 0001751 0001751 00000016663 12470362212 010726 0000000 0000000 /* mpc_fma -- Fused multiply-add of three complex numbers
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-impl.h"
/* return a bound on the precision needed to add or subtract x and y exactly */
static mpfr_prec_t
bound_prec_addsub (mpfr_srcptr x, mpfr_srcptr y)
{
if (!mpfr_regular_p (x))
return mpfr_get_prec (y);
else if (!mpfr_regular_p (y))
return mpfr_get_prec (x);
else /* neither x nor y are NaN, Inf or zero */
{
mpfr_exp_t ex = mpfr_get_exp (x);
mpfr_exp_t ey = mpfr_get_exp (y);
mpfr_exp_t ulpx = ex - mpfr_get_prec (x);
mpfr_exp_t ulpy = ey - mpfr_get_prec (y);
return ((ex >= ey) ? ex : ey) + 1 - ((ulpx <= ulpy) ? ulpx : ulpy);
}
}
/* r <- a*b+c */
int
mpc_fma_naive (mpc_ptr r, mpc_srcptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
mpfr_t rea_reb, rea_imb, ima_reb, ima_imb, tmp;
mpfr_prec_t pre12, pre13, pre23, pim12, pim13, pim23;
int inex_re, inex_im;
mpfr_init2 (rea_reb, mpfr_get_prec (mpc_realref(a)) + mpfr_get_prec (mpc_realref(b)));
mpfr_init2 (rea_imb, mpfr_get_prec (mpc_realref(a)) + mpfr_get_prec (mpc_imagref(b)));
mpfr_init2 (ima_reb, mpfr_get_prec (mpc_imagref(a)) + mpfr_get_prec (mpc_realref(b)));
mpfr_init2 (ima_imb, mpfr_get_prec (mpc_imagref(a)) + mpfr_get_prec (mpc_imagref(b)));
mpfr_mul (rea_reb, mpc_realref(a), mpc_realref(b), GMP_RNDZ); /* exact */
mpfr_mul (rea_imb, mpc_realref(a), mpc_imagref(b), GMP_RNDZ); /* exact */
mpfr_mul (ima_reb, mpc_imagref(a), mpc_realref(b), GMP_RNDZ); /* exact */
mpfr_mul (ima_imb, mpc_imagref(a), mpc_imagref(b), GMP_RNDZ); /* exact */
/* Re(r) <- rea_reb - ima_imb + Re(c) */
pre12 = bound_prec_addsub (rea_reb, ima_imb); /* bound on exact precision for
rea_reb - ima_imb */
pre13 = bound_prec_addsub (rea_reb, mpc_realref(c));
/* bound for rea_reb + Re(c) */
pre23 = bound_prec_addsub (ima_imb, mpc_realref(c));
/* bound for ima_imb - Re(c) */
if (pre12 <= pre13 && pre12 <= pre23) /* (rea_reb - ima_imb) + Re(c) */
{
mpfr_init2 (tmp, pre12);
mpfr_sub (tmp, rea_reb, ima_imb, GMP_RNDZ); /* exact */
inex_re = mpfr_add (mpc_realref(r), tmp, mpc_realref(c), MPC_RND_RE(rnd));
/* the only possible bad overlap is between r and c, but since we are
only touching the real part of both, it is ok */
}
else if (pre13 <= pre23) /* (rea_reb + Re(c)) - ima_imb */
{
mpfr_init2 (tmp, pre13);
mpfr_add (tmp, rea_reb, mpc_realref(c), GMP_RNDZ); /* exact */
inex_re = mpfr_sub (mpc_realref(r), tmp, ima_imb, MPC_RND_RE(rnd));
/* the only possible bad overlap is between r and c, but since we are
only touching the real part of both, it is ok */
}
else /* rea_reb + (Re(c) - ima_imb) */
{
mpfr_init2 (tmp, pre23);
mpfr_sub (tmp, mpc_realref(c), ima_imb, GMP_RNDZ); /* exact */
inex_re = mpfr_add (mpc_realref(r), tmp, rea_reb, MPC_RND_RE(rnd));
/* the only possible bad overlap is between r and c, but since we are
only touching the real part of both, it is ok */
}
/* Im(r) <- rea_imb + ima_reb + Im(c) */
pim12 = bound_prec_addsub (rea_imb, ima_reb); /* bound on exact precision for
rea_imb + ima_reb */
pim13 = bound_prec_addsub (rea_imb, mpc_imagref(c));
/* bound for rea_imb + Im(c) */
pim23 = bound_prec_addsub (ima_reb, mpc_imagref(c));
/* bound for ima_reb + Im(c) */
if (pim12 <= pim13 && pim12 <= pim23) /* (rea_imb + ima_reb) + Im(c) */
{
mpfr_set_prec (tmp, pim12);
mpfr_add (tmp, rea_imb, ima_reb, GMP_RNDZ); /* exact */
inex_im = mpfr_add (mpc_imagref(r), tmp, mpc_imagref(c), MPC_RND_IM(rnd));
/* the only possible bad overlap is between r and c, but since we are
only touching the imaginary part of both, it is ok */
}
else if (pim13 <= pim23) /* (rea_imb + Im(c)) + ima_reb */
{
mpfr_set_prec (tmp, pim13);
mpfr_add (tmp, rea_imb, mpc_imagref(c), GMP_RNDZ); /* exact */
inex_im = mpfr_add (mpc_imagref(r), tmp, ima_reb, MPC_RND_IM(rnd));
/* the only possible bad overlap is between r and c, but since we are
only touching the imaginary part of both, it is ok */
}
else /* rea_imb + (Im(c) + ima_reb) */
{
mpfr_set_prec (tmp, pre23);
mpfr_add (tmp, mpc_imagref(c), ima_reb, GMP_RNDZ); /* exact */
inex_im = mpfr_add (mpc_imagref(r), tmp, rea_imb, MPC_RND_IM(rnd));
/* the only possible bad overlap is between r and c, but since we are
only touching the imaginary part of both, it is ok */
}
mpfr_clear (rea_reb);
mpfr_clear (rea_imb);
mpfr_clear (ima_reb);
mpfr_clear (ima_imb);
mpfr_clear (tmp);
return MPC_INEX(inex_re, inex_im);
}
/* The algorithm is as follows:
- in a first pass, we use the target precision + some extra bits
- if it fails, we add the number of cancelled bits when adding
Re(a*b) and Re(c) [similarly for the imaginary part]
- it is fails again, we call the mpc_fma_naive function, which also
deals with the special cases */
int
mpc_fma (mpc_ptr r, mpc_srcptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
mpc_t ab;
mpfr_prec_t pre, pim, wpre, wpim;
mpfr_exp_t diffre, diffim;
int i, inex = 0, okre = 0, okim = 0;
if (mpc_fin_p (a) == 0 || mpc_fin_p (b) == 0 || mpc_fin_p (c) == 0)
return mpc_fma_naive (r, a, b, c, rnd);
pre = mpfr_get_prec (mpc_realref(r));
pim = mpfr_get_prec (mpc_imagref(r));
wpre = pre + mpc_ceil_log2 (pre) + 10;
wpim = pim + mpc_ceil_log2 (pim) + 10;
mpc_init3 (ab, wpre, wpim);
for (i = 0; i < 2; ++i)
{
mpc_mul (ab, a, b, MPC_RNDZZ);
if (mpfr_zero_p (mpc_realref(ab)) || mpfr_zero_p (mpc_imagref(ab)))
break;
diffre = mpfr_get_exp (mpc_realref(ab));
diffim = mpfr_get_exp (mpc_imagref(ab));
mpc_add (ab, ab, c, MPC_RNDZZ);
if (mpfr_zero_p (mpc_realref(ab)) || mpfr_zero_p (mpc_imagref(ab)))
break;
diffre -= mpfr_get_exp (mpc_realref(ab));
diffim -= mpfr_get_exp (mpc_imagref(ab));
diffre = (diffre > 0 ? diffre + 1 : 1);
diffim = (diffim > 0 ? diffim + 1 : 1);
okre = diffre > (mpfr_exp_t) wpre ? 0 : mpfr_can_round (mpc_realref(ab),
wpre - diffre, GMP_RNDN, GMP_RNDZ,
pre + (MPC_RND_RE (rnd) == GMP_RNDN));
okim = diffim > (mpfr_exp_t) wpim ? 0 : mpfr_can_round (mpc_imagref(ab),
wpim - diffim, GMP_RNDN, GMP_RNDZ,
pim + (MPC_RND_IM (rnd) == GMP_RNDN));
if (okre && okim)
{
inex = mpc_set (r, ab, rnd);
break;
}
if (i == 1)
break;
if (okre == 0 && diffre > 1)
wpre += diffre;
if (okim == 0 && diffim > 1)
wpim += diffim;
mpfr_set_prec (mpc_realref(ab), wpre);
mpfr_set_prec (mpc_imagref(ab), wpim);
}
mpc_clear (ab);
return okre && okim ? inex : mpc_fma_naive (r, a, b, c, rnd);
}
mpc-1.0.3/src/add.c 0000644 0001751 0001751 00000002151 12426164730 010704 0000000 0000000 /* mpc_add -- Add two complex numbers.
Copyright (C) 2002, 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-impl.h"
/* return 0 iff both the real and imaginary parts are exact */
int
mpc_add (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_add (mpc_realref(a), mpc_realref(b), mpc_realref(c), MPC_RND_RE(rnd));
inex_im = mpfr_add (mpc_imagref(a), mpc_imagref(b), mpc_imagref(c), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/src/sqr.c 0000644 0001751 0001751 00000027274 12470362212 010770 0000000 0000000 /* mpc_sqr -- Square a complex number.
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 /* for MPC_ASSERT */
#include "mpc-impl.h"
static int
mpfr_fsss (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr c, mpfr_rnd_t rnd)
{
/* Computes z = a^2 - c^2.
Assumes that a and c are finite and non-zero; so a squaring yielding
an infinity is an overflow, and a squaring yielding 0 is an underflow.
Assumes further that z is distinct from a and c. */
int inex;
mpfr_t u, v;
/* u=a^2, v=c^2 exactly */
mpfr_init2 (u, 2*mpfr_get_prec (a));
mpfr_init2 (v, 2*mpfr_get_prec (c));
mpfr_sqr (u, a, GMP_RNDN);
mpfr_sqr (v, c, GMP_RNDN);
/* tentatively compute z as u-v; here we need z to be distinct
from a and c to not lose the latter */
inex = mpfr_sub (z, u, v, rnd);
if (mpfr_inf_p (z)) {
/* replace by "correctly rounded overflow" */
mpfr_set_si (z, (mpfr_signbit (z) ? -1 : 1), GMP_RNDN);
inex = mpfr_mul_2ui (z, z, mpfr_get_emax (), rnd);
}
else if (mpfr_zero_p (u) && !mpfr_zero_p (v)) {
/* exactly u underflowed, determine inexact flag */
inex = (mpfr_signbit (u) ? 1 : -1);
}
else if (mpfr_zero_p (v) && !mpfr_zero_p (u)) {
/* exactly v underflowed, determine inexact flag */
inex = (mpfr_signbit (v) ? -1 : 1);
}
else if (mpfr_nan_p (z) || (mpfr_zero_p (u) && mpfr_zero_p (v))) {
/* In the first case, u and v are +inf.
In the second case, u and v are zeroes; their difference may be 0
or the least representable number, with a sign to be determined.
Redo the computations with mpz_t exponents */
mpfr_exp_t ea, ec;
mpz_t eu, ev;
/* cheat to work around the const qualifiers */
/* Normalise the input by shifting and keep track of the shifts in
the exponents of u and v */
ea = mpfr_get_exp (a);
ec = mpfr_get_exp (c);
mpfr_set_exp ((mpfr_ptr) a, (mpfr_prec_t) 0);
mpfr_set_exp ((mpfr_ptr) c, (mpfr_prec_t) 0);
mpz_init (eu);
mpz_init (ev);
mpz_set_si (eu, (long int) ea);
mpz_mul_2exp (eu, eu, 1);
mpz_set_si (ev, (long int) ec);
mpz_mul_2exp (ev, ev, 1);
/* recompute u and v and move exponents to eu and ev */
mpfr_sqr (u, a, GMP_RNDN);
/* exponent of u is non-positive */
mpz_sub_ui (eu, eu, (unsigned long int) (-mpfr_get_exp (u)));
mpfr_set_exp (u, (mpfr_prec_t) 0);
mpfr_sqr (v, c, GMP_RNDN);
mpz_sub_ui (ev, ev, (unsigned long int) (-mpfr_get_exp (v)));
mpfr_set_exp (v, (mpfr_prec_t) 0);
if (mpfr_nan_p (z)) {
mpfr_exp_t emax = mpfr_get_emax ();
int overflow;
/* We have a = ma * 2^ea with 1/2 <= |ma| < 1 and ea <= emax.
So eu <= 2*emax, and eu > emax since we have
an overflow. The same holds for ev. Shift u and v by as much as
possible so that one of them has exponent emax and the
remaining exponents in eu and ev are the same. Then carry out
the addition. Shifting u and v prevents an underflow. */
if (mpz_cmp (eu, ev) >= 0) {
mpfr_set_exp (u, emax);
mpz_sub_ui (eu, eu, (long int) emax);
mpz_sub (ev, ev, eu);
mpfr_set_exp (v, (mpfr_exp_t) mpz_get_ui (ev));
/* remaining common exponent is now in eu */
}
else {
mpfr_set_exp (v, emax);
mpz_sub_ui (ev, ev, (long int) emax);
mpz_sub (eu, eu, ev);
mpfr_set_exp (u, (mpfr_exp_t) mpz_get_ui (eu));
mpz_set (eu, ev);
/* remaining common exponent is now also in eu */
}
inex = mpfr_sub (z, u, v, rnd);
/* Result is finite since u and v have the same sign. */
overflow = mpfr_mul_2ui (z, z, mpz_get_ui (eu), rnd);
if (overflow)
inex = overflow;
}
else {
int underflow;
/* Subtraction of two zeroes. We have a = ma * 2^ea
with 1/2 <= |ma| < 1 and ea >= emin and similarly for b.
So 2*emin < 2*emin+1 <= eu < emin < 0, and analogously for v. */
mpfr_exp_t emin = mpfr_get_emin ();
if (mpz_cmp (eu, ev) <= 0) {
mpfr_set_exp (u, emin);
mpz_add_ui (eu, eu, (unsigned long int) (-emin));
mpz_sub (ev, ev, eu);
mpfr_set_exp (v, (mpfr_exp_t) mpz_get_si (ev));
}
else {
mpfr_set_exp (v, emin);
mpz_add_ui (ev, ev, (unsigned long int) (-emin));
mpz_sub (eu, eu, ev);
mpfr_set_exp (u, (mpfr_exp_t) mpz_get_si (eu));
mpz_set (eu, ev);
}
inex = mpfr_sub (z, u, v, rnd);
mpz_neg (eu, eu);
underflow = mpfr_div_2ui (z, z, mpz_get_ui (eu), rnd);
if (underflow)
inex = underflow;
}
mpz_clear (eu);
mpz_clear (ev);
mpfr_set_exp ((mpfr_ptr) a, ea);
mpfr_set_exp ((mpfr_ptr) c, ec);
/* works also when a == c */
}
mpfr_clear (u);
mpfr_clear (v);
return inex;
}
int
mpc_sqr (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
{
int ok;
mpfr_t u, v;
mpfr_t x;
/* temporary variable to hold the real part of op,
needed in the case rop==op */
mpfr_prec_t prec;
int inex_re, inex_im, inexact;
mpfr_exp_t emin;
int saved_underflow;
/* special values: NaN and infinities */
if (!mpc_fin_p (op)) {
if (mpfr_nan_p (mpc_realref (op)) || mpfr_nan_p (mpc_imagref (op))) {
mpfr_set_nan (mpc_realref (rop));
mpfr_set_nan (mpc_imagref (rop));
}
else if (mpfr_inf_p (mpc_realref (op))) {
if (mpfr_inf_p (mpc_imagref (op))) {
mpfr_set_inf (mpc_imagref (rop),
MPFR_SIGN (mpc_realref (op)) * MPFR_SIGN (mpc_imagref (op)));
mpfr_set_nan (mpc_realref (rop));
}
else {
if (mpfr_zero_p (mpc_imagref (op)))
mpfr_set_nan (mpc_imagref (rop));
else
mpfr_set_inf (mpc_imagref (rop),
MPFR_SIGN (mpc_realref (op)) * MPFR_SIGN (mpc_imagref (op)));
mpfr_set_inf (mpc_realref (rop), +1);
}
}
else /* IM(op) is infinity, RE(op) is not */ {
if (mpfr_zero_p (mpc_realref (op)))
mpfr_set_nan (mpc_imagref (rop));
else
mpfr_set_inf (mpc_imagref (rop),
MPFR_SIGN (mpc_realref (op)) * MPFR_SIGN (mpc_imagref (op)));
mpfr_set_inf (mpc_realref (rop), -1);
}
return MPC_INEX (0, 0); /* exact */
}
prec = MPC_MAX_PREC(rop);
/* Check for real resp. purely imaginary number */
if (mpfr_zero_p (mpc_imagref(op))) {
int same_sign = mpfr_signbit (mpc_realref (op)) == mpfr_signbit (mpc_imagref (op));
inex_re = mpfr_sqr (mpc_realref(rop), mpc_realref(op), MPC_RND_RE(rnd));
inex_im = mpfr_set_ui (mpc_imagref(rop), 0ul, GMP_RNDN);
if (!same_sign)
mpc_conj (rop, rop, MPC_RNDNN);
return MPC_INEX(inex_re, inex_im);
}
if (mpfr_zero_p (mpc_realref(op))) {
int same_sign = mpfr_signbit (mpc_realref (op)) == mpfr_signbit (mpc_imagref (op));
inex_re = -mpfr_sqr (mpc_realref(rop), mpc_imagref(op), INV_RND (MPC_RND_RE(rnd)));
mpfr_neg (mpc_realref(rop), mpc_realref(rop), GMP_RNDN);
inex_im = mpfr_set_ui (mpc_imagref(rop), 0ul, GMP_RNDN);
if (!same_sign)
mpc_conj (rop, rop, MPC_RNDNN);
return MPC_INEX(inex_re, inex_im);
}
if (rop == op)
{
mpfr_init2 (x, MPC_PREC_RE (op));
mpfr_set (x, op->re, GMP_RNDN);
}
else
x [0] = op->re [0];
/* From here on, use x instead of op->re and safely overwrite rop->re. */
/* Compute real part of result. */
if (SAFE_ABS (mpfr_exp_t,
mpfr_get_exp (mpc_realref (op)) - mpfr_get_exp (mpc_imagref (op)))
> (mpfr_exp_t) MPC_MAX_PREC (op) / 2) {
/* If the real and imaginary parts of the argument have very different
exponents, it is not reasonable to use Karatsuba squaring; compute
exactly with the standard formulae instead, even if this means an
additional multiplication. Using the approach copied from mul, over-
and underflows are also handled correctly. */
inex_re = mpfr_fsss (rop->re, x, op->im, MPC_RND_RE (rnd));
}
else {
/* Karatsuba squaring: we compute the real part as (x+y)*(x-y) and the
imaginary part as 2*x*y, with a total of 2M instead of 2S+1M for the
naive algorithm, which computes x^2-y^2 and 2*y*y */
mpfr_init (u);
mpfr_init (v);
emin = mpfr_get_emin ();
do
{
prec += mpc_ceil_log2 (prec) + 5;
mpfr_set_prec (u, prec);
mpfr_set_prec (v, prec);
/* Let op = x + iy. We need u = x+y and v = x-y, rounded away. */
/* The error is bounded above by 1 ulp. */
/* We first let inexact be 1 if the real part is not computed */
/* exactly and determine the sign later. */
inexact = ROUND_AWAY (mpfr_add (u, x, mpc_imagref (op), MPFR_RNDA), u)
| ROUND_AWAY (mpfr_sub (v, x, mpc_imagref (op), MPFR_RNDA), v);
/* compute the real part as u*v, rounded away */
/* determine also the sign of inex_re */
if (mpfr_sgn (u) == 0 || mpfr_sgn (v) == 0) {
/* as we have rounded away, the result is exact */
mpfr_set_ui (mpc_realref (rop), 0, GMP_RNDN);
inex_re = 0;
ok = 1;
}
else {
mpfr_rnd_t rnd_away;
/* FIXME: can be replaced by MPFR_RNDA in mpfr >= 3 */
rnd_away = (mpfr_sgn (u) * mpfr_sgn (v) > 0 ? GMP_RNDU : GMP_RNDD);
inexact |= ROUND_AWAY (mpfr_mul (u, u, v, MPFR_RNDA), u); /* error 5 */
if (mpfr_get_exp (u) == emin || mpfr_inf_p (u)) {
/* under- or overflow */
inex_re = mpfr_fsss (rop->re, x, op->im, MPC_RND_RE (rnd));
ok = 1;
}
else {
ok = (!inexact) | mpfr_can_round (u, prec - 3,
rnd_away, GMP_RNDZ,
MPC_PREC_RE (rop) + (MPC_RND_RE (rnd) == GMP_RNDN));
if (ok) {
inex_re = mpfr_set (mpc_realref (rop), u, MPC_RND_RE (rnd));
if (inex_re == 0)
/* remember that u was already rounded */
inex_re = inexact;
}
}
}
}
while (!ok);
mpfr_clear (u);
mpfr_clear (v);
}
saved_underflow = mpfr_underflow_p ();
mpfr_clear_underflow ();
inex_im = mpfr_mul (rop->im, x, op->im, MPC_RND_IM (rnd));
if (!mpfr_underflow_p ())
inex_im |= mpfr_mul_2ui (rop->im, rop->im, 1, MPC_RND_IM (rnd));
/* We must not multiply by 2 if rop->im has been set to the smallest
representable number. */
if (saved_underflow)
mpfr_set_underflow ();
if (rop == op)
mpfr_clear (x);
return MPC_INEX (inex_re, inex_im);
}
mpc-1.0.3/src/mpc.h 0000644 0001751 0001751 00000030675 12470362312 010747 0000000 0000000 /* mpc.h -- Include file for mpc.
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012, 2014, 2015 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_H
#define __MPC_H
#include "gmp.h"
#include "mpfr.h"
/* Backwards compatibility with mpfr<3.0.0 */
#ifndef mpfr_exp_t
#define mpfr_exp_t mp_exp_t
#endif
/* Define MPC version number */
#define MPC_VERSION_MAJOR 1
#define MPC_VERSION_MINOR 0
#define MPC_VERSION_PATCHLEVEL 3
#define MPC_VERSION_STRING "1.0.3"
/* Macros dealing with MPC VERSION */
#define MPC_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
#define MPC_VERSION \
MPC_VERSION_NUM(MPC_VERSION_MAJOR,MPC_VERSION_MINOR,MPC_VERSION_PATCHLEVEL)
/* Check if stdint.h/inttypes.h is included */
#if defined (INTMAX_C) && defined (UINTMAX_C)
#define _MPC_H_HAVE_INTMAX_T 1
#endif
/* Return values */
/* Transform negative to 2, positive to 1, leave 0 unchanged */
#define MPC_INEX_POS(inex) (((inex) < 0) ? 2 : ((inex) == 0) ? 0 : 1)
/* Transform 2 to negative, 1 to positive, leave 0 unchanged */
#define MPC_INEX_NEG(inex) (((inex) == 2) ? -1 : ((inex) == 0) ? 0 : 1)
/* The global inexact flag is made of (real flag) + 4 * (imaginary flag), where
each of the real and imaginary inexact flag are:
0 when the result is exact (no rounding error)
1 when the result is larger than the exact value
2 when the result is smaller than the exact value */
#define MPC_INEX(inex_re, inex_im) \
(MPC_INEX_POS(inex_re) | (MPC_INEX_POS(inex_im) << 2))
#define MPC_INEX_RE(inex) MPC_INEX_NEG((inex) & 3)
#define MPC_INEX_IM(inex) MPC_INEX_NEG((inex) >> 2)
/* For functions computing two results, the return value is
inexact1+16*inexact2, which is 0 iif both results are exact. */
#define MPC_INEX12(inex1, inex2) (inex1 | (inex2 << 4))
#define MPC_INEX1(inex) (inex & 15)
#define MPC_INEX2(inex) (inex >> 4)
/* Definition of rounding modes */
/* a complex rounding mode is just a pair of two real rounding modes
we reserve four bits for a real rounding mode. */
typedef int mpc_rnd_t;
#define MPC_RND(r1,r2) (((int)(r1)) + ((int)(r2) << 4))
#define MPC_RND_RE(x) ((mpfr_rnd_t)((x) & 0x0F))
#define MPC_RND_IM(x) ((mpfr_rnd_t)((x) >> 4))
#define MPC_RNDNN MPC_RND (GMP_RNDN,GMP_RNDN)
#define MPC_RNDNZ MPC_RND (GMP_RNDN,GMP_RNDZ)
#define MPC_RNDNU MPC_RND (GMP_RNDN,GMP_RNDU)
#define MPC_RNDND MPC_RND (GMP_RNDN,GMP_RNDD)
#define MPC_RNDZN MPC_RND (GMP_RNDZ,GMP_RNDN)
#define MPC_RNDZZ MPC_RND (GMP_RNDZ,GMP_RNDZ)
#define MPC_RNDZU MPC_RND (GMP_RNDZ,GMP_RNDU)
#define MPC_RNDZD MPC_RND (GMP_RNDZ,GMP_RNDD)
#define MPC_RNDUN MPC_RND (GMP_RNDU,GMP_RNDN)
#define MPC_RNDUZ MPC_RND (GMP_RNDU,GMP_RNDZ)
#define MPC_RNDUU MPC_RND (GMP_RNDU,GMP_RNDU)
#define MPC_RNDUD MPC_RND (GMP_RNDU,GMP_RNDD)
#define MPC_RNDDN MPC_RND (GMP_RNDD,GMP_RNDN)
#define MPC_RNDDZ MPC_RND (GMP_RNDD,GMP_RNDZ)
#define MPC_RNDDU MPC_RND (GMP_RNDD,GMP_RNDU)
#define MPC_RNDDD MPC_RND (GMP_RNDD,GMP_RNDD)
/* Definitions of types and their semantics */
typedef struct {
mpfr_t re;
mpfr_t im;
}
__mpc_struct;
typedef __mpc_struct mpc_t[1];
typedef __mpc_struct *mpc_ptr;
typedef const __mpc_struct *mpc_srcptr;
/* Support for WINDOWS DLL, see
http://lists.gforge.inria.fr/pipermail/mpc-discuss/2011-November/000990.html;
when building the DLL, export symbols, otherwise behave as GMP */
#if defined (__MPC_LIBRARY_BUILD) && __GMP_LIBGMP_DLL
#define __MPC_DECLSPEC __GMP_DECLSPEC_EXPORT
#else
#define __MPC_DECLSPEC __GMP_DECLSPEC
#endif
#if defined (__cplusplus)
extern "C" {
#endif
__MPC_DECLSPEC int mpc_add (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_add_fr (mpc_ptr, mpc_srcptr, mpfr_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_add_si (mpc_ptr, mpc_srcptr, long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_add_ui (mpc_ptr, mpc_srcptr, unsigned long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_sub (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_sub_fr (mpc_ptr, mpc_srcptr, mpfr_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_fr_sub (mpc_ptr, mpfr_srcptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_sub_ui (mpc_ptr, mpc_srcptr, unsigned long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_ui_ui_sub (mpc_ptr, unsigned long int, unsigned long int, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_mul (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_mul_fr (mpc_ptr, mpc_srcptr, mpfr_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_mul_ui (mpc_ptr, mpc_srcptr, unsigned long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_mul_si (mpc_ptr, mpc_srcptr, long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_mul_i (mpc_ptr, mpc_srcptr, int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_sqr (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_div (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_pow (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_pow_fr (mpc_ptr, mpc_srcptr, mpfr_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_pow_ld (mpc_ptr, mpc_srcptr, long double, mpc_rnd_t);
__MPC_DECLSPEC int mpc_pow_d (mpc_ptr, mpc_srcptr, double, mpc_rnd_t);
__MPC_DECLSPEC int mpc_pow_si (mpc_ptr, mpc_srcptr, long, mpc_rnd_t);
__MPC_DECLSPEC int mpc_pow_ui (mpc_ptr, mpc_srcptr, unsigned long, mpc_rnd_t);
__MPC_DECLSPEC int mpc_pow_z (mpc_ptr, mpc_srcptr, mpz_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_div_fr (mpc_ptr, mpc_srcptr, mpfr_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_fr_div (mpc_ptr, mpfr_srcptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_div_ui (mpc_ptr, mpc_srcptr, unsigned long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_ui_div (mpc_ptr, unsigned long int, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_div_2ui (mpc_ptr, mpc_srcptr, unsigned long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_mul_2ui (mpc_ptr, mpc_srcptr, unsigned long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_div_2si (mpc_ptr, mpc_srcptr, long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_mul_2si (mpc_ptr, mpc_srcptr, long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_conj (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_neg (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_norm (mpfr_ptr, mpc_srcptr, mpfr_rnd_t);
__MPC_DECLSPEC int mpc_abs (mpfr_ptr, mpc_srcptr, mpfr_rnd_t);
__MPC_DECLSPEC int mpc_sqrt (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_d (mpc_ptr, double, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_d_d (mpc_ptr, double, double, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_ld (mpc_ptr, long double, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_ld_ld (mpc_ptr, long double, long double, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_f (mpc_ptr, mpf_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_f_f (mpc_ptr, mpf_srcptr, mpf_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_fr (mpc_ptr, mpfr_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_fr_fr (mpc_ptr, mpfr_srcptr, mpfr_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_q (mpc_ptr, mpq_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_q_q (mpc_ptr, mpq_srcptr, mpq_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_si (mpc_ptr, long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_si_si (mpc_ptr, long int, long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_ui (mpc_ptr, unsigned long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_ui_ui (mpc_ptr, unsigned long int, unsigned long int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_z (mpc_ptr, mpz_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_z_z (mpc_ptr, mpz_srcptr, mpz_srcptr, mpc_rnd_t);
__MPC_DECLSPEC void mpc_swap (mpc_ptr, mpc_ptr);
__MPC_DECLSPEC int mpc_fma (mpc_ptr, mpc_srcptr, mpc_srcptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC void mpc_set_nan (mpc_ptr);
__MPC_DECLSPEC int mpc_real (mpfr_ptr, mpc_srcptr, mpfr_rnd_t);
__MPC_DECLSPEC int mpc_imag (mpfr_ptr, mpc_srcptr, mpfr_rnd_t);
__MPC_DECLSPEC int mpc_arg (mpfr_ptr, mpc_srcptr, mpfr_rnd_t);
__MPC_DECLSPEC int mpc_proj (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_cmp (mpc_srcptr, mpc_srcptr);
__MPC_DECLSPEC int mpc_cmp_si_si (mpc_srcptr, long int, long int);
__MPC_DECLSPEC int mpc_exp (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_log (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_log10 (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_sin (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_cos (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_sin_cos (mpc_ptr, mpc_ptr, mpc_srcptr, mpc_rnd_t, mpc_rnd_t);
__MPC_DECLSPEC int mpc_tan (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_sinh (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_cosh (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_tanh (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_asin (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_acos (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_atan (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_asinh (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_acosh (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC int mpc_atanh (mpc_ptr, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC void mpc_clear (mpc_ptr);
__MPC_DECLSPEC int mpc_urandom (mpc_ptr, gmp_randstate_t);
__MPC_DECLSPEC void mpc_init2 (mpc_ptr, mpfr_prec_t);
__MPC_DECLSPEC void mpc_init3 (mpc_ptr, mpfr_prec_t, mpfr_prec_t);
__MPC_DECLSPEC mpfr_prec_t mpc_get_prec (mpc_srcptr x);
__MPC_DECLSPEC void mpc_get_prec2 (mpfr_prec_t *pr, mpfr_prec_t *pi, mpc_srcptr x);
__MPC_DECLSPEC void mpc_set_prec (mpc_ptr, mpfr_prec_t);
__MPC_DECLSPEC const char * mpc_get_version (void);
__MPC_DECLSPEC int mpc_strtoc (mpc_ptr, const char *, char **, int, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_str (mpc_ptr, const char *, int, mpc_rnd_t);
__MPC_DECLSPEC char * mpc_get_str (int, size_t, mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC void mpc_free_str (char *);
/* declare certain functions only if appropriate headers have been included */
#ifdef _MPC_H_HAVE_INTMAX_T
__MPC_DECLSPEC int mpc_set_sj (mpc_ptr, intmax_t, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_uj (mpc_ptr, uintmax_t, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_sj_sj (mpc_ptr, intmax_t, intmax_t, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_uj_uj (mpc_ptr, uintmax_t, uintmax_t, mpc_rnd_t);
#endif
#ifdef _Complex_I
__MPC_DECLSPEC int mpc_set_dc (mpc_ptr, double _Complex, mpc_rnd_t);
__MPC_DECLSPEC int mpc_set_ldc (mpc_ptr, long double _Complex, mpc_rnd_t);
__MPC_DECLSPEC double _Complex mpc_get_dc (mpc_srcptr, mpc_rnd_t);
__MPC_DECLSPEC long double _Complex mpc_get_ldc (mpc_srcptr, mpc_rnd_t);
#endif
#ifdef _GMP_H_HAVE_FILE
__MPC_DECLSPEC int mpc_inp_str (mpc_ptr, FILE *, size_t *, int, mpc_rnd_t);
__MPC_DECLSPEC size_t mpc_out_str (FILE *, int, size_t, mpc_srcptr, mpc_rnd_t);
#endif
#if defined (__cplusplus)
}
#endif
#define mpc_realref(x) ((x)->re)
#define mpc_imagref(x) ((x)->im)
#define mpc_cmp_si(x, y) \
( mpc_cmp_si_si ((x), (y), 0l) )
#define mpc_ui_sub(x, y, z, r) mpc_ui_ui_sub (x, y, 0ul, z, r)
/*
Define a fake mpfr_set_fr so that, for instance, mpc_set_fr_z would
be defined as follows:
mpc_set_fr_z (mpc_t rop, mpfr_t x, mpz_t y, mpc_rnd_t rnd)
MPC_SET_X_Y (fr, z, rop, x, y, rnd)
*/
#ifndef mpfr_set_fr
#define mpfr_set_fr mpfr_set
#endif
#define MPC_SET_X_Y(real_t, imag_t, z, real_value, imag_value, rnd) \
{ \
int _inex_re, _inex_im; \
_inex_re = (mpfr_set_ ## real_t) (mpc_realref (z), (real_value), MPC_RND_RE (rnd)); \
_inex_im = (mpfr_set_ ## imag_t) (mpc_imagref (z), (imag_value), MPC_RND_IM (rnd)); \
return MPC_INEX (_inex_re, _inex_im); \
}
#endif /* ifndef __MPC_H */
mpc-1.0.3/src/mul.c 0000644 0001751 0001751 00000053305 12470362212 010752 0000000 0000000 /* mpc_mul -- Multiply two complex numbers
Copyright (C) 2002, 2004, 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 /* for MPC_ASSERT */
#include "mpc-impl.h"
#define mpz_add_si(z,x,y) do { \
if (y >= 0) \
mpz_add_ui (z, x, (long int) y); \
else \
mpz_sub_ui (z, x, (long int) (-y)); \
} while (0);
/* compute z=x*y when x has an infinite part */
static int
mul_infinite (mpc_ptr z, mpc_srcptr x, mpc_srcptr y)
{
/* Let x=xr+i*xi and y=yr+i*yi; extract the signs of the operands */
int xrs = mpfr_signbit (mpc_realref (x)) ? -1 : 1;
int xis = mpfr_signbit (mpc_imagref (x)) ? -1 : 1;
int yrs = mpfr_signbit (mpc_realref (y)) ? -1 : 1;
int yis = mpfr_signbit (mpc_imagref (y)) ? -1 : 1;
int u, v;
/* compute the sign of
u = xrs * yrs * xr * yr - xis * yis * xi * yi
v = xrs * yis * xr * yi + xis * yrs * xi * yr
+1 if positive, -1 if negatiye, 0 if NaN */
if ( mpfr_nan_p (mpc_realref (x)) || mpfr_nan_p (mpc_imagref (x))
|| mpfr_nan_p (mpc_realref (y)) || mpfr_nan_p (mpc_imagref (y))) {
u = 0;
v = 0;
}
else if (mpfr_inf_p (mpc_realref (x))) {
/* x = (+/-inf) xr + i*xi */
u = ( mpfr_zero_p (mpc_realref (y))
|| (mpfr_inf_p (mpc_imagref (x)) && mpfr_zero_p (mpc_imagref (y)))
|| (mpfr_zero_p (mpc_imagref (x)) && mpfr_inf_p (mpc_imagref (y)))
|| ( (mpfr_inf_p (mpc_imagref (x)) || mpfr_inf_p (mpc_imagref (y)))
&& xrs*yrs == xis*yis)
? 0 : xrs * yrs);
v = ( mpfr_zero_p (mpc_imagref (y))
|| (mpfr_inf_p (mpc_imagref (x)) && mpfr_zero_p (mpc_realref (y)))
|| (mpfr_zero_p (mpc_imagref (x)) && mpfr_inf_p (mpc_realref (y)))
|| ( (mpfr_inf_p (mpc_imagref (x)) || mpfr_inf_p (mpc_imagref (x)))
&& xrs*yis != xis*yrs)
? 0 : xrs * yis);
}
else {
/* x = xr + i*(+/-inf) with |xr| != inf */
u = ( mpfr_zero_p (mpc_imagref (y))
|| (mpfr_zero_p (mpc_realref (x)) && mpfr_inf_p (mpc_realref (y)))
|| (mpfr_inf_p (mpc_realref (y)) && xrs*yrs == xis*yis)
? 0 : -xis * yis);
v = ( mpfr_zero_p (mpc_realref (y))
|| (mpfr_zero_p (mpc_realref (x)) && mpfr_inf_p (mpc_imagref (y)))
|| (mpfr_inf_p (mpc_imagref (y)) && xrs*yis != xis*yrs)
? 0 : xis * yrs);
}
if (u == 0 && v == 0) {
/* Naive result is NaN+i*NaN. Obtain an infinity using the algorithm
given in Annex G.5.1 of the ISO C99 standard */
int xr = (mpfr_zero_p (mpc_realref (x)) || mpfr_nan_p (mpc_realref (x)) ? 0
: (mpfr_inf_p (mpc_realref (x)) ? 1 : 0));
int xi = (mpfr_zero_p (mpc_imagref (x)) || mpfr_nan_p (mpc_imagref (x)) ? 0
: (mpfr_inf_p (mpc_imagref (x)) ? 1 : 0));
int yr = (mpfr_zero_p (mpc_realref (y)) || mpfr_nan_p (mpc_realref (y)) ? 0 : 1);
int yi = (mpfr_zero_p (mpc_imagref (y)) || mpfr_nan_p (mpc_imagref (y)) ? 0 : 1);
if (mpc_inf_p (y)) {
yr = mpfr_inf_p (mpc_realref (y)) ? 1 : 0;
yi = mpfr_inf_p (mpc_imagref (y)) ? 1 : 0;
}
u = xrs * xr * yrs * yr - xis * xi * yis * yi;
v = xrs * xr * yis * yi + xis * xi * yrs * yr;
}
if (u == 0)
mpfr_set_nan (mpc_realref (z));
else
mpfr_set_inf (mpc_realref (z), u);
if (v == 0)
mpfr_set_nan (mpc_imagref (z));
else
mpfr_set_inf (mpc_imagref (z), v);
return MPC_INEX (0, 0); /* exact */
}
/* compute z = x*y for Im(y) == 0 */
static int
mul_real (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
{
int xrs, xis, yrs, yis;
int inex;
/* save signs of operands */
xrs = MPFR_SIGNBIT (mpc_realref (x));
xis = MPFR_SIGNBIT (mpc_imagref (x));
yrs = MPFR_SIGNBIT (mpc_realref (y));
yis = MPFR_SIGNBIT (mpc_imagref (y));
inex = mpc_mul_fr (z, x, mpc_realref (y), rnd);
/* Signs of zeroes may be wrong. Their correction does not change the
inexact flag. */
if (mpfr_zero_p (mpc_realref (z)))
mpfr_setsign (mpc_realref (z), mpc_realref (z), MPC_RND_RE(rnd) == GMP_RNDD
|| (xrs != yrs && xis == yis), GMP_RNDN);
if (mpfr_zero_p (mpc_imagref (z)))
mpfr_setsign (mpc_imagref (z), mpc_imagref (z), MPC_RND_IM (rnd) == GMP_RNDD
|| (xrs != yis && xis != yrs), GMP_RNDN);
return inex;
}
/* compute z = x*y for Re(y) == 0, and Im(x) != 0 and Im(y) != 0 */
static int
mul_imag (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
{
int sign;
int inex_re, inex_im;
int overlap = z == x || z == y;
mpc_t rop;
if (overlap)
mpc_init3 (rop, MPC_PREC_RE (z), MPC_PREC_IM (z));
else
rop [0] = z[0];
sign = (MPFR_SIGNBIT (mpc_realref (y)) != MPFR_SIGNBIT (mpc_imagref (x)))
&& (MPFR_SIGNBIT (mpc_imagref (y)) != MPFR_SIGNBIT (mpc_realref (x)));
inex_re = -mpfr_mul (mpc_realref (rop), mpc_imagref (x), mpc_imagref (y),
INV_RND (MPC_RND_RE (rnd)));
mpfr_neg (mpc_realref (rop), mpc_realref (rop), GMP_RNDN); /* exact */
inex_im = mpfr_mul (mpc_imagref (rop), mpc_realref (x), mpc_imagref (y),
MPC_RND_IM (rnd));
mpc_set (z, rop, MPC_RNDNN);
/* Sign of zeroes may be wrong (note that Re(z) cannot be zero) */
if (mpfr_zero_p (mpc_imagref (z)))
mpfr_setsign (mpc_imagref (z), mpc_imagref (z), MPC_RND_IM (rnd) == GMP_RNDD
|| sign, GMP_RNDN);
if (overlap)
mpc_clear (rop);
return MPC_INEX (inex_re, inex_im);
}
static int
mpfr_fmma (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
mpfr_srcptr d, int sign, mpfr_rnd_t rnd)
{
/* Computes z = ab+cd if sign >= 0, or z = ab-cd if sign < 0.
Assumes that a, b, c, d are finite and non-zero; so any multiplication
of two of them yielding an infinity is an overflow, and a
multiplication yielding 0 is an underflow.
Assumes further that z is distinct from a, b, c, d. */
int inex;
mpfr_t u, v;
/* u=a*b, v=sign*c*d exactly */
mpfr_init2 (u, mpfr_get_prec (a) + mpfr_get_prec (b));
mpfr_init2 (v, mpfr_get_prec (c) + mpfr_get_prec (d));
mpfr_mul (u, a, b, GMP_RNDN);
mpfr_mul (v, c, d, GMP_RNDN);
if (sign < 0)
mpfr_neg (v, v, GMP_RNDN);
/* tentatively compute z as u+v; here we need z to be distinct
from a, b, c, d to not lose the latter */
inex = mpfr_add (z, u, v, rnd);
if (mpfr_inf_p (z)) {
/* replace by "correctly rounded overflow" */
mpfr_set_si (z, (mpfr_signbit (z) ? -1 : 1), GMP_RNDN);
inex = mpfr_mul_2ui (z, z, mpfr_get_emax (), rnd);
}
else if (mpfr_zero_p (u) && !mpfr_zero_p (v)) {
/* exactly u underflowed, determine inexact flag */
inex = (mpfr_signbit (u) ? 1 : -1);
}
else if (mpfr_zero_p (v) && !mpfr_zero_p (u)) {
/* exactly v underflowed, determine inexact flag */
inex = (mpfr_signbit (v) ? 1 : -1);
}
else if (mpfr_nan_p (z) || (mpfr_zero_p (u) && mpfr_zero_p (v))) {
/* In the first case, u and v are infinities with opposite signs.
In the second case, u and v are zeroes; their sum may be 0 or the
least representable number, with a sign to be determined.
Redo the computations with mpz_t exponents */
mpfr_exp_t ea, eb, ec, ed;
mpz_t eu, ev;
/* cheat to work around the const qualifiers */
/* Normalise the input by shifting and keep track of the shifts in
the exponents of u and v */
ea = mpfr_get_exp (a);
eb = mpfr_get_exp (b);
ec = mpfr_get_exp (c);
ed = mpfr_get_exp (d);
mpfr_set_exp ((mpfr_ptr) a, (mpfr_prec_t) 0);
mpfr_set_exp ((mpfr_ptr) b, (mpfr_prec_t) 0);
mpfr_set_exp ((mpfr_ptr) c, (mpfr_prec_t) 0);
mpfr_set_exp ((mpfr_ptr) d, (mpfr_prec_t) 0);
mpz_init (eu);
mpz_init (ev);
mpz_set_si (eu, (long int) ea);
mpz_add_si (eu, eu, (long int) eb);
mpz_set_si (ev, (long int) ec);
mpz_add_si (ev, ev, (long int) ed);
/* recompute u and v and move exponents to eu and ev */
mpfr_mul (u, a, b, GMP_RNDN);
/* exponent of u is non-positive */
mpz_sub_ui (eu, eu, (unsigned long int) (-mpfr_get_exp (u)));
mpfr_set_exp (u, (mpfr_prec_t) 0);
mpfr_mul (v, c, d, GMP_RNDN);
if (sign < 0)
mpfr_neg (v, v, GMP_RNDN);
mpz_sub_ui (ev, ev, (unsigned long int) (-mpfr_get_exp (v)));
mpfr_set_exp (v, (mpfr_prec_t) 0);
if (mpfr_nan_p (z)) {
mpfr_exp_t emax = mpfr_get_emax ();
int overflow;
/* We have a = ma * 2^ea with 1/2 <= |ma| < 1 and ea <= emax, and
analogously for b. So eu <= 2*emax, and eu > emax since we have
an overflow. The same holds for ev. Shift u and v by as much as
possible so that one of them has exponent emax and the
remaining exponents in eu and ev are the same. Then carry out
the addition. Shifting u and v prevents an underflow. */
if (mpz_cmp (eu, ev) >= 0) {
mpfr_set_exp (u, emax);
mpz_sub_ui (eu, eu, (long int) emax);
mpz_sub (ev, ev, eu);
mpfr_set_exp (v, (mpfr_exp_t) mpz_get_ui (ev));
/* remaining common exponent is now in eu */
}
else {
mpfr_set_exp (v, emax);
mpz_sub_ui (ev, ev, (long int) emax);
mpz_sub (eu, eu, ev);
mpfr_set_exp (u, (mpfr_exp_t) mpz_get_ui (eu));
mpz_set (eu, ev);
/* remaining common exponent is now also in eu */
}
inex = mpfr_add (z, u, v, rnd);
/* Result is finite since u and v have different signs. */
overflow = mpfr_mul_2ui (z, z, mpz_get_ui (eu), rnd);
if (overflow)
inex = overflow;
}
else {
int underflow;
/* Addition of two zeroes with same sign. We have a = ma * 2^ea
with 1/2 <= |ma| < 1 and ea >= emin and similarly for b.
So 2*emin < 2*emin+1 <= eu < emin < 0, and analogously for v. */
mpfr_exp_t emin = mpfr_get_emin ();
if (mpz_cmp (eu, ev) <= 0) {
mpfr_set_exp (u, emin);
mpz_add_ui (eu, eu, (unsigned long int) (-emin));
mpz_sub (ev, ev, eu);
mpfr_set_exp (v, (mpfr_exp_t) mpz_get_si (ev));
}
else {
mpfr_set_exp (v, emin);
mpz_add_ui (ev, ev, (unsigned long int) (-emin));
mpz_sub (eu, eu, ev);
mpfr_set_exp (u, (mpfr_exp_t) mpz_get_si (eu));
mpz_set (eu, ev);
}
inex = mpfr_add (z, u, v, rnd);
mpz_neg (eu, eu);
underflow = mpfr_div_2ui (z, z, mpz_get_ui (eu), rnd);
if (underflow)
inex = underflow;
}
mpz_clear (eu);
mpz_clear (ev);
mpfr_set_exp ((mpfr_ptr) a, ea);
mpfr_set_exp ((mpfr_ptr) b, eb);
mpfr_set_exp ((mpfr_ptr) c, ec);
mpfr_set_exp ((mpfr_ptr) d, ed);
/* works also when some of a, b, c, d are not all distinct */
}
mpfr_clear (u);
mpfr_clear (v);
return inex;
}
int
mpc_mul_naive (mpc_ptr z, mpc_srcptr x, mpc_srcptr y, mpc_rnd_t rnd)
{
/* computes z=x*y by the schoolbook method, where x and y are assumed
to be finite and without zero parts */
int overlap, inex;
mpc_t rop;
MPC_ASSERT ( mpfr_regular_p (mpc_realref (x)) && mpfr_regular_p (mpc_imagref (x))
&& mpfr_regular_p (mpc_realref (y)) && mpfr_regular_p (mpc_imagref (y)));
overlap = (z == x) || (z == y);
if (overlap)
mpc_init3 (rop, MPC_PREC_RE (z), MPC_PREC_IM (z));
else
rop [0] = z [0];
inex = MPC_INEX (mpfr_fmma (mpc_realref (rop), mpc_realref (x), mpc_realref (y), mpc_imagref (x),
mpc_imagref (y), -1, MPC_RND_RE (rnd)),
mpfr_fmma (mpc_imagref (rop), mpc_realref (x), mpc_imagref (y), mpc_imagref (x),
mpc_realref (y), +1, MPC_RND_IM (rnd)));
mpc_set (z, rop, MPC_RNDNN);
if (overlap)
mpc_clear (rop);
return inex;
}
int
mpc_mul_karatsuba (mpc_ptr rop, mpc_srcptr op1, mpc_srcptr op2, mpc_rnd_t rnd)
{
/* computes rop=op1*op2 by a Karatsuba algorithm, where op1 and op2
are assumed to be finite and without zero parts */
mpfr_srcptr a, b, c, d;
int mul_i, ok, inexact, mul_a, mul_c, inex_re = 0, inex_im = 0, sign_x, sign_u;
mpfr_t u, v, w, x;
mpfr_prec_t prec, prec_re, prec_u, prec_v, prec_w;
mpfr_rnd_t rnd_re, rnd_u;
int overlap;
/* true if rop == op1 or rop == op2 */
mpc_t result;
/* overlap is quite difficult to handle, because we have to tentatively
round the variable u in the end to either the real or the imaginary
part of rop (it is not possible to tell now whether the real or
imaginary part is used). If this fails, we have to start again and
need the correct values of op1 and op2.
So we just create a new variable for the result in this case. */
int loop;
const int MAX_MUL_LOOP = 1;
overlap = (rop == op1) || (rop == op2);
if (overlap)
mpc_init3 (result, MPC_PREC_RE (rop), MPC_PREC_IM (rop));
else
result [0] = rop [0];
a = mpc_realref(op1);
b = mpc_imagref(op1);
c = mpc_realref(op2);
d = mpc_imagref(op2);
/* (a + i*b) * (c + i*d) = [ac - bd] + i*[ad + bc] */
mul_i = 0; /* number of multiplications by i */
mul_a = 1; /* implicit factor for a */
mul_c = 1; /* implicit factor for c */
if (mpfr_cmp_abs (a, b) < 0)
{
MPFR_SWAP (a, b);
mul_i ++;
mul_a = -1; /* consider i * (a+i*b) = -b + i*a */
}
if (mpfr_cmp_abs (c, d) < 0)
{
MPFR_SWAP (c, d);
mul_i ++;
mul_c = -1; /* consider -d + i*c instead of c + i*d */
}
/* find the precision and rounding mode for the new real part */
if (mul_i % 2)
{
prec_re = MPC_PREC_IM(rop);
rnd_re = MPC_RND_IM(rnd);
}
else /* mul_i = 0 or 2 */
{
prec_re = MPC_PREC_RE(rop);
rnd_re = MPC_RND_RE(rnd);
}
if (mul_i)
rnd_re = INV_RND(rnd_re);
/* now |a| >= |b| and |c| >= |d| */
prec = MPC_MAX_PREC(rop);
mpfr_init2 (v, prec_v = mpfr_get_prec (a) + mpfr_get_prec (d));
mpfr_init2 (w, prec_w = mpfr_get_prec (b) + mpfr_get_prec (c));
mpfr_init2 (u, 2);
mpfr_init2 (x, 2);
inexact = mpfr_mul (v, a, d, GMP_RNDN);
if (inexact) {
/* over- or underflow */
ok = 0;
goto clear;
}
if (mul_a == -1)
mpfr_neg (v, v, GMP_RNDN);
inexact = mpfr_mul (w, b, c, GMP_RNDN);
if (inexact) {
/* over- or underflow */
ok = 0;
goto clear;
}
if (mul_c == -1)
mpfr_neg (w, w, GMP_RNDN);
/* compute sign(v-w) */
sign_x = mpfr_cmp_abs (v, w);
if (sign_x > 0)
sign_x = 2 * mpfr_sgn (v) - mpfr_sgn (w);
else if (sign_x == 0)
sign_x = mpfr_sgn (v) - mpfr_sgn (w);
else
sign_x = mpfr_sgn (v) - 2 * mpfr_sgn (w);
sign_u = mul_a * mpfr_sgn (a) * mul_c * mpfr_sgn (c);
if (sign_x * sign_u < 0)
{ /* swap inputs */
MPFR_SWAP (a, c);
MPFR_SWAP (b, d);
mpfr_swap (v, w);
{ int tmp; tmp = mul_a; mul_a = mul_c; mul_c = tmp; }
sign_x = - sign_x;
}
/* now sign_x * sign_u >= 0 */
loop = 0;
do
{
loop++;
/* the following should give failures with prob. <= 1/prec */
prec += mpc_ceil_log2 (prec) + 3;
mpfr_set_prec (u, prec_u = prec);
mpfr_set_prec (x, prec);
/* first compute away(b +/- a) and store it in u */
inexact = (mul_a == -1 ?
ROUND_AWAY (mpfr_sub (u, b, a, MPFR_RNDA), u) :
ROUND_AWAY (mpfr_add (u, b, a, MPFR_RNDA), u));
/* then compute away(+/-c - d) and store it in x */
inexact |= (mul_c == -1 ?
ROUND_AWAY (mpfr_add (x, c, d, MPFR_RNDA), x) :
ROUND_AWAY (mpfr_sub (x, c, d, MPFR_RNDA), x));
if (mul_c == -1)
mpfr_neg (x, x, GMP_RNDN);
if (inexact == 0)
mpfr_prec_round (u, prec_u = 2 * prec, GMP_RNDN);
/* compute away(u*x) and store it in u */
inexact |= ROUND_AWAY (mpfr_mul (u, u, x, MPFR_RNDA), u);
/* (a+b)*(c-d) */
/* if all computations are exact up to here, it may be that
the real part is exact, thus we need if possible to
compute v - w exactly */
if (inexact == 0)
{
mpfr_prec_t prec_x;
/* v and w are different from 0, so mpfr_get_exp is safe to use */
prec_x = SAFE_ABS (mpfr_exp_t, mpfr_get_exp (v) - mpfr_get_exp (w))
+ MPC_MAX (prec_v, prec_w) + 1;
/* +1 is necessary for a potential carry */
/* ensure we do not use a too large precision */
if (prec_x > prec_u)
prec_x = prec_u;
if (prec_x > prec)
mpfr_prec_round (x, prec_x, GMP_RNDN);
}
rnd_u = (sign_u > 0) ? GMP_RNDU : GMP_RNDD;
inexact |= mpfr_sub (x, v, w, rnd_u); /* ad - bc */
/* in case u=0, ensure that rnd_u rounds x away from zero */
if (mpfr_sgn (u) == 0)
rnd_u = (mpfr_sgn (x) > 0) ? GMP_RNDU : GMP_RNDD;
inexact |= mpfr_add (u, u, x, rnd_u); /* ac - bd */
ok = inexact == 0 ||
mpfr_can_round (u, prec_u - 3, rnd_u, GMP_RNDZ,
prec_re + (rnd_re == GMP_RNDN));
/* this ensures both we can round correctly and determine the correct
inexact flag (for rounding to nearest) */
}
while (!ok && loop <= MAX_MUL_LOOP);
/* after MAX_MUL_LOOP rounds, use mpc_naive instead */
if (ok) {
/* if inexact is zero, then u is exactly ac-bd, otherwise fix the sign
of the inexact flag for u, which was rounded away from ac-bd */
if (inexact != 0)
inexact = mpfr_sgn (u);
if (mul_i == 0)
{
inex_re = mpfr_set (mpc_realref(result), u, MPC_RND_RE(rnd));
if (inex_re == 0)
{
inex_re = inexact; /* u is rounded away from 0 */
inex_im = mpfr_add (mpc_imagref(result), v, w, MPC_RND_IM(rnd));
}
else
inex_im = mpfr_add (mpc_imagref(result), v, w, MPC_RND_IM(rnd));
}
else if (mul_i == 1) /* (x+i*y)/i = y - i*x */
{
inex_im = mpfr_neg (mpc_imagref(result), u, MPC_RND_IM(rnd));
if (inex_im == 0)
{
inex_im = -inexact; /* u is rounded away from 0 */
inex_re = mpfr_add (mpc_realref(result), v, w, MPC_RND_RE(rnd));
}
else
inex_re = mpfr_add (mpc_realref(result), v, w, MPC_RND_RE(rnd));
}
else /* mul_i = 2, z/i^2 = -z */
{
inex_re = mpfr_neg (mpc_realref(result), u, MPC_RND_RE(rnd));
if (inex_re == 0)
{
inex_re = -inexact; /* u is rounded away from 0 */
inex_im = -mpfr_add (mpc_imagref(result), v, w,
INV_RND(MPC_RND_IM(rnd)));
mpfr_neg (mpc_imagref(result), mpc_imagref(result), MPC_RND_IM(rnd));
}
else
{
inex_im = -mpfr_add (mpc_imagref(result), v, w,
INV_RND(MPC_RND_IM(rnd)));
mpfr_neg (mpc_imagref(result), mpc_imagref(result), MPC_RND_IM(rnd));
}
}
mpc_set (rop, result, MPC_RNDNN);
}
clear:
mpfr_clear (u);
mpfr_clear (v);
mpfr_clear (w);
mpfr_clear (x);
if (overlap)
mpc_clear (result);
if (ok)
return MPC_INEX(inex_re, inex_im);
else
return mpc_mul_naive (rop, op1, op2, rnd);
}
int
mpc_mul (mpc_ptr a, mpc_srcptr b, mpc_srcptr c, mpc_rnd_t rnd)
{
/* Conforming to ISO C99 standard (G.5.1 multiplicative operators),
infinities are treated specially if both parts are NaN when computed
naively. */
if (mpc_inf_p (b))
return mul_infinite (a, b, c);
if (mpc_inf_p (c))
return mul_infinite (a, c, b);
/* NaN contamination of both parts in result */
if (mpfr_nan_p (mpc_realref (b)) || mpfr_nan_p (mpc_imagref (b))
|| mpfr_nan_p (mpc_realref (c)) || mpfr_nan_p (mpc_imagref (c))) {
mpfr_set_nan (mpc_realref (a));
mpfr_set_nan (mpc_imagref (a));
return MPC_INEX (0, 0);
}
/* check for real multiplication */
if (mpfr_zero_p (mpc_imagref (b)))
return mul_real (a, c, b, rnd);
if (mpfr_zero_p (mpc_imagref (c)))
return mul_real (a, b, c, rnd);
/* check for purely imaginary multiplication */
if (mpfr_zero_p (mpc_realref (b)))
return mul_imag (a, c, b, rnd);
if (mpfr_zero_p (mpc_realref (c)))
return mul_imag (a, b, c, rnd);
/* If the real and imaginary part of one argument have a very different */
/* exponent, it is not reasonable to use Karatsuba multiplication. */
if ( SAFE_ABS (mpfr_exp_t,
mpfr_get_exp (mpc_realref (b)) - mpfr_get_exp (mpc_imagref (b)))
> (mpfr_exp_t) MPC_MAX_PREC (b) / 2
|| SAFE_ABS (mpfr_exp_t,
mpfr_get_exp (mpc_realref (c)) - mpfr_get_exp (mpc_imagref (c)))
> (mpfr_exp_t) MPC_MAX_PREC (c) / 2)
return mpc_mul_naive (a, b, c, rnd);
else
return ((MPC_MAX_PREC(a)
<= (mpfr_prec_t) MUL_KARATSUBA_THRESHOLD * BITS_PER_MP_LIMB)
? mpc_mul_naive : mpc_mul_karatsuba) (a, b, c, rnd);
}
mpc-1.0.3/src/sub_ui.c 0000644 0001751 0001751 00000002162 12426164730 011444 0000000 0000000 /* mpc_sub_ui -- Add a complex number and an unsigned long int.
Copyright (C) 2002, 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-impl.h"
/* return 0 iff both the real and imaginary parts are exact */
int
mpc_sub_ui (mpc_ptr a, mpc_srcptr b, unsigned long int c, mpc_rnd_t rnd)
{
int inex_re, inex_im;
inex_re = mpfr_sub_ui (mpc_realref(a), mpc_realref(b), c, MPC_RND_RE(rnd));
inex_im = mpfr_set (mpc_imagref(a), mpc_imagref(b), MPC_RND_IM(rnd));
return MPC_INEX(inex_re, inex_im);
}
mpc-1.0.3/NEWS 0000644 0001751 0001751 00000014514 12470362312 007721 0000000 0000000 Changes in version 1.0.3:
- Fixed mpc_pow, see
http://lists.gforge.inria.fr/pipermail/mpc-discuss/2014-October/001315.html
- #18257: Switched to libtool 2.4.5.
Changes in version 1.0.2:
- Fixed mpc_atan, mpc_atanh for (+-0, +-1), see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994#c7
- Fixed mpc_log10 for purely imaginary argument, see
http://lists.gforge.inria.fr/pipermail/mpc-discuss/2012-September/001208.html
Changes in version 1.0.1:
- Switched to automake 1.11.6, see
https://lists.gnu.org/archive/html/automake/2012-07/msg00023.html
- #14669: Fixed extraction of CC from gmp.h
- Fixed case of intermediate zero real or imaginary part in mpc_fma,
found by hydra with GMP_CHECK_RANDOMIZE=1346362345
Changes in version 1.0:
- First release as a GNU package
- License change: LGPLv3+ for code, GFDLv1.3+ (with no invariant sections)
for documentation
- 100% of all lines are covered by tests
- Functions renamed:
mpc_mul_2exp to mpc_mul_2ui, mpc_div_2exp to mpc_div_2ui
- 0^0, which returned (NaN,NaN) previously, now returns (1,+0)
- Removed compatibility with K&R compilers, untestable due to lack of
such compilers
- New functions: mpc_log10, mpc_mul_2si, mpc_div_2si
- Speed-ups:
- mpc_fma
- Bug fixes:
- mpc_div and mpc_norm now return a value indicating the effective
rounding direction, as the other functions
- mpc_mul, mpc_sqr and mpc_norm now return correct results even if there
are over- or underflows during the computation
- mpc_asin, mpc_proj, mpc_sqr: Wrong result when input variable has
infinite part and equals output variable is corrected
- mpc_fr_sub: Wrong return value for imaginary part is corrected
Changes in version 0.9:
- New functions:
- mpc_set_dc, mpc_set_ldc, mpc_get_dc, mpc_get_ldc for converting
between mpc type variables and C variables of type double _Complex
or long double _Complex
- mpc_sin_cos, computing simultaneously the sine and cosine
- Speed-ups:
- mpc_pow_si through binary exponentiation
- mpc_pow_z when the exponent fits in a long
- mpc_tan through the use of mpc_sin_cos
- Bug fixes:
- trigonometric functions: infinite loop due to overflow for large
arguments
- mpc_exp: close to infinite loop for argument close to 0
- mpc_sqrt: close to infinite loop for argument close to 1
- mpc_add_si: replaced macro by function, since the macro evaluated the
same expression twice
- Logging feature for debugging:
./configure --enable-logging
#include "mpc-log.h" instead of #include "mpc.h"
- Minimally required library versions: gmp 4.3.2, mpfr 2.4.2
Changes in version 0.8.2:
- Speed-up of mpc_pow_ui through binary exponentiation
Changes in version 0.8.1:
- Bug fixes:
- mpc_acosh, mpc_asinh, mpc_atanh: swap of precisions between real and
imaginary parts
- mpc_atan: memory leak
- mpc_log: wrong ternary value in data file; masked by bug in mpfr-2.4.1
Changes in version 0.8 ("Dianthus deltoides"):
- New functions:
- mpc_asin, mpc_acos, mpc_atan, mpc_asinh, mpc_acosh, mpc_atanh,
mpc_pow_d, mpc_pow_ld, mpc_pow_si, mpc_pow_ui, mpc_pow_z, mpc_pow_fr
- Bug fixes:
- mpc_ui_div: real divisor
Changes in version 0.7 ("Campanula uniflora"):
- New functions: mpc_pow, mpc_set_nan, mpc_swap
- Bug fixes:
- mpc_log: along branch cut
- mpc_norm: infinite loop in case of overflow
- mpc_ui_div, mpc_div, mpc_fr_div: handling of division by 0 and
infinities following the example code of the C99 standard
- compilation with g++
- Makefile.vc updated (thanks to Mickael Gastineau)
- Minimal gmp version is 4.2
- Changed MPC_SET_X_Y macro
- Functions mpc_random and mpc_random2 removed
Changes in version 0.6 ("Bellis perennis"):
- New functions: mpc_get_str, mpc_set_str, mpc_strtoc, mpc_set_uj,
mpc_set_sj, mpc_set_ld, mpc_set_ld_ld, mpc_set_si_si, mpc_set_uj_uj,
mpc_set_sj_sj, mpc_set_f, mpc_set_f_f, mpc_set_q, mpc_set_q_q, mpc_set_z,
mpc_set_z_z and mpc_free_str
- New macro: MPC_SET_X_Y
- mpc_set_ui_fr removed
- Default precision removed, as well as mpc_init and all mpc_init_set*
combinations; use mpc_init2 or mpc_init3, followed by mpc_set, instead
- mpc_exp, mpc_log, mpc_cos, mpc_sin, mpc_tan, mpc_cosh, mpc_sinh,
mpc_tanh and mpc_sqrt return inexact value
- inp_str returns inexact value and the number of read characters
in an additional parameter
- Get default $CC and $CFLAGS from gmp.h (__GMP_CC / __GMP_CFLAGS,
which are available as of GMP 4.2.3)
- Bug fixes:
- mpc_get_version and MPC_VERSION_STRING agree
- Compilation on i686-pc-cygwin and i686-pc-mingw32 fixed
Changes in version 0.5.2:
- New macros:
- version number: MPC_VERSION_NUM, MPC_VERSION
- Makefile.vc updated (thanks to Mickael Gastineau)
- Compilation on Debian-Gnu-Linux-PowerPC and MacOsX
fixed (thanks to Laurent Fousse and Mickael Gastineau)
Changes in version 0.5.1:
- New functions:
- mpc_set_fr_fr
- mpc_real, mpc_imag
- mpc_arg, mpc_proj
- New macros:
- version number: MPC_VERSION_MAJOR, MPC_VERSION_MINOR,
MPC_VERSION_PATCHLEVEL, MPC_VERSION_STRING
- references to number parts: mpc_realref and mpc_imagref
- Test framework rewritten
- Configure checks for recent gmp (>= 4.2) and mpfr (>= 2.3.1)
libraries
- New configure options: --with-gmp-lib, --with-gmp-include,
--with-mpfr-lib, and --with-mpfr-include
- Export declarations for MSWindows, makefile.vc updated (thanks to
Mickael Gastineau)
- Optimisations:
- cmp_mul_fr, cmp_sin, cmp_cos
- Bug fixes:
- configure looks for gmp first, then for mpfr
- mpc_cos, mpc_div, mpc_div_fr, mpc_fr_sub, mpc_mul_fr, mpc_set_fr,
mpc_sqr
- fix handling of special values: mpc_exp, mpc_log, mpc_mul, mpc_norm,
mpc_sqr, mpc_sqrt
Changes in version 0.5 ("Aconitum neomontanum"):
- Support for autotools
- New functions:
- logarithm
- trigonometric functions: mpc_cos, mpc_tan
- hyperbolic functions: mpc_cosh, mpc_sinh, mpc_tanh
- Bug fixes:
- mpc_sqrt with directed rounding
Copyright (C) 2008, 2009, 2010, 2011, 2012 INRIA
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty.
mpc-1.0.3/compile 0000555 0001751 0001751 00000016244 12470361151 010600 0000000 0000000 #!/bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey .
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
mpc-1.0.3/ltmain.sh 0000444 0001751 0001751 00001170760 12470361144 011051 0000000 0000000 #!/gnu/store/nx4zd42igyb7ghmv4mxv6ncg8wr7ypa1-bash-4.3.33/bin/sh
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
## by inline-source v2014-01-03.01
# libtool (GNU libtool) 2.4.5
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit , 1996
# Copyright (C) 1996-2015 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# GNU Libtool is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that
# is built using GNU Libtool, you may include this file under the
# same distribution terms that you use for the rest of that program.
#
# GNU Libtool 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
PROGRAM=libtool
PACKAGE=libtool
VERSION=2.4.5
package_revision=2.4.5
## ------ ##
## Usage. ##
## ------ ##
# Run './libtool --help' for help with using this script from the
# command line.
## ------------------------------- ##
## User overridable command paths. ##
## ------------------------------- ##
# After configure completes, it has a better idea of some of the
# shell tools we need than the defaults used by the functions shared
# with bootstrap, so set those here where they can still be over-
# ridden by the user, but otherwise take precedence.
: ${AUTOCONF="autoconf"}
: ${AUTOMAKE="automake"}
## -------------------------- ##
## Source external libraries. ##
## -------------------------- ##
# Much of our low-level functionality needs to be sourced from external
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
scriptversion=2014-01-03.01; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
# Copyright (C) 2004-2015 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# As a special exception to the GNU General Public License, if you distribute
# this file as part of a program or library that is built using GNU Libtool,
# you may include this file under the same distribution terms that you use
# for the rest of that program.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# Please report bugs or propose patches to gary@gnu.org.
## ------ ##
## Usage. ##
## ------ ##
# Evaluate this file near the top of your script to gain access to
# the functions and variables defined here:
#
# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
#
# If you need to override any of the default environment variable
# settings, do that before evaluating this file.
## -------------------- ##
## Shell normalisation. ##
## -------------------- ##
# Some shells need a little help to be as Bourne compatible as possible.
# Before doing anything else, make sure all that help has been provided!
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
fi
# NLS nuisances: We save the old values in case they are required later.
_G_user_locale=
_G_safe_locale=
for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test set = \"\${$_G_var+set}\"; then
save_$_G_var=\$$_G_var
$_G_var=C
export $_G_var
_G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
_G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
fi"
done
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Make sure IFS has a sensible default
sp=' '
nl='
'
IFS="$sp $nl"
# There are apparently some retarded systems that use ';' as a PATH separator!
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
## ------------------------- ##
## Locate command utilities. ##
## ------------------------- ##
# func_executable_p FILE
# ----------------------
# Check that FILE is an executable regular file.
func_executable_p ()
{
test -f "$1" && test -x "$1"
}
# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
# --------------------------------------------
# Search for either a program that responds to --version with output
# containing "GNU", or else returned by CHECK_FUNC otherwise, by
# trying all the directories in PATH with each of the elements of
# PROGS_LIST.
#
# CHECK_FUNC should accept the path to a candidate program, and
# set $func_check_prog_result if it truncates its output less than
# $_G_path_prog_max characters.
func_path_progs ()
{
_G_progs_list=$1
_G_check_func=$2
_G_PATH=${3-"$PATH"}
_G_path_prog_max=0
_G_path_prog_found=false
_G_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for _G_dir in $_G_PATH; do
IFS=$_G_save_IFS
test -z "$_G_dir" && _G_dir=.
for _G_prog_name in $_G_progs_list; do
for _exeext in '' .EXE; do
_G_path_prog=$_G_dir/$_G_prog_name$_exeext
func_executable_p "$_G_path_prog" || continue
case `"$_G_path_prog" --version 2>&1` in
*GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
*) $_G_check_func $_G_path_prog
func_path_progs_result=$func_check_prog_result
;;
esac
$_G_path_prog_found && break 3
done
done
done
IFS=$_G_save_IFS
test -z "$func_path_progs_result" && {
echo "no acceptable sed could be found in \$PATH" >&2
exit 1
}
}
# We want to be able to use the functions in this file before configure
# has figured out where the best binaries are kept, which means we have
# to search for them ourselves - except when the results are already set
# where we skip the searches.
# Unless the user overrides by setting SED, search the path for either GNU
# sed, or the sed that truncates its output the least.
test -z "$SED" && {
_G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for _G_i in 1 2 3 4 5 6 7; do
_G_sed_script=$_G_sed_script$nl$_G_sed_script
done
echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
_G_sed_script=
func_check_prog_sed ()
{
_G_path_prog=$1
_G_count=0
printf 0123456789 >conftest.in
while :
do
cat conftest.in conftest.in >conftest.tmp
mv conftest.tmp conftest.in
cp conftest.in conftest.nl
echo '' >> conftest.nl
"$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break
diff conftest.out conftest.nl >/dev/null 2>&1 || break
_G_count=`expr $_G_count + 1`
if test "$_G_count" -gt "$_G_path_prog_max"; then
# Best one so far, save it but keep looking for a better one
func_check_prog_result=$_G_path_prog
_G_path_prog_max=$_G_count
fi
# 10*(2^10) chars as input seems more than enough
test 10 -lt "$_G_count" && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out
}
func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
rm -f conftest.sed
SED=$func_path_progs_result
}
# Unless the user overrides by setting GREP, search the path for either GNU
# grep, or the grep that truncates its output the least.
test -z "$GREP" && {
func_check_prog_grep ()
{
_G_path_prog=$1
_G_count=0
_G_path_prog_max=0
printf 0123456789 >conftest.in
while :
do
cat conftest.in conftest.in >conftest.tmp
mv conftest.tmp conftest.in
cp conftest.in conftest.nl
echo 'GREP' >> conftest.nl
"$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break
diff conftest.out conftest.nl >/dev/null 2>&1 || break
_G_count=`expr $_G_count + 1`
if test "$_G_count" -gt "$_G_path_prog_max"; then
# Best one so far, save it but keep looking for a better one
func_check_prog_result=$_G_path_prog
_G_path_prog_max=$_G_count
fi
# 10*(2^10) chars as input seems more than enough
test 10 -lt "$_G_count" && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out
}
func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
GREP=$func_path_progs_result
}
## ------------------------------- ##
## User overridable command paths. ##
## ------------------------------- ##
# All uppercase variable names are used for environment variables. These
# variables can be overridden by the user before calling a script that
# uses them if a suitable command of that name is not already available
# in the command search PATH.
: ${CP="cp -f"}
: ${ECHO="printf %s\n"}
: ${EGREP="$GREP -E"}
: ${FGREP="$GREP -F"}
: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
## -------------------- ##
## Useful sed snippets. ##
## -------------------- ##
sed_dirname='s|/[^/]*$||'
sed_basename='s|^.*/||'
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
# Same as above, but do not quote variable references.
sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
# Sed substitution that turns a string into a regex matching for the
# string literally.
sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
# Sed substitution that converts a w32 file name or path
# that contains forward slashes, into one that contains
# (escaped) backslashes. A very naive implementation.
sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
# Re-'\' parameter expansions in output of sed_double_quote_subst that
# were '\'-ed in input to the same. If an odd number of '\' preceded a
# '$' in input to sed_double_quote_subst, that '$' was protected from
# expansion. Since each input '\' is now two '\'s, look for any number
# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
_G_bs='\\'
_G_bs2='\\\\'
_G_bs4='\\\\\\\\'
_G_dollar='\$'
sed_double_backslash="\
s/$_G_bs4/&\\
/g
s/^$_G_bs2$_G_dollar/$_G_bs&/
s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
s/\n//g"
## ----------------- ##
## Global variables. ##
## ----------------- ##
# Except for the global variables explicitly listed below, the following
# functions in the '^func_' namespace, and the '^require_' namespace
# variables initialised in the 'Resource management' section, sourcing
# this file will not pollute your global namespace with anything
# else. There's no portable way to scope variables in Bourne shell
# though, so actually running these functions will sometimes place
# results into a variable named after the function, and often use
# temporary variables in the '^_G_' namespace. If you are careful to
# avoid using those namespaces casually in your sourcing script, things
# should continue to work as you expect. And, of course, you can freely
# overwrite any of the functions or variables defined here before
# calling anything to customize them.
EXIT_SUCCESS=0
EXIT_FAILURE=1
EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
# Allow overriding, eg assuming that you follow the convention of
# putting '$debug_cmd' at the start of all your functions, you can get
# bash to show function call trace with:
#
# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
debug_cmd=${debug_cmd-":"}
exit_cmd=:
# By convention, finish your script with:
#
# exit $exit_status
#
# so that you can set exit_status to non-zero if you want to indicate
# something went wrong during execution without actually bailing out at
# the point of failure.
exit_status=$EXIT_SUCCESS
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
# is ksh but when the shell is invoked as "sh" and the current value of
# the _XPG environment variable is not equal to 1 (one), the special
# positional parameter $0, within a function call, is the name of the
# function.
progpath=$0
# The name of this program.
progname=`$ECHO "$progpath" |$SED "$sed_basename"`
# Make sure we have an absolute progpath for reexecution:
case $progpath in
[\\/]*|[A-Za-z]:\\*) ;;
*[\\/]*)
progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
progdir=`cd "$progdir" && pwd`
progpath=$progdir/$progname
;;
*)
_G_IFS=$IFS
IFS=${PATH_SEPARATOR-:}
for progdir in $PATH; do
IFS=$_G_IFS
test -x "$progdir/$progname" && break
done
IFS=$_G_IFS
test -n "$progdir" || progdir=`pwd`
progpath=$progdir/$progname
;;
esac
## ----------------- ##
## Standard options. ##
## ----------------- ##
# The following options affect the operation of the functions defined
# below, and should be set appropriately depending on run-time para-
# meters passed on the command line.
opt_dry_run=false
opt_quiet=false
opt_verbose=false
# Categories 'all' and 'none' are always available. Append any others
# you will pass as the first argument to func_warning from your own
# code.
warning_categories=
# By default, display warnings according to 'opt_warning_types'. Set
# 'warning_func' to ':' to elide all warnings, or func_fatal_error to
# treat the next displayed warning as a fatal error.
warning_func=func_warn_and_continue
# Set to 'all' to display all warnings, 'none' to suppress all
# warnings, or a space delimited list of some subset of
# 'warning_categories' to display only the listed warnings.
opt_warning_types=all
## -------------------- ##
## Resource management. ##
## -------------------- ##
# This section contains definitions for functions that each ensure a
# particular resource (a file, or a non-empty configuration variable for
# example) is available, and if appropriate to extract default values
# from pertinent package files. Call them using their associated
# 'require_*' variable to ensure that they are executed, at most, once.
#
# It's entirely deliberate that calling these functions can set
# variables that don't obey the namespace limitations obeyed by the rest
# of this file, in order that that they be as useful as possible to
# callers.
# require_term_colors
# -------------------
# Allow display of bold text on terminals that support it.
require_term_colors=func_require_term_colors
func_require_term_colors ()
{
$debug_cmd
test -t 1 && {
# COLORTERM and USE_ANSI_COLORS environment variables take
# precedence, because most terminfo databases neglect to describe
# whether color sequences are supported.
test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
if test 1 = "$USE_ANSI_COLORS"; then
# Standard ANSI escape sequences
tc_reset='[0m'
tc_bold='[1m'; tc_standout='[7m'
tc_red='[31m'; tc_green='[32m'
tc_blue='[34m'; tc_cyan='[36m'
else
# Otherwise trust the terminfo database after all.
test -n "`tput sgr0 2>/dev/null`" && {
tc_reset=`tput sgr0`
test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
tc_standout=$tc_bold
test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
}
fi
}
require_term_colors=:
}
## ----------------- ##
## Function library. ##
## ----------------- ##
# This section contains a variety of useful functions to call in your
# scripts. Take note of the portable wrappers for features provided by
# some modern shells, which will fall back to slower equivalents on
# less featureful shells.
# func_append VAR VALUE
# ---------------------
# Append VALUE onto the existing contents of VAR.
# We should try to minimise forks, especially on Windows where they are
# unreasonably slow, so skip the feature probes when bash or zsh are
# being used:
if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
: ${_G_HAVE_ARITH_OP="yes"}
: ${_G_HAVE_XSI_OPS="yes"}
# The += operator was introduced in bash 3.1
case $BASH_VERSION in
[12].* | 3.0 | 3.0*) ;;
*)
: ${_G_HAVE_PLUSEQ_OP="yes"}
;;
esac
fi
# _G_HAVE_PLUSEQ_OP
# Can be empty, in which case the shell is probed, "yes" if += is
# useable or anything else if it does not work.
test -z "$_G_HAVE_PLUSEQ_OP" \
&& (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
&& _G_HAVE_PLUSEQ_OP=yes
if test yes = "$_G_HAVE_PLUSEQ_OP"
then
# This is an XSI compatible shell, allowing a faster implementation...
eval 'func_append ()
{
$debug_cmd
eval "$1+=\$2"
}'
else
# ...otherwise fall back to using expr, which is often a shell builtin.
func_append ()
{
$debug_cmd
eval "$1=\$$1\$2"
}
fi
# func_append_quoted VAR VALUE
# ----------------------------
# Quote VALUE and append to the end of shell variable VAR, separated
# by a space.
if test yes = "$_G_HAVE_PLUSEQ_OP"; then
eval 'func_append_quoted ()
{
$debug_cmd
func_quote_for_eval "$2"
eval "$1+=\\ \$func_quote_for_eval_result"
}'
else
func_append_quoted ()
{
$debug_cmd
func_quote_for_eval "$2"
eval "$1=\$$1\\ \$func_quote_for_eval_result"
}
fi
# func_append_uniq VAR VALUE
# --------------------------
# Append unique VALUE onto the existing contents of VAR, assuming
# entries are delimited by the first character of VALUE. For example:
#
# func_append_uniq options " --another-option option-argument"
#
# will only append to $options if " --another-option option-argument "
# is not already present somewhere in $options already (note spaces at
# each end implied by leading space in second argument).
func_append_uniq ()
{
$debug_cmd
eval _G_current_value='`$ECHO $'$1'`'
_G_delim=`expr "$2" : '\(.\)'`
case $_G_delim$_G_current_value$_G_delim in
*"$2$_G_delim"*) ;;
*) func_append "$@" ;;
esac
}
# func_arith TERM...
# ------------------
# Set func_arith_result to the result of evaluating TERMs.
test -z "$_G_HAVE_ARITH_OP" \
&& (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
&& _G_HAVE_ARITH_OP=yes
if test yes = "$_G_HAVE_ARITH_OP"; then
eval 'func_arith ()
{
$debug_cmd
func_arith_result=$(( $* ))
}'
else
func_arith ()
{
$debug_cmd
func_arith_result=`expr "$@"`
}
fi
# func_basename FILE
# ------------------
# Set func_basename_result to FILE with everything up to and including
# the last / stripped.
if test yes = "$_G_HAVE_XSI_OPS"; then
# If this shell supports suffix pattern removal, then use it to avoid
# forking. Hide the definitions single quotes in case the shell chokes
# on unsupported syntax...
_b='func_basename_result=${1##*/}'
_d='case $1 in
*/*) func_dirname_result=${1%/*}$2 ;;
* ) func_dirname_result=$3 ;;
esac'
else
# ...otherwise fall back to using sed.
_b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
_d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
if test "X$func_dirname_result" = "X$1"; then
func_dirname_result=$3
else
func_append func_dirname_result "$2"
fi'
fi
eval 'func_basename ()
{
$debug_cmd
'"$_b"'
}'
# func_dirname FILE APPEND NONDIR_REPLACEMENT
# -------------------------------------------
# Compute the dirname of FILE. If nonempty, add APPEND to the result,
# otherwise set result to NONDIR_REPLACEMENT.
eval 'func_dirname ()
{
$debug_cmd
'"$_d"'
}'
# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
# --------------------------------------------------------
# Perform func_basename and func_dirname in a single function
# call:
# dirname: Compute the dirname of FILE. If nonempty,
# add APPEND to the result, otherwise set result
# to NONDIR_REPLACEMENT.
# value returned in "$func_dirname_result"
# basename: Compute filename of FILE.
# value retuned in "$func_basename_result"
# For efficiency, we do not delegate to the functions above but instead
# duplicate the functionality here.
eval 'func_dirname_and_basename ()
{
$debug_cmd
'"$_b"'
'"$_d"'
}'
# func_echo ARG...
# ----------------
# Echo program name prefixed message.
func_echo ()
{
$debug_cmd
_G_message=$*
func_echo_IFS=$IFS
IFS=$nl
for _G_line in $_G_message; do
IFS=$func_echo_IFS
$ECHO "$progname: $_G_line"
done
IFS=$func_echo_IFS
}
# func_echo_all ARG...
# --------------------
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
$ECHO "$*"
}
# func_echo_infix_1 INFIX ARG...
# ------------------------------
# Echo program name, followed by INFIX on the first line, with any
# additional lines not showing INFIX.
func_echo_infix_1 ()
{
$debug_cmd
$require_term_colors
_G_infix=$1; shift
_G_indent=$_G_infix
_G_prefix="$progname: $_G_infix: "
_G_message=$*
# Strip color escape sequences before counting printable length
for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
do
test -n "$_G_tc" && {
_G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
_G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
}
done
_G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
func_echo_infix_1_IFS=$IFS
IFS=$nl
for _G_line in $_G_message; do
IFS=$func_echo_infix_1_IFS
$ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
_G_prefix=$_G_indent
done
IFS=$func_echo_infix_1_IFS
}
# func_error ARG...
# -----------------
# Echo program name prefixed message to standard error.
func_error ()
{
$debug_cmd
$require_term_colors
func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
}
# func_fatal_error ARG...
# -----------------------
# Echo program name prefixed message to standard error, and exit.
func_fatal_error ()
{
$debug_cmd
func_error "$*"
exit $EXIT_FAILURE
}
# func_grep EXPRESSION FILENAME
# -----------------------------
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
$debug_cmd
$GREP "$1" "$2" >/dev/null 2>&1
}
# func_len STRING
# ---------------
# Set func_len_result to the length of STRING. STRING may not
# start with a hyphen.
test -z "$_G_HAVE_XSI_OPS" \
&& (eval 'x=a/b/c;
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
&& _G_HAVE_XSI_OPS=yes
if test yes = "$_G_HAVE_XSI_OPS"; then
eval 'func_len ()
{
$debug_cmd
func_len_result=${#1}
}'
else
func_len ()
{
$debug_cmd
func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
}
fi
# func_mkdir_p DIRECTORY-PATH
# ---------------------------
# Make sure the entire path to DIRECTORY-PATH is available.
func_mkdir_p ()
{
$debug_cmd
_G_directory_path=$1
_G_dir_list=
if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
# Protect directory names starting with '-'
case $_G_directory_path in
-*) _G_directory_path=./$_G_directory_path ;;
esac
# While some portion of DIR does not yet exist...
while test ! -d "$_G_directory_path"; do
# ...make a list in topmost first order. Use a colon delimited
# list incase some portion of path contains whitespace.
_G_dir_list=$_G_directory_path:$_G_dir_list
# If the last portion added has no slash in it, the list is done
case $_G_directory_path in */*) ;; *) break ;; esac
# ...otherwise throw away the child directory and loop
_G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
done
_G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
func_mkdir_p_IFS=$IFS; IFS=:
for _G_dir in $_G_dir_list; do
IFS=$func_mkdir_p_IFS
# mkdir can fail with a 'File exist' error if two processes
# try to create one of the directories concurrently. Don't
# stop in that case!
$MKDIR "$_G_dir" 2>/dev/null || :
done
IFS=$func_mkdir_p_IFS
# Bail out if we (or some other process) failed to create a directory.
test -d "$_G_directory_path" || \
func_fatal_error "Failed to create '$1'"
fi
}
# func_mktempdir [BASENAME]
# -------------------------
# Make a temporary directory that won't clash with other running
# libtool processes, and avoids race conditions if possible. If
# given, BASENAME is the basename for that directory.
func_mktempdir ()
{
$debug_cmd
_G_template=${TMPDIR-/tmp}/${1-$progname}
if test : = "$opt_dry_run"; then
# Return a directory name, but don't create it in dry-run mode
_G_tmpdir=$_G_template-$$
else
# If mktemp works, use that first and foremost
_G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
if test ! -d "$_G_tmpdir"; then
# Failing that, at least try and use $RANDOM to avoid a race
_G_tmpdir=$_G_template-${RANDOM-0}$$
func_mktempdir_umask=`umask`
umask 0077
$MKDIR "$_G_tmpdir"
umask $func_mktempdir_umask
fi
# If we're not in dry-run mode, bomb out on failure
test -d "$_G_tmpdir" || \
func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
fi
$ECHO "$_G_tmpdir"
}
# func_normal_abspath PATH
# ------------------------
# Remove doubled-up and trailing slashes, "." path components,
# and cancel out any ".." path components in PATH after making
# it an absolute path.
func_normal_abspath ()
{
$debug_cmd
# These SED scripts presuppose an absolute path with a trailing slash.
_G_pathcar='s|^/\([^/]*\).*$|\1|'
_G_pathcdr='s|^/[^/]*||'
_G_removedotparts=':dotsl
s|/\./|/|g
t dotsl
s|/\.$|/|'
_G_collapseslashes='s|/\{1,\}|/|g'
_G_finalslash='s|/*$|/|'
# Start from root dir and reassemble the path.
func_normal_abspath_result=
func_normal_abspath_tpath=$1
func_normal_abspath_altnamespace=
case $func_normal_abspath_tpath in
"")
# Empty path, that just means $cwd.
func_stripname '' '/' "`pwd`"
func_normal_abspath_result=$func_stripname_result
return
;;
# The next three entries are used to spot a run of precisely
# two leading slashes without using negated character classes;
# we take advantage of case's first-match behaviour.
///*)
# Unusual form of absolute path, do nothing.
;;
//*)
# Not necessarily an ordinary path; POSIX reserves leading '//'
# and for example Cygwin uses it to access remote file shares
# over CIFS/SMB, so we conserve a leading double slash if found.
func_normal_abspath_altnamespace=/
;;
/*)
# Absolute path, do nothing.
;;
*)
# Relative path, prepend $cwd.
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
;;
esac
# Cancel out all the simple stuff to save iterations. We also want
# the path to end with a slash for ease of parsing, so make sure
# there is one (and only one) here.
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
while :; do
# Processed it all yet?
if test / = "$func_normal_abspath_tpath"; then
# If we ascended to the root using ".." the result may be empty now.
if test -z "$func_normal_abspath_result"; then
func_normal_abspath_result=/
fi
break
fi
func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-e "$_G_pathcar"`
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-e "$_G_pathcdr"`
# Figure out what to do with it
case $func_normal_abspath_tcomponent in
"")
# Trailing empty path component, ignore it.
;;
..)
# Parent dir; strip last assembled component from result.
func_dirname "$func_normal_abspath_result"
func_normal_abspath_result=$func_dirname_result
;;
*)
# Actual path component, append it.
func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
;;
esac
done
# Restore leading double-slash if one was found on entry.
func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
}
# func_notquiet ARG...
# --------------------
# Echo program name prefixed message only when not in quiet mode.
func_notquiet ()
{
$debug_cmd
$opt_quiet || func_echo ${1+"$@"}
# A bug in bash halts the script if the last line of a function
# fails when set -e is in force, so we need another command to
# work around that:
:
}
# func_relative_path SRCDIR DSTDIR
# --------------------------------
# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
func_relative_path ()
{
$debug_cmd
func_relative_path_result=
func_normal_abspath "$1"
func_relative_path_tlibdir=$func_normal_abspath_result
func_normal_abspath "$2"
func_relative_path_tbindir=$func_normal_abspath_result
# Ascend the tree starting from libdir
while :; do
# check if we have found a prefix of bindir
case $func_relative_path_tbindir in
$func_relative_path_tlibdir)
# found an exact match
func_relative_path_tcancelled=
break
;;
$func_relative_path_tlibdir*)
# found a matching prefix
func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
func_relative_path_tcancelled=$func_stripname_result
if test -z "$func_relative_path_result"; then
func_relative_path_result=.
fi
break
;;
*)
func_dirname $func_relative_path_tlibdir
func_relative_path_tlibdir=$func_dirname_result
if test -z "$func_relative_path_tlibdir"; then
# Have to descend all the way to the root!
func_relative_path_result=../$func_relative_path_result
func_relative_path_tcancelled=$func_relative_path_tbindir
break
fi
func_relative_path_result=../$func_relative_path_result
;;
esac
done
# Now calculate path; take care to avoid doubling-up slashes.
func_stripname '' '/' "$func_relative_path_result"
func_relative_path_result=$func_stripname_result
func_stripname '/' '/' "$func_relative_path_tcancelled"
if test -n "$func_stripname_result"; then
func_append func_relative_path_result "/$func_stripname_result"
fi
# Normalisation. If bindir is libdir, return '.' else relative path.
if test -n "$func_relative_path_result"; then
func_stripname './' '' "$func_relative_path_result"
func_relative_path_result=$func_stripname_result
fi
test -n "$func_relative_path_result" || func_relative_path_result=.
:
}
# func_quote_for_eval ARG...
# --------------------------
# Aesthetically quote ARGs to be evaled later.
# This function returns two values:
# i) func_quote_for_eval_result
# double-quoted, suitable for a subsequent eval
# ii) func_quote_for_eval_unquoted_result
# has all characters that are still active within double
# quotes backslashified.
func_quote_for_eval ()
{
$debug_cmd
func_quote_for_eval_unquoted_result=
func_quote_for_eval_result=
while test 0 -lt $#; do
case $1 in
*[\\\`\"\$]*)
_G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
*)
_G_unquoted_arg=$1 ;;
esac
if test -n "$func_quote_for_eval_unquoted_result"; then
func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
else
func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
fi
case $_G_unquoted_arg in
# Double-quote args containing shell metacharacters to delay
# word splitting, command substitution and variable expansion
# for a subsequent eval.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
_G_quoted_arg=\"$_G_unquoted_arg\"
;;
*)
_G_quoted_arg=$_G_unquoted_arg
;;
esac
if test -n "$func_quote_for_eval_result"; then
func_append func_quote_for_eval_result " $_G_quoted_arg"
else
func_append func_quote_for_eval_result "$_G_quoted_arg"
fi
shift
done
}
# func_quote_for_expand ARG
# -------------------------
# Aesthetically quote ARG to be evaled later; same as above,
# but do not quote variable references.
func_quote_for_expand ()
{
$debug_cmd
case $1 in
*[\\\`\"]*)
_G_arg=`$ECHO "$1" | $SED \
-e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
*)
_G_arg=$1 ;;
esac
case $_G_arg in
# Double-quote args containing shell metacharacters to delay
# word splitting and command substitution for a subsequent eval.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
_G_arg=\"$_G_arg\"
;;
esac
func_quote_for_expand_result=$_G_arg
}
# func_stripname PREFIX SUFFIX NAME
# ---------------------------------
# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
# PREFIX and SUFFIX must not contain globbing or regex special
# characters, hashes, percent signs, but SUFFIX may contain a leading
# dot (in which case that matches only a dot).
if test yes = "$_G_HAVE_XSI_OPS"; then
eval 'func_stripname ()
{
$debug_cmd
# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
# positional parameters, so assign one to ordinary variable first.
func_stripname_result=$3
func_stripname_result=${func_stripname_result#"$1"}
func_stripname_result=${func_stripname_result%"$2"}
}'
else
func_stripname ()
{
$debug_cmd
case $2 in
.*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
esac
}
fi
# func_show_eval CMD [FAIL_EXP]
# -----------------------------
# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.
func_show_eval ()
{
$debug_cmd
_G_cmd=$1
_G_fail_exp=${2-':'}
func_quote_for_expand "$_G_cmd"
eval "func_notquiet $func_quote_for_expand_result"
$opt_dry_run || {
eval "$_G_cmd"
_G_status=$?
if test 0 -ne "$_G_status"; then
eval "(exit $_G_status); $_G_fail_exp"
fi
}
}
# func_show_eval_locale CMD [FAIL_EXP]
# ------------------------------------
# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it. Use the saved locale for evaluation.
func_show_eval_locale ()
{
$debug_cmd
_G_cmd=$1
_G_fail_exp=${2-':'}
$opt_quiet || {
func_quote_for_expand "$_G_cmd"
eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || {
eval "$_G_user_locale
$_G_cmd"
_G_status=$?
eval "$_G_safe_locale"
if test 0 -ne "$_G_status"; then
eval "(exit $_G_status); $_G_fail_exp"
fi
}
}
# func_tr_sh
# ----------
# Turn $1 into a string suitable for a shell variable name.
# Result is stored in $func_tr_sh_result. All characters
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
# if $1 begins with a digit, a '_' is prepended as well.
func_tr_sh ()
{
$debug_cmd
case $1 in
[0-9]* | *[!a-zA-Z0-9_]*)
func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
;;
* )
func_tr_sh_result=$1
;;
esac
}
# func_verbose ARG...
# -------------------
# Echo program name prefixed message in verbose mode only.
func_verbose ()
{
$debug_cmd
$opt_verbose && func_echo "$*"
:
}
# func_warn_and_continue ARG...
# -----------------------------
# Echo program name prefixed warning message to standard error.
func_warn_and_continue ()
{
$debug_cmd
$require_term_colors
func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
}
# func_warning CATEGORY ARG...
# ----------------------------
# Echo program name prefixed warning message to standard error. Warning
# messages can be filtered according to CATEGORY, where this function
# elides messages where CATEGORY is not listed in the global variable
# 'opt_warning_types'.
func_warning ()
{
$debug_cmd
# CATEGORY must be in the warning_categories list!
case " $warning_categories " in
*" $1 "*) ;;
*) func_internal_error "invalid warning category '$1'" ;;
esac
_G_category=$1
shift
case " $opt_warning_types " in
*" $_G_category "*) $warning_func ${1+"$@"} ;;
esac
}
# func_sort_ver VER1 VER2
# -----------------------
# 'sort -V' is not generally available.
# Note this deviates from the version comparison in automake
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
# but this should suffice as we won't be specifying old
# version formats or redundant trailing .0 in bootstrap.conf.
# If we did want full compatibility then we should probably
# use m4_version_compare from autoconf.
func_sort_ver ()
{
$debug_cmd
printf '%s\n%s\n' "$1" "$2" \
| sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
}
# func_lt_ver PREV CURR
# ---------------------
# Return true if PREV and CURR are in the correct order according to
# func_sort_ver, otherwise false. Use it like this:
#
# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
func_lt_ver ()
{
$debug_cmd
test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
}
# Local variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC"
# End:
#! /bin/sh
# Set a version string for this script.
scriptversion=2014-01-07.03; # UTC
# A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
# Copyright (C) 2010-2015 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# Please report bugs or propose patches to gary@gnu.org.
## ------ ##
## Usage. ##
## ------ ##
# This file is a library for parsing options in your shell scripts along
# with assorted other useful supporting features that you can make use
# of too.
#
# For the simplest scripts you might need only:
#
# #!/bin/sh
# . relative/path/to/funclib.sh
# . relative/path/to/options-parser
# scriptversion=1.0
# func_options ${1+"$@"}
# eval set dummy "$func_options_result"; shift
# ...rest of your script...
#
# In order for the '--version' option to work, you will need to have a
# suitably formatted comment like the one at the top of this file
# starting with '# Written by ' and ending with '# warranty; '.
#
# For '-h' and '--help' to work, you will also need a one line
# description of your script's purpose in a comment directly above the
# '# Written by ' line, like the one at the top of this file.
#
# The default options also support '--debug', which will turn on shell
# execution tracing (see the comment above debug_cmd below for another
# use), and '--verbose' and the func_verbose function to allow your script
# to display verbose messages only when your user has specified
# '--verbose'.
#
# After sourcing this file, you can plug processing for additional
# options by amending the variables from the 'Configuration' section
# below, and following the instructions in the 'Option parsing'
# section further down.
## -------------- ##
## Configuration. ##
## -------------- ##
# You should override these variables in your script after sourcing this
# file so that they reflect the customisations you have added to the
# option parser.
# The usage line for option parsing errors and the start of '-h' and
# '--help' output messages. You can embed shell variables for delayed
# expansion at the time the message is displayed, but you will need to
# quote other shell meta-characters carefully to prevent them being
# expanded when the contents are evaled.
usage='$progpath [OPTION]...'
# Short help message in response to '-h' and '--help'. Add to this or
# override it after sourcing this library to reflect the full set of
# options your script accepts.
usage_message="\
--debug enable verbose shell tracing
-W, --warnings=CATEGORY
report the warnings falling in CATEGORY [all]
-v, --verbose verbosely report processing
--version print version information and exit
-h, --help print short or long help message and exit
"
# Additional text appended to 'usage_message' in response to '--help'.
long_help_message="
Warning categories include:
'all' show all warnings
'none' turn off all the warnings
'error' warnings are treated as fatal errors"
# Help message printed before fatal option parsing errors.
fatal_help="Try '\$progname --help' for more information."
## ------------------------- ##
## Hook function management. ##
## ------------------------- ##
# This section contains functions for adding, removing, and running hooks
# to the main code. A hook is just a named list of of function, that can
# be run in order later on.
# func_hookable FUNC_NAME
# -----------------------
# Declare that FUNC_NAME will run hooks added with
# 'func_add_hook FUNC_NAME ...'.
func_hookable ()
{
$debug_cmd
func_append hookable_fns " $1"
}
# func_add_hook FUNC_NAME HOOK_FUNC
# ---------------------------------
# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
# first have been declared "hookable" by a call to 'func_hookable'.
func_add_hook ()
{
$debug_cmd
case " $hookable_fns " in
*" $1 "*) ;;
*) func_fatal_error "'$1' does not accept hook functions." ;;
esac
eval func_append ${1}_hooks '" $2"'
}
# func_remove_hook FUNC_NAME HOOK_FUNC
# ------------------------------------
# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
func_remove_hook ()
{
$debug_cmd
eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
}
# func_run_hooks FUNC_NAME [ARG]...
# ---------------------------------
# Run all hook functions registered to FUNC_NAME.
# It is assumed that the list of hook functions contains nothing more
# than a whitespace-delimited list of legal shell function names, and
# no effort is wasted trying to catch shell meta-characters or preserve
# whitespace.
func_run_hooks ()
{
$debug_cmd
case " $hookable_fns " in
*" $1 "*) ;;
*) func_fatal_error "'$1' does not support hook funcions.n" ;;
esac
eval _G_hook_fns=\$$1_hooks; shift
for _G_hook in $_G_hook_fns; do
eval $_G_hook '"$@"'
# store returned options list back into positional
# parameters for next 'cmd' execution.
eval _G_hook_result=\$${_G_hook}_result
eval set dummy "$_G_hook_result"; shift
done
func_quote_for_eval ${1+"$@"}
func_run_hooks_result=$func_quote_for_eval_result
}
## --------------- ##
## Option parsing. ##
## --------------- ##
# In order to add your own option parsing hooks, you must accept the
# full positional parameter list in your hook function, remove any
# options that you action, and then pass back the remaining unprocessed
# options in '_result', escaped suitably for
# 'eval'. Like this:
#
# my_options_prep ()
# {
# $debug_cmd
#
# # Extend the existing usage message.
# usage_message=$usage_message'
# -s, --silent don'\''t print informational messages
# '
#
# func_quote_for_eval ${1+"$@"}
# my_options_prep_result=$func_quote_for_eval_result
# }
# func_add_hook func_options_prep my_options_prep
#
#
# my_silent_option ()
# {
# $debug_cmd
#
# # Note that for efficiency, we parse as many options as we can
# # recognise in a loop before passing the remainder back to the
# # caller on the first unrecognised argument we encounter.
# while test $# -gt 0; do
# opt=$1; shift
# case $opt in
# --silent|-s) opt_silent=: ;;
# # Separate non-argument short options:
# -s*) func_split_short_opt "$_G_opt"
# set dummy "$func_split_short_opt_name" \
# "-$func_split_short_opt_arg" ${1+"$@"}
# shift
# ;;
# *) set dummy "$_G_opt" "$*"; shift; break ;;
# esac
# done
#
# func_quote_for_eval ${1+"$@"}
# my_silent_option_result=$func_quote_for_eval_result
# }
# func_add_hook func_parse_options my_silent_option
#
#
# my_option_validation ()
# {
# $debug_cmd
#
# $opt_silent && $opt_verbose && func_fatal_help "\
# '--silent' and '--verbose' options are mutually exclusive."
#
# func_quote_for_eval ${1+"$@"}
# my_option_validation_result=$func_quote_for_eval_result
# }
# func_add_hook func_validate_options my_option_validation
#
# You'll alse need to manually amend $usage_message to reflect the extra
# options you parse. It's preferable to append if you can, so that
# multiple option parsing hooks can be added safely.
# func_options [ARG]...
# ---------------------
# All the functions called inside func_options are hookable. See the
# individual implementations for details.
func_hookable func_options
func_options ()
{
$debug_cmd
func_options_prep ${1+"$@"}
eval func_parse_options \
${func_options_prep_result+"$func_options_prep_result"}
eval func_validate_options \
${func_parse_options_result+"$func_parse_options_result"}
eval func_run_hooks func_options \
${func_validate_options_result+"$func_validate_options_result"}
# save modified positional parameters for caller
func_options_result=$func_run_hooks_result
}
# func_options_prep [ARG]...
# --------------------------
# All initialisations required before starting the option parse loop.
# Note that when calling hook functions, we pass through the list of
# positional parameters. If a hook function modifies that list, and
# needs to propogate that back to rest of this script, then the complete
# modified list must be put in 'func_run_hooks_result' before
# returning.
func_hookable func_options_prep
func_options_prep ()
{
$debug_cmd
# Option defaults:
opt_verbose=false
opt_warning_types=
func_run_hooks func_options_prep ${1+"$@"}
# save modified positional parameters for caller
func_options_prep_result=$func_run_hooks_result
}
# func_parse_options [ARG]...
# ---------------------------
# The main option parsing loop.
func_hookable func_parse_options
func_parse_options ()
{
$debug_cmd
func_parse_options_result=
# this just eases exit handling
while test $# -gt 0; do
# Defer to hook functions for initial option parsing, so they
# get priority in the event of reusing an option name.
func_run_hooks func_parse_options ${1+"$@"}
# Adjust func_parse_options positional parameters to match
eval set dummy "$func_run_hooks_result"; shift
# Break out of the loop if we already parsed every option.
test $# -gt 0 || break
_G_opt=$1
shift
case $_G_opt in
--debug|-x) debug_cmd='set -x'
func_echo "enabling shell trace mode"
$debug_cmd
;;
--no-warnings|--no-warning|--no-warn)
set dummy --warnings none ${1+"$@"}
shift
;;
--warnings|--warning|-W)
test $# = 0 && func_missing_arg $_G_opt && break
case " $warning_categories $1" in
*" $1 "*)
# trailing space prevents matching last $1 above
func_append_uniq opt_warning_types " $1"
;;
*all)
opt_warning_types=$warning_categories
;;
*none)
opt_warning_types=none
warning_func=:
;;
*error)
opt_warning_types=$warning_categories
warning_func=func_fatal_error
;;
*)
func_fatal_error \
"unsupported warning category: '$1'"
;;
esac
shift
;;
--verbose|-v) opt_verbose=: ;;
--version) func_version ;;
-\?|-h) func_usage ;;
--help) func_help ;;
# Separate optargs to long options (plugins may need this):
--*=*) func_split_equals "$_G_opt"
set dummy "$func_split_equals_lhs" \
"$func_split_equals_rhs" ${1+"$@"}
shift
;;
# Separate optargs to short options:
-W*)
func_split_short_opt "$_G_opt"
set dummy "$func_split_short_opt_name" \
"$func_split_short_opt_arg" ${1+"$@"}
shift
;;
# Separate non-argument short options:
-\?*|-h*|-v*|-x*)
func_split_short_opt "$_G_opt"
set dummy "$func_split_short_opt_name" \
"-$func_split_short_opt_arg" ${1+"$@"}
shift
;;
--) break ;;
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
*) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
esac
done
# save modified positional parameters for caller
func_quote_for_eval ${1+"$@"}
func_parse_options_result=$func_quote_for_eval_result
}
# func_validate_options [ARG]...
# ------------------------------
# Perform any sanity checks on option settings and/or unconsumed
# arguments.
func_hookable func_validate_options
func_validate_options ()
{
$debug_cmd
# Display all warnings if -W was not given.
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
func_run_hooks func_validate_options ${1+"$@"}
# Bail if the options were screwed!
$exit_cmd $EXIT_FAILURE
# save modified positional parameters for caller
func_validate_options_result=$func_run_hooks_result
}
## ----------------- ##
## Helper functions. ##
## ----------------- ##
# This section contains the helper functions used by the rest of the
# hookable option parser framework in ascii-betical order.
# func_fatal_help ARG...
# ----------------------
# Echo program name prefixed message to standard error, followed by
# a help hint, and exit.
func_fatal_help ()
{
$debug_cmd
eval \$ECHO \""Usage: $usage"\"
eval \$ECHO \""$fatal_help"\"
func_error ${1+"$@"}
exit $EXIT_FAILURE
}
# func_help
# ---------
# Echo long help message to standard output and exit.
func_help ()
{
$debug_cmd
func_usage_message
$ECHO "$long_help_message"
exit 0
}
# func_missing_arg ARGNAME
# ------------------------
# Echo program name prefixed message to standard error and set global
# exit_cmd.
func_missing_arg ()
{
$debug_cmd
func_error "Missing argument for '$1'."
exit_cmd=exit
}
# func_split_equals STRING
# ------------------------
# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
# splitting STRING at the '=' sign.
test -z "$_G_HAVE_XSI_OPS" \
&& (eval 'x=a/b/c;
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
&& _G_HAVE_XSI_OPS=yes
if test yes = "$_G_HAVE_XSI_OPS"
then
# This is an XSI compatible shell, allowing a faster implementation...
eval 'func_split_equals ()
{
$debug_cmd
func_split_equals_lhs=${1%%=*}
func_split_equals_rhs=${1#*=}
test "x$func_split_equals_lhs" = "x$1" \
&& func_split_equals_rhs=
}'
else
# ...otherwise fall back to using expr, which is often a shell builtin.
func_split_equals ()
{
$debug_cmd
func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
func_split_equals_rhs=
test "x$func_split_equals_lhs" = "x$1" \
|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
}
fi #func_split_equals
# func_split_short_opt SHORTOPT
# -----------------------------
# Set func_split_short_opt_name and func_split_short_opt_arg shell
# variables after splitting SHORTOPT after the 2nd character.
if test yes = "$_G_HAVE_XSI_OPS"
then
# This is an XSI compatible shell, allowing a faster implementation...
eval 'func_split_short_opt ()
{
$debug_cmd
func_split_short_opt_arg=${1#??}
func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
}'
else
# ...otherwise fall back to using expr, which is often a shell builtin.
func_split_short_opt ()
{
$debug_cmd
func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
}
fi #func_split_short_opt
# func_usage
# ----------
# Echo short help message to standard output and exit.
func_usage ()
{
$debug_cmd
func_usage_message
$ECHO "Run '$progname --help |${PAGER-more}' for full usage"
exit 0
}
# func_usage_message
# ------------------
# Echo short help message to standard output.
func_usage_message ()
{
$debug_cmd
eval \$ECHO \""Usage: $usage"\"
echo
$SED -n 's|^# ||
/^Written by/{
x;p;x
}
h
/^Written by/q' < "$progpath"
echo
eval \$ECHO \""$usage_message"\"
}
# func_version
# ------------
# Echo version message to standard output and exit.
func_version ()
{
$debug_cmd
printf '%s\n' "$progname $scriptversion"
$SED -n '
/(C)/!b go
:more
/\./!{
N
s|\n# | |
b more
}
:go
/^# Written by /,/# warranty; / {
s|^# ||
s|^# *$||
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
p
}
/^# Written by / {
s|^# ||
p
}
/^warranty; /q' < "$progpath"
exit $?
}
# Local variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC"
# End:
# Set a version string.
scriptversion='(GNU libtool) 2.4.5'
# func_echo ARG...
# ----------------
# Libtool also displays the current mode in messages, so override
# funclib.sh func_echo with this custom definition.
func_echo ()
{
$debug_cmd
_G_message=$*
func_echo_IFS=$IFS
IFS=$nl
for _G_line in $_G_message; do
IFS=$func_echo_IFS
$ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
done
IFS=$func_echo_IFS
}
# func_warning ARG...
# -------------------
# Libtool warnings are not categorized, so override funclib.sh
# func_warning with this simpler definition.
func_warning ()
{
$debug_cmd
$warning_func ${1+"$@"}
}
## ---------------- ##
## Options parsing. ##
## ---------------- ##
# Hook in the functions to make sure our own options are parsed during
# the option parsing loop.
usage='$progpath [OPTION]... [MODE-ARG]...'
# Short help message in response to '-h'.
usage_message="Options:
--config show all configuration variables
--debug enable verbose shell tracing
-n, --dry-run display commands without modifying any files
--features display basic configuration information and exit
--mode=MODE use operation mode MODE
--no-warnings equivalent to '-Wnone'
--preserve-dup-deps don't remove duplicate dependency libraries
--quiet, --silent don't print informational messages
--tag=TAG use configuration variables from tag TAG
-v, --verbose print more informational messages than default
--version print version information
-W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
-h, --help, --help-all print short, long, or detailed help message
"
# Additional text appended to 'usage_message' in response to '--help'.
long_help_message=$long_help_message"
MODE must be one of the following:
clean remove files from the build directory
compile compile a source file into a libtool object
execute automatically set library path, then run a program
finish complete the installation of libtool libraries
install install libraries or executables
link create a library or an executable
uninstall remove libraries from an installed directory
MODE-ARGS vary depending on the MODE. When passed as first option,
'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
Try '$progname --help --mode=MODE' for a more detailed description of MODE.
When reporting a bug, please describe a test case to reproduce it and
include the following information:
host-triplet: $host
shell: $SHELL
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
version: $progname (GNU libtool) 2.4.5
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to .
GNU libtool home page: .
General help using GNU software: ."
# func_lo2o OBJECT-NAME
# ---------------------
# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
# object suffix.
lo2o=s/\\.lo\$/.$objext/
o2lo=s/\\.$objext\$/.lo/
if test yes = "$_G_HAVE_XSI_OPS"; then
eval 'func_lo2o ()
{
case $1 in
*.lo) func_lo2o_result=${1%.lo}.$objext ;;
* ) func_lo2o_result=$1 ;;
esac
}'
# func_xform LIBOBJ-OR-SOURCE
# ---------------------------
# Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
# suffix to a '.lo' libtool-object suffix.
eval 'func_xform ()
{
func_xform_result=${1%.*}.lo
}'
else
# ...otherwise fall back to using sed.
func_lo2o ()
{
func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
}
func_xform ()
{
func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
}
fi
# func_fatal_configuration ARG...
# -------------------------------
# Echo program name prefixed message to standard error, followed by
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
func__fatal_error ${1+"$@"} \
"See the $PACKAGE documentation for more information." \
"Fatal configuration error."
}
# func_config
# -----------
# Display the configuration for all the tags in this script.
func_config ()
{
re_begincf='^# ### BEGIN LIBTOOL'
re_endcf='^# ### END LIBTOOL'
# Default configuration.
$SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
# Now print the configurations for the tags.
for tagname in $taglist; do
$SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
done
exit $?
}
# func_features
# -------------
# Display the features supported by this script.
func_features ()
{
echo "host: $host"
if test yes = "$build_libtool_libs"; then
echo "enable shared libraries"
else
echo "disable shared libraries"
fi
if test yes = "$build_old_libs"; then
echo "enable static libraries"
else
echo "disable static libraries"
fi
exit $?
}
# func_enable_tag TAGNAME
# -----------------------
# Verify that TAGNAME is valid, and either flag an error and exit, or
# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
# variable here.
func_enable_tag ()
{
# Global variable:
tagname=$1
re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
sed_extractcf=/$re_begincf/,/$re_endcf/p
# Validate tagname.
case $tagname in
*[!-_A-Za-z0-9,/]*)
func_fatal_error "invalid tag name: $tagname"
;;
esac
# Don't test for the "default" C tag, as we know it's
# there but not specially marked.
case $tagname in
CC) ;;
*)
if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
taglist="$taglist $tagname"
# Evaluate the configuration. Be careful to quote the path
# and the sed script, to avoid splitting on whitespace, but
# also don't use non-portable quotes within backquotes within
# quotes we have to do it in 2 steps:
extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
eval "$extractedcf"
else
func_error "ignoring unknown tag $tagname"
fi
;;
esac
}
# func_check_version_match
# ------------------------
# Ensure that we are using m4 macros, and libtool script from the same
# release of libtool.
func_check_version_match ()
{
if test "$package_revision" != "$macro_revision"; then
if test "$VERSION" != "$macro_version"; then
if test -z "$macro_version"; then
cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from an older release.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
else
cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
fi
else
cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
$progname: of $PACKAGE $VERSION and run autoconf again.
_LT_EOF
fi
exit $EXIT_MISMATCH
fi
}
# libtool_options_prep [ARG]...
# -----------------------------
# Preparation for options parsed by libtool.
libtool_options_prep ()
{
$debug_mode
# Option defaults:
opt_config=false
opt_dlopen=
opt_dry_run=false
opt_help=false
opt_mode=
opt_preserve_dup_deps=false
opt_quiet=false
nonopt=
preserve_args=
# Shorthand for --mode=foo, only valid as the first argument
case $1 in
clean|clea|cle|cl)
shift; set dummy --mode clean ${1+"$@"}; shift
;;
compile|compil|compi|comp|com|co|c)
shift; set dummy --mode compile ${1+"$@"}; shift
;;
execute|execut|execu|exec|exe|ex|e)
shift; set dummy --mode execute ${1+"$@"}; shift
;;
finish|finis|fini|fin|fi|f)
shift; set dummy --mode finish ${1+"$@"}; shift
;;
install|instal|insta|inst|ins|in|i)
shift; set dummy --mode install ${1+"$@"}; shift
;;
link|lin|li|l)
shift; set dummy --mode link ${1+"$@"}; shift
;;
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
shift; set dummy --mode uninstall ${1+"$@"}; shift
;;
esac
# Pass back the list of options.
func_quote_for_eval ${1+"$@"}
libtool_options_prep_result=$func_quote_for_eval_result
}
func_add_hook func_options_prep libtool_options_prep
# libtool_parse_options [ARG]...
# ---------------------------------
# Provide handling for libtool specific options.
libtool_parse_options ()
{
$debug_cmd
# Perform our own loop to consume as many options as possible in
# each iteration.
while test $# -gt 0; do
_G_opt=$1
shift
case $_G_opt in
--dry-run|--dryrun|-n)
opt_dry_run=:
;;
--config) func_config ;;
--dlopen|-dlopen)
opt_dlopen="${opt_dlopen+$opt_dlopen
}$1"
shift
;;
--preserve-dup-deps)
opt_preserve_dup_deps=: ;;
--features) func_features ;;
--finish) set dummy --mode finish ${1+"$@"}; shift ;;
--help) opt_help=: ;;
--help-all) opt_help=': help-all' ;;
--mode) test $# = 0 && func_missing_arg $_G_opt && break
opt_mode=$1
case $1 in
# Valid mode arguments:
clean|compile|execute|finish|install|link|relink|uninstall) ;;
# Catch anything else as an error
*) func_error "invalid argument for $_G_opt"
exit_cmd=exit
break
;;
esac
shift
;;
--no-silent|--no-quiet)
opt_quiet=false
func_append preserve_args " $_G_opt"
;;
--no-warnings|--no-warning|--no-warn)
opt_warning=false
func_append preserve_args " $_G_opt"
;;
--no-verbose)
opt_verbose=false
func_append preserve_args " $_G_opt"
;;
--silent|--quiet)
opt_quiet=:
opt_verbose=false
func_append preserve_args " $_G_opt"
;;
--tag) test $# = 0 && func_missing_arg $_G_opt && break
opt_tag=$1
func_append preserve_args " $_G_opt $1"
func_enable_tag "$1"
shift
;;
--verbose|-v) opt_quiet=false
opt_verbose=:
func_append preserve_args " $_G_opt"
;;
# An option not handled by this hook function:
*) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
esac
done
# save modified positional parameters for caller
func_quote_for_eval ${1+"$@"}
libtool_parse_options_result=$func_quote_for_eval_result
}
func_add_hook func_parse_options libtool_parse_options
# libtool_validate_options [ARG]...
# ---------------------------------
# Perform any sanity checks on option settings and/or unconsumed
# arguments.
libtool_validate_options ()
{
# save first non-option argument
if test 0 -lt $#; then
nonopt=$1
shift
fi
# preserve --debug
test : = "$debug_cmd" || func_append preserve_args " --debug"
case $host in
# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
*cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
# don't eliminate duplications in $postdeps and $predeps
opt_duplicate_compiler_generated_deps=:
;;
*)
opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
;;
esac
$opt_help || {
# Sanity checks first:
func_check_version_match
test yes != "$build_libtool_libs" \
&& test yes != "$build_old_libs" \
&& func_fatal_configuration "not configured to build any kind of library"
# Darwin sucks
eval std_shrext=\"$shrext_cmds\"
# Only execute mode is allowed to have -dlopen flags.
if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
func_error "unrecognized option '-dlopen'"
$ECHO "$help" 1>&2
exit $EXIT_FAILURE
fi
# Change the help message to a mode-specific one.
generic_help=$help
help="Try '$progname --help --mode=$opt_mode' for more information."
}
# Pass back the unparsed argument list
func_quote_for_eval ${1+"$@"}
libtool_validate_options_result=$func_quote_for_eval_result
}
func_add_hook func_validate_options libtool_validate_options
# Process options as early as possible so that --help and --version
# can return quickly.
func_options ${1+"$@"}
eval set dummy "$func_options_result"; shift
## ----------- ##
## Main. ##
## ----------- ##
magic='%%%MAGIC variable%%%'
magic_exe='%%%MAGIC EXE variable%%%'
# Global variables.
extracted_archives=
extracted_serial=0
# If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being
# left over by shells.
exec_cmd=
# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
$1
_LTECHO_EOF'
}
# func_generated_by_libtool
# True iff stdin has been generated by Libtool. This function is only
# a basic sanity check; it will hardly flush out determined imposters.
func_generated_by_libtool_p ()
{
$GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
}
# func_lalib_p file
# True iff FILE is a libtool '.la' library or '.lo' object file.
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_lalib_p ()
{
test -f "$1" &&
$SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
}
# func_lalib_unsafe_p file
# True iff FILE is a libtool '.la' library or '.lo' object file.
# This function implements the same check as func_lalib_p without
# resorting to external programs. To this end, it redirects stdin and
# closes it afterwards, without saving the original file descriptor.
# As a safety measure, use it only where a negative result would be
# fatal anyway. Works if 'file' does not exist.
func_lalib_unsafe_p ()
{
lalib_p=no
if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
for lalib_p_l in 1 2 3 4
do
read lalib_p_line
case $lalib_p_line in
\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
esac
done
exec 0<&5 5<&-
fi
test yes = "$lalib_p"
}
# func_ltwrapper_script_p file
# True iff FILE is a libtool wrapper script
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_script_p ()
{
test -f "$1" &&
$lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
}
# func_ltwrapper_executable_p file
# True iff FILE is a libtool wrapper executable
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_executable_p ()
{
func_ltwrapper_exec_suffix=
case $1 in
*.exe) ;;
*) func_ltwrapper_exec_suffix=.exe ;;
esac
$GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
}
# func_ltwrapper_scriptname file
# Assumes file is an ltwrapper_executable
# uses $file to determine the appropriate filename for a
# temporary ltwrapper_script.
func_ltwrapper_scriptname ()
{
func_dirname_and_basename "$1" "" "."
func_stripname '' '.exe' "$func_basename_result"
func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
}
# func_ltwrapper_p file
# True iff FILE is a libtool wrapper script or wrapper executable
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_p ()
{
func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
}
# func_execute_cmds commands fail_cmd
# Execute tilde-delimited COMMANDS.
# If FAIL_CMD is given, eval that upon failure.
# FAIL_CMD may read-access the current command in variable CMD!
func_execute_cmds ()
{
$debug_cmd
save_ifs=$IFS; IFS='~'
for cmd in $1; do
IFS=$sp$nl
eval cmd=\"$cmd\"
IFS=$save_ifs
func_show_eval "$cmd" "${2-:}"
done
IFS=$save_ifs
}
# func_source file
# Source FILE, adding directory component if necessary.
# Note that it is not necessary on cygwin/mingw to append a dot to
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
# behavior happens only for exec(3), not for open(2)! Also, sourcing
# 'FILE.' does not work on cygwin managed mounts.
func_source ()
{
$debug_cmd
case $1 in
*/* | *\\*) . "$1" ;;
*) . "./$1" ;;
esac
}
# func_resolve_sysroot PATH
# Replace a leading = in PATH with a sysroot. Store the result into
# func_resolve_sysroot_result
func_resolve_sysroot ()
{
func_resolve_sysroot_result=$1
case $func_resolve_sysroot_result in
=*)
func_stripname '=' '' "$func_resolve_sysroot_result"
func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
;;
esac
}
# func_replace_sysroot PATH
# If PATH begins with the sysroot, replace it with = and
# store the result into func_replace_sysroot_result.
func_replace_sysroot ()
{
case $lt_sysroot:$1 in
?*:"$lt_sysroot"*)
func_stripname "$lt_sysroot" '' "$1"
func_replace_sysroot_result='='$func_stripname_result
;;
*)
# Including no sysroot.
func_replace_sysroot_result=$1
;;
esac
}
# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
# arg is usually of the form 'gcc ...'
func_infer_tag ()
{
$debug_cmd
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
func_append_quoted CC_quoted "$arg"
done
CC_expanded=`func_echo_all $CC`
CC_quoted_expanded=`func_echo_all $CC_quoted`
case $@ in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
" $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
" $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
# Evaluate the configuration.
eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
CC_quoted=
for arg in $CC; do
# Double-quote args containing other shell metacharacters.
func_append_quoted CC_quoted "$arg"
done
CC_expanded=`func_echo_all $CC`
CC_quoted_expanded=`func_echo_all $CC_quoted`
case "$@ " in
" $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
" $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
tagname=$z
break
;;
esac
fi
done
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
func_echo "unable to infer tagged configuration"
func_fatal_error "specify a tag with '--tag'"
# else
# func_verbose "using $tagname tagged configuration"
fi
;;
esac
fi
}
# func_write_libtool_object output_name pic_name nonpic_name
# Create a libtool object file (analogous to a ".la" file),
# but don't create it if we're doing a dry run.
func_write_libtool_object ()
{
write_libobj=$1
if test yes = "$build_libtool_libs"; then
write_lobj=\'$2\'
else
write_lobj=none
fi
if test yes = "$build_old_libs"; then
write_oldobj=\'$3\'
else
write_oldobj=none
fi
$opt_dry_run || {
cat >${write_libobj}T </dev/null`
if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
$SED -e "$sed_naive_backslashify"`
else
func_convert_core_file_wine_to_w32_result=
fi
fi
}
# end: func_convert_core_file_wine_to_w32
# func_convert_core_path_wine_to_w32 ARG
# Helper function used by path conversion functions when $build is *nix, and
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
# configured wine environment available, with the winepath program in $build's
# $PATH. Assumes ARG has no leading or trailing path separator characters.
#
# ARG is path to be converted from $build format to win32.
# Result is available in $func_convert_core_path_wine_to_w32_result.
# Unconvertible file (directory) names in ARG are skipped; if no directory names
# are convertible, then the result may be empty.
func_convert_core_path_wine_to_w32 ()
{
$debug_cmd
# unfortunately, winepath doesn't convert paths, only file names
func_convert_core_path_wine_to_w32_result=
if test -n "$1"; then
oldIFS=$IFS
IFS=:
for func_convert_core_path_wine_to_w32_f in $1; do
IFS=$oldIFS
func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
if test -n "$func_convert_core_file_wine_to_w32_result"; then
if test -z "$func_convert_core_path_wine_to_w32_result"; then
func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
else
func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
fi
fi
done
IFS=$oldIFS
fi
}
# end: func_convert_core_path_wine_to_w32
# func_cygpath ARGS...
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
# (2), returns the Cygwin file name or path in func_cygpath_result (input
# file name or path is assumed to be in w32 format, as previously converted
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
# or path in func_cygpath_result (input file name or path is assumed to be in
# Cygwin format). Returns an empty string on error.
#
# ARGS are passed to cygpath, with the last one being the file name or path to
# be converted.
#
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
# environment variable; do not put it in $PATH.
func_cygpath ()
{
$debug_cmd
if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
if test "$?" -ne 0; then
# on failure, ensure result is empty
func_cygpath_result=
fi
else
func_cygpath_result=
func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
fi
}
#end: func_cygpath
# func_convert_core_msys_to_w32 ARG
# Convert file name or path ARG from MSYS format to w32 format. Return
# result in func_convert_core_msys_to_w32_result.
func_convert_core_msys_to_w32 ()
{
$debug_cmd
# awkward: cmd appends spaces to result
func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
$SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
}
#end: func_convert_core_msys_to_w32
# func_convert_file_check ARG1 ARG2
# Verify that ARG1 (a file name in $build format) was converted to $host
# format in ARG2. Otherwise, emit an error message, but continue (resetting
# func_to_host_file_result to ARG1).
func_convert_file_check ()
{
$debug_cmd
if test -z "$2" && test -n "$1"; then
func_error "Could not determine host file name corresponding to"
func_error " '$1'"
func_error "Continuing, but uninstalled executables may not work."
# Fallback:
func_to_host_file_result=$1
fi
}
# end func_convert_file_check
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
# Verify that FROM_PATH (a path in $build format) was converted to $host
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
# func_to_host_file_result to a simplistic fallback value (see below).
func_convert_path_check ()
{
$debug_cmd
if test -z "$4" && test -n "$3"; then
func_error "Could not determine the host path corresponding to"
func_error " '$3'"
func_error "Continuing, but uninstalled executables may not work."
# Fallback. This is a deliberately simplistic "conversion" and
# should not be "improved". See libtool.info.
if test "x$1" != "x$2"; then
lt_replace_pathsep_chars="s|$1|$2|g"
func_to_host_path_result=`echo "$3" |
$SED -e "$lt_replace_pathsep_chars"`
else
func_to_host_path_result=$3
fi
fi
}
# end func_convert_path_check
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
# and appending REPL if ORIG matches BACKPAT.
func_convert_path_front_back_pathsep ()
{
$debug_cmd
case $4 in
$1 ) func_to_host_path_result=$3$func_to_host_path_result
;;
esac
case $4 in
$2 ) func_append func_to_host_path_result "$3"
;;
esac
}
# end func_convert_path_front_back_pathsep
##################################################
# $build to $host FILE NAME CONVERSION FUNCTIONS #
##################################################
# invoked via '$to_host_file_cmd ARG'
#
# In each case, ARG is the path to be converted from $build to $host format.
# Result will be available in $func_to_host_file_result.
# func_to_host_file ARG
# Converts the file name ARG from $build format to $host format. Return result
# in func_to_host_file_result.
func_to_host_file ()
{
$debug_cmd
$to_host_file_cmd "$1"
}
# end func_to_host_file
# func_to_tool_file ARG LAZY
# converts the file name ARG from $build format to toolchain format. Return
# result in func_to_tool_file_result. If the conversion in use is listed
# in (the comma separated) LAZY, no conversion takes place.
func_to_tool_file ()
{
$debug_cmd
case ,$2, in
*,"$to_tool_file_cmd",*)
func_to_tool_file_result=$1
;;
*)
$to_tool_file_cmd "$1"
func_to_tool_file_result=$func_to_host_file_result
;;
esac
}
# end func_to_tool_file
# func_convert_file_noop ARG
# Copy ARG to func_to_host_file_result.
func_convert_file_noop ()
{
func_to_host_file_result=$1
}
# end func_convert_file_noop
# func_convert_file_msys_to_w32 ARG
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
# conversion to w32 is not available inside the cwrapper. Returns result in
# func_to_host_file_result.
func_convert_file_msys_to_w32 ()
{
$debug_cmd
func_to_host_file_result=$1
if test -n "$1"; then
func_convert_core_msys_to_w32 "$1"
func_to_host_file_result=$func_convert_core_msys_to_w32_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_msys_to_w32
# func_convert_file_cygwin_to_w32 ARG
# Convert file name ARG from Cygwin to w32 format. Returns result in
# func_to_host_file_result.
func_convert_file_cygwin_to_w32 ()
{
$debug_cmd
func_to_host_file_result=$1
if test -n "$1"; then
# because $build is cygwin, we call "the" cygpath in $PATH; no need to use
# LT_CYGPATH in this case.
func_to_host_file_result=`cygpath -m "$1"`
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_cygwin_to_w32
# func_convert_file_nix_to_w32 ARG
# Convert file name ARG from *nix to w32 format. Requires a wine environment
# and a working winepath. Returns result in func_to_host_file_result.
func_convert_file_nix_to_w32 ()
{
$debug_cmd
func_to_host_file_result=$1
if test -n "$1"; then
func_convert_core_file_wine_to_w32 "$1"
func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_nix_to_w32
# func_convert_file_msys_to_cygwin ARG
# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
# Returns result in func_to_host_file_result.
func_convert_file_msys_to_cygwin ()
{
$debug_cmd
func_to_host_file_result=$1
if test -n "$1"; then
func_convert_core_msys_to_w32 "$1"
func_cygpath -u "$func_convert_core_msys_to_w32_result"
func_to_host_file_result=$func_cygpath_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_msys_to_cygwin
# func_convert_file_nix_to_cygwin ARG
# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
# in func_to_host_file_result.
func_convert_file_nix_to_cygwin ()
{
$debug_cmd
func_to_host_file_result=$1
if test -n "$1"; then
# convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
func_convert_core_file_wine_to_w32 "$1"
func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
func_to_host_file_result=$func_cygpath_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_nix_to_cygwin
#############################################
# $build to $host PATH CONVERSION FUNCTIONS #
#############################################
# invoked via '$to_host_path_cmd ARG'
#
# In each case, ARG is the path to be converted from $build to $host format.
# The result will be available in $func_to_host_path_result.
#
# Path separators are also converted from $build format to $host format. If
# ARG begins or ends with a path separator character, it is preserved (but
# converted to $host format) on output.
#
# All path conversion functions are named using the following convention:
# file name conversion function : func_convert_file_X_to_Y ()
# path conversion function : func_convert_path_X_to_Y ()
# where, for any given $build/$host combination the 'X_to_Y' value is the
# same. If conversion functions are added for new $build/$host combinations,
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
# will break.
# func_init_to_host_path_cmd
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
# appropriate value, based on the value of $to_host_file_cmd.
to_host_path_cmd=
func_init_to_host_path_cmd ()
{
$debug_cmd
if test -z "$to_host_path_cmd"; then
func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
to_host_path_cmd=func_convert_path_$func_stripname_result
fi
}
# func_to_host_path ARG
# Converts the path ARG from $build format to $host format. Return result
# in func_to_host_path_result.
func_to_host_path ()
{
$debug_cmd
func_init_to_host_path_cmd
$to_host_path_cmd "$1"
}
# end func_to_host_path
# func_convert_path_noop ARG
# Copy ARG to func_to_host_path_result.
func_convert_path_noop ()
{
func_to_host_path_result=$1
}
# end func_convert_path_noop
# func_convert_path_msys_to_w32 ARG
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
# conversion to w32 is not available inside the cwrapper. Returns result in
# func_to_host_path_result.
func_convert_path_msys_to_w32 ()
{
$debug_cmd
func_to_host_path_result=$1
if test -n "$1"; then
# Remove leading and trailing path separator characters from ARG. MSYS
# behavior is inconsistent here; cygpath turns them into '.;' and ';.';
# and winepath ignores them completely.
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
func_to_host_path_result=$func_convert_core_msys_to_w32_result
func_convert_path_check : ";" \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
fi
}
# end func_convert_path_msys_to_w32
# func_convert_path_cygwin_to_w32 ARG
# Convert path ARG from Cygwin to w32 format. Returns result in
# func_to_host_file_result.
func_convert_path_cygwin_to_w32 ()
{
$debug_cmd
func_to_host_path_result=$1
if test -n "$1"; then
# See func_convert_path_msys_to_w32:
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
func_convert_path_check : ";" \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
fi
}
# end func_convert_path_cygwin_to_w32
# func_convert_path_nix_to_w32 ARG
# Convert path ARG from *nix to w32 format. Requires a wine environment and
# a working winepath. Returns result in func_to_host_file_result.
func_convert_path_nix_to_w32 ()
{
$debug_cmd
func_to_host_path_result=$1
if test -n "$1"; then
# See func_convert_path_msys_to_w32:
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
func_convert_path_check : ";" \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
fi
}
# end func_convert_path_nix_to_w32
# func_convert_path_msys_to_cygwin ARG
# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
# Returns result in func_to_host_file_result.
func_convert_path_msys_to_cygwin ()
{
$debug_cmd
func_to_host_path_result=$1
if test -n "$1"; then
# See func_convert_path_msys_to_w32:
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
func_to_host_path_result=$func_cygpath_result
func_convert_path_check : : \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
fi
}
# end func_convert_path_msys_to_cygwin
# func_convert_path_nix_to_cygwin ARG
# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
# func_to_host_file_result.
func_convert_path_nix_to_cygwin ()
{
$debug_cmd
func_to_host_path_result=$1
if test -n "$1"; then
# Remove leading and trailing path separator characters from
# ARG. msys behavior is inconsistent here, cygpath turns them
# into '.;' and ';.', and winepath ignores them completely.
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
func_to_host_path_result=$func_cygpath_result
func_convert_path_check : : \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
fi
}
# end func_convert_path_nix_to_cygwin
# func_dll_def_p FILE
# True iff FILE is a Windows DLL '.def' file.
# Keep in sync with _LT_DLL_DEF_P in libtool.m4
func_dll_def_p ()
{
$debug_cmd
func_dll_def_p_tmp=`$SED -n \
-e 's/^[ ]*//' \
-e '/^\(;.*\)*$/d' \
-e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
-e q \
"$1"`
test DEF = "$func_dll_def_p_tmp"
}
# func_mode_compile arg...
func_mode_compile ()
{
$debug_cmd
# Get the compilation command and the source file.
base_compile=
srcfile=$nonopt # always keep a non-empty value in "srcfile"
suppress_opt=yes
suppress_output=
arg_mode=normal
libobj=
later=
pie_flag=
for arg
do
case $arg_mode in
arg )
# do not "continue". Instead, add this to base_compile
lastarg=$arg
arg_mode=normal
;;
target )
libobj=$arg
arg_mode=normal
continue
;;
normal )
# Accept any command-line options.
case $arg in
-o)
test -n "$libobj" && \
func_fatal_error "you cannot specify '-o' more than once"
arg_mode=target
continue
;;
-pie | -fpie | -fPIE)
func_append pie_flag " $arg"
continue
;;
-shared | -static | -prefer-pic | -prefer-non-pic)
func_append later " $arg"
continue
;;
-no-suppress)
suppress_opt=no
continue
;;
-Xcompiler)
arg_mode=arg # the next one goes into the "base_compile" arg list
continue # The current "srcfile" will either be retained or
;; # replaced later. I would guess that would be a bug.
-Wc,*)
func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result
lastarg=
save_ifs=$IFS; IFS=,
for arg in $args; do
IFS=$save_ifs
func_append_quoted lastarg "$arg"
done
IFS=$save_ifs
func_stripname ' ' '' "$lastarg"
lastarg=$func_stripname_result
# Add the arguments to base_compile.
func_append base_compile " $lastarg"
continue
;;
*)
# Accept the current argument as the source file.
# The previous "srcfile" becomes the current argument.
#
lastarg=$srcfile
srcfile=$arg
;;
esac # case $arg
;;
esac # case $arg_mode
# Aesthetically quote the previous argument.
func_append_quoted base_compile "$lastarg"
done # for arg
case $arg_mode in
arg)
func_fatal_error "you must specify an argument for -Xcompile"
;;
target)
func_fatal_error "you must specify a target with '-o'"
;;
*)
# Get the name of the library object.
test -z "$libobj" && {
func_basename "$srcfile"
libobj=$func_basename_result
}
;;
esac
# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
case $libobj in
*.[cCFSifmso] | \
*.ada | *.adb | *.ads | *.asm | \
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
*.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
func_xform "$libobj"
libobj=$func_xform_result
;;
esac
case $libobj in
*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
*)
func_fatal_error "cannot determine name of library object from '$libobj'"
;;
esac
func_infer_tag $base_compile
for arg in $later; do
case $arg in
-shared)
test yes = "$build_libtool_libs" \
|| func_fatal_configuration "cannot build a shared library"
build_old_libs=no
continue
;;
-static)
build_libtool_libs=no
build_old_libs=yes
continue
;;
-prefer-pic)
pic_mode=yes
continue
;;
-prefer-non-pic)
pic_mode=no
continue
;;
esac
done
func_quote_for_eval "$libobj"
test "X$libobj" != "X$func_quote_for_eval_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
objname=$func_basename_result
xdir=$func_dirname_result
lobj=$xdir$objdir/$objname
test -z "$base_compile" && \
func_fatal_help "you must specify a compilation command"
# Delete any leftover library objects.
if test yes = "$build_old_libs"; then
removelist="$obj $lobj $libobj ${libobj}T"
else
removelist="$lobj $libobj ${libobj}T"
fi
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
cygwin* | mingw* | pw32* | os2* | cegcc*)
pic_mode=default
;;
esac
if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
# non-PIC code in shared libraries is not supported
pic_mode=default
fi
# Calculate the filename of the output object if compiler does
# not support -o with -c
if test no = "$compiler_c_o"; then
output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
lockfile=$output_obj.lock
else
output_obj=
need_locks=no
lockfile=
fi
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
if test yes = "$need_locks"; then
until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
func_echo "Waiting for $lockfile to be removed"
sleep 2
done
elif test warn = "$need_locks"; then
if test -f "$lockfile"; then
$ECHO "\
*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support '-c' and '-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
func_append removelist " $output_obj"
$ECHO "$srcfile" > "$lockfile"
fi
$opt_dry_run || $RM $removelist
func_append removelist " $lockfile"
trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
srcfile=$func_to_tool_file_result
func_quote_for_eval "$srcfile"
qsrcfile=$func_quote_for_eval_result
# Only build a PIC object if we are building libtool libraries.
if test yes = "$build_libtool_libs"; then
# Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile
if test no != "$pic_mode"; then
command="$base_compile $qsrcfile $pic_flag"
else
# Don't build PIC code
command="$base_compile $qsrcfile"
fi
func_mkdir_p "$xdir$objdir"
if test -z "$output_obj"; then
# Place PIC objects in $objdir
func_append command " -o $lobj"
fi
func_show_eval_locale "$command" \
'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
if test warn = "$need_locks" &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$ECHO "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support '-c' and '-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed, then go on to compile the next one
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
func_show_eval '$MV "$output_obj" "$lobj"' \
'error=$?; $opt_dry_run || $RM $removelist; exit $error'
fi
# Allow error messages only from the first compilation.
if test yes = "$suppress_opt"; then
suppress_output=' >/dev/null 2>&1'
fi
fi
# Only build a position-dependent object if we build old libraries.
if test yes = "$build_old_libs"; then
if test yes != "$pic_mode"; then
# Don't build PIC code
command="$base_compile $qsrcfile$pie_flag"
else
command="$base_compile $qsrcfile $pic_flag"
fi
if test yes = "$compiler_c_o"; then
func_append command " -o $obj"
fi
# Suppress compiler output if we already did a PIC compilation.
func_append command "$suppress_output"
func_show_eval_locale "$command" \
'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
if test warn = "$need_locks" &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$ECHO "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support '-c' and '-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
func_show_eval '$MV "$output_obj" "$obj"' \
'error=$?; $opt_dry_run || $RM $removelist; exit $error'
fi
fi
$opt_dry_run || {
func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
# Unlock the critical section if it was locked
if test no != "$need_locks"; then
removelist=$lockfile
$RM "$lockfile"
fi
}
exit $EXIT_SUCCESS
}
$opt_help || {
test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
}
func_mode_help ()
{
# We need to display help for each of the modes.
case $opt_mode in
"")
# Generic help is extracted from the usage comments
# at the start of this file.
func_help
;;
clean)
$ECHO \
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
Remove files from the build directory.
RM is the name of the program to use to delete files associated with each FILE
(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
to RM.
If FILE is a libtool library, object or program, all the files associated
with it are deleted. Otherwise, only FILE itself is deleted using RM."
;;
compile)
$ECHO \
"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Compile a source file into a libtool library object.
This mode accepts the following additional options:
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
-no-suppress do not suppress compiler output for multiple passes
-prefer-pic try to build PIC objects only
-prefer-non-pic try to build non-PIC objects only
-shared do not build a '.o' file suitable for static linking
-static only build a '.o' file suitable for static linking
-Wc,FLAG pass FLAG directly to the compiler
COMPILE-COMMAND is a command to be used in creating a 'standard' object file
from the given SOURCEFILE.
The output file name is determined by removing the directory component from
SOURCEFILE, then substituting the C source code suffix '.c' with the
library object suffix, '.lo'."
;;
execute)
$ECHO \
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
Automatically set library path, then run a program.
This mode accepts the following additional options:
-dlopen FILE add the directory containing FILE to the library path
This mode sets the library path environment variable according to '-dlopen'
flags.
If any of the ARGS are libtool executable wrappers, then they are translated
into their corresponding uninstalled binary, and any of their required library
directories are added to the library path.
Then, COMMAND is executed, with ARGS as arguments."
;;
finish)
$ECHO \
"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
Complete the installation of libtool libraries.
Each LIBDIR is a directory that contains libtool libraries.
The commands that this mode executes may require superuser privileges. Use
the '--dry-run' option if you just want to see what would be executed."
;;
install)
$ECHO \
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
Install executables or libraries.
INSTALL-COMMAND is the installation command. The first component should be
either the 'install' or 'cp' program.
The following components of INSTALL-COMMAND are treated specially:
-inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
The rest of the components are interpreted as arguments to that command (only
BSD-compatible install options are recognized)."
;;
link)
$ECHO \
"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
Link object files or libraries together to form another library, or to
create an executable program.
LINK-COMMAND is a command using the C compiler that you would use to create
a program from several object files.
The following components of LINK-COMMAND are treated specially:
-all-static do not do any dynamic linking at all
-avoid-version do not add a version suffix if possible
-bindir BINDIR specify path to binaries directory (for systems where
libraries must be found in the PATH setting at runtime)
-dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
-no-fast-install disable the fast-install mode
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
-objectlist FILE use a list of object files found in FILE to specify objects
-os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
-precious-files-regex REGEX
don't remove output files matching REGEX
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
-shared only do dynamic linking of libtool libraries
-shrext SUFFIX override the standard shared library file extension
-static do not do any dynamic linking of uninstalled libtool libraries
-static-libtool-libs
do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0]
-weak LIBNAME declare that the target provides the LIBNAME interface
-Wc,FLAG
-Xcompiler FLAG pass linker-specific FLAG directly to the compiler
-Wl,FLAG
-Xlinker FLAG pass linker-specific FLAG directly to the linker
-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
All other options (arguments beginning with '-') are ignored.
Every other argument is treated as a filename. Files ending in '.la' are
treated as uninstalled libtool libraries, other files are standard or library
object files.
If the OUTPUT-FILE ends in '.la', then a libtool library is created,
only library objects ('.lo' files) may be specified, and '-rpath' is
required, except when creating a convenience library.
If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
using 'ar' and 'ranlib', or on Windows using 'lib'.
If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
is created, otherwise an executable program is created."
;;
uninstall)
$ECHO \
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Remove libraries from an installation directory.
RM is the name of the program to use to delete files associated with each FILE
(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
to RM.
If FILE is a libtool library, all the files associated with it are deleted.
Otherwise, only FILE itself is deleted using RM."
;;
*)
func_fatal_help "invalid operation mode '$opt_mode'"
;;
esac
echo
$ECHO "Try '$progname --help' for more information about other modes."
}
# Now that we've collected a possible --mode arg, show help if necessary
if $opt_help; then
if test : = "$opt_help"; then
func_mode_help
else
{
func_help noexit
for opt_mode in compile link execute install finish uninstall clean; do
func_mode_help
done
} | $SED -n '1p; 2,$s/^Usage:/ or: /p'
{
func_help noexit
for opt_mode in compile link execute install finish uninstall clean; do
echo
func_mode_help
done
} |
$SED '1d
/^When reporting/,/^Report/{
H
d
}
$x
/information about other modes/d
/more detailed .*MODE/d
s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
fi
exit $?
fi
# func_mode_execute arg...
func_mode_execute ()
{
$debug_cmd
# The first argument is the command name.
cmd=$nonopt
test -z "$cmd" && \
func_fatal_help "you must specify a COMMAND"
# Handle -dlopen flags immediately.
for file in $opt_dlopen; do
test -f "$file" \
|| func_fatal_help "'$file' is not a file"
dir=
case $file in
*.la)
func_resolve_sysroot "$file"
file=$func_resolve_sysroot_result
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
|| func_fatal_help "'$lib' is not a valid libtool archive"
# Read the libtool library.
dlname=
library_names=
func_source "$file"
# Skip this library if it cannot be dlopened.
if test -z "$dlname"; then
# Warn if it was a shared library.
test -n "$library_names" && \
func_warning "'$file' was not linked with '-export-dynamic'"
continue
fi
func_dirname "$file" "" "."
dir=$func_dirname_result
if test -f "$dir/$objdir/$dlname"; then
func_append dir "/$objdir"
else
if test ! -f "$dir/$dlname"; then
func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
fi
fi
;;
*.lo)
# Just add the directory containing the .lo file.
func_dirname "$file" "" "."
dir=$func_dirname_result
;;
*)
func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
continue
;;
esac
# Get the absolute pathname.
absdir=`cd "$dir" && pwd`
test -n "$absdir" && dir=$absdir
# Now add the directory to shlibpath_var.
if eval "test -z \"\$$shlibpath_var\""; then
eval "$shlibpath_var=\"\$dir\""
else
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
fi
done
# This variable tells wrapper scripts just to set shlibpath_var
# rather than running their programs.
libtool_execute_magic=$magic
# Check if any of the arguments is a wrapper script.
args=
for file
do
case $file in
-* | *.la | *.lo ) ;;
*)
# Do a test to see if this is really a libtool program.
if func_ltwrapper_script_p "$file"; then
func_source "$file"
# Transform arg to wrapped name.
file=$progdir/$program
elif func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
func_source "$func_ltwrapper_scriptname_result"
# Transform arg to wrapped name.
file=$progdir/$program
fi
;;
esac
# Quote arguments (to preserve shell metacharacters).
func_append_quoted args "$file"
done
if $opt_dry_run; then
# Display what would be done.
if test -n "$shlibpath_var"; then
eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
echo "export $shlibpath_var"
fi
$ECHO "$cmd$args"
exit $EXIT_SUCCESS
else
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
fi
# Restore saved environment variables
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${save_$lt_var+set}\" = set; then
$lt_var=\$save_$lt_var; export $lt_var
else
$lt_unset $lt_var
fi"
done
# Now prepare to actually exec the command.
exec_cmd=\$cmd$args
fi
}
test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
# func_mode_finish arg...
func_mode_finish ()
{
$debug_cmd
libs=
libdirs=
admincmds=
for opt in "$nonopt" ${1+"$@"}
do
if test -d "$opt"; then
func_append libdirs " $opt"
elif test -f "$opt"; then
if func_lalib_unsafe_p "$opt"; then
func_append libs " $opt"
else
func_warning "'$opt' is not a valid libtool archive"
fi
else
func_fatal_error "invalid argument '$opt'"
fi
done
if test -n "$libs"; then
if test -n "$lt_sysroot"; then
sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
else
sysroot_cmd=
fi
# Remove sysroot references
if $opt_dry_run; then
for lib in $libs; do
echo "removing references to $lt_sysroot and '=' prefixes from $lib"
done
else
tmpdir=`func_mktempdir`
for lib in $libs; do
$SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
> $tmpdir/tmp-la
mv -f $tmpdir/tmp-la $lib
done
${RM}r "$tmpdir"
fi
fi
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
'"$cmd"'"'
fi
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
$opt_dry_run || eval "$cmds" || func_append admincmds "
$cmds"
fi
done
fi
# Exit here if they wanted silent mode.
$opt_quiet && exit $EXIT_SUCCESS
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
echo "----------------------------------------------------------------------"
echo "Libraries have been installed in:"
for libdir in $libdirs; do
$ECHO " $libdir"
done
echo
echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and"
echo "specify the full pathname of the library, or use the '-LLIBDIR'"
echo "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then
echo " - add LIBDIR to the '$shlibpath_var' environment variable"
echo " during execution"
fi
if test -n "$runpath_var"; then
echo " - add LIBDIR to the '$runpath_var' environment variable"
echo " during linking"
fi
if test -n "$hardcode_libdir_flag_spec"; then
libdir=LIBDIR
eval flag=\"$hardcode_libdir_flag_spec\"
$ECHO " - use the '$flag' linker flag"
fi
if test -n "$admincmds"; then
$ECHO " - have your system administrator run these commands:$admincmds"
fi
if test -f /etc/ld.so.conf; then
echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
fi
echo
echo "See any operating system documentation about shared libraries for"
case $host in
solaris2.[6789]|solaris2.1[0-9])
echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
echo "pages."
;;
*)
echo "more information, such as the ld(1) and ld.so(8) manual pages."
;;
esac
echo "----------------------------------------------------------------------"
fi
exit $EXIT_SUCCESS
}
test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
# func_mode_install arg...
func_mode_install ()
{
$debug_cmd
# There may be an optional sh(1) argument at the beginning of
# install_prog (especially on Windows NT).
if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
# Allow the use of GNU shtool's install command.
case $nonopt in *shtool*) :;; *) false;; esac
then
# Aesthetically quote it.
func_quote_for_eval "$nonopt"
install_prog="$func_quote_for_eval_result "
arg=$1
shift
else
install_prog=
arg=$nonopt
fi
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
func_quote_for_eval "$arg"
func_append install_prog "$func_quote_for_eval_result"
install_shared_prog=$install_prog
case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;;
*) install_cp=false ;;
esac
# We need to accept at least all the BSD install flags.
dest=
files=
opts=
prev=
install_type=
isdir=false
stripme=
no_mode=:
for arg
do
arg2=
if test -n "$dest"; then
func_append files " $dest"
dest=$arg
continue
fi
case $arg in
-d) isdir=: ;;
-f)
if $install_cp; then :; else
prev=$arg
fi
;;
-g | -m | -o)
prev=$arg
;;
-s)
stripme=" -s"
continue
;;
-*)
;;
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
if test X-m = "X$prev" && test -n "$install_override_mode"; then
arg2=$install_override_mode
no_mode=false
fi
prev=
else
dest=$arg
continue
fi
;;
esac
# Aesthetically quote the argument.
func_quote_for_eval "$arg"
func_append install_prog " $func_quote_for_eval_result"
if test -n "$arg2"; then
func_quote_for_eval "$arg2"
fi
func_append install_shared_prog " $func_quote_for_eval_result"
done
test -z "$install_prog" && \
func_fatal_help "you must specify an install program"
test -n "$prev" && \
func_fatal_help "the '$prev' option requires an argument"
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
func_quote_for_eval "$install_override_mode"
func_append install_shared_prog " -m $func_quote_for_eval_result"
fi
fi
if test -z "$files"; then
if test -z "$dest"; then
func_fatal_help "no file or destination specified"
else
func_fatal_help "you must specify a destination"
fi
fi
# Strip any trailing slash from the destination.
func_stripname '' '/' "$dest"
dest=$func_stripname_result
# Check to see that the destination is a directory.
test -d "$dest" && isdir=:
if $isdir; then
destdir=$dest
destname=
else
func_dirname_and_basename "$dest" "" "."
destdir=$func_dirname_result
destname=$func_basename_result
# Not a directory, so check to see that there is only one file specified.
set dummy $files; shift
test "$#" -gt 1 && \
func_fatal_help "'$dest' is not a directory"
fi
case $destdir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
for file in $files; do
case $file in
*.lo) ;;
*)
func_fatal_help "'$destdir' must be an absolute directory name"
;;
esac
done
;;
esac
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic=$magic
staticlibs=
future_libdirs=
current_libdirs=
for file in $files; do
# Do each installation.
case $file in
*.$libext)
# Do the static libraries later.
func_append staticlibs " $file"
;;
*.la)
func_resolve_sysroot "$file"
file=$func_resolve_sysroot_result
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
|| func_fatal_help "'$file' is not a valid libtool archive"
library_names=
old_library=
relink_command=
func_source "$file"
# Add the libdir to current_libdirs if it is the destination.
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
*) func_append current_libdirs " $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
*) func_append future_libdirs " $libdir" ;;
esac
fi
func_dirname "$file" "/" ""
dir=$func_dirname_result
func_append dir "$objdir"
if test -n "$relink_command"; then
# Determine the prefix the user has applied to our future dir.
inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
# are installed to the same prefix.
# At present, this check doesn't affect windows .dll's that
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
test "$inst_prefix_dir" = "$destdir" && \
func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
else
relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
fi
func_warning "relinking '$file'"
func_show_eval "$relink_command" \
'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
fi
# See the names of the shared library.
set dummy $library_names; shift
if test -n "$1"; then
realname=$1
shift
srcname=$realname
test -n "$relink_command" && srcname=${realname}T
# Install the shared library and build the symlinks.
func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
'exit $?'
tstripme=$stripme
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
case $realname in
*.dll.a)
tstripme=
;;
esac
;;
os2*)
case $realname in
*_dll.a)
tstripme=
;;
esac
;;
esac
if test -n "$tstripme" && test -n "$striplib"; then
func_show_eval "$striplib $destdir/$realname" 'exit $?'
fi
if test "$#" -gt 0; then
# Delete the old symlinks, and create new ones.
# Try 'ln -sf' first, because the 'ln' binary might depend on
# the symlink we replace! Solaris /bin/ln does not understand -f,
# so we also need to try rm && ln -s.
for linkname
do
test "$linkname" != "$realname" \
&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
done
fi
# Do each command in the postinstall commands.
lib=$destdir/$realname
func_execute_cmds "$postinstall_cmds" 'exit $?'
fi
# Install the pseudo-library for information purposes.
func_basename "$file"
name=$func_basename_result
instname=$dir/${name}i
func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
# Maybe install the static library, too.
test -n "$old_library" && func_append staticlibs " $dir/$old_library"
;;
*.lo)
# Install (i.e. copy) a libtool object.
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile=$destdir/$destname
else
func_basename "$file"
destfile=$func_basename_result
destfile=$destdir/$destfile
fi
# Deduce the name of the destination old-style object file.
case $destfile in
*.lo)
func_lo2o "$destfile"
staticdest=$func_lo2o_result
;;
*.$objext)
staticdest=$destfile
destfile=
;;
*)
func_fatal_help "cannot copy a libtool object to '$destfile'"
;;
esac
# Install the libtool object if requested.
test -n "$destfile" && \
func_show_eval "$install_prog $file $destfile" 'exit $?'
# Install the old object if enabled.
if test yes = "$build_old_libs"; then
# Deduce the name of the old-style object file.
func_lo2o "$file"
staticobj=$func_lo2o_result
func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
fi
exit $EXIT_SUCCESS
;;
*)
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile=$destdir/$destname
else
func_basename "$file"
destfile=$func_basename_result
destfile=$destdir/$destfile
fi
# If the file is missing, and there is a .exe on the end, strip it
# because it is most likely a libtool script we actually want to
# install
stripped_ext=
case $file in
*.exe)
if test ! -f "$file"; then
func_stripname '' '.exe' "$file"
file=$func_stripname_result
stripped_ext=.exe
fi
;;
esac
# Do a test to see if this is really a libtool program.
case $host in
*cygwin* | *mingw*)
if func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
wrapper=$func_ltwrapper_scriptname_result
else
func_stripname '' '.exe' "$file"
wrapper=$func_stripname_result
fi
;;
*)
wrapper=$file
;;
esac
if func_ltwrapper_script_p "$wrapper"; then
notinst_deplibs=
relink_command=
func_source "$wrapper"
# Check the variables that should have been set.
test -z "$generated_by_libtool_version" && \
func_fatal_error "invalid libtool wrapper script '$wrapper'"
finalize=:
for lib in $notinst_deplibs; do
# Check to see that each library is installed.
libdir=
if test -f "$lib"; then
func_source "$lib"
fi
libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
if test -n "$libdir" && test ! -f "$libfile"; then
func_warning "'$lib' has not been installed in '$libdir'"
finalize=false
fi
done
relink_command=
func_source "$wrapper"
outputname=
if test no = "$fast_install" && test -n "$relink_command"; then
$opt_dry_run || {
if $finalize; then
tmpdir=`func_mktempdir`
func_basename "$file$stripped_ext"
file=$func_basename_result
outputname=$tmpdir/$file
# Replace the output file specification.
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
$opt_quiet || {
func_quote_for_expand "$relink_command"
eval "func_echo $func_quote_for_expand_result"
}
if eval "$relink_command"; then :
else
func_error "error: relink '$file' with the above command before installing it"
$opt_dry_run || ${RM}r "$tmpdir"
continue
fi
file=$outputname
else
func_warning "cannot relink '$file'"
fi
}
else
# Install the binary that we compiled earlier.
file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
fi
fi
# remove .exe since cygwin /usr/bin/install will append another
# one anyway
case $install_prog,$host in
*/usr/bin/install*,*cygwin*)
case $file:$destfile in
*.exe:*.exe)
# this is ok
;;
*.exe:*)
destfile=$destfile.exe
;;
*:*.exe)
func_stripname '' '.exe' "$destfile"
destfile=$func_stripname_result
;;
esac
;;
esac
func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
$opt_dry_run || if test -n "$outputname"; then
${RM}r "$tmpdir"
fi
;;
esac
done
for file in $staticlibs; do
func_basename "$file"
name=$func_basename_result
# Set up the ranlib parameters.
oldlib=$destdir/$name
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
tool_oldlib=$func_to_tool_file_result
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
if test -n "$stripme" && test -n "$old_striplib"; then
func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
fi
# Do each command in the postinstall commands.
func_execute_cmds "$old_postinstall_cmds" 'exit $?'
done
test -n "$future_libdirs" && \
func_warning "remember to run '$progname --finish$future_libdirs'"
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
$opt_dry_run && current_libdirs=" -n$current_libdirs"
exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
else
exit $EXIT_SUCCESS
fi
}
test install = "$opt_mode" && func_mode_install ${1+"$@"}
# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
# a dlpreopen symbol table.
func_generate_dlsyms ()
{
$debug_cmd
my_outputname=$1
my_originator=$2
my_pic_p=${3-false}
my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
my_dlsyms=
if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
if test -n "$NM" && test -n "$global_symbol_pipe"; then
my_dlsyms=${my_outputname}S.c
else
func_error "not configured to extract global symbols from dlpreopened files"
fi
fi
if test -n "$my_dlsyms"; then
case $my_dlsyms in
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
nlist=$output_objdir/$my_outputname.nm
func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
# Parse the name list into a source file.
func_verbose "creating $output_objdir/$my_dlsyms"
$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
#ifdef __cplusplus
extern \"C\" {
#endif
#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
#endif
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
/* DATA imports from DLLs on WIN32 can't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs. */
# define LT_DLSYM_CONST
#elif defined __osf__
/* This system does not cope well with relocations in const data. */
# define LT_DLSYM_CONST
#else
# define LT_DLSYM_CONST const
#endif
#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
/* External symbol declarations for the compiler. */\
"
if test yes = "$dlself"; then
func_verbose "generating symbol list for '$output'"
$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
for progfile in $progfiles; do
func_to_tool_file "$progfile" func_convert_file_msys_to_w32
func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
$opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
done
if test -n "$exclude_expsyms"; then
$opt_dry_run || {
eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
}
fi
if test -n "$export_symbols_regex"; then
$opt_dry_run || {
eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
}
fi
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
export_symbols=$output_objdir/$outputname.exp
$opt_dry_run || {
$RM $export_symbols
eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
case $host in
*cygwin* | *mingw* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
;;
esac
}
else
$opt_dry_run || {
eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
*cygwin* | *mingw* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
;;
esac
}
fi
fi
for dlprefile in $dlprefiles; do
func_verbose "extracting global C symbols from '$dlprefile'"
func_basename "$dlprefile"
name=$func_basename_result
case $host in
*cygwin* | *mingw* | *cegcc* )
# if an import library, we need to obtain dlname
if func_win32_import_lib_p "$dlprefile"; then
func_tr_sh "$dlprefile"
eval "curr_lafile=\$libfile_$func_tr_sh_result"
dlprefile_dlbasename=
if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
# Use subshell, to avoid clobbering current variable values
dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
if test -n "$dlprefile_dlname"; then
func_basename "$dlprefile_dlname"
dlprefile_dlbasename=$func_basename_result
else
# no lafile. user explicitly requested -dlpreopen .
$sharedlib_from_linklib_cmd "$dlprefile"
dlprefile_dlbasename=$sharedlib_from_linklib_result
fi
fi
$opt_dry_run || {
if test -n "$dlprefile_dlbasename"; then
eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
else
func_warning "Could not compute DLL name from $name"
eval '$ECHO ": $name " >> "$nlist"'
fi
func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
$SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
}
else # not an import lib
$opt_dry_run || {
eval '$ECHO ": $name " >> "$nlist"'
func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
}
fi
;;
*)
$opt_dry_run || {
eval '$ECHO ": $name " >> "$nlist"'
func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
}
;;
esac
done
$opt_dry_run || {
# Make sure we have at least an empty file.
test -f "$nlist" || : > "$nlist"
if test -n "$exclude_expsyms"; then
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
$MV "$nlist"T "$nlist"
fi
# Try sorting and uniquifying the output.
if $GREP -v "^: " < "$nlist" |
if sort -k 3 /dev/null 2>&1; then
sort -k 3
else
sort +2
fi |
uniq > "$nlist"S; then
:
else
$GREP -v "^: " < "$nlist" > "$nlist"S
fi
if test -f "$nlist"S; then
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
else
echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
fi
func_show_eval '$RM "${nlist}I"'
if test -n "$global_symbol_to_import"; then
eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
fi
echo >> "$output_objdir/$my_dlsyms" "\
/* The mapping between symbol names and symbols. */
typedef struct {
const char *name;
void *address;
} lt_dlsymlist;
extern LT_DLSYM_CONST lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[];\
"
if test -s "$nlist"I; then
echo >> "$output_objdir/$my_dlsyms" "\
static void lt_syminit(void)
{
LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
for (; symbol->name; ++symbol)
{"
$SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
echo >> "$output_objdir/$my_dlsyms" "\
}
}"
fi
echo >> "$output_objdir/$my_dlsyms" "\
LT_DLSYM_CONST lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[] =
{ {\"$my_originator\", (void *) 0},"
if test -s "$nlist"I; then
echo >> "$output_objdir/$my_dlsyms" "\
{\"@INIT@\", (void *) <_syminit},"
fi
case $need_lib_prefix in
no)
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
;;
*)
eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
;;
esac
echo >> "$output_objdir/$my_dlsyms" "\
{0, (void *) 0}
};
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt_${my_prefix}_LTX_preloaded_symbols;
}
#endif
#ifdef __cplusplus
}
#endif\
"
} # !$opt_dry_run
pic_flag_for_symtable=
case "$compile_command " in
*" -static "*) ;;
*)
case $host in
# compiling the symbol table file with pic_flag works around
# a FreeBSD bug that causes programs to crash when -lm is
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
*-*-hpux*)
pic_flag_for_symtable=" $pic_flag" ;;
*)
$my_pic_p && pic_flag_for_symtable=" $pic_flag"
;;
esac
;;
esac
symtab_cflags=
for arg in $LTCFLAGS; do
case $arg in
-pie | -fpie | -fPIE) ;;
*) func_append symtab_cflags " $arg" ;;
esac
done
# Now compile the dynamic symbol file.
func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
# Clean up the generated files.
func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
# Transform the symbol file into the correct name.
symfileobj=$output_objdir/${my_outputname}S.$objext
case $host in
*cygwin* | *mingw* | *cegcc* )
if test -f "$output_objdir/$my_outputname.def"; then
compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
else
compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
fi
;;
*)
compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
;;
esac
;;
*)
func_fatal_error "unknown suffix for '$my_dlsyms'"
;;
esac
else
# We keep going just in case the user didn't refer to
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
# really was required.
# Nullify the symbol file.
compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
fi
}
# func_cygming_gnu_implib_p ARG
# This predicate returns with zero status (TRUE) if
# ARG is a GNU/binutils-style import library. Returns
# with nonzero status (FALSE) otherwise.
func_cygming_gnu_implib_p ()
{
$debug_cmd
func_to_tool_file "$1" func_convert_file_msys_to_w32
func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
test -n "$func_cygming_gnu_implib_tmp"
}
# func_cygming_ms_implib_p ARG
# This predicate returns with zero status (TRUE) if
# ARG is an MS-style import library. Returns
# with nonzero status (FALSE) otherwise.
func_cygming_ms_implib_p ()
{
$debug_cmd
func_to_tool_file "$1" func_convert_file_msys_to_w32
func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
test -n "$func_cygming_ms_implib_tmp"
}
# func_win32_libid arg
# return the library type of file 'arg'
#
# Need a lot of goo to handle *both* DLLs and import libs
# Has to be a shell function in order to 'eat' the argument
# that is supplied when $file_magic_command is called.
# Despite the name, also deal with 64 bit binaries.
func_win32_libid ()
{
$debug_cmd
win32_libid_type=unknown
win32_fileres=`file -L $1 2>/dev/null`
case $win32_fileres in
*ar\ archive\ import\ library*) # definitely import
win32_libid_type="x86 archive import"
;;
*ar\ archive*) # could be an import, or static
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
case $nm_interface in
"MS dumpbin")
if func_cygming_ms_implib_p "$1" ||
func_cygming_gnu_implib_p "$1"
then
win32_nmres=import
else
win32_nmres=
fi
;;
*)
func_to_tool_file "$1" func_convert_file_msys_to_w32
win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
$SED -n -e '
1,100{
/ I /{
s|.*|import|
p
q
}
}'`
;;
esac
case $win32_nmres in
import*) win32_libid_type="x86 archive import";;
*) win32_libid_type="x86 archive static";;
esac
fi
;;
*DLL*)
win32_libid_type="x86 DLL"
;;
*executable*) # but shell scripts are "executable" too...
case $win32_fileres in
*MS\ Windows\ PE\ Intel*)
win32_libid_type="x86 DLL"
;;
esac
;;
esac
$ECHO "$win32_libid_type"
}
# func_cygming_dll_for_implib ARG
#
# Platform-specific function to extract the
# name of the DLL associated with the specified
# import library ARG.
# Invoked by eval'ing the libtool variable
# $sharedlib_from_linklib_cmd
# Result is available in the variable
# $sharedlib_from_linklib_result
func_cygming_dll_for_implib ()
{
$debug_cmd
sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
}
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
#
# The is the core of a fallback implementation of a
# platform-specific function to extract the name of the
# DLL associated with the specified import library LIBNAME.
#
# SECTION_NAME is either .idata$6 or .idata$7, depending
# on the platform and compiler that created the implib.
#
# Echos the name of the DLL associated with the
# specified import library.
func_cygming_dll_for_implib_fallback_core ()
{
$debug_cmd
match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
$OBJDUMP -s --section "$1" "$2" 2>/dev/null |
$SED '/^Contents of section '"$match_literal"':/{
# Place marker at beginning of archive member dllname section
s/.*/====MARK====/
p
d
}
# These lines can sometimes be longer than 43 characters, but
# are always uninteresting
/:[ ]*file format pe[i]\{,1\}-/d
/^In archive [^:]*:/d
# Ensure marker is printed
/^====MARK====/p
# Remove all lines with less than 43 characters
/^.\{43\}/!d
# From remaining lines, remove first 43 characters
s/^.\{43\}//' |
$SED -n '
# Join marker and all lines until next marker into a single line
/^====MARK====/ b para
H
$ b para
b
:para
x
s/\n//g
# Remove the marker
s/^====MARK====//
# Remove trailing dots and whitespace
s/[\. \t]*$//
# Print
/./p' |
# we now have a list, one entry per line, of the stringified
# contents of the appropriate section of all members of the
# archive that possess that section. Heuristic: eliminate
# all those that have a first or second character that is
# a '.' (that is, objdump's representation of an unprintable
# character.) This should work for all archives with less than
# 0x302f exports -- but will fail for DLLs whose name actually
# begins with a literal '.' or a single character followed by
# a '.'.
#
# Of those that remain, print the first one.
$SED -e '/^\./d;/^.\./d;q'
}
# func_cygming_dll_for_implib_fallback ARG
# Platform-specific function to extract the
# name of the DLL associated with the specified
# import library ARG.
#
# This fallback implementation is for use when $DLLTOOL
# does not support the --identify-strict option.
# Invoked by eval'ing the libtool variable
# $sharedlib_from_linklib_cmd
# Result is available in the variable
# $sharedlib_from_linklib_result
func_cygming_dll_for_implib_fallback ()
{
$debug_cmd
if func_cygming_gnu_implib_p "$1"; then
# binutils import library
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
elif func_cygming_ms_implib_p "$1"; then
# ms-generated import library
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
else
# unknown
sharedlib_from_linklib_result=
fi
}
# func_extract_an_archive dir oldlib
func_extract_an_archive ()
{
$debug_cmd
f_ex_an_ar_dir=$1; shift
f_ex_an_ar_oldlib=$1
if test yes = "$lock_old_archive_extraction"; then
lockfile=$f_ex_an_ar_oldlib.lock
until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
func_echo "Waiting for $lockfile to be removed"
sleep 2
done
fi
func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
'stat=$?; rm -f "$lockfile"; exit $stat'
if test yes = "$lock_old_archive_extraction"; then
$opt_dry_run || rm -f "$lockfile"
fi
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
:
else
func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
fi
}
# func_extract_archives gentop oldlib ...
func_extract_archives ()
{
$debug_cmd
my_gentop=$1; shift
my_oldlibs=${1+"$@"}
my_oldobjs=
my_xlib=
my_xabs=
my_xdir=
for my_xlib in $my_oldlibs; do
# Extract the objects.
case $my_xlib in
[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
func_basename "$my_xlib"
my_xlib=$func_basename_result
my_xlib_u=$my_xlib
while :; do
case " $extracted_archives " in
*" $my_xlib_u "*)
func_arith $extracted_serial + 1
extracted_serial=$func_arith_result
my_xlib_u=lt$extracted_serial-$my_xlib ;;
*) break ;;
esac
done
extracted_archives="$extracted_archives $my_xlib_u"
my_xdir=$my_gentop/$my_xlib_u
func_mkdir_p "$my_xdir"
case $host in
*-darwin*)
func_verbose "Extracting $my_xabs"
# Do not bother doing anything if just a dry run
$opt_dry_run || {
darwin_orig_dir=`pwd`
cd $my_xdir || exit $?
darwin_archive=$my_xabs
darwin_curdir=`pwd`
func_basename "$darwin_archive"
darwin_base_archive=$func_basename_result
darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
if test -n "$darwin_arches"; then
darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
darwin_arch=
func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
for darwin_arch in $darwin_arches; do
func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
$LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
cd "unfat-$$/$darwin_base_archive-$darwin_arch"
func_extract_an_archive "`pwd`" "$darwin_base_archive"
cd "$darwin_curdir"
$RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
done # $darwin_arches
## Okay now we've a bunch of thin objects, gotta fatten them up :)
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
$LIPO -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
$RM -rf unfat-$$
cd "$darwin_orig_dir"
else
cd $darwin_orig_dir
func_extract_an_archive "$my_xdir" "$my_xabs"
fi # $darwin_arches
} # !$opt_dry_run
;;
*)
func_extract_an_archive "$my_xdir" "$my_xabs"
;;
esac
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
done
func_extract_archives_result=$my_oldobjs
}
# func_emit_wrapper [arg=no]
#
# Emit a libtool wrapper script on stdout.
# Don't directly open a file because we may want to
# incorporate the script contents within a cygwin/mingw
# wrapper executable. Must ONLY be called from within
# func_mode_link because it depends on a number of variables
# set therein.
#
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
# variable will take. If 'yes', then the emitted script
# will assume that the directory where it is stored is
# the $objdir directory. This is a cygwin/mingw-specific
# behavior.
func_emit_wrapper ()
{
func_emit_wrapper_arg1=${1-no}
$ECHO "\
#! $SHELL
# $output - temporary wrapper script for $objdir/$outputname
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
#
# The $output program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='$sed_quote_subst'
# Be Bourne compatible
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
relink_command=\"$relink_command\"
# This environment variable determines our operation mode.
if test \"\$libtool_install_magic\" = \"$magic\"; then
# install mode needs the following variables:
generated_by_libtool_version='$macro_version'
notinst_deplibs='$notinst_deplibs'
else
# When we are sourced in execute mode, \$file and \$ECHO are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\""
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
$ECHO "\
# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
\$1
_LTECHO_EOF'
}
ECHO=\"$qECHO\"
fi
# Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper
# /script/ and the wrapper /executable/ that is used only on
# windows platforms, and (c) all begin with the string "--lt-"
# (application programs are unlikely to have options that match
# this pattern).
#
# There are only two supported options: --lt-debug and
# --lt-dump-script. There is, deliberately, no --lt-help.
#
# The first argument to this parsing function should be the
# script's $0 value, followed by "$@".
lt_option_debug=
func_parse_lt_options ()
{
lt_script_arg0=\$0
shift
for lt_opt
do
case \"\$lt_opt\" in
--lt-debug) lt_option_debug=1 ;;
--lt-dump-script)
lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
cat \"\$lt_dump_D/\$lt_dump_F\"
exit 0
;;
--lt-*)
\$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
exit 1
;;
esac
done
# Print the debug banner immediately:
if test -n \"\$lt_option_debug\"; then
echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
fi
}
# Used when --lt-debug. Prints its arguments to stdout
# (redirection is the responsibility of the caller)
func_lt_dump_args ()
{
lt_dump_args_N=1;
for lt_arg
do
\$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
done
}
# Core function for launching the target application
func_exec_program_core ()
{
"
case $host in
# Backslashes separate directories on plain windows
*-*-mingw | *-*-os2* | *-cegcc*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
func_lt_dump_args \${1+\"\$@\"} 1>&2
fi
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
"
;;
*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
func_lt_dump_args \${1+\"\$@\"} 1>&2
fi
exec \"\$progdir/\$program\" \${1+\"\$@\"}
"
;;
esac
$ECHO "\
\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
exit 1
}
# A function to encapsulate launching the target application
# Strips options in the --lt-* namespace from \$@ and
# launches target application with the remaining arguments.
func_exec_program ()
{
case \" \$* \" in
*\\ --lt-*)
for lt_wr_arg
do
case \$lt_wr_arg in
--lt-*) ;;
*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
esac
shift
done ;;
esac
func_exec_program_core \${1+\"\$@\"}
}
# Parse options
func_parse_lt_options \"\$0\" \${1+\"\$@\"}
# Find the directory that this script lives in.
thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
while test -n \"\$file\"; do
destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
# If there was a directory component, then change thisdir.
if test \"x\$destdir\" != \"x\$file\"; then
case \"\$destdir\" in
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
*) thisdir=\"\$thisdir/\$destdir\" ;;
esac
fi
file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
done
# Usually 'no', except on cygwin/mingw when embedded into
# the cwrapper.
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
# special case for '.'
if test \"\$thisdir\" = \".\"; then
thisdir=\`pwd\`
fi
# remove .libs from thisdir
case \"\$thisdir\" in
*[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
$objdir ) thisdir=. ;;
esac
fi
# Try to get the absolute directory name.
absdir=\`cd \"\$thisdir\" && pwd\`
test -n \"\$absdir\" && thisdir=\"\$absdir\"
"
if test yes = "$fast_install"; then
$ECHO "\
program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" ||
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\"
if test ! -d \"\$progdir\"; then
$MKDIR \"\$progdir\"
else
$RM \"\$progdir/\$file\"
fi"
$ECHO "\
# relink executable if necessary
if test -n \"\$relink_command\"; then
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
else
\$ECHO \"\$relink_command_output\" >&2
$RM \"\$progdir/\$file\"
exit 1
fi
fi
$MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
{ $RM \"\$progdir/\$program\";
$MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
$RM \"\$progdir/\$file\"
fi"
else
$ECHO "\
program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
$ECHO "\
if test -f \"\$progdir/\$program\"; then"
# fixup the dll searchpath if we need to.
#
# Fix the DLL searchpath if we need to. Do this before prepending
# to shlibpath, because on Windows, both are PATH and uninstalled
# libraries must come first.
if test -n "$dllsearchpath"; then
$ECHO "\
# Add the dll search path components to the executable PATH
PATH=$dllsearchpath:\$PATH
"
fi
# Export our shlibpath_var if we have one.
if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$ECHO "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
# Some systems cannot cope with colon-terminated $shlibpath_var
# The second colon is a workaround for a bug in BeOS R4 sed
$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
export $shlibpath_var
"
fi
$ECHO "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
func_exec_program \${1+\"\$@\"}
fi
else
# The program doesn't exist.
\$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
\$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
fi
fi\
"
}
# func_emit_cwrapperexe_src
# emit the source code for a wrapper executable on stdout
# Must ONLY be called from within func_mode_link because
# it depends on a number of variable set therein.
func_emit_cwrapperexe_src ()
{
cat <
#include
#ifdef _MSC_VER
# include
# include
# include
#else
# include
# include
# ifdef __CYGWIN__
# include
# endif
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
/* declarations of non-ANSI functions */
#if defined __MINGW32__
# ifdef __STRICT_ANSI__
int _putenv (const char *);
# endif
#elif defined __CYGWIN__
# ifdef __STRICT_ANSI__
char *realpath (const char *, char *);
int putenv (char *);
int setenv (const char *, const char *, int);
# endif
/* #elif defined other_platform || defined ... */
#endif
/* portability defines, excluding path handling macros */
#if defined _MSC_VER
# define setmode _setmode
# define stat _stat
# define chmod _chmod
# define getcwd _getcwd
# define putenv _putenv
# define S_IXUSR _S_IEXEC
#elif defined __MINGW32__
# define setmode _setmode
# define stat _stat
# define chmod _chmod
# define getcwd _getcwd
# define putenv _putenv
#elif defined __CYGWIN__
# define HAVE_SETENV
# define FOPEN_WB "wb"
/* #elif defined other platforms ... */
#endif
#if defined PATH_MAX
# define LT_PATHMAX PATH_MAX
#elif defined MAXPATHLEN
# define LT_PATHMAX MAXPATHLEN
#else
# define LT_PATHMAX 1024
#endif
#ifndef S_IXOTH
# define S_IXOTH 0
#endif
#ifndef S_IXGRP
# define S_IXGRP 0
#endif
/* path handling portability macros */
#ifndef DIR_SEPARATOR
# define DIR_SEPARATOR '/'
# define PATH_SEPARATOR ':'
#endif
#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
defined __OS2__
# define HAVE_DOS_BASED_FILE_SYSTEM
# define FOPEN_WB "wb"
# ifndef DIR_SEPARATOR_2
# define DIR_SEPARATOR_2 '\\'
# endif
# ifndef PATH_SEPARATOR_2
# define PATH_SEPARATOR_2 ';'
# endif
#endif
#ifndef DIR_SEPARATOR_2
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
#else /* DIR_SEPARATOR_2 */
# define IS_DIR_SEPARATOR(ch) \
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */
#ifndef PATH_SEPARATOR_2
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
#else /* PATH_SEPARATOR_2 */
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
#endif /* PATH_SEPARATOR_2 */
#ifndef FOPEN_WB
# define FOPEN_WB "w"
#endif
#ifndef _O_BINARY
# define _O_BINARY 0
#endif
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \
if (stale) { free (stale); stale = 0; } \
} while (0)
#if defined LT_DEBUGWRAPPER
static int lt_debug = 1;
#else
static int lt_debug = 0;
#endif
const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
void *xmalloc (size_t num);
char *xstrdup (const char *string);
const char *base_name (const char *name);
char *find_executable (const char *wrapper);
char *chase_symlinks (const char *pathspec);
int make_executable (const char *path);
int check_executable (const char *path);
char *strendzap (char *str, const char *pat);
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
void lt_fatal (const char *file, int line, const char *message, ...);
static const char *nonnull (const char *s);
static const char *nonempty (const char *s);
void lt_setenv (const char *name, const char *value);
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
void lt_update_exe_path (const char *name, const char *value);
void lt_update_lib_path (const char *name, const char *value);
char **prepare_spawn (char **argv);
void lt_dump_script (FILE *f);
EOF
cat <= 0)
&& (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
return 1;
else
return 0;
}
int
make_executable (const char *path)
{
int rval = 0;
struct stat st;
lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
nonempty (path));
if ((!path) || (!*path))
return 0;
if (stat (path, &st) >= 0)
{
rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
}
return rval;
}
/* Searches for the full path of the wrapper. Returns
newly allocated full path name if found, NULL otherwise
Does not chase symlinks, even on platforms that support them.
*/
char *
find_executable (const char *wrapper)
{
int has_slash = 0;
const char *p;
const char *p_next;
/* static buffer for getcwd */
char tmp[LT_PATHMAX + 1];
size_t tmp_len;
char *concat_name;
lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
nonempty (wrapper));
if ((wrapper == NULL) || (*wrapper == '\0'))
return NULL;
/* Absolute path? */
#if defined HAVE_DOS_BASED_FILE_SYSTEM
if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
{
concat_name = xstrdup (wrapper);
if (check_executable (concat_name))
return concat_name;
XFREE (concat_name);
}
else
{
#endif
if (IS_DIR_SEPARATOR (wrapper[0]))
{
concat_name = xstrdup (wrapper);
if (check_executable (concat_name))
return concat_name;
XFREE (concat_name);
}
#if defined HAVE_DOS_BASED_FILE_SYSTEM
}
#endif
for (p = wrapper; *p; p++)
if (*p == '/')
{
has_slash = 1;
break;
}
if (!has_slash)
{
/* no slashes; search PATH */
const char *path = getenv ("PATH");
if (path != NULL)
{
for (p = path; *p; p = p_next)
{
const char *q;
size_t p_len;
for (q = p; *q; q++)
if (IS_PATH_SEPARATOR (*q))
break;
p_len = (size_t) (q - p);
p_next = (*q == '\0' ? q : q + 1);
if (p_len == 0)
{
/* empty path: current directory */
if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
nonnull (strerror (errno)));
tmp_len = strlen (tmp);
concat_name =
XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
concat_name[tmp_len] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
}
else
{
concat_name =
XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
memcpy (concat_name, p, p_len);
concat_name[p_len] = '/';
strcpy (concat_name + p_len + 1, wrapper);
}
if (check_executable (concat_name))
return concat_name;
XFREE (concat_name);
}
}
/* not found in PATH; assume curdir */
}
/* Relative path | not found in path: prepend cwd */
if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
nonnull (strerror (errno)));
tmp_len = strlen (tmp);
concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
concat_name[tmp_len] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
if (check_executable (concat_name))
return concat_name;
XFREE (concat_name);
return NULL;
}
char *
chase_symlinks (const char *pathspec)
{
#ifndef S_ISLNK
return xstrdup (pathspec);
#else
char buf[LT_PATHMAX];
struct stat s;
char *tmp_pathspec = xstrdup (pathspec);
char *p;
int has_symlinks = 0;
while (strlen (tmp_pathspec) && !has_symlinks)
{
lt_debugprintf (__FILE__, __LINE__,
"checking path component for symlinks: %s\n",
tmp_pathspec);
if (lstat (tmp_pathspec, &s) == 0)
{
if (S_ISLNK (s.st_mode) != 0)
{
has_symlinks = 1;
break;
}
/* search backwards for last DIR_SEPARATOR */
p = tmp_pathspec + strlen (tmp_pathspec) - 1;
while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
p--;
if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
{
/* no more DIR_SEPARATORS left */
break;
}
*p = '\0';
}
else
{
lt_fatal (__FILE__, __LINE__,
"error accessing file \"%s\": %s",
tmp_pathspec, nonnull (strerror (errno)));
}
}
XFREE (tmp_pathspec);
if (!has_symlinks)
{
return xstrdup (pathspec);
}
tmp_pathspec = realpath (pathspec, buf);
if (tmp_pathspec == 0)
{
lt_fatal (__FILE__, __LINE__,
"could not follow symlinks for %s", pathspec);
}
return xstrdup (tmp_pathspec);
#endif
}
char *
strendzap (char *str, const char *pat)
{
size_t len, patlen;
assert (str != NULL);
assert (pat != NULL);
len = strlen (str);
patlen = strlen (pat);
if (patlen <= len)
{
str += len - patlen;
if (STREQ (str, pat))
*str = '\0';
}
return str;
}
void
lt_debugprintf (const char *file, int line, const char *fmt, ...)
{
va_list args;
if (lt_debug)
{
(void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
va_start (args, fmt);
(void) vfprintf (stderr, fmt, args);
va_end (args);
}
}
static void
lt_error_core (int exit_status, const char *file,
int line, const char *mode,
const char *message, va_list ap)
{
fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
vfprintf (stderr, message, ap);
fprintf (stderr, ".\n");
if (exit_status >= 0)
exit (exit_status);
}
void
lt_fatal (const char *file, int line, const char *message, ...)
{
va_list ap;
va_start (ap, message);
lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
va_end (ap);
}
static const char *
nonnull (const char *s)
{
return s ? s : "(null)";
}
static const char *
nonempty (const char *s)
{
return (s && !*s) ? "(empty)" : nonnull (s);
}
void
lt_setenv (const char *name, const char *value)
{
lt_debugprintf (__FILE__, __LINE__,
"(lt_setenv) setting '%s' to '%s'\n",
nonnull (name), nonnull (value));
{
#ifdef HAVE_SETENV
/* always make a copy, for consistency with !HAVE_SETENV */
char *str = xstrdup (value);
setenv (name, str, 1);
#else
size_t len = strlen (name) + 1 + strlen (value) + 1;
char *str = XMALLOC (char, len);
sprintf (str, "%s=%s", name, value);
if (putenv (str) != EXIT_SUCCESS)
{
XFREE (str);
}
#endif
}
}
char *
lt_extend_str (const char *orig_value, const char *add, int to_end)
{
char *new_value;
if (orig_value && *orig_value)
{
size_t orig_value_len = strlen (orig_value);
size_t add_len = strlen (add);
new_value = XMALLOC (char, add_len + orig_value_len + 1);
if (to_end)
{
strcpy (new_value, orig_value);
strcpy (new_value + orig_value_len, add);
}
else
{
strcpy (new_value, add);
strcpy (new_value + add_len, orig_value);
}
}
else
{
new_value = xstrdup (add);
}
return new_value;
}
void
lt_update_exe_path (const char *name, const char *value)
{
lt_debugprintf (__FILE__, __LINE__,
"(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
nonnull (name), nonnull (value));
if (name && *name && value && *value)
{
char *new_value = lt_extend_str (getenv (name), value, 0);
/* some systems can't cope with a ':'-terminated path #' */
size_t len = strlen (new_value);
while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
{
new_value[--len] = '\0';
}
lt_setenv (name, new_value);
XFREE (new_value);
}
}
void
lt_update_lib_path (const char *name, const char *value)
{
lt_debugprintf (__FILE__, __LINE__,
"(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
nonnull (name), nonnull (value));
if (name && *name && value && *value)
{
char *new_value = lt_extend_str (getenv (name), value, 0);
lt_setenv (name, new_value);
XFREE (new_value);
}
}
EOF
case $host_os in
mingw*)
cat <<"EOF"
/* Prepares an argument vector before calling spawn().
Note that spawn() does not by itself call the command interpreter
(getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&v);
v.dwPlatformId == VER_PLATFORM_WIN32_NT;
}) ? "cmd.exe" : "command.com").
Instead it simply concatenates the arguments, separated by ' ', and calls
CreateProcess(). We must quote the arguments since Win32 CreateProcess()
interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
special way:
- Space and tab are interpreted as delimiters. They are not treated as
delimiters if they are surrounded by double quotes: "...".
- Unescaped double quotes are removed from the input. Their only effect is
that within double quotes, space and tab are treated like normal
characters.
- Backslashes not followed by double quotes are not special.
- But 2*n+1 backslashes followed by a double quote become
n backslashes followed by a double quote (n >= 0):
\" -> "
\\\" -> \"
\\\\\" -> \\"
*/
#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
char **
prepare_spawn (char **argv)
{
size_t argc;
char **new_argv;
size_t i;
/* Count number of arguments. */
for (argc = 0; argv[argc] != NULL; argc++)
;
/* Allocate new argument vector. */
new_argv = XMALLOC (char *, argc + 1);
/* Put quoted arguments into the new argument vector. */
for (i = 0; i < argc; i++)
{
const char *string = argv[i];
if (string[0] == '\0')
new_argv[i] = xstrdup ("\"\"");
else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
{
int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
size_t length;
unsigned int backslashes;
const char *s;
char *quoted_string;
char *p;
length = 0;
backslashes = 0;
if (quote_around)
length++;
for (s = string; *s != '\0'; s++)
{
char c = *s;
if (c == '"')
length += backslashes + 1;
length++;
if (c == '\\')
backslashes++;
else
backslashes = 0;
}
if (quote_around)
length += backslashes + 1;
quoted_string = XMALLOC (char, length + 1);
p = quoted_string;
backslashes = 0;
if (quote_around)
*p++ = '"';
for (s = string; *s != '\0'; s++)
{
char c = *s;
if (c == '"')
{
unsigned int j;
for (j = backslashes + 1; j > 0; j--)
*p++ = '\\';
}
*p++ = c;
if (c == '\\')
backslashes++;
else
backslashes = 0;
}
if (quote_around)
{
unsigned int j;
for (j = backslashes; j > 0; j--)
*p++ = '\\';
*p++ = '"';
}
*p = '\0';
new_argv[i] = quoted_string;
}
else
new_argv[i] = (char *) string;
}
new_argv[argc] = NULL;
return new_argv;
}
EOF
;;
esac
cat <<"EOF"
void lt_dump_script (FILE* f)
{
EOF
func_emit_wrapper yes |
$SED -n -e '
s/^\(.\{79\}\)\(..*\)/\1\
\2/
h
s/\([\\"]\)/\\\1/g
s/$/\\n/
s/\([^\n]*\).*/ fputs ("\1", f);/p
g
D'
cat <<"EOF"
}
EOF
}
# end: func_emit_cwrapperexe_src
# func_win32_import_lib_p ARG
# True if ARG is an import lib, as indicated by $file_magic_cmd
func_win32_import_lib_p ()
{
$debug_cmd
case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
*import*) : ;;
*) false ;;
esac
}
# func_suncc_cstd_abi
# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
# Several compiler flags select an ABI that is incompatible with the
# Cstd library. Avoid specifying it if any are in CXXFLAGS.
func_suncc_cstd_abi ()
{
$debug_cmd
case " $compile_command " in
*" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
suncc_use_cstd_abi=no
;;
*)
suncc_use_cstd_abi=yes
;;
esac
}
# func_mode_link arg...
func_mode_link ()
{
$debug_cmd
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# what system we are compiling for in order to pass an extra
# flag for every libtool invocation.
# allow_undefined=no
# FIXME: Unfortunately, there are problems with the above when trying
# to make a dll that has undefined symbols, in which case not
# even a static library is built. For now, we need to specify
# -no-undefined on the libtool link line when we can be certain
# that all symbols are satisfied, otherwise we get a static library.
allow_undefined=yes
;;
*)
allow_undefined=yes
;;
esac
libtool_args=$nonopt
base_compile="$nonopt $@"
compile_command=$nonopt
finalize_command=$nonopt
compile_rpath=
finalize_rpath=
compile_shlibpath=
finalize_shlibpath=
convenience=
old_convenience=
deplibs=
old_deplibs=
compiler_flags=
linker_flags=
dllsearchpath=
lib_search_path=`pwd`
inst_prefix_dir=
new_inherited_linker_flags=
avoid_version=no
bindir=
dlfiles=
dlprefiles=
dlself=no
export_dynamic=no
export_symbols=
export_symbols_regex=
generated=
libobjs=
ltlibs=
module=no
no_install=no
objs=
os2dllname=
non_pic_objects=
precious_files_regex=
prefer_static_libs=no
preload=false
prev=
prevarg=
release=
rpath=
xrpath=
perm_rpath=
temp_rpath=
thread_safe=no
vinfo=
vinfo_number=no
weak_libs=
single_module=$wl-single_module
func_infer_tag $base_compile
# We need to know -static, to get the right output filenames.
for arg
do
case $arg in
-shared)
test yes != "$build_libtool_libs" \
&& func_fatal_configuration "cannot build a shared library"
build_old_libs=no
break
;;
-all-static | -static | -static-libtool-libs)
case $arg in
-all-static)
if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
func_warning "complete static linking is impossible in this configuration"
fi
if test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
;;
-static)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=built
;;
-static-libtool-libs)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
;;
esac
build_libtool_libs=no
build_old_libs=yes
break
;;
esac
done
# See if our shared archives depend on static archives.
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
# Go through the arguments, transforming them on the way.
while test "$#" -gt 0; do
arg=$1
shift
func_quote_for_eval "$arg"
qarg=$func_quote_for_eval_unquoted_result
func_append libtool_args " $func_quote_for_eval_result"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
output)
func_append compile_command " @OUTPUT@"
func_append finalize_command " @OUTPUT@"
;;
esac
case $prev in
bindir)
bindir=$arg
prev=
continue
;;
dlfiles|dlprefiles)
$preload || {
# Add the symbol object into the linking commands.
func_append compile_command " @SYMFILE@"
func_append finalize_command " @SYMFILE@"
preload=:
}
case $arg in
*.la | *.lo) ;; # We handle these cases below.
force)
if test no = "$dlself"; then
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
self)
if test dlprefiles = "$prev"; then
dlself=yes
elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
dlself=yes
else
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
*)
if test dlfiles = "$prev"; then
func_append dlfiles " $arg"
else
func_append dlprefiles " $arg"
fi
prev=
continue
;;
esac
;;
expsyms)
export_symbols=$arg
test -f "$arg" \
|| func_fatal_error "symbol file '$arg' does not exist"
prev=
continue
;;
expsyms_regex)
export_symbols_regex=$arg
prev=
continue
;;
framework)
case $host in
*-*-darwin*)
case "$deplibs " in
*" $qarg.ltframework "*) ;;
*) func_append deplibs " $qarg.ltframework" # this is fixed later
;;
esac
;;
esac
prev=
continue
;;
inst_prefix)
inst_prefix_dir=$arg
prev=
continue
;;
mllvm)
# Clang does not use LLVM to link, so we can simply discard any
# '-mllvm $arg' options when doing the link step.
prev=
continue
;;
objectlist)
if test -f "$arg"; then
save_arg=$arg
moreargs=
for fil in `cat "$save_arg"`
do
# func_append moreargs " $fil"
arg=$fil
# A libtool-controlled object.
# Check to see that this really is a libtool object.
if func_lalib_unsafe_p "$arg"; then
pic_object=
non_pic_object=
# Read the .lo file
func_source "$arg"
if test -z "$pic_object" ||
test -z "$non_pic_object" ||
test none = "$pic_object" &&
test none = "$non_pic_object"; then
func_fatal_error "cannot find name of object for '$arg'"
fi
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
xdir=$func_dirname_result
if test none != "$pic_object"; then
# Prepend the subdirectory the object is found in.
pic_object=$xdir$pic_object
if test dlfiles = "$prev"; then
if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
func_append dlfiles " $pic_object"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
# CHECK ME: I think I busted this. -Ossama
if test dlprefiles = "$prev"; then
# Preload the old-style object.
func_append dlprefiles " $pic_object"
prev=
fi
# A PIC object.
func_append libobjs " $pic_object"
arg=$pic_object
fi
# Non-PIC object.
if test none != "$non_pic_object"; then
# Prepend the subdirectory the object is found in.
non_pic_object=$xdir$non_pic_object
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
if test -z "$pic_object" || test none = "$pic_object"; then
arg=$non_pic_object
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
non_pic_object=$pic_object
func_append non_pic_objects " $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
if $opt_dry_run; then
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
xdir=$func_dirname_result
func_lo2o "$arg"
pic_object=$xdir$objdir/$func_lo2o_result
non_pic_object=$xdir$func_lo2o_result
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
func_fatal_error "'$arg' is not a valid libtool object"
fi
fi
done
else
func_fatal_error "link input file '$arg' does not exist"
fi
arg=$save_arg
prev=
continue
;;
os2dllname)
os2dllname=$arg
prev=
continue
;;
precious_regex)
precious_files_regex=$arg
prev=
continue
;;
release)
release=-$arg
prev=
continue
;;
rpath | xrpath)
# We need an absolute path.
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
esac
if test rpath = "$prev"; then
case "$rpath " in
*" $arg "*) ;;
*) func_append rpath " $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
*) func_append xrpath " $arg" ;;
esac
fi
prev=
continue
;;
shrext)
shrext_cmds=$arg
prev=
continue
;;
weak)
func_append weak_libs " $arg"
prev=
continue
;;
xcclinker)
func_append linker_flags " $qarg"
func_append compiler_flags " $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xcompiler)
func_append compiler_flags " $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xlinker)
func_append linker_flags " $qarg"
func_append compiler_flags " $wl$qarg"
prev=
func_append compile_command " $wl$qarg"
func_append finalize_command " $wl$qarg"
continue
;;
*)
eval "$prev=\"\$arg\""
prev=
continue
;;
esac
fi # test -n "$prev"
prevarg=$arg
case $arg in
-all-static)
if test -n "$link_static_flag"; then
# See comment for -static flag below, for more details.
func_append compile_command " $link_static_flag"
func_append finalize_command " $link_static_flag"
fi
continue
;;
-allow-undefined)
# FIXME: remove this flag sometime in the future.
func_fatal_error "'-allow-undefined' must not be used because it is the default"
;;
-avoid-version)
avoid_version=yes
continue
;;
-bindir)
prev=bindir
continue
;;
-dlopen)
prev=dlfiles
continue
;;
-dlpreopen)
prev=dlprefiles
continue
;;
-export-dynamic)
export_dynamic=yes
continue
;;
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
func_fatal_error "more than one -exported-symbols argument is not allowed"
fi
if test X-export-symbols = "X$arg"; then
prev=expsyms
else
prev=expsyms_regex
fi
continue
;;
-framework)
prev=framework
continue
;;
-inst-prefix-dir)
prev=inst_prefix
continue
;;
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
# so, if we see these flags be careful not to treat them like -L
-L[A-Z][A-Z]*:*)
case $with_gcc/$host in
no/*-*-irix* | /*-*-irix*)
func_append compile_command " $arg"
func_append finalize_command " $arg"
;;
esac
continue
;;
-L*)
func_stripname "-L" '' "$arg"
if test -z "$func_stripname_result"; then
if test "$#" -gt 0; then
func_fatal_error "require no space between '-L' and '$1'"
else
func_fatal_error "need path for '-L' option"
fi
fi
func_resolve_sysroot "$func_stripname_result"
dir=$func_resolve_sysroot_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
absdir=`cd "$dir" && pwd`
test -z "$absdir" && \
func_fatal_error "cannot determine absolute directory name of '$dir'"
dir=$absdir
;;
esac
case "$deplibs " in
*" -L$dir "* | *" $arg "*)
# Will only happen for absolute or sysroot arguments
;;
*)
# Preserve sysroot, but never include relative directories
case $dir in
[\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
*) func_append deplibs " -L$dir" ;;
esac
func_append lib_search_path " $dir"
;;
esac
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$dir:"*) ;;
::) dllsearchpath=$dir;;
*) func_append dllsearchpath ":$dir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
*) func_append dllsearchpath ":$testbindir";;
esac
;;
esac
continue
;;
-l*)
if test X-lc = "X$arg" || test X-lm = "X$arg"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
# These systems don't actually have a C or math library (as such)
continue
;;
*-*-os2*)
# These systems don't actually have a C library (as such)
test X-lc = "X$arg" && continue
;;
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc due to us having libc/libc_r.
test X-lc = "X$arg" && continue
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
func_append deplibs " System.ltframework"
continue
;;
*-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype
test X-lc = "X$arg" && continue
;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work
test X-lc = "X$arg" && continue
;;
esac
elif test X-lc_r = "X$arg"; then
case $host in
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
esac
fi
func_append deplibs " $arg"
continue
;;
-mllvm)
prev=mllvm
continue
;;
-module)
module=yes
continue
;;
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
-model|-arch|-isysroot|--sysroot)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
prev=xcompiler
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
case "$new_inherited_linker_flags " in
*" $arg "*) ;;
* ) func_append new_inherited_linker_flags " $arg" ;;
esac
continue
;;
-multi_module)
single_module=$wl-multi_module
continue
;;
-no-fast-install)
fast_install=no
continue
;;
-no-install)
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
# The PATH hackery in wrapper scripts is required on Windows
# and Darwin in order for the loader to find any dlls it needs.
func_warning "'-no-install' is ignored for $host"
func_warning "assuming '-no-fast-install' instead"
fast_install=no
;;
*) no_install=yes ;;
esac
continue
;;
-no-undefined)
allow_undefined=no
continue
;;
-objectlist)
prev=objectlist
continue
;;
-os2dllname)
prev=os2dllname
continue
;;
-o) prev=output ;;
-precious-files-regex)
prev=precious_regex
continue
;;
-release)
prev=release
continue
;;
-rpath)
prev=rpath
continue
;;
-R)
prev=xrpath
continue
;;
-R*)
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
=*)
func_stripname '=' '' "$dir"
dir=$lt_sysroot$func_stripname_result
;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
esac
case "$xrpath " in
*" $dir "*) ;;
*) func_append xrpath " $dir" ;;
esac
continue
;;
-shared)
# The effects of -shared are defined in a previous loop.
continue
;;
-shrext)
prev=shrext
continue
;;
-static | -static-libtool-libs)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
# would be equivalent was wrong. It would break on at least
# Digital Unix and AIX.
continue
;;
-thread-safe)
thread_safe=yes
continue
;;
-version-info)
prev=vinfo
continue
;;
-version-number)
prev=vinfo
vinfo_number=yes
continue
;;
-weak)
prev=weak
continue
;;
-Wc,*)
func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result
arg=
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $func_quote_for_eval_result"
func_append compiler_flags " $func_quote_for_eval_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
-Wl,*)
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
-Xcompiler)
prev=xcompiler
continue
;;
-Xlinker)
prev=xlinker
continue
;;
-XCClinker)
prev=xcclinker
continue
;;
# -msg_* for osf cc
-msg_*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
;;
# Flags to be passed through unchanged, with rationale:
# -64, -mips[0-9] enable 64-bit mode for the SGI compiler
# -r[0-9][0-9]* specify processor for the SGI compiler
# -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
# +DA*, +DD* enable 64-bit mode for the HP compiler
# -q* compiler args for the IBM compiler
# -m*, -t[45]*, -txscale* architecture-specific flags for GCC
# -F/path path to uninstalled frameworks, gcc on darwin
# -p, -pg, --coverage, -fprofile-* profiling flags for GCC
# -fstack-protector* stack protector flags for GCC
# @file GCC response files
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -stdlib=* select c++ std lib with clang
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
func_append compiler_flags " $arg"
continue
;;
-Z*)
if test os2 = "`expr $host : '.*\(os2\)'`"; then
# OS/2 uses -Zxxx to specify OS/2-specific options
compiler_flags="$compiler_flags $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
case $arg in
-Zlinker | -Zstack)
prev=xcompiler
;;
esac
continue
else
# Otherwise treat like 'Some other compiler flag' below
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
fi
;;
# Some other compiler flag.
-* | +*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
;;
*.$objext)
# A standard object.
func_append objs " $arg"
;;
*.lo)
# A libtool-controlled object.
# Check to see that this really is a libtool object.
if func_lalib_unsafe_p "$arg"; then
pic_object=
non_pic_object=
# Read the .lo file
func_source "$arg"
if test -z "$pic_object" ||
test -z "$non_pic_object" ||
test none = "$pic_object" &&
test none = "$non_pic_object"; then
func_fatal_error "cannot find name of object for '$arg'"
fi
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
xdir=$func_dirname_result
test none = "$pic_object" || {
# Prepend the subdirectory the object is found in.
pic_object=$xdir$pic_object
if test dlfiles = "$prev"; then
if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
func_append dlfiles " $pic_object"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
# CHECK ME: I think I busted this. -Ossama
if test dlprefiles = "$prev"; then
# Preload the old-style object.
func_append dlprefiles " $pic_object"
prev=
fi
# A PIC object.
func_append libobjs " $pic_object"
arg=$pic_object
}
# Non-PIC object.
if test none != "$non_pic_object"; then
# Prepend the subdirectory the object is found in.
non_pic_object=$xdir$non_pic_object
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
if test -z "$pic_object" || test none = "$pic_object"; then
arg=$non_pic_object
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
non_pic_object=$pic_object
func_append non_pic_objects " $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
if $opt_dry_run; then
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
xdir=$func_dirname_result
func_lo2o "$arg"
pic_object=$xdir$objdir/$func_lo2o_result
non_pic_object=$xdir$func_lo2o_result
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
func_fatal_error "'$arg' is not a valid libtool object"
fi
fi
;;
*.$libext)
# An archive.
func_append deplibs " $arg"
func_append old_deplibs " $arg"
continue
;;
*.la)
# A libtool-controlled library.
func_resolve_sysroot "$arg"
if test dlfiles = "$prev"; then
# This library was specified with -dlopen.
func_append dlfiles " $func_resolve_sysroot_result"
prev=
elif test dlprefiles = "$prev"; then
# The library was specified with -dlpreopen.
func_append dlprefiles " $func_resolve_sysroot_result"
prev=
else
func_append deplibs " $func_resolve_sysroot_result"
fi
continue
;;
# Some other compiler argument.
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
;;
esac # arg
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
func_append compile_command " $arg"
func_append finalize_command " $arg"
fi
done # argument parsing loop
test -n "$prev" && \
func_fatal_help "the '$prevarg' option requires an argument"
if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
func_append compile_command " $arg"
func_append finalize_command " $arg"
fi
oldlibs=
# calculate the name of the file, without its directory
func_basename "$output"
outputname=$func_basename_result
libobjs_save=$libobjs
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
else
shlib_search_path=
fi
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
# Definition is injected by LT_CONFIG during libtool generation.
func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
func_dirname "$output" "/" ""
output_objdir=$func_dirname_result$objdir
func_to_tool_file "$output_objdir/"
tool_output_objdir=$func_to_tool_file_result
# Create the object directory.
func_mkdir_p "$output_objdir"
# Determine the type of output
case $output in
"")
func_fatal_help "you must specify an output file"
;;
*.$libext) linkmode=oldlib ;;
*.lo | *.$objext) linkmode=obj ;;
*.la) linkmode=lib ;;
*) linkmode=prog ;; # Anything else should be a program.
esac
specialdeplibs=
libs=
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
if $opt_preserve_dup_deps; then
case "$libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
func_append libs " $deplib"
done
if test lib = "$linkmode"; then
libs="$predeps $libs $compiler_lib_search_path $postdeps"
# Compute libraries that are listed more than once in $predeps
# $postdeps and mark them as special (i.e., whose duplicates are
# not to be eliminated).
pre_post_deps=
if $opt_duplicate_compiler_generated_deps; then
for pre_post_dep in $predeps $postdeps; do
case "$pre_post_deps " in
*" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
esac
func_append pre_post_deps " $pre_post_dep"
done
fi
pre_post_deps=
fi
deplibs=
newdependency_libs=
newlib_search_path=
need_relink=no # whether we're linking any uninstalled libtool libraries
notinst_deplibs= # not-installed libtool libraries
notinst_path= # paths that contain not-installed libtool libraries
case $linkmode in
lib)
passes="conv dlpreopen link"
for file in $dlfiles $dlprefiles; do
case $file in
*.la) ;;
*)
func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
;;
esac
done
;;
prog)
compile_deplibs=
finalize_deplibs=
alldeplibs=false
newdlfiles=
newdlprefiles=
passes="conv scan dlopen dlpreopen link"
;;
*) passes="conv"
;;
esac
for pass in $passes; do
# The preopen pass in lib mode reverses $deplibs; put it back here
# so that -L comes before libs that need it for instance...
if test lib,link = "$linkmode,$pass"; then
## FIXME: Find the place where the list is rebuilt in the wrong
## order, and fix it there properly
tmp_deplibs=
for deplib in $deplibs; do
tmp_deplibs="$deplib $tmp_deplibs"
done
deplibs=$tmp_deplibs
fi
if test lib,link = "$linkmode,$pass" ||
test prog,scan = "$linkmode,$pass"; then
libs=$deplibs
deplibs=
fi
if test prog = "$linkmode"; then
case $pass in
dlopen) libs=$dlfiles ;;
dlpreopen) libs=$dlprefiles ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
if test lib,dlpreopen = "$linkmode,$pass"; then
# Collect and forward deplibs of preopened libtool libs
for lib in $dlprefiles; do
# Ignore non-libtool-libs
dependency_libs=
func_resolve_sysroot "$lib"
case $lib in
*.la) func_source "$func_resolve_sysroot_result" ;;
esac
# Collect preopened libtool deplibs, except any this library
# has declared as weak libs
for deplib in $dependency_libs; do
func_basename "$deplib"
deplib_base=$func_basename_result
case " $weak_libs " in
*" $deplib_base "*) ;;
*) func_append deplibs " $deplib" ;;
esac
done
done
libs=$dlprefiles
fi
if test dlopen = "$pass"; then
# Collect dlpreopened libraries
save_deplibs=$deplibs
deplibs=
fi
for deplib in $libs; do
lib=
found=false
case $deplib in
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
func_append compiler_flags " $deplib"
if test lib = "$linkmode"; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
* ) func_append new_inherited_linker_flags " $deplib" ;;
esac
fi
fi
continue
;;
-l*)
if test lib != "$linkmode" && test prog != "$linkmode"; then
func_warning "'-l' is ignored for archives/objects"
continue
fi
func_stripname '-l' '' "$deplib"
name=$func_stripname_result
if test lib = "$linkmode"; then
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
else
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
fi
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
lib=$searchdir/lib$name$search_ext
if test -f "$lib"; then
if test .la = "$search_ext"; then
found=:
else
found=false
fi
break 2
fi
done
done
if $found; then
# deplib is a libtool library
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
# We need to do some special things here, and not later.
if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $deplib "*)
if func_lalib_p "$lib"; then
library_names=
old_library=
func_source "$lib"
for l in $old_library $library_names; do
ll=$l
done
if test "X$ll" = "X$old_library"; then # only static version available
found=false
func_dirname "$lib" "" "."
ladir=$func_dirname_result
lib=$ladir/$old_library
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
fi
;;
*) ;;
esac
fi
else
# deplib doesn't seem to be a libtool library
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
;; # -l
*.ltframework)
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
if test lib = "$linkmode"; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
* ) func_append new_inherited_linker_flags " $deplib" ;;
esac
fi
fi
continue
;;
-L*)
case $linkmode in
lib)
deplibs="$deplib $deplibs"
test conv = "$pass" && continue
newdependency_libs="$deplib $newdependency_libs"
func_stripname '-L' '' "$deplib"
func_resolve_sysroot "$func_stripname_result"
func_append newlib_search_path " $func_resolve_sysroot_result"
;;
prog)
if test conv = "$pass"; then
deplibs="$deplib $deplibs"
continue
fi
if test scan = "$pass"; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
func_stripname '-L' '' "$deplib"
func_resolve_sysroot "$func_stripname_result"
func_append newlib_search_path " $func_resolve_sysroot_result"
;;
*)
func_warning "'-L' is ignored for archives/objects"
;;
esac # linkmode
continue
;; # -L
-R*)
if test link = "$pass"; then
func_stripname '-R' '' "$deplib"
func_resolve_sysroot "$func_stripname_result"
dir=$func_resolve_sysroot_result
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
*) func_append xrpath " $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
*.la)
func_resolve_sysroot "$deplib"
lib=$func_resolve_sysroot_result
;;
*.$libext)
if test conv = "$pass"; then
deplibs="$deplib $deplibs"
continue
fi
case $linkmode in
lib)
# Linking convenience modules into shared libraries is allowed,
# but linking other static libraries is non-portable.
case " $dlpreconveniencelibs " in
*" $deplib "*) ;;
*)
valid_a_lib=false
case $deplibs_check_method in
match_pattern*)
set dummy $deplibs_check_method; shift
match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
valid_a_lib=:
fi
;;
pass_all)
valid_a_lib=:
;;
esac
if $valid_a_lib; then
echo
$ECHO "*** Warning: Linking the shared library $output against the"
$ECHO "*** static library $deplib is not portable!"
deplibs="$deplib $deplibs"
else
echo
$ECHO "*** Warning: Trying to link with static lib archive $deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because the file extensions .$libext of this argument makes me believe"
echo "*** that it is just a static archive that I should not use here."
fi
;;
esac
continue
;;
prog)
if test link != "$pass"; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
continue
;;
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
if test conv = "$pass"; then
deplibs="$deplib $deplibs"
elif test prog = "$linkmode"; then
if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
func_append newdlprefiles " $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
func_append newdlfiles " $deplib"
fi
fi
continue
;;
%DEPLIBS%)
alldeplibs=:
continue
;;
esac # case $deplib
$found || test -f "$lib" \
|| func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$lib" \
|| func_fatal_error "'$lib' is not a valid libtool archive"
func_dirname "$lib" "" "."
ladir=$func_dirname_result
dlname=
dlopen=
dlpreopen=
libdir=
library_names=
old_library=
inherited_linker_flags=
# If the library was installed with an old release of libtool,
# it will not redefine variables installed, or shouldnotlink
installed=yes
shouldnotlink=no
avoidtemprpath=
# Read the .la file
func_source "$lib"
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
*) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
esac
done
fi
dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
if test lib,link = "$linkmode,$pass" ||
test prog,scan = "$linkmode,$pass" ||
{ test prog != "$linkmode" && test lib != "$linkmode"; }; then
test -n "$dlopen" && func_append dlfiles " $dlopen"
test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
fi
if test conv = "$pass"; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
if test -z "$old_library"; then
func_fatal_error "cannot find name of link library for '$lib'"
fi
# It is a libtool convenience library, so add in its objects.
func_append convenience " $ladir/$objdir/$old_library"
func_append old_convenience " $ladir/$objdir/$old_library"
elif test prog != "$linkmode" && test lib != "$linkmode"; then
func_fatal_error "'$lib' is not a convenience library"
fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
func_append tmp_libs " $deplib"
done
continue
fi # $pass = conv
# Get the name of the library we link against.
linklib=
if test -n "$old_library" &&
{ test yes = "$prefer_static_libs" ||
test built,no = "$prefer_static_libs,$installed"; }; then
linklib=$old_library
else
for l in $old_library $library_names; do
linklib=$l
done
fi
if test -z "$linklib"; then
func_fatal_error "cannot find name of link library for '$lib'"
fi
# This library was specified with -dlopen.
if test dlopen = "$pass"; then
test -z "$libdir" \
&& func_fatal_error "cannot -dlopen a convenience library: '$lib'"
if test -z "$dlname" ||
test yes != "$dlopen_support" ||
test no = "$build_libtool_libs"
then
# If there is no dlname, no dlopen support or we're linking
# statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't
# bomb out in the load deplibs phase.
func_append dlprefiles " $lib $dependency_libs"
else
func_append newdlfiles " $lib"
fi
continue
fi # $pass = dlopen
# We need an absolute path.
case $ladir in
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
func_warning "cannot determine absolute directory name of '$ladir'"
func_warning "passing it literally to the linker, although it might fail"
abs_ladir=$ladir
fi
;;
esac
func_basename "$lib"
laname=$func_basename_result
# Find the relevant object directory and library name.
if test yes = "$installed"; then
if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
func_warning "library '$lib' was moved."
dir=$ladir
absdir=$abs_ladir
libdir=$abs_ladir
else
dir=$lt_sysroot$libdir
absdir=$lt_sysroot$libdir
fi
test yes = "$hardcode_automatic" && avoidtemprpath=yes
else
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
dir=$ladir
absdir=$abs_ladir
# Remove this search path later
func_append notinst_path " $abs_ladir"
else
dir=$ladir/$objdir
absdir=$abs_ladir/$objdir
# Remove this search path later
func_append notinst_path " $abs_ladir"
fi
fi # $installed = yes
func_stripname 'lib' '.la' "$laname"
name=$func_stripname_result
# This library was specified with -dlpreopen.
if test dlpreopen = "$pass"; then
if test -z "$libdir" && test prog = "$linkmode"; then
func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
fi
case $host in
# special handling for platforms with PE-DLLs.
*cygwin* | *mingw* | *cegcc* )
# Linker will automatically link against shared library if both
# static and shared are present. Therefore, ensure we extract
# symbols from the import library if a shared library is present
# (otherwise, the dlopen module name will be incorrect). We do
# this by putting the import library name into $newdlprefiles.
# We recover the dlopen module name by 'saving' the la file
# name in a special purpose variable, and (later) extracting the
# dlname from the la file.
if test -n "$dlname"; then
func_tr_sh "$dir/$linklib"
eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
func_append newdlprefiles " $dir/$linklib"
else
func_append newdlprefiles " $dir/$old_library"
# Keep a list of preopened convenience libraries to check
# that they are being used correctly in the link pass.
test -z "$libdir" && \
func_append dlpreconveniencelibs " $dir/$old_library"
fi
;;
* )
# Prefer using a static library (so that no silly _DYNAMIC symbols
# are required to link).
if test -n "$old_library"; then
func_append newdlprefiles " $dir/$old_library"
# Keep a list of preopened convenience libraries to check
# that they are being used correctly in the link pass.
test -z "$libdir" && \
func_append dlpreconveniencelibs " $dir/$old_library"
# Otherwise, use the dlname, so that lt_dlopen finds it.
elif test -n "$dlname"; then
func_append newdlprefiles " $dir/$dlname"
else
func_append newdlprefiles " $dir/$linklib"
fi
;;
esac
fi # $pass = dlpreopen
if test -z "$libdir"; then
# Link the convenience library
if test lib = "$linkmode"; then
deplibs="$dir/$old_library $deplibs"
elif test prog,link = "$linkmode,$pass"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
deplibs="$lib $deplibs" # used for prog,scan pass
fi
continue
fi
if test prog = "$linkmode" && test link != "$pass"; then
func_append newlib_search_path " $ladir"
deplibs="$lib $deplibs"
linkalldeplibs=false
if test no != "$link_all_deplibs" || test -z "$library_names" ||
test no = "$build_libtool_libs"; then
linkalldeplibs=:
fi
tmp_libs=
for deplib in $dependency_libs; do
case $deplib in
-L*) func_stripname '-L' '' "$deplib"
func_resolve_sysroot "$func_stripname_result"
func_append newlib_search_path " $func_resolve_sysroot_result"
;;
esac
# Need to link against all dependency_libs?
if $linkalldeplibs; then
deplibs="$deplib $deplibs"
else
# Need to hardcode shared library paths
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
func_append tmp_libs " $deplib"
done # for deplib
continue
fi # $linkmode = prog...
if test prog,link = "$linkmode,$pass"; then
if test -n "$library_names" &&
{ { test no = "$prefer_static_libs" ||
test built,yes = "$prefer_static_libs,$installed"; } ||
test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
# Make sure the rpath contains only unique directories.
case $temp_rpath: in
*"$absdir:"*) ;;
*) func_append temp_rpath "$absdir:" ;;
esac
fi
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) func_append compile_rpath " $absdir" ;;
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) func_append finalize_rpath " $libdir" ;;
esac
;;
esac
fi # $linkmode,$pass = prog,link...
if $alldeplibs &&
{ test pass_all = "$deplibs_check_method" ||
{ test yes = "$build_libtool_libs" &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
fi
fi
link_static=no # Whether the deplib will be linked statically
use_static_libs=$prefer_static_libs
if test built = "$use_static_libs" && test yes = "$installed"; then
use_static_libs=no
fi
if test -n "$library_names" &&
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
case $host in
*cygwin* | *mingw* | *cegcc* | *os2*)
# No point in relinking DLLs because paths are not encoded
func_append notinst_deplibs " $lib"
need_relink=no
;;
*)
if test no = "$installed"; then
func_append notinst_deplibs " $lib"
need_relink=yes
fi
;;
esac
# This is a shared library
# Warn about portability, can't link against -module's on some
# systems (darwin). Don't bleat about dlopened modules though!
dlopenmodule=
for dlpremoduletest in $dlprefiles; do
if test "X$dlpremoduletest" = "X$lib"; then
dlopenmodule=$dlpremoduletest
break
fi
done
if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
echo
if test prog = "$linkmode"; then
$ECHO "*** Warning: Linking the executable $output against the loadable module"
else
$ECHO "*** Warning: Linking the shared library $output against the loadable module"
fi
$ECHO "*** $linklib is not portable!"
fi
if test lib = "$linkmode" &&
test yes = "$hardcode_into_libs"; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) func_append compile_rpath " $absdir" ;;
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) func_append finalize_rpath " $libdir" ;;
esac
;;
esac
fi
if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname
set dummy $library_names
shift
realname=$1
shift
libname=`eval "\\$ECHO \"$libname_spec\""`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
soname=$dlname
elif test -n "$soname_spec"; then
# bleh windows
case $host in
*cygwin* | mingw* | *cegcc* | *os2*)
func_arith $current - $age
major=$func_arith_result
versuffix=-$major
;;
esac
eval soname=\"$soname_spec\"
else
soname=$realname
fi
# Make a new name for the extract_expsyms_cmds to use
soroot=$soname
func_basename "$soroot"
soname=$func_basename_result
func_stripname 'lib' '.dll' "$soname"
newlib=libimp-$func_stripname_result.a
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
else
func_verbose "extracting exported symbol list from '$soname'"
func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
fi
# Create $newlib
if test -f "$output_objdir/$newlib"; then :; else
func_verbose "generating import library for '$soname'"
func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
fi
# make sure the library variables are pointing to the new library
dir=$output_objdir
linklib=$newlib
fi # test -n "$old_archive_from_expsyms_cmds"
if test prog = "$linkmode" || test relink != "$opt_mode"; then
add_shlibpath=
add_dir=
add=
lib_linked=yes
case $hardcode_action in
immediate | unsupported)
if test no = "$hardcode_direct"; then
add=$dir/$linklib
case $host in
*-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
*-*-sysv4*uw2*) add_dir=-L$dir ;;
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
*-*-unixware7*) add_dir=-L$dir ;;
*-*-darwin* )
# if the lib is a (non-dlopened) module then we cannot
# link against it, someone is ignoring the earlier warnings
if /usr/bin/file -L $add 2> /dev/null |
$GREP ": [^:]* bundle" >/dev/null; then
if test "X$dlopenmodule" != "X$lib"; then
$ECHO "*** Warning: lib $linklib is a module, not a shared library"
if test -z "$old_library"; then
echo
echo "*** And there doesn't seem to be a static archive available"
echo "*** The link will probably fail, sorry"
else
add=$dir/$old_library
fi
elif test -n "$old_library"; then
add=$dir/$old_library
fi
fi
esac
elif test no = "$hardcode_minus_L"; then
case $host in
*-*-sunos*) add_shlibpath=$dir ;;
esac
add_dir=-L$dir
add=-l$name
elif test no = "$hardcode_shlibpath_var"; then
add_shlibpath=$dir
add=-l$name
else
lib_linked=no
fi
;;
relink)
if test yes = "$hardcode_direct" &&
test no = "$hardcode_direct_absolute"; then
add=$dir/$linklib
elif test yes = "$hardcode_minus_L"; then
add_dir=-L$absdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
func_append add_dir " -L$inst_prefix_dir$libdir"
;;
esac
fi
add=-l$name
elif test yes = "$hardcode_shlibpath_var"; then
add_shlibpath=$dir
add=-l$name
else
lib_linked=no
fi
;;
*) lib_linked=no ;;
esac
if test yes != "$lib_linked"; then
func_fatal_configuration "unsupported hardcode properties"
fi
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
*) func_append compile_shlibpath "$add_shlibpath:" ;;
esac
fi
if test prog = "$linkmode"; then
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
test -n "$add" && compile_deplibs="$add $compile_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
if test yes != "$hardcode_direct" &&
test yes != "$hardcode_minus_L" &&
test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) func_append finalize_shlibpath "$libdir:" ;;
esac
fi
fi
fi
if test prog = "$linkmode" || test relink = "$opt_mode"; then
add_shlibpath=
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
if test yes = "$hardcode_direct" &&
test no = "$hardcode_direct_absolute"; then
add=$libdir/$linklib
elif test yes = "$hardcode_minus_L"; then
add_dir=-L$libdir
add=-l$name
elif test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) func_append finalize_shlibpath "$libdir:" ;;
esac
add=-l$name
elif test yes = "$hardcode_automatic"; then
if test -n "$inst_prefix_dir" &&
test -f "$inst_prefix_dir$libdir/$linklib"; then
add=$inst_prefix_dir$libdir/$linklib
else
add=$libdir/$linklib
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
add_dir=-L$libdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
func_append add_dir " -L$inst_prefix_dir$libdir"
;;
esac
fi
add=-l$name
fi
if test prog = "$linkmode"; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
fi
fi
elif test prog = "$linkmode"; then
# Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and
# shared platforms.
if test unsupported != "$hardcode_direct"; then
test -n "$old_library" && linklib=$old_library
compile_deplibs="$dir/$linklib $compile_deplibs"
finalize_deplibs="$dir/$linklib $finalize_deplibs"
else
compile_deplibs="-l$name -L$dir $compile_deplibs"
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
fi
elif test yes = "$build_libtool_libs"; then
# Not a shared library
if test pass_all != "$deplibs_check_method"; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
echo
$ECHO "*** Warning: This system cannot link to static lib archive $lib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have."
if test yes = "$module"; then
echo "*** But as you try to build a module library, libtool will still create "
echo "*** a static module, that should work as long as the dlopening application"
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
echo
echo "*** However, this would only work if libtool was able to extract symbol"
echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless."
echo "*** 'nm' from GNU binutils and a full rebuild may help."
fi
if test no = "$build_old_libs"; then
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
else
deplibs="$dir/$old_library $deplibs"
link_static=yes
fi
fi # link shared/static library?
if test lib = "$linkmode"; then
if test -n "$dependency_libs" &&
{ test yes != "$hardcode_into_libs" ||
test yes = "$build_old_libs" ||
test yes = "$link_static"; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
case $libdir in
-R*) func_stripname '-R' '' "$libdir"
temp_xrpath=$func_stripname_result
case " $xrpath " in
*" $temp_xrpath "*) ;;
*) func_append xrpath " $temp_xrpath";;
esac;;
*) func_append temp_deplibs " $libdir";;
esac
done
dependency_libs=$temp_deplibs
fi
func_append newlib_search_path " $absdir"
# Link against this library
test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
case $deplib in
-L*) func_stripname '-L' '' "$deplib"
func_resolve_sysroot "$func_stripname_result";;
*) func_resolve_sysroot "$deplib" ;;
esac
if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $func_resolve_sysroot_result "*)
func_append specialdeplibs " $func_resolve_sysroot_result" ;;
esac
fi
func_append tmp_libs " $func_resolve_sysroot_result"
done
if test no != "$link_all_deplibs"; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
path=
case $deplib in
-L*) path=$deplib ;;
*.la)
func_resolve_sysroot "$deplib"
deplib=$func_resolve_sysroot_result
func_dirname "$deplib" "" "."
dir=$func_dirname_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
func_warning "cannot determine absolute directory name of '$dir'"
absdir=$dir
fi
;;
esac
if $GREP "^installed=no" $deplib > /dev/null; then
case $host in
*-*-darwin*)
depdepl=
eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names"; then
for tmp in $deplibrary_names; do
depdepl=$tmp
done
if test -f "$absdir/$objdir/$depdepl"; then
depdepl=$absdir/$objdir/$depdepl
darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
if test -z "$darwin_install_name"; then
darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
fi
func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
path=
fi
fi
;;
*)
path=-L$absdir/$objdir
;;
esac
else
eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
test -z "$libdir" && \
func_fatal_error "'$deplib' is not a valid libtool archive"
test "$absdir" != "$libdir" && \
func_warning "'$deplib' seems to be moved"
path=-L$absdir
fi
;;
esac
case " $deplibs " in
*" $path "*) ;;
*) deplibs="$path $deplibs" ;;
esac
done
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
if test link = "$pass"; then
if test prog = "$linkmode"; then
compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
else
compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
fi
fi
dependency_libs=$newdependency_libs
if test dlpreopen = "$pass"; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
if test dlopen != "$pass"; then
test conv = "$pass" || {
# Make sure lib_search_path contains only unique directories.
lib_search_path=
for dir in $newlib_search_path; do
case "$lib_search_path " in
*" $dir "*) ;;
*) func_append lib_search_path " $dir" ;;
esac
done
newlib_search_path=
}
if test prog,link = "$linkmode,$pass"; then
vars="compile_deplibs finalize_deplibs"
else
vars=deplibs
fi
for var in $vars dependency_libs; do
# Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
for deplib in $tmp_libs; do
# FIXME: Pedantically, this is the right thing to do, so
# that some nasty dependency loop isn't accidentally
# broken:
#new_libs="$deplib $new_libs"
# Pragmatically, this seems to cause very few problems in
# practice:
case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
-R*) ;;
*)
# And here is the reason: when a library appears more
# than once as an explicit dependence of a library, or
# is implicitly linked in more than once by the
# compiler, it is considered special, and multiple
# occurrences thereof are not removed. Compare this
# with having the same library being listed as a
# dependency of multiple other libraries: in this case,
# we know (pedantically, we assume) the library does not
# need to be listed more than once, so we keep only the
# last copy. This is not always right, but it is rare
# enough that we require users that really mean to play
# such unportable linking tricks to link the library
# using -Wl,-lname, so that libtool does not consider it
# for duplicate removal.
case " $specialdeplibs " in
*" $deplib "*) new_libs="$deplib $new_libs" ;;
*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$deplib $new_libs" ;;
esac
;;
esac
;;
esac
done
tmp_libs=
for deplib in $new_libs; do
case $deplib in
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
*) func_append tmp_libs " $deplib" ;;
esac
;;
*) func_append tmp_libs " $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
done # for var
fi
# Add Sun CC postdeps if required:
test CXX = "$tagname" && {
case $host_os in
linux*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C++ 5.9
func_suncc_cstd_abi
if test no != "$suncc_use_cstd_abi"; then
func_append postdeps ' -library=Cstd -library=Crun'
fi
;;
esac
;;
solaris*)
func_cc_basename "$CC"
case $func_cc_basename_result in
CC* | sunCC*)
func_suncc_cstd_abi
if test no != "$suncc_use_cstd_abi"; then
func_append postdeps ' -library=Cstd -library=Crun'
fi
;;
esac
;;
esac
}
# Last step: remove runtime libs from dependency_libs
# (they stay in deplibs)
tmp_libs=
for i in $dependency_libs; do
case " $predeps $postdeps $compiler_lib_search_path " in
*" $i "*)
i=
;;
esac
if test -n "$i"; then
func_append tmp_libs " $i"
fi
done
dependency_libs=$tmp_libs
done # for pass
if test prog = "$linkmode"; then
dlfiles=$newdlfiles
fi
if test prog = "$linkmode" || test lib = "$linkmode"; then
dlprefiles=$newdlprefiles
fi
case $linkmode in
oldlib)
if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
func_warning "'-dlopen' is ignored for archives"
fi
case " $deplibs" in
*\ -l* | *\ -L*)
func_warning "'-l' and '-L' are ignored for archives" ;;
esac
test -n "$rpath" && \
func_warning "'-rpath' is ignored for archives"
test -n "$xrpath" && \
func_warning "'-R' is ignored for archives"
test -n "$vinfo" && \
func_warning "'-version-info/-version-number' is ignored for archives"
test -n "$release" && \
func_warning "'-release' is ignored for archives"
test -n "$export_symbols$export_symbols_regex" && \
func_warning "'-export-symbols' is ignored for archives"
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs=$output
func_append objs "$old_deplibs"
;;
lib)
# Make sure we only generate libraries of the form 'libNAME.la'.
case $outputname in
lib*)
func_stripname 'lib' '.la' "$outputname"
name=$func_stripname_result
eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\"
;;
*)
test no = "$module" \
&& func_fatal_help "libtool library '$output' must begin with 'lib'"
if test no != "$need_lib_prefix"; then
# Add the "lib" prefix for modules if required
func_stripname '' '.la' "$outputname"
name=$func_stripname_result
eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\"
else
func_stripname '' '.la' "$outputname"
libname=$func_stripname_result
fi
;;
esac
if test -n "$objs"; then
if test pass_all != "$deplibs_check_method"; then
func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
else
echo
$ECHO "*** Warning: Linking the shared library $output against the non-libtool"
$ECHO "*** objects $objs is not portable!"
func_append libobjs " $objs"
fi
fi
test no = "$dlself" \
|| func_warning "'-dlopen self' is ignored for libtool libraries"
set dummy $rpath
shift
test 1 -lt "$#" \
&& func_warning "ignoring multiple '-rpath's for a libtool library"
install_libdir=$1
oldlibs=
if test -z "$rpath"; then
if test yes = "$build_libtool_libs"; then
# Building a libtool convenience library.
# Some compilers have problems with a '.al' extension so
# convenience libraries should have the same extension an
# archive normally would.
oldlibs="$output_objdir/$libname.$libext $oldlibs"
build_libtool_libs=convenience
build_old_libs=yes
fi
test -n "$vinfo" && \
func_warning "'-version-info/-version-number' is ignored for convenience libraries"
test -n "$release" && \
func_warning "'-release' is ignored for convenience libraries"
else
# Parse the version information argument.
save_ifs=$IFS; IFS=:
set dummy $vinfo 0 0 0
shift
IFS=$save_ifs
test -n "$7" && \
func_fatal_help "too many parameters to '-version-info'"
# convert absolute version numbers to libtool ages
# this retains compatibility with .la files and attempts
# to make the code below a bit more comprehensible
case $vinfo_number in
yes)
number_major=$1
number_minor=$2
number_revision=$3
#
# There are really only two kinds -- those that
# use the current revision as the major version
# and those that subtract age and use age as
# a minor version. But, then there is irix
# that has an extra 1 added just for fun
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
darwin|freebsd-elf|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
age=$number_minor
revision=$number_revision
;;
freebsd-aout|qnx|sunos)
current=$number_major
revision=$number_minor
age=0
;;
irix|nonstopux)
func_arith $number_major + $number_minor
current=$func_arith_result
age=$number_minor
revision=$number_minor
lt_irix_increment=no
;;
esac
;;
no)
current=$1
revision=$2
age=$3
;;
esac
# Check that each of the things are valid numbers.
case $current in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "CURRENT '$current' must be a nonnegative integer"
func_fatal_error "'$vinfo' is not valid version information"
;;
esac
case $revision in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "REVISION '$revision' must be a nonnegative integer"
func_fatal_error "'$vinfo' is not valid version information"
;;
esac
case $age in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "AGE '$age' must be a nonnegative integer"
func_fatal_error "'$vinfo' is not valid version information"
;;
esac
if test "$age" -gt "$current"; then
func_error "AGE '$age' is greater than the current interface number '$current'"
func_fatal_error "'$vinfo' is not valid version information"
fi
# Calculate the version variables.
major=
versuffix=
verstring=
case $version_type in
none) ;;
darwin)
# Like Linux, but with the current version available in
# verstring for coding it into the library header
func_arith $current - $age
major=.$func_arith_result
versuffix=$major.$age.$revision
# Darwin ld doesn't like 0 for these options...
func_arith $current + 1
minor_current=$func_arith_result
xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
# On Darwin other compilers
case $CC in
nagfor*)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
*)
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
esac
;;
freebsd-aout)
major=.$current
versuffix=.$current.$revision
;;
freebsd-elf)
func_arith $current - $age
major=.$func_arith_result
versuffix=$major.$age.$revision
;;
irix | nonstopux)
if test no = "$lt_irix_increment"; then
func_arith $current - $age
else
func_arith $current - $age + 1
fi
major=$func_arith_result
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
esac
verstring=$verstring_prefix$major.$revision
# Add in all the interfaces that we are compatible with.
loop=$revision
while test 0 -ne "$loop"; do
func_arith $revision - $loop
iface=$func_arith_result
func_arith $loop - 1
loop=$func_arith_result
verstring=$verstring_prefix$major.$iface:$verstring
done
# Before this point, $major must not contain '.'.
major=.$major
versuffix=$major.$revision
;;
linux) # correct to gnu/linux during the next big refactor
func_arith $current - $age
major=.$func_arith_result
versuffix=$major.$age.$revision
;;
osf)
func_arith $current - $age
major=.$func_arith_result
versuffix=.$current.$age.$revision
verstring=$current.$age.$revision
# Add in all the interfaces that we are compatible with.
loop=$age
while test 0 -ne "$loop"; do
func_arith $current - $loop
iface=$func_arith_result
func_arith $loop - 1
loop=$func_arith_result
verstring=$verstring:$iface.0
done
# Make executables depend on our current version.
func_append verstring ":$current.0"
;;
qnx)
major=.$current
versuffix=.$current
;;
sco)
major=.$current
versuffix=.$current
;;
sunos)
major=.$current
versuffix=.$current.$revision
;;
windows)
# Use '-' rather than '.', since we only want one
# extension on DOS 8.3 file systems.
func_arith $current - $age
major=$func_arith_result
versuffix=-$major
;;
*)
func_fatal_configuration "unknown library version type '$version_type'"
;;
esac
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
case $version_type in
darwin)
# we can't check for "0.0" in archive_cmds due to quoting
# problems, so we reset it completely
verstring=
;;
*)
verstring=0.0
;;
esac
if test no = "$need_version"; then
versuffix=
else
versuffix=.0.0
fi
fi
# Remove version info from name if versioning should be avoided
if test yes,no = "$avoid_version,$need_version"; then
major=
versuffix=
verstring=
fi
# Check to see if the archive will have undefined symbols.
if test yes = "$allow_undefined"; then
if test unsupported = "$allow_undefined_flag"; then
if test yes = "$build_old_libs"; then
func_warning "undefined symbols not allowed in $host shared libraries; building static only"
build_libtool_libs=no
else
func_fatal_error "can't build $host shared library unless -no-undefined is specified"
fi
fi
else
# Don't allow undefined symbols.
allow_undefined_flag=$no_undefined_flag
fi
fi
func_generate_dlsyms "$libname" "$libname" :
func_append libobjs " $symfileobj"
test " " = "$libobjs" && libobjs=
if test relink != "$opt_mode"; then
# Remove our outputs, but don't remove object files since they
# may have been created when compiling PIC objects.
removelist=
tempremovelist=`$ECHO "$output_objdir/*"`
for p in $tempremovelist; do
case $p in
*.$objext | *.gcno)
;;
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
if test -n "$precious_files_regex"; then
if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
then
continue
fi
fi
func_append removelist " $p"
;;
*) ;;
esac
done
test -n "$removelist" && \
func_show_eval "${RM}r \$removelist"
fi
# Now set the variables for building old libraries.
if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
func_append oldlibs " $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
#for path in $notinst_path; do
# lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
# deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
# dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
#done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
func_replace_sysroot "$libdir"
func_append temp_xrpath " -R$func_replace_sysroot_result"
case "$finalize_rpath " in
*" $libdir "*) ;;
*) func_append finalize_rpath " $libdir" ;;
esac
done
if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
dependency_libs="$temp_xrpath $dependency_libs"
fi
fi
# Make sure dlfiles contains only unique files that won't be dlpreopened
old_dlfiles=$dlfiles
dlfiles=
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
*) func_append dlfiles " $lib" ;;
esac
done
# Make sure dlprefiles contains only unique files
old_dlprefiles=$dlprefiles
dlprefiles=
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
*) func_append dlprefiles " $lib" ;;
esac
done
if test yes = "$build_libtool_libs"; then
if test -n "$rpath"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
func_append deplibs " System.ltframework"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc due to us having libc/libc_r.
;;
*-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype
;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work
;;
*)
# Add libc to deplibs on all other systems if necessary.
if test yes = "$build_libtool_need_lc"; then
func_append deplibs " -lc"
fi
;;
esac
fi
# Transform deplibs into only deplibs that can be linked in shared.
name_save=$name
libname_save=$libname
release_save=$release
versuffix_save=$versuffix
major_save=$major
# I'm not sure if I'm treating the release correctly. I think
# release should show up in the -l (ie -lgmp5) so we don't want to
# add it in twice. Is that correct?
release=
versuffix=
major=
newdeplibs=
droppeddeps=no
case $deplibs_check_method in
pass_all)
# Don't check for shared/static. Everything works.
# This might be a little naive. We might want to check
# whether the library exists or not. But this is on
# osf3 & osf4 and I'm not really sure... Just
# implementing what was already the behavior.
newdeplibs=$deplibs
;;
test_compile)
# This code stresses the "libraries are programs" paradigm to its
# limits. Maybe even breaks it. We compile a program, linking it
# against the deplibs as a proxy for the library. Then we can check
# whether they linked in statically or dynamically with ldd.
$opt_dry_run || $RM conftest.c
cat > conftest.c </dev/null`
$nocaseglob
else
potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
fi
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null |
$GREP " -> " >/dev/null; then
continue
fi
# The statement above tries to avoid entering an
# endless loop below, in case of cyclic links.
# We might still enter an endless loop, since a link
# loop can be closed while we follow links,
# but so what?
potlib=$potent_lib
while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
$SED -e 10q |
$EGREP "$file_magic_regex" > /dev/null; then
func_append newdeplibs " $a_deplib"
a_deplib=
break 2
fi
done
done
fi
if test -n "$a_deplib"; then
droppeddeps=yes
echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib"; then
$ECHO "*** with $libname but no candidates were found. (...for file magic test)"
else
$ECHO "*** with $libname and none of the candidates passed a file format test"
$ECHO "*** using a file magic. Last file checked: $potlib"
fi
fi
;;
*)
# Add a -L argument.
func_append newdeplibs " $a_deplib"
;;
esac
done # Gone through all deplibs.
;;
match_pattern*)
set dummy $deplibs_check_method; shift
match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
for a_deplib in $deplibs; do
case $a_deplib in
-l*)
func_stripname -l '' "$a_deplib"
name=$func_stripname_result
if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $a_deplib "*)
func_append newdeplibs " $a_deplib"
a_deplib=
;;
esac
fi
if test -n "$a_deplib"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib=$potent_lib # see symlink-check above in file_magic test
if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
$EGREP "$match_pattern_regex" > /dev/null; then
func_append newdeplibs " $a_deplib"
a_deplib=
break 2
fi
done
done
fi
if test -n "$a_deplib"; then
droppeddeps=yes
echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib"; then
$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
else
$ECHO "*** with $libname and none of the candidates passed a file format test"
$ECHO "*** using a regex pattern. Last file checked: $potlib"
fi
fi
;;
*)
# Add a -L argument.
func_append newdeplibs " $a_deplib"
;;
esac
done # Gone through all deplibs.
;;
none | unknown | *)
newdeplibs=
tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
if test yes = "$allow_libtool_libs_with_static_runtimes"; then
for i in $predeps $postdeps; do
# can't use Xsed below, because $i might contain '/'
tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
done
fi
case $tmp_deplibs in
*[!\ \ ]*)
echo
if test none = "$deplibs_check_method"; then
echo "*** Warning: inter-library dependencies are not supported in this platform."
else
echo "*** Warning: inter-library dependencies are not known to be supported."
fi
echo "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes
;;
esac
;;
esac
versuffix=$versuffix_save
major=$major_save
release=$release_save
libname=$libname_save
name=$name_save
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library with the System framework
newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
;;
esac
if test yes = "$droppeddeps"; then
if test yes = "$module"; then
echo
echo "*** Warning: libtool could not satisfy all declared inter-library"
$ECHO "*** dependencies of module $libname. Therefore, libtool will create"
echo "*** a static module, that should work as long as the dlopening"
echo "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
echo
echo "*** However, this would only work if libtool was able to extract symbol"
echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless."
echo "*** 'nm' from GNU binutils and a full rebuild may help."
fi
if test no = "$build_old_libs"; then
oldlibs=$output_objdir/$libname.$libext
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
else
echo "*** The inter-library dependencies that have been dropped here will be"
echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it."
if test no = "$allow_undefined"; then
echo
echo "*** Since this library must not contain undefined symbols,"
echo "*** because either the platform does not support them or"
echo "*** it was explicitly requested with -no-undefined,"
echo "*** libtool will only create a static version of it."
if test no = "$build_old_libs"; then
oldlibs=$output_objdir/$libname.$libext
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
fi
fi
# Done checking deplibs!
deplibs=$newdeplibs
fi
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
case $host in
*-*-darwin*)
newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
;;
esac
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=
for path in $notinst_path; do
case " $new_libs " in
*" -L$path/$objdir "*) ;;
*)
case " $deplibs " in
*" -L$path/$objdir "*)
func_append new_libs " -L$path/$objdir" ;;
esac
;;
esac
done
for deplib in $deplibs; do
case $deplib in
-L*)
case " $new_libs " in
*" $deplib "*) ;;
*) func_append new_libs " $deplib" ;;
esac
;;
*) func_append new_libs " $deplib" ;;
esac
done
deplibs=$new_libs
# All the library-specific variables (install_libdir is set above).
library_names=
old_library=
dlname=
# Test again, we may have decided not to build it any more
if test yes = "$build_libtool_libs"; then
# Remove $wl instances when linking with ld.
# FIXME: should test the right _cmds variable.
case $archive_cmds in
*\$LD\ *) wl= ;;
esac
if test yes = "$hardcode_into_libs"; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
rpath=$finalize_rpath
test relink = "$opt_mode" || rpath=$compile_rpath$rpath
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
func_replace_sysroot "$libdir"
libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
hardcode_libdirs=$libdir
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
func_append dep_rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) func_append perm_rpath " $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir=$hardcode_libdirs
eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
func_append rpath "$dir:"
done
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
fi
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
fi
shlibpath=$finalize_shlibpath
test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
# Get the real and link names of the library.
eval shared_ext=\"$shrext_cmds\"
eval library_names=\"$library_names_spec\"
set dummy $library_names
shift
realname=$1
shift
if test -n "$soname_spec"; then
eval soname=\"$soname_spec\"
else
soname=$realname
fi
if test -z "$dlname"; then
dlname=$soname
fi
lib=$output_objdir/$realname
linknames=
for link
do
func_append linknames " $link"
done
# Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
test "X$libobjs" = "X " && libobjs=
delfiles=
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
export_symbols=$output_objdir/$libname.uexp
func_append delfiles " $export_symbols"
fi
orig_export_symbols=
case $host_os in
cygwin* | mingw* | cegcc*)
if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
# exporting using user supplied symfile
func_dll_def_p "$export_symbols" || {
# and it's NOT already a .def file. Must figure out
# which of the given symbols are data symbols and tag
# them as such. So, trigger use of export_symbols_cmds.
# export_symbols gets reassigned inside the "prepare
# the list of exported symbols" if statement, so the
# include_expsyms logic still works.
orig_export_symbols=$export_symbols
export_symbols=
always_export_symbols=yes
}
fi
;;
esac
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
func_verbose "generating symbol list for '$libname.la'"
export_symbols=$output_objdir/$libname.exp
$opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
save_ifs=$IFS; IFS='~'
for cmd1 in $cmds; do
IFS=$save_ifs
# Take the normal branch if the nm_file_list_spec branch
# doesn't work or if tool conversion is not needed.
case $nm_file_list_spec~$to_tool_file_cmd in
*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
try_normal_branch=yes
eval cmd=\"$cmd1\"
func_len " $cmd"
len=$func_len_result
;;
*)
try_normal_branch=no
;;
esac
if test yes = "$try_normal_branch" \
&& { test "$len" -lt "$max_cmd_len" \
|| test "$max_cmd_len" -le -1; }
then
func_show_eval "$cmd" 'exit $?'
skipped_export=false
elif test -n "$nm_file_list_spec"; then
func_basename "$output"
output_la=$func_basename_result
save_libobjs=$libobjs
save_output=$output
output=$output_objdir/$output_la.nm
func_to_tool_file "$output"
libobjs=$nm_file_list_spec$func_to_tool_file_result
func_append delfiles " $output"
func_verbose "creating $NM input file list: $output"
for obj in $save_libobjs; do
func_to_tool_file "$obj"
$ECHO "$func_to_tool_file_result"
done > "$output"
eval cmd=\"$cmd1\"
func_show_eval "$cmd" 'exit $?'
output=$save_output
libobjs=$save_libobjs
skipped_export=false
else
# The command line is too long to execute in one step.
func_verbose "using reloadable object file for export list..."
skipped_export=:
# Break out early, otherwise skipped_export may be
# set to false by a later but shorter cmd.
break
fi
done
IFS=$save_ifs
if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
fi
fi
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
tmp_export_symbols=$export_symbols
test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
fi
if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
# The given exports_symbols file has to be filtered, so filter it.
func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
# FIXME: $output_objdir/$libname.filter potentially contains lots of
# 's' commands, which not all seds can handle. GNU sed should be fine
# though. Also, the filter scales superlinearly with the number of
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
func_append delfiles " $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
tmp_deplibs=
for test_deplib in $deplibs; do
case " $convenience " in
*" $test_deplib "*) ;;
*)
func_append tmp_deplibs " $test_deplib"
;;
esac
done
deplibs=$tmp_deplibs
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec" &&
test yes = "$compiler_needs_object" &&
test -z "$libobjs"; then
# extract the archives, so we have objects to list.
# TODO: could optimize this to just extract one archive.
whole_archive_flag_spec=
fi
if test -n "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
test "X$libobjs" = "X " && libobjs=
else
gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_extract_archives $gentop $convenience
func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
fi
if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
func_append linker_flags " $flag"
fi
# Make a backup of the uninstalled library when relinking
if test relink = "$opt_mode"; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
eval test_cmds=\"$module_expsym_cmds\"
cmds=$module_expsym_cmds
else
eval test_cmds=\"$module_cmds\"
cmds=$module_cmds
fi
else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval test_cmds=\"$archive_expsym_cmds\"
cmds=$archive_expsym_cmds
else
eval test_cmds=\"$archive_cmds\"
cmds=$archive_cmds
fi
fi
if test : != "$skipped_export" &&
func_len " $test_cmds" &&
len=$func_len_result &&
test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
:
else
# The command line is too long to link in one step, link piecewise
# or, if using GNU ld and skipped_export is not :, use a linker
# script.
# Save the value of $output and $libobjs because we want to
# use them later. If we have whole_archive_flag_spec, we
# want to use save_libobjs as it was before
# whole_archive_flag_spec was expanded, because we can't
# assume the linker understands whole_archive_flag_spec.
# This may have to be revisited, in case too many
# convenience libraries get linked in and end up exceeding
# the spec.
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
fi
save_output=$output
func_basename "$output"
output_la=$func_basename_result
# Clear the reloadable object creation command queue and
# initialize k to one.
test_cmds=
concat_cmds=
objlist=
last_robj=
k=1
if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
output=$output_objdir/$output_la.lnkscript
func_verbose "creating GNU ld script: $output"
echo 'INPUT (' > $output
for obj in $save_libobjs
do
func_to_tool_file "$obj"
$ECHO "$func_to_tool_file_result" >> $output
done
echo ')' >> $output
func_append delfiles " $output"
func_to_tool_file "$output"
output=$func_to_tool_file_result
elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
output=$output_objdir/$output_la.lnk
func_verbose "creating linker input file list: $output"
: > $output
set x $save_libobjs
shift
firstobj=
if test yes = "$compiler_needs_object"; then
firstobj="$1 "
shift
fi
for obj
do
func_to_tool_file "$obj"
$ECHO "$func_to_tool_file_result" >> $output
done
func_append delfiles " $output"
func_to_tool_file "$output"
output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
output=$output_objdir/$output_la-$k.$objext
eval test_cmds=\"$reload_cmds\"
func_len " $test_cmds"
len0=$func_len_result
len=$len0
# Loop over the list of objects to be linked.
for obj in $save_libobjs
do
func_len " $obj"
func_arith $len + $func_len_result
len=$func_arith_result
if test -z "$objlist" ||
test "$len" -lt "$max_cmd_len"; then
func_append objlist " $obj"
else
# The command $test_cmds is almost too long, add a
# command to the queue.
if test 1 -eq "$k"; then
# The first file doesn't have a previous command to add.
reload_objs=$objlist
eval concat_cmds=\"$reload_cmds\"
else
# All subsequent reloadable object files will link in
# the last one created.
reload_objs="$objlist $last_robj"
eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
fi
last_robj=$output_objdir/$output_la-$k.$objext
func_arith $k + 1
k=$func_arith_result
output=$output_objdir/$output_la-$k.$objext
objlist=" $obj"
func_len " $last_robj"
func_arith $len0 + $func_len_result
len=$func_arith_result
fi
done
# Handle the remaining objects by creating one last
# reloadable object file. All subsequent reloadable object
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
reload_objs="$objlist $last_robj"
eval concat_cmds=\"\$concat_cmds$reload_cmds\"
if test -n "$last_robj"; then
eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
fi
func_append delfiles " $output"
else
output=
fi
${skipped_export-false} && {
func_verbose "generating symbol list for '$libname.la'"
export_symbols=$output_objdir/$libname.exp
$opt_dry_run || $RM $export_symbols
libobjs=$output
# Append the command to create the export file.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
if test -n "$last_robj"; then
eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
fi
}
test -n "$save_libobjs" &&
func_verbose "creating a temporary reloadable object file: $output"
# Loop through the commands generated above and execute them.
save_ifs=$IFS; IFS='~'
for cmd in $concat_cmds; do
IFS=$save_ifs
$opt_quiet || {
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
# Restore the uninstalled library and exit
if test relink = "$opt_mode"; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
fi
exit $lt_exit
}
done
IFS=$save_ifs
if test -n "$export_symbols_regex" && ${skipped_export-false}; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
fi
fi
${skipped_export-false} && {
if test -n "$export_symbols" && test -n "$include_expsyms"; then
tmp_export_symbols=$export_symbols
test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
fi
if test -n "$orig_export_symbols"; then
# The given exports_symbols file has to be filtered, so filter it.
func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
# FIXME: $output_objdir/$libname.filter potentially contains lots of
# 's' commands, which not all seds can handle. GNU sed should be fine
# though. Also, the filter scales superlinearly with the number of
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
func_append delfiles " $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
}
libobjs=$output
# Restore the value of output.
output=$save_output
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
test "X$libobjs" = "X " && libobjs=
fi
# Expand the library linking commands again to reset the
# value of $libobjs for piecewise linking.
# Do each of the archive commands.
if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
cmds=$module_expsym_cmds
else
cmds=$module_cmds
fi
else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
cmds=$archive_expsym_cmds
else
cmds=$archive_cmds
fi
fi
fi
if test -n "$delfiles"; then
# Append the command to remove temporary files to $cmds.
eval cmds=\"\$cmds~\$RM $delfiles\"
fi
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
save_ifs=$IFS; IFS='~'
for cmd in $cmds; do
IFS=$sp$nl
eval cmd=\"$cmd\"
IFS=$save_ifs
$opt_quiet || {
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
# Restore the uninstalled library and exit
if test relink = "$opt_mode"; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
fi
exit $lt_exit
}
done
IFS=$save_ifs
# Restore the uninstalled library and exit
if test relink = "$opt_mode"; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
if test -n "$convenience"; then
if test -z "$whole_archive_flag_spec"; then
func_show_eval '${RM}r "$gentop"'
fi
fi
exit $EXIT_SUCCESS
fi
# Create links to the real library.
for linkname in $linknames; do
if test "$realname" != "$linkname"; then
func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
fi
done
# If -module or -export-dynamic was specified, set the dlname.
if test yes = "$module" || test yes = "$export_dynamic"; then
# On all known operating systems, these are identical.
dlname=$soname
fi
fi
;;
obj)
if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
func_warning "'-dlopen' is ignored for objects"
fi
case " $deplibs" in
*\ -l* | *\ -L*)
func_warning "'-l' and '-L' are ignored for objects" ;;
esac
test -n "$rpath" && \
func_warning "'-rpath' is ignored for objects"
test -n "$xrpath" && \
func_warning "'-R' is ignored for objects"
test -n "$vinfo" && \
func_warning "'-version-info' is ignored for objects"
test -n "$release" && \
func_warning "'-release' is ignored for objects"
case $output in
*.lo)
test -n "$objs$old_deplibs" && \
func_fatal_error "cannot build library object '$output' from non-libtool objects"
libobj=$output
func_lo2o "$libobj"
obj=$func_lo2o_result
;;
*)
libobj=
obj=$output
;;
esac
# Delete the old objects.
$opt_dry_run || $RM $obj $libobj
# Objects from convenience libraries. This assumes
# single-version convenience libraries. Whenever we create
# different ones for PIC/non-PIC, this we'll have to duplicate
# the extraction.
reload_conv_objs=
gentop=
# if reload_cmds runs $LD directly, get rid of -Wl from
# whole_archive_flag_spec and hope we can get by with turning comma
# into space.
case $reload_cmds in
*\$LD[\ \$]*) wl= ;;
esac
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
else
gentop=$output_objdir/${obj}x
func_append generated " $gentop"
func_extract_archives $gentop $convenience
reload_conv_objs="$reload_objs $func_extract_archives_result"
fi
fi
# If we're not building shared, we need to use non_pic_objs
test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
# Create the old-style object.
reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
output=$obj
func_execute_cmds "$reload_cmds" 'exit $?'
# Exit if we aren't doing a library object file.
if test -z "$libobj"; then
if test -n "$gentop"; then
func_show_eval '${RM}r "$gentop"'
fi
exit $EXIT_SUCCESS
fi
test yes = "$build_libtool_libs" || {
if test -n "$gentop"; then
func_show_eval '${RM}r "$gentop"'
fi
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
# $show "echo timestamp > $libobj"
# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
exit $EXIT_SUCCESS
}
if test -n "$pic_flag" || test default != "$pic_mode"; then
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs"
output=$libobj
func_execute_cmds "$reload_cmds" 'exit $?'
fi
if test -n "$gentop"; then
func_show_eval '${RM}r "$gentop"'
fi
exit $EXIT_SUCCESS
;;
prog)
case $host in
*cygwin*) func_stripname '' '.exe' "$output"
output=$func_stripname_result.exe;;
esac
test -n "$vinfo" && \
func_warning "'-version-info' is ignored for programs"
test -n "$release" && \
func_warning "'-release' is ignored for programs"
$preload \
&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
;;
esac
case $host in
*-*-darwin*)
# Don't allow lazy linking, it breaks C++ global constructors
# But is supposedly fixed on 10.4 or later (yay!).
if test CXX = "$tagname"; then
case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10.[0123])
func_append compile_command " $wl-bind_at_load"
func_append finalize_command " $wl-bind_at_load"
;;
esac
fi
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
;;
esac
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=
for path in $notinst_path; do
case " $new_libs " in
*" -L$path/$objdir "*) ;;
*)
case " $compile_deplibs " in
*" -L$path/$objdir "*)
func_append new_libs " -L$path/$objdir" ;;
esac
;;
esac
done
for deplib in $compile_deplibs; do
case $deplib in
-L*)
case " $new_libs " in
*" $deplib "*) ;;
*) func_append new_libs " $deplib" ;;
esac
;;
*) func_append new_libs " $deplib" ;;
esac
done
compile_deplibs=$new_libs
func_append compile_command " $compile_deplibs"
func_append finalize_command " $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
*) func_append finalize_rpath " $libdir" ;;
esac
done
fi
# Now hardcode the library paths
rpath=
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs=$libdir
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
func_append rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) func_append perm_rpath " $libdir" ;;
esac
fi
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$libdir:"*) ;;
::) dllsearchpath=$libdir;;
*) func_append dllsearchpath ":$libdir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
*) func_append dllsearchpath ":$testbindir";;
esac
;;
esac
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir=$hardcode_libdirs
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
compile_rpath=$rpath
rpath=
hardcode_libdirs=
for libdir in $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs=$libdir
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
func_append rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
*) func_append finalize_perm_rpath " $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir=$hardcode_libdirs
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
finalize_rpath=$rpath
if test -n "$libobjs" && test yes = "$build_old_libs"; then
# Transform all the library objects into standard objects.
compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
fi
func_generate_dlsyms "$outputname" "@PROGRAM@" false
# template prelinking step
if test -n "$prelink_cmds"; then
func_execute_cmds "$prelink_cmds" 'exit $?'
fi
wrappers_required=:
case $host in
*cegcc* | *mingw32ce*)
# Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
wrappers_required=false
;;
*cygwin* | *mingw* )
test yes = "$build_libtool_libs" || wrappers_required=false
;;
*)
if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
wrappers_required=false
fi
;;
esac
$wrappers_required || {
# Replace the output file specification.
compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
link_command=$compile_command$compile_rpath
# We have no uninstalled library dependencies, so finalize right now.
exit_status=0
func_show_eval "$link_command" 'exit_status=$?'
if test -n "$postlink_cmds"; then
func_to_tool_file "$output"
postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
func_execute_cmds "$postlink_cmds" 'exit $?'
fi
# Delete the generated files.
if test -f "$output_objdir/${outputname}S.$objext"; then
func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
fi
exit $exit_status
}
if test -n "$compile_shlibpath$finalize_shlibpath"; then
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
fi
if test -n "$finalize_shlibpath"; then
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
fi
compile_var=
finalize_var=
if test -n "$runpath_var"; then
if test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
func_append rpath "$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
if test -n "$finalize_perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
func_append rpath "$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
fi
if test yes = "$no_install"; then
# We don't need to create a wrapper script.
link_command=$compile_var$compile_command$compile_rpath
# Replace the output file specification.
link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
$opt_dry_run || $RM $output
# Link the executable and exit
func_show_eval "$link_command" 'exit $?'
if test -n "$postlink_cmds"; then
func_to_tool_file "$output"
postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
func_execute_cmds "$postlink_cmds" 'exit $?'
fi
exit $EXIT_SUCCESS
fi
case $hardcode_action,$fast_install in
relink,*)
# Fast installation is not supported
link_command=$compile_var$compile_command$compile_rpath
relink_command=$finalize_var$finalize_command$finalize_rpath
func_warning "this platform does not like uninstalled shared libraries"
func_warning "'$output' will be relinked during installation"
;;
*,yes)
link_command=$finalize_var$compile_command$finalize_rpath
relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
;;
*,no)
link_command=$compile_var$compile_command$compile_rpath
relink_command=$finalize_var$finalize_command$finalize_rpath
;;
*,needless)
link_command=$finalize_var$compile_command$finalize_rpath
relink_command=
;;
esac
# Replace the output file specification.
link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
$opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
func_show_eval "$link_command" 'exit $?'
if test -n "$postlink_cmds"; then
func_to_tool_file "$output_objdir/$outputname"
postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
func_execute_cmds "$postlink_cmds" 'exit $?'
fi
# Now create the wrapper script.
func_verbose "creating $output"
# Quote the relink command for shipping.
if test -n "$relink_command"; then
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
func_quote_for_eval "$var_value"
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
fi
# Only actually do things if not in dry run mode.
$opt_dry_run || {
# win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here.
case $output in
*.exe) func_stripname '' '.exe' "$output"
output=$func_stripname_result ;;
esac
# test for cygwin because mv fails w/o .exe extensions
case $host in
*cygwin*)
exeext=.exe
func_stripname '' '.exe' "$outputname"
outputname=$func_stripname_result ;;
*) exeext= ;;
esac
case $host in
*cygwin* | *mingw* )
func_dirname_and_basename "$output" "" "."
output_name=$func_basename_result
output_path=$func_dirname_result
cwrappersource=$output_path/$objdir/lt-$output_name.c
cwrapper=$output_path/$output_name.exe
$RM $cwrappersource $cwrapper
trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
func_emit_cwrapperexe_src > $cwrappersource
# The wrapper executable is built using the $host compiler,
# because it contains $host paths and files. If cross-
# compiling, it, like the target executable, must be
# executed on the $host or under an emulation environment.
$opt_dry_run || {
$LTCC $LTCFLAGS -o $cwrapper $cwrappersource
$STRIP $cwrapper
}
# Now, create the wrapper script for func_source use:
func_ltwrapper_scriptname $cwrapper
$RM $func_ltwrapper_scriptname_result
trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
$opt_dry_run || {
# note: this script will not be executed, so do not chmod.
if test "x$build" = "x$host"; then
$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
else
func_emit_wrapper no > $func_ltwrapper_scriptname_result
fi
}
;;
* )
$RM $output
trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
func_emit_wrapper no > $output
chmod +x $output
;;
esac
}
exit $EXIT_SUCCESS
;;
esac
# See if we need to build an old-fashioned archive.
for oldlib in $oldlibs; do
case $build_libtool_libs in
convenience)
oldobjs="$libobjs_save $symfileobj"
addlibs=$convenience
build_libtool_libs=no
;;
module)
oldobjs=$libobjs_save
addlibs=$old_convenience
build_libtool_libs=no
;;
*)
oldobjs="$old_deplibs $non_pic_objects"
$preload && test -f "$symfileobj" \
&& func_append oldobjs " $symfileobj"
addlibs=$old_convenience
;;
esac
if test -n "$addlibs"; then
gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_extract_archives $gentop $addlibs
func_append oldobjs " $func_extract_archives_result"
fi
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
cmds=$old_archive_from_new_cmds
else
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
func_append oldobjs " $func_extract_archives_result"
fi
# POSIX demands no paths to be encoded in archives. We have
# to avoid creating archives with duplicate basenames if we
# might have to extract them afterwards, e.g., when creating a
# static archive out of a convenience library, or when linking
# the entirety of a libtool archive into another (currently
# not supported by libtool).
if (for obj in $oldobjs
do
func_basename "$obj"
$ECHO "$func_basename_result"
done | sort | sort -uc >/dev/null 2>&1); then
:
else
echo "copying selected object files to avoid basename conflicts..."
gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_mkdir_p "$gentop"
save_oldobjs=$oldobjs
oldobjs=
counter=1
for obj in $save_oldobjs
do
func_basename "$obj"
objbase=$func_basename_result
case " $oldobjs " in
" ") oldobjs=$obj ;;
*[\ /]"$objbase "*)
while :; do
# Make sure we don't pick an alternate name that also
# overlaps.
newobj=lt$counter-$objbase
func_arith $counter + 1
counter=$func_arith_result
case " $oldobjs " in
*[\ /]"$newobj "*) ;;
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
esac
done
func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
func_append oldobjs " $gentop/$newobj"
;;
*) func_append oldobjs " $obj" ;;
esac
done
fi
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
tool_oldlib=$func_to_tool_file_result
eval cmds=\"$old_archive_cmds\"
func_len " $cmds"
len=$func_len_result
if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cmds=$old_archive_cmds
elif test -n "$archiver_list_spec"; then
func_verbose "using command file archive linking..."
for obj in $oldobjs
do
func_to_tool_file "$obj"
$ECHO "$func_to_tool_file_result"
done > $output_objdir/$libname.libcmd
func_to_tool_file "$output_objdir/$libname.libcmd"
oldobjs=" $archiver_list_spec$func_to_tool_file_result"
cmds=$old_archive_cmds
else
# the command line is too long to link in one step, link in parts
func_verbose "using piecewise archive linking..."
save_RANLIB=$RANLIB
RANLIB=:
objlist=
concat_cmds=
save_oldobjs=$oldobjs
oldobjs=
# Is there a better way of finding the last object in the list?
for obj in $save_oldobjs
do
last_oldobj=$obj
done
eval test_cmds=\"$old_archive_cmds\"
func_len " $test_cmds"
len0=$func_len_result
len=$len0
for obj in $save_oldobjs
do
func_len " $obj"
func_arith $len + $func_len_result
len=$func_arith_result
func_append objlist " $obj"
if test "$len" -lt "$max_cmd_len"; then
:
else
# the above command should be used before it gets too long
oldobjs=$objlist
if test "$obj" = "$last_oldobj"; then
RANLIB=$save_RANLIB
fi
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
objlist=
len=$len0
fi
done
RANLIB=$save_RANLIB
oldobjs=$objlist
if test -z "$oldobjs"; then
eval cmds=\"\$concat_cmds\"
else
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
fi
fi
fi
func_execute_cmds "$cmds" 'exit $?'
done
test -n "$generated" && \
func_show_eval "${RM}r$generated"
# Now create the libtool archive.
case $output in
*.la)
old_library=
test yes = "$build_old_libs" && old_library=$libname.$libext
func_verbose "creating $output"
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
func_quote_for_eval "$var_value"
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
if test yes = "$hardcode_automatic"; then
relink_command=
fi
# Only create the output if not a dry run.
$opt_dry_run || {
for installed in no yes; do
if test yes = "$installed"; then
if test -z "$install_libdir"; then
break
fi
output=$output_objdir/${outputname}i
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
case $deplib in
*.la)
func_basename "$deplib"
name=$func_basename_result
func_resolve_sysroot "$deplib"
eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
test -z "$libdir" && \
func_fatal_error "'$deplib' is not a valid libtool archive"
func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
;;
-L*)
func_stripname -L '' "$deplib"
func_replace_sysroot "$func_stripname_result"
func_append newdependency_libs " -L$func_replace_sysroot_result"
;;
-R*)
func_stripname -R '' "$deplib"
func_replace_sysroot "$func_stripname_result"
func_append newdependency_libs " -R$func_replace_sysroot_result"
;;
*) func_append newdependency_libs " $deplib" ;;
esac
done
dependency_libs=$newdependency_libs
newdlfiles=
for lib in $dlfiles; do
case $lib in
*.la)
func_basename "$lib"
name=$func_basename_result
eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
func_fatal_error "'$lib' is not a valid libtool archive"
func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
;;
*) func_append newdlfiles " $lib" ;;
esac
done
dlfiles=$newdlfiles
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
*.la)
# Only pass preopened files to the pseudo-archive (for
# eventual linking with the app. that links it) if we
# didn't already link the preopened objects directly into
# the library:
func_basename "$lib"
name=$func_basename_result
eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
func_fatal_error "'$lib' is not a valid libtool archive"
func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
;;
esac
done
dlprefiles=$newdlprefiles
else
newdlfiles=
for lib in $dlfiles; do
case $lib in
[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
*) abs=`pwd`"/$lib" ;;
esac
func_append newdlfiles " $abs"
done
dlfiles=$newdlfiles
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
*) abs=`pwd`"/$lib" ;;
esac
func_append newdlprefiles " $abs"
done
dlprefiles=$newdlprefiles
fi
$RM $output
# place dlname in correct position for cygwin
# In fact, it would be nice if we could use this code for all target
# systems that can't hard-code library paths into their executables
# and that have no shared library path variable independent of PATH,
# but it turns out we can't easily determine that from inspecting
# libtool variables, so we have to hard-code the OSs to which it
# applies here; at the moment, that means platforms that use the PE
# object format with DLL files. See the long comment at the top of
# tests/bindir.at for full details.
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
# If a -bindir argument was supplied, place the dll there.
if test -n "$bindir"; then
func_relative_path "$install_libdir" "$bindir"
tdlname=$func_relative_path_result/$dlname
else
# Otherwise fall back on heuristic.
tdlname=../bin/$dlname
fi
;;
esac
$ECHO > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='$tdlname'
# Names of this library.
library_names='$library_names'
# The name of the static archive.
old_library='$old_library'
# Linker flags that cannot go in dependency_libs.
inherited_linker_flags='$new_inherited_linker_flags'
# Libraries that this one depends upon.
dependency_libs='$dependency_libs'
# Names of additional weak libraries provided by this library
weak_library_names='$weak_libs'
# Version information for $libname.
current=$current
age=$age
revision=$revision
# Is this an already installed library?
installed=$installed
# Should we warn about portability when linking against -modules?
shouldnotlink=$module
# Files to dlopen/dlpreopen
dlopen='$dlfiles'
dlpreopen='$dlprefiles'
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
if test no,yes = "$installed,$need_relink"; then
$ECHO >> $output "\
relink_command=\"$relink_command\""
fi
done
}
# Do a symbolic link so that the libtool archive can be found in
# LD_LIBRARY_PATH before the program is installed.
func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
;;
esac
exit $EXIT_SUCCESS
}
if test link = "$opt_mode" || test relink = "$opt_mode"; then
func_mode_link ${1+"$@"}
fi
# func_mode_uninstall arg...
func_mode_uninstall ()
{
$debug_cmd
RM=$nonopt
files=
rmforce=false
exit_status=0
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic=$magic
for arg
do
case $arg in
-f) func_append RM " $arg"; rmforce=: ;;
-*) func_append RM " $arg" ;;
*) func_append files " $arg" ;;
esac
done
test -z "$RM" && \
func_fatal_help "you must specify an RM program"
rmdirs=
for file in $files; do
func_dirname "$file" "" "."
dir=$func_dirname_result
if test . = "$dir"; then
odir=$objdir
else
odir=$dir/$objdir
fi
func_basename "$file"
name=$func_basename_result
test uninstall = "$opt_mode" && odir=$dir
# Remember odir for removal later, being careful to avoid duplicates
if test clean = "$opt_mode"; then
case " $rmdirs " in
*" $odir "*) ;;
*) func_append rmdirs " $odir" ;;
esac
fi
# Don't error if the file doesn't exist and rm -f was used.
if { test -L "$file"; } >/dev/null 2>&1 ||
{ test -h "$file"; } >/dev/null 2>&1 ||
test -f "$file"; then
:
elif test -d "$file"; then
exit_status=1
continue
elif $rmforce; then
continue
fi
rmfiles=$file
case $name in
*.la)
# Possibly a libtool archive, so verify it.
if func_lalib_p "$file"; then
func_source $dir/$name
# Delete the libtool libraries and symlinks.
for n in $library_names; do
func_append rmfiles " $odir/$n"
done
test -n "$old_library" && func_append rmfiles " $odir/$old_library"
case $opt_mode in
clean)
case " $library_names " in
*" $dlname "*) ;;
*) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
esac
test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
;;
uninstall)
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
fi
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
fi
# FIXME: should reinstall the best remaining shared library.
;;
esac
fi
;;
*.lo)
# Possibly a libtool object, so verify it.
if func_lalib_p "$file"; then
# Read the .lo file
func_source $dir/$name
# Add PIC object to the list of files to remove.
if test -n "$pic_object" && test none != "$pic_object"; then
func_append rmfiles " $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
if test -n "$non_pic_object" && test none != "$non_pic_object"; then
func_append rmfiles " $dir/$non_pic_object"
fi
fi
;;
*)
if test clean = "$opt_mode"; then
noexename=$name
case $file in
*.exe)
func_stripname '' '.exe' "$file"
file=$func_stripname_result
func_stripname '' '.exe' "$name"
noexename=$func_stripname_result
# $file with .exe has already been added to rmfiles,
# add $file without .exe
func_append rmfiles " $file"
;;
esac
# Do a test to see if this is a libtool program.
if func_ltwrapper_p "$file"; then
if func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
relink_command=
func_source $func_ltwrapper_scriptname_result
func_append rmfiles " $func_ltwrapper_scriptname_result"
else
relink_command=
func_source $dir/$noexename
fi
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
func_append rmfiles " $odir/$name $odir/${name}S.$objext"
if test yes = "$fast_install" && test -n "$relink_command"; then
func_append rmfiles " $odir/lt-$name"
fi
if test "X$noexename" != "X$name"; then
func_append rmfiles " $odir/lt-$noexename.c"
fi
fi
fi
;;
esac
func_show_eval "$RM $rmfiles" 'exit_status=1'
done
# Try to remove the $objdir's in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
func_show_eval "rmdir $dir >/dev/null 2>&1"
fi
done
exit $exit_status
}
if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
func_mode_uninstall ${1+"$@"}
fi
test -z "$opt_mode" && {
help=$generic_help
func_fatal_help "you must specify a MODE"
}
test -z "$exec_cmd" && \
func_fatal_help "invalid operation mode '$opt_mode'"
if test -n "$exec_cmd"; then
eval exec "$exec_cmd"
exit $EXIT_FAILURE
fi
exit $exit_status
# The TAGs below are defined such that we never get into a situation
# where we disable both kinds of libraries. Given conflicting
# choices, we go for a static library, that is the most portable,
# since we can't tell whether shared libraries were disabled because
# the user asked for that or because the platform doesn't support
# them. This is particularly important on AIX, because we don't
# support having both static and shared libraries enabled at the same
# time on that platform, so we default to a shared-only configuration.
# If a disable-shared tag is given, we'll fallback to a static-only
# configuration. But we'll never go from static-only to shared-only.
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
build_libtool_libs=no
build_old_libs=yes
# ### END LIBTOOL TAG CONFIG: disable-shared
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
# ### END LIBTOOL TAG CONFIG: disable-static
# Local Variables:
# mode:shell-script
# sh-indentation:2
# End:
mpc-1.0.3/test-driver 0000555 0001751 0001751 00000011037 12470361151 011413 0000000 0000000 #!/bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2013-07-13.22; # UTC
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <$log_file 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
tweaked_estatus=1
else
tweaked_estatus=$estatus
fi
case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
# Report the test outcome and exit status in the logs, so that one can
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
echo "$res $test_name (exit status: $estatus)" >>$log_file
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
echo ":test-result: $res" > $trs_file
echo ":global-test-result: $res" >> $trs_file
echo ":recheck: $recheck" >> $trs_file
echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
mpc-1.0.3/Makefile.in 0000644 0001751 0001751 00000067114 12470362457 011305 0000000 0000000 # 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@
subdir = .
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 $(top_srcdir)/configure \
$(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
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 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
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__installdirs = "$(DESTDIR)$(includedir)"
HEADERS = $(include_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# 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
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
COPYING.LESSER ChangeLog INSTALL NEWS README TODO ar-lib \
compile config.guess config.sub depcomp install-sh ltmain.sh \
missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
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 number for distribution tarball
VERSION = @VERSION@@GITVERSION@
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@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src tests doc
EXTRA_HEADERS = src/mpc-log.h
include_HEADERS = src/mpc.h @MPC_LOG_H@
EXTRA_DIST = doc/fdl-1.3.texi src/mpc-log.h tests/tgeneric.c Makefile.vc
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(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-recursive
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"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
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
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@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
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(HEADERS) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
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:
clean-generic:
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-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-includeHEADERS
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-includeHEADERS
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-generic \
distclean-hdr distclean-libtool distclean-tags distcleancheck \
distdir distuninstallcheck 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-includeHEADERS \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-includeHEADERS
.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:
mpc-1.0.3/ar-lib 0000555 0001751 0001751 00000013301 12470361151 010305 0000000 0000000 #!/bin/sh
# Wrapper for Microsoft lib.exe
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2014 Free Software Foundation, Inc.
# Written by Peter Rosin .
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
# func_error message
func_error ()
{
echo "$me: $1" 1>&2
exit 1
}
file_conv=
# func_file_conv build_file
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv in
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_at_file at_file operation archive
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
# for each of them.
# When interpreting the content of the @FILE, do NOT use func_file_conv,
# since the user would need to supply preconverted file names to
# binutils ar, at least for MinGW.
func_at_file ()
{
operation=$2
archive=$3
at_file_contents=`cat "$1"`
eval set x "$at_file_contents"
shift
for member
do
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
done
}
case $1 in
'')
func_error "no command. Try '$0 --help' for more information."
;;
-h | --h*)
cat <