From bf668fc8f06ccba22b4927fba337efdabbe06ac1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 7 Jun 1996 21:18:34 +0000 Subject: Fri Jun 7 16:48:13 1996 Roland McGrath * sysdeps/unix/sysv/linux/i386/Dist: New file, list sys/perm.h and sys/vm86.h. Removed old math code no longer used since the fdlibm integration. * sysdeps/stub/acos.c: File removed. * sysdeps/stub/asin.c: File removed. * sysdeps/stub/atan2.c: File removed. * sysdeps/stub/cosh.c: File removed. * sysdeps/stub/exp.c: File removed. * sysdeps/stub/fmod.c: File removed. * sysdeps/stub/frexp.c: File removed. * sysdeps/stub/log.c: File removed. * sysdeps/stub/log10.c: File removed. * sysdeps/stub/sinh.c: File removed. * sysdeps/stub/tan.c: File removed. * sysdeps/stub/tanh.c: File removed. * sysdeps/generic/acos.c: File removed. * sysdeps/generic/acosh.c: File removed. * sysdeps/generic/asin.c: File removed. * sysdeps/generic/asinh.c: File removed. * sysdeps/generic/atan.c: File removed. * sysdeps/generic/atan2.c: File removed. * sysdeps/generic/atanh.c: File removed. * sysdeps/generic/cabs.c: File removed. * sysdeps/generic/ceil.c: File removed. * sysdeps/generic/copysign.c: File removed. * sysdeps/generic/cosh.c: File removed. * sysdeps/generic/exp.c: File removed. * sysdeps/generic/expm1.c: File removed. * sysdeps/generic/fabs.c: File removed. * sysdeps/generic/floor.c: File removed. * sysdeps/generic/fmod.c: File removed. * sysdeps/generic/frexp.c: File removed. * sysdeps/generic/hypot.c: File removed. * sysdeps/generic/infnan.c: File removed. * sysdeps/generic/isnan.c: File removed. * sysdeps/generic/ldexp.c: File removed. * sysdeps/generic/log.c: File removed. * sysdeps/generic/log10.c: File removed. * sysdeps/generic/log1p.c: File removed. * sysdeps/generic/modf.c: File removed. * sysdeps/generic/pow.c: File removed. * sysdeps/generic/rint.c: File removed. * sysdeps/generic/sinh.c: File removed. * sysdeps/generic/tan.c: File removed. * sysdeps/generic/tanh.c: File removed. * sysdeps/ieee754/cabs.c: File removed. * sysdeps/ieee754/copysign.c: File removed. * sysdeps/ieee754/frexp.c: File removed. * sysdeps/ieee754/hypot.c: File removed. * sysdeps/ieee754/infnan.c: File removed. * sysdeps/ieee754/ldexp.c: File removed. * sysdeps/ieee754/log10.c: File removed. * posix/Makefile (headers): Add schedbits.h. * math/Makefile (elided-routines): Add long double routines. Fri Jun 7 09:11:17 1996 Roland McGrath * sysdeps/unix/sysv/linux/Dist: Add sys/sysinfo.h, sys/mount.h, sys/kdaemon.h, sys/io.h, sys/mount.h, sysctl.c. * gmon/Makefile (distribute): Add profil-counter.h. * sysdeps/unix/sysv/linux/alpha/Dist: New file. * sysdeps/unix/Dist: Add s-proto.S. * sysdeps/unix/common/mk-local_lim.c: Obsolete file removed. * Make-dist (+sysdep-tsrcs): Get all syscalls.list files too. * csu/Makefile (distribute): Add start.c. * elf/Makefile (distribute): Add dl-machine.h. * sysdeps/alpha/Dist: Add _mcount.S. * sysdeps/alpha/Makefile (sysdep_routines): Append instead of resetting; don't add bb_init_func. * string/Makefile (routines): Add strerror_r. * string/string.h (strerror_r): Use int for BUFLEN arg. * Makefile (distribute): Add shlib-versions. * po/Makefile (distribute): Add SYS_libc.pot. * misc/Makefile (routines): Add lsearch. * manual/lang.texi (Consistency Checking): Merge in assert_perror defn and other changes inadvertently made to the obsolete assert.texi. * manual/assert.texi: File removed. * mach/mach_syscalls.c: Obsolete file removed. * mach/mach_syscalls.h: Likewise. * mach/mach_traps.S: Likewise. * mach/msg_destroy.c: Likewise. * mach/vm_page_size.c: Likewise. * locale/Makefile (distribute): Add weight.h, charset.h. * Makefile (distribute): Add version.h. * hurd/Makefile (headers): Add hurd/ioctl.h. (distribute): Add intr-rpc.d, intr-rpc.h, faultexc.defs. * csu/Makefile (distribute): Add gmon-start.c. * Makefile (distribute): Add config.h.in. sysdeps/m68k/fpu/e_atanhl.c, sysdeps/m68k/fpu/e_coshl.c: New files. --- ChangeLog | 117 ++++++++- manual/examples/search | Bin 24576 -> 0 bytes math/Makefile | 5 +- posix/Makefile | 2 +- sysdeps/generic/acos.c | 42 ---- sysdeps/generic/acosh.c | 102 -------- sysdeps/generic/asin.c | 44 ---- sysdeps/generic/asinh.c | 101 -------- sysdeps/generic/atan.c | 27 --- sysdeps/generic/atan2.c | 281 ---------------------- sysdeps/generic/atanh.c | 83 ------- sysdeps/generic/cabs.c | 26 -- sysdeps/generic/ceil.c | 68 ------ sysdeps/generic/copysign.c | 30 --- sysdeps/generic/cosh.c | 133 ----------- sysdeps/generic/exp.c | 203 ---------------- sysdeps/generic/expm1.c | 170 ------------- sysdeps/generic/fabs.c | 27 --- sysdeps/generic/floor.c | 74 ------ sysdeps/generic/fmod.c | 155 ------------ sysdeps/generic/frexp.c | 53 ----- sysdeps/generic/hypot.c | 27 --- sysdeps/generic/infnan.c | 48 ---- sysdeps/generic/isnan.c | 29 --- sysdeps/generic/ldexp.c | 27 --- sysdeps/generic/log.c | 486 -------------------------------------- sysdeps/generic/log10.c | 37 --- sysdeps/generic/log1p.c | 170 ------------- sysdeps/generic/modf.c | 31 --- sysdeps/generic/pow.c | 215 ----------------- sysdeps/generic/rint.c | 87 ------- sysdeps/generic/sinh.c | 121 ---------- sysdeps/generic/tan.c | 74 ------ sysdeps/generic/tanh.c | 99 -------- sysdeps/ieee754/cabs.c | 232 ------------------ sysdeps/ieee754/copysign.c | 37 --- sysdeps/ieee754/frexp.c | 42 ---- sysdeps/ieee754/hypot.c | 197 --------------- sysdeps/ieee754/infnan.c | 50 ---- sysdeps/ieee754/ldexp.c | 146 ------------ sysdeps/ieee754/log10.c | 30 --- sysdeps/stub/acos.c | 32 --- sysdeps/stub/asin.c | 32 --- sysdeps/stub/atan2.c | 31 --- sysdeps/stub/cosh.c | 32 --- sysdeps/stub/exp.c | 32 --- sysdeps/stub/fmod.c | 32 --- sysdeps/stub/frexp.c | 33 --- sysdeps/stub/log.c | 32 --- sysdeps/stub/log10.c | 32 --- sysdeps/stub/sinh.c | 32 --- sysdeps/stub/tan.c | 32 --- sysdeps/stub/tanh.c | 32 --- sysdeps/unix/sysv/linux/i386/Dist | 1 + 54 files changed, 121 insertions(+), 4192 deletions(-) delete mode 100755 manual/examples/search delete mode 100644 sysdeps/generic/acos.c delete mode 100644 sysdeps/generic/acosh.c delete mode 100644 sysdeps/generic/asin.c delete mode 100644 sysdeps/generic/asinh.c delete mode 100644 sysdeps/generic/atan.c delete mode 100644 sysdeps/generic/atan2.c delete mode 100644 sysdeps/generic/atanh.c delete mode 100644 sysdeps/generic/cabs.c delete mode 100644 sysdeps/generic/ceil.c delete mode 100644 sysdeps/generic/copysign.c delete mode 100644 sysdeps/generic/cosh.c delete mode 100644 sysdeps/generic/exp.c delete mode 100644 sysdeps/generic/expm1.c delete mode 100644 sysdeps/generic/fabs.c delete mode 100644 sysdeps/generic/floor.c delete mode 100644 sysdeps/generic/fmod.c delete mode 100644 sysdeps/generic/frexp.c delete mode 100644 sysdeps/generic/hypot.c delete mode 100644 sysdeps/generic/infnan.c delete mode 100644 sysdeps/generic/isnan.c delete mode 100644 sysdeps/generic/ldexp.c delete mode 100644 sysdeps/generic/log.c delete mode 100644 sysdeps/generic/log10.c delete mode 100644 sysdeps/generic/log1p.c delete mode 100644 sysdeps/generic/modf.c delete mode 100644 sysdeps/generic/pow.c delete mode 100644 sysdeps/generic/rint.c delete mode 100644 sysdeps/generic/sinh.c delete mode 100644 sysdeps/generic/tan.c delete mode 100644 sysdeps/generic/tanh.c delete mode 100644 sysdeps/ieee754/cabs.c delete mode 100644 sysdeps/ieee754/copysign.c delete mode 100644 sysdeps/ieee754/frexp.c delete mode 100644 sysdeps/ieee754/hypot.c delete mode 100644 sysdeps/ieee754/infnan.c delete mode 100644 sysdeps/ieee754/ldexp.c delete mode 100644 sysdeps/ieee754/log10.c delete mode 100644 sysdeps/stub/acos.c delete mode 100644 sysdeps/stub/asin.c delete mode 100644 sysdeps/stub/atan2.c delete mode 100644 sysdeps/stub/cosh.c delete mode 100644 sysdeps/stub/exp.c delete mode 100644 sysdeps/stub/fmod.c delete mode 100644 sysdeps/stub/frexp.c delete mode 100644 sysdeps/stub/log.c delete mode 100644 sysdeps/stub/log10.c delete mode 100644 sysdeps/stub/sinh.c delete mode 100644 sysdeps/stub/tan.c delete mode 100644 sysdeps/stub/tanh.c create mode 100644 sysdeps/unix/sysv/linux/i386/Dist diff --git a/ChangeLog b/ChangeLog index ecf93e1b01..194541f86b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,63 @@ +Fri Jun 7 16:48:13 1996 Roland McGrath + + * sysdeps/unix/sysv/linux/i386/Dist: New file, list sys/perm.h and + sys/vm86.h. + + Removed old math code no longer used since the fdlibm integration. + * sysdeps/stub/acos.c: File removed. + * sysdeps/stub/asin.c: File removed. + * sysdeps/stub/atan2.c: File removed. + * sysdeps/stub/cosh.c: File removed. + * sysdeps/stub/exp.c: File removed. + * sysdeps/stub/fmod.c: File removed. + * sysdeps/stub/frexp.c: File removed. + * sysdeps/stub/log.c: File removed. + * sysdeps/stub/log10.c: File removed. + * sysdeps/stub/sinh.c: File removed. + * sysdeps/stub/tan.c: File removed. + * sysdeps/stub/tanh.c: File removed. + * sysdeps/generic/acos.c: File removed. + * sysdeps/generic/acosh.c: File removed. + * sysdeps/generic/asin.c: File removed. + * sysdeps/generic/asinh.c: File removed. + * sysdeps/generic/atan.c: File removed. + * sysdeps/generic/atan2.c: File removed. + * sysdeps/generic/atanh.c: File removed. + * sysdeps/generic/cabs.c: File removed. + * sysdeps/generic/ceil.c: File removed. + * sysdeps/generic/copysign.c: File removed. + * sysdeps/generic/cosh.c: File removed. + * sysdeps/generic/exp.c: File removed. + * sysdeps/generic/expm1.c: File removed. + * sysdeps/generic/fabs.c: File removed. + * sysdeps/generic/floor.c: File removed. + * sysdeps/generic/fmod.c: File removed. + * sysdeps/generic/frexp.c: File removed. + * sysdeps/generic/hypot.c: File removed. + * sysdeps/generic/infnan.c: File removed. + * sysdeps/generic/isnan.c: File removed. + * sysdeps/generic/ldexp.c: File removed. + * sysdeps/generic/log.c: File removed. + * sysdeps/generic/log10.c: File removed. + * sysdeps/generic/log1p.c: File removed. + * sysdeps/generic/modf.c: File removed. + * sysdeps/generic/pow.c: File removed. + * sysdeps/generic/rint.c: File removed. + * sysdeps/generic/sinh.c: File removed. + * sysdeps/generic/tan.c: File removed. + * sysdeps/generic/tanh.c: File removed. + * sysdeps/ieee754/cabs.c: File removed. + * sysdeps/ieee754/copysign.c: File removed. + * sysdeps/ieee754/frexp.c: File removed. + * sysdeps/ieee754/hypot.c: File removed. + * sysdeps/ieee754/infnan.c: File removed. + * sysdeps/ieee754/ldexp.c: File removed. + * sysdeps/ieee754/log10.c: File removed. + + * posix/Makefile (headers): Add schedbits.h. + + * math/Makefile (elided-routines): Add long double routines. + Fri Jun 7 11:02:22 1996 Miles Bader * login/login.c (tty_name): New function. @@ -5,6 +65,60 @@ Fri Jun 7 11:02:22 1996 Miles Bader (PATH_MAX): MACRO removed. : New include. +Fri Jun 7 09:11:17 1996 Roland McGrath + + * sysdeps/unix/sysv/linux/Dist: Add sys/sysinfo.h, sys/mount.h, + sys/kdaemon.h, sys/io.h, sys/mount.h, sysctl.c. + + * gmon/Makefile (distribute): Add profil-counter.h. + + * sysdeps/unix/sysv/linux/alpha/Dist: New file. + + * sysdeps/unix/Dist: Add s-proto.S. + + * sysdeps/unix/common/mk-local_lim.c: Obsolete file removed. + + * Make-dist (+sysdep-tsrcs): Get all syscalls.list files too. + + * csu/Makefile (distribute): Add start.c. + + * elf/Makefile (distribute): Add dl-machine.h. + + * sysdeps/alpha/Dist: Add _mcount.S. + + * sysdeps/alpha/Makefile (sysdep_routines): Append instead of + resetting; don't add bb_init_func. + + * string/Makefile (routines): Add strerror_r. + * string/string.h (strerror_r): Use int for BUFLEN arg. + + * Makefile (distribute): Add shlib-versions. + + * po/Makefile (distribute): Add SYS_libc.pot. + + * misc/Makefile (routines): Add lsearch. + + * manual/lang.texi (Consistency Checking): Merge in assert_perror defn + and other changes inadvertently made to the obsolete assert.texi. + * manual/assert.texi: File removed. + + * mach/mach_syscalls.c: Obsolete file removed. + * mach/mach_syscalls.h: Likewise. + * mach/mach_traps.S: Likewise. + * mach/msg_destroy.c: Likewise. + * mach/vm_page_size.c: Likewise. + + * locale/Makefile (distribute): Add weight.h, charset.h. + + * Makefile (distribute): Add version.h. + + * hurd/Makefile (headers): Add hurd/ioctl.h. + (distribute): Add intr-rpc.d, intr-rpc.h, faultexc.defs. + + * csu/Makefile (distribute): Add gmon-start.c. + + * Makefile (distribute): Add config.h.in. + Wed Jun 5 22:06:21 1996 Andreas Schwab * sysdeps/m68k/dl-machine.h (elf_machine_rela): Fix type of reloc @@ -110,7 +224,6 @@ Tue Jun 4 22:03:02 1996 Andreas Schwab -#include -#include - -/* Return the inverse cosine of X. */ -double -DEFUN(acos, (x), double x) -{ - double t; - - if (__isnan(x)) - { - errno = EDOM; - return x; - } - - if (x == -1.0) - /* If X is -1, the general formula blows up (zero divided by zero loses), - but we know that acos(-1) = pi. */ - t = atan2(1.0, 0.0); - else - t = atan2(sqrt((1.0 - x) / (1.0 + x)), 1.0); - return t + t; -} diff --git a/sysdeps/generic/acosh.c b/sysdeps/generic/acosh.c deleted file mode 100644 index bc16cc7b46..0000000000 --- a/sysdeps/generic/acosh.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static char sccsid[] = "@(#)acosh.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ - -/* ACOSH(X) - * RETURN THE INVERSE HYPERBOLIC COSINE OF X - * DOUBLE PRECISION (VAX D FORMAT 56 BITS, IEEE DOUBLE 53 BITS) - * CODED IN C BY K.C. NG, 2/16/85; - * REVISED BY K.C. NG on 3/6/85, 3/24/85, 4/16/85, 8/17/85. - * - * Required system supported functions : - * sqrt(x) - * - * Required kernel function: - * log1p(x) ...return log(1+x) - * - * Method : - * Based on - * acosh(x) = log [ x + sqrt(x*x-1) ] - * we have - * acosh(x) := log1p(x)+ln2, if (x > 1.0E20); else - * acosh(x) := log1p( sqrt(x-1) * (sqrt(x-1) + sqrt(x+1)) ) . - * These formulae avoid the over/underflow complication. - * - * Special cases: - * acosh(x) is NaN with signal if x<1. - * acosh(NaN) is NaN without signal. - * - * Accuracy: - * acosh(x) returns the exact inverse hyperbolic cosine of x nearly - * rounded. In a test run with 512,000 random arguments on a VAX, the - * maximum observed error was 3.30 ulps (units of the last place) at - * x=1.0070493753568216 . - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. - */ - -#include "mathimpl.h" - -vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) -vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) - -ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) -ic(ln2lo, 1.9082149292705877000E-10,-33, 1.A39EF35793C76) - -#ifdef vccast -#define ln2hi vccast(ln2hi) -#define ln2lo vccast(ln2lo) -#endif - -double acosh(x) -double x; -{ - double t,big=1.E20; /* big+1==big */ - -#if !defined(vax)&&!defined(tahoe) - if(x!=x) return(x); /* x is NaN */ -#endif /* !defined(vax)&&!defined(tahoe) */ - - /* return log1p(x) + log(2) if x is large */ - if(x>big) {t=log1p(x)+ln2lo; return(t+ln2hi);} - - t=sqrt(x-1.0); - return(log1p(t*(t+sqrt(x+1.0)))); -} diff --git a/sysdeps/generic/asin.c b/sysdeps/generic/asin.c deleted file mode 100644 index e75ee3d87e..0000000000 --- a/sysdeps/generic/asin.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include -#include -#include - -/* Return the inverse sine of X. */ -double -DEFUN(asin, (x), double x) -{ - double abs_x; - - if (__isnan(x)) - { - errno = EDOM; - return x; - } - - abs_x = fabs(x); - - if (abs_x <= 0.5) - return atan2(x, sqrt(1.0 - (x * x))); - else - { - double t = 1.0 - abs_x; - return atan2(x, sqrt((t + t) - (t * t))); - } -} diff --git a/sysdeps/generic/asinh.c b/sysdeps/generic/asinh.c deleted file mode 100644 index 5db8d2ddf7..0000000000 --- a/sysdeps/generic/asinh.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static char sccsid[] = "@(#)asinh.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ - -/* ASINH(X) - * RETURN THE INVERSE HYPERBOLIC SINE OF X - * DOUBLE PRECISION (VAX D format 56 bits, IEEE DOUBLE 53 BITS) - * CODED IN C BY K.C. NG, 2/16/85; - * REVISED BY K.C. NG on 3/7/85, 3/24/85, 4/16/85. - * - * Required system supported functions : - * copysign(x,y) - * sqrt(x) - * - * Required kernel function: - * log1p(x) ...return log(1+x) - * - * Method : - * Based on - * asinh(x) = sign(x) * log [ |x| + sqrt(x*x+1) ] - * we have - * asinh(x) := x if 1+x*x=1, - * := sign(x)*(log1p(x)+ln2)) if sqrt(1+x*x)=x, else - * := sign(x)*log1p(|x| + |x|/(1/|x| + sqrt(1+(1/|x|)^2)) ) - * - * Accuracy: - * asinh(x) returns the exact inverse hyperbolic sine of x nearly rounded. - * In a test run with 52,000 random arguments on a VAX, the maximum - * observed error was 1.58 ulps (units in the last place). - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. - */ -#include "mathimpl.h" - -vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) -vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) - -ic(ln2hi, 6.9314718036912381649E-1, -1, 1.62E42FEE00000) -ic(ln2lo, 1.9082149292705877000E-10, -33, 1.A39EF35793C76) - -#ifdef vccast -#define ln2hi vccast(ln2hi) -#define ln2lo vccast(ln2lo) -#endif - -double asinh(x) -double x; -{ - double t,s; - const static double small=1.0E-10, /* fl(1+small*small) == 1 */ - big =1.0E20, /* fl(1+big) == big */ - one =1.0 ; - -#if !defined(vax)&&!defined(tahoe) - if(x!=x) return(x); /* x is NaN */ -#endif /* !defined(vax)&&!defined(tahoe) */ - if((t=copysign(x,one))>small) - if(t big */ - {s=log1p(t)+ln2lo; return(copysign(s+ln2hi,x));} - else /* if |x| < small */ - return(x); -} diff --git a/sysdeps/generic/atan.c b/sysdeps/generic/atan.c deleted file mode 100644 index f2cc693924..0000000000 --- a/sysdeps/generic/atan.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include -#include - -/* Return the inverse tangent of X. */ -double -DEFUN(atan, (x), register double x) -{ - return atan2(x, 1.0); -} diff --git a/sysdeps/generic/atan2.c b/sysdeps/generic/atan2.c deleted file mode 100644 index 958a154726..0000000000 --- a/sysdeps/generic/atan2.c +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static char sccsid[] = "@(#)atan2.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ - -/* ATAN2(Y,X) - * RETURN ARG (X+iY) - * DOUBLE PRECISION (VAX D format 56 bits, IEEE DOUBLE 53 BITS) - * CODED IN C BY K.C. NG, 1/8/85; - * REVISED BY K.C. NG on 2/7/85, 2/13/85, 3/7/85, 3/30/85, 6/29/85. - * - * Required system supported functions : - * copysign(x,y) - * scalb(x,y) - * logb(x) - * - * Method : - * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). - * 2. Reduce x to positive by (if x and y are unexceptional): - * ARG (x+iy) = arctan(y/x) ... if x > 0, - * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0, - * 3. According to the integer k=4t+0.25 truncated , t=y/x, the argument - * is further reduced to one of the following intervals and the - * arctangent of y/x is evaluated by the corresponding formula: - * - * [0,7/16] atan(y/x) = t - t^3*(a1+t^2*(a2+...(a10+t^2*a11)...) - * [7/16,11/16] atan(y/x) = atan(1/2) + atan( (y-x/2)/(x+y/2) ) - * [11/16.19/16] atan(y/x) = atan( 1 ) + atan( (y-x)/(x+y) ) - * [19/16,39/16] atan(y/x) = atan(3/2) + atan( (y-1.5x)/(x+1.5y) ) - * [39/16,INF] atan(y/x) = atan(INF) + atan( -x/y ) - * - * Special cases: - * Notations: atan2(y,x) == ARG (x+iy) == ARG(x,y). - * - * ARG( NAN , (anything) ) is NaN; - * ARG( (anything), NaN ) is NaN; - * ARG(+(anything but NaN), +-0) is +-0 ; - * ARG(-(anything but NaN), +-0) is +-PI ; - * ARG( 0, +-(anything but 0 and NaN) ) is +-PI/2; - * ARG( +INF,+-(anything but INF and NaN) ) is +-0 ; - * ARG( -INF,+-(anything but INF and NaN) ) is +-PI; - * ARG( +INF,+-INF ) is +-PI/4 ; - * ARG( -INF,+-INF ) is +-3PI/4; - * ARG( (anything but,0,NaN, and INF),+-INF ) is +-PI/2; - * - * Accuracy: - * atan2(y,x) returns (PI/pi) * the exact ARG (x+iy) nearly rounded, - * where - * - * in decimal: - * pi = 3.141592653589793 23846264338327 ..... - * 53 bits PI = 3.141592653589793 115997963 ..... , - * 56 bits PI = 3.141592653589793 227020265 ..... , - * - * in hexadecimal: - * pi = 3.243F6A8885A308D313198A2E.... - * 53 bits PI = 3.243F6A8885A30 = 2 * 1.921FB54442D18 error=.276ulps - * 56 bits PI = 3.243F6A8885A308 = 4 * .C90FDAA22168C2 error=.206ulps - * - * In a test run with 356,000 random argument on [-1,1] * [-1,1] on a - * VAX, the maximum observed error was 1.41 ulps (units of the last place) - * compared with (PI/pi)*(the exact ARG(x+iy)). - * - * Note: - * We use machine PI (the true pi rounded) in place of the actual - * value of pi for all the trig and inverse trig functions. In general, - * if trig is one of sin, cos, tan, then computed trig(y) returns the - * exact trig(y*pi/PI) nearly rounded; correspondingly, computed arctrig - * returns the exact arctrig(y)*PI/pi nearly rounded. These guarantee the - * trig functions have period PI, and trig(arctrig(x)) returns x for - * all critical values x. - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. - */ - -#include "mathimpl.h" - -vc(athfhi, 4.6364760900080611433E-1 ,6338,3fed,da7b,2b0d, -1, .ED63382B0DDA7B) -vc(athflo, 1.9338828231967579916E-19 ,5005,2164,92c0,9cfe, -62, .E450059CFE92C0) -vc(PIo4, 7.8539816339744830676E-1 ,0fda,4049,68c2,a221, 0, .C90FDAA22168C2) -vc(at1fhi, 9.8279372324732906796E-1 ,985e,407b,b4d9,940f, 0, .FB985E940FB4D9) -vc(at1flo,-3.5540295636764633916E-18 ,1edc,a383,eaea,34d6, -57,-.831EDC34D6EAEA) -vc(PIo2, 1.5707963267948966135E0 ,0fda,40c9,68c2,a221, 1, .C90FDAA22168C2) -vc(PI, 3.1415926535897932270E0 ,0fda,4149,68c2,a221, 2, .C90FDAA22168C2) -vc(a1, 3.3333333333333473730E-1 ,aaaa,3faa,ab75,aaaa, -1, .AAAAAAAAAAAB75) -vc(a2, -2.0000000000017730678E-1 ,cccc,bf4c,946e,cccd, -2,-.CCCCCCCCCD946E) -vc(a3, 1.4285714286694640301E-1 ,4924,3f12,4262,9274, -2, .92492492744262) -vc(a4, -1.1111111135032672795E-1 ,8e38,bee3,6292,ebc6, -3,-.E38E38EBC66292) -vc(a5, 9.0909091380563043783E-2 ,2e8b,3eba,d70c,b31b, -3, .BA2E8BB31BD70C) -vc(a6, -7.6922954286089459397E-2 ,89c8,be9d,7f18,27c3, -3,-.9D89C827C37F18) -vc(a7, 6.6663180891693915586E-2 ,86b4,3e88,9e58,ae37, -3, .8886B4AE379E58) -vc(a8, -5.8772703698290408927E-2 ,bba5,be70,a942,8481, -4,-.F0BBA58481A942) -vc(a9, 5.2170707402812969804E-2 ,b0f3,3e55,13ab,a1ab, -4, .D5B0F3A1AB13AB) -vc(a10, -4.4895863157820361210E-2 ,e4b9,be37,048f,7fd1, -4,-.B7E4B97FD1048F) -vc(a11, 3.3006147437343875094E-2 ,3174,3e07,2d87,3cf7, -4, .8731743CF72D87) -vc(a12, -1.4614844866464185439E-2 ,731a,bd6f,76d9,2f34, -6,-.EF731A2F3476D9) - -ic(athfhi, 4.6364760900080609352E-1 , -2, 1.DAC670561BB4F) -ic(athflo, 4.6249969567426939759E-18 , -58, 1.5543B8F253271) -ic(PIo4, 7.8539816339744827900E-1 , -1, 1.921FB54442D18) -ic(at1fhi, 9.8279372324732905408E-1 , -1, 1.F730BD281F69B) -ic(at1flo,-2.4407677060164810007E-17 , -56, -1.C23DFEFEAE6B5) -ic(PIo2, 1.5707963267948965580E0 , 0, 1.921FB54442D18) -ic(PI, 3.1415926535897931160E0 , 1, 1.921FB54442D18) -ic(a1, 3.3333333333333942106E-1 , -2, 1.55555555555C3) -ic(a2, -1.9999999999979536924E-1 , -3, -1.9999999997CCD) -ic(a3, 1.4285714278004377209E-1 , -3, 1.24924921EC1D7) -ic(a4, -1.1111110579344973814E-1 , -4, -1.C71C7059AF280) -ic(a5, 9.0908906105474668324E-2 , -4, 1.745CE5AA35DB2) -ic(a6, -7.6919217767468239799E-2 , -4, -1.3B0FA54BEC400) -ic(a7, 6.6614695906082474486E-2 , -4, 1.10DA924597FFF) -ic(a8, -5.8358371008508623523E-2 , -5, -1.DE125FDDBD793) -ic(a9, 4.9850617156082015213E-2 , -5, 1.9860524BDD807) -ic(a10, -3.6700606902093604877E-2 , -5, -1.2CA6C04C6937A) -ic(a11, 1.6438029044759730479E-2 , -6, 1.0D52174A1BB54) - -#ifdef vccast -#define athfhi vccast(athfhi) -#define athflo vccast(athflo) -#define PIo4 vccast(PIo4) -#define at1fhi vccast(at1fhi) -#define at1flo vccast(at1flo) -#define PIo2 vccast(PIo2) -#define PI vccast(PI) -#define a1 vccast(a1) -#define a2 vccast(a2) -#define a3 vccast(a3) -#define a4 vccast(a4) -#define a5 vccast(a5) -#define a6 vccast(a6) -#define a7 vccast(a7) -#define a8 vccast(a8) -#define a9 vccast(a9) -#define a10 vccast(a10) -#define a11 vccast(a11) -#define a12 vccast(a12) -#endif - -double atan2(y,x) -double y,x; -{ - static const double zero=0, one=1, small=1.0E-9, big=1.0E18; - double t,z,signy,signx,hi,lo; - int k,m; - -#if !defined(vax)&&!defined(tahoe) - /* if x or y is NAN */ - if(x!=x) return(x); if(y!=y) return(y); -#endif /* !defined(vax)&&!defined(tahoe) */ - - /* copy down the sign of y and x */ - signy = copysign(one,y) ; - signx = copysign(one,x) ; - - /* if x is 1.0, goto begin */ - if(x==1) { y=copysign(y,one); t=y; if(finite(t)) goto begin;} - - /* when y = 0 */ - if(y==zero) return((signx==one)?y:copysign(PI,signy)); - - /* when x = 0 */ - if(x==zero) return(copysign(PIo2,signy)); - - /* when x is INF */ - if(!finite(x)) - if(!finite(y)) - return(copysign((signx==one)?PIo4:3*PIo4,signy)); - else - return(copysign((signx==one)?zero:PI,signy)); - - /* when y is INF */ - if(!finite(y)) return(copysign(PIo2,signy)); - - /* compute y/x */ - x=copysign(x,one); - y=copysign(y,one); - if((m=(k=logb(y))-logb(x)) > 60) t=big+big; - else if(m < -80 ) t=y/x; - else { t = y/x ; y = scalb(y,-k); x=scalb(x,-k); } - - /* begin argument reduction */ -begin: - if (t < 2.4375) { - - /* truncate 4(t+1/16) to integer for branching */ - k = 4 * (t+0.0625); - switch (k) { - - /* t is in [0,7/16] */ - case 0: - case 1: - if (t < small) - { big + small ; /* raise inexact flag */ - return (copysign((signx>zero)?t:PI-t,signy)); } - - hi = zero; lo = zero; break; - - /* t is in [7/16,11/16] */ - case 2: - hi = athfhi; lo = athflo; - z = x+x; - t = ( (y+y) - x ) / ( z + y ); break; - - /* t is in [11/16,19/16] */ - case 3: - case 4: - hi = PIo4; lo = zero; - t = ( y - x ) / ( x + y ); break; - - /* t is in [19/16,39/16] */ - default: - hi = at1fhi; lo = at1flo; - z = y-x; y=y+y+y; t = x+x; - t = ( (z+z)-x ) / ( t + y ); break; - } - } - /* end of if (t < 2.4375) */ - - else - { - hi = PIo2; lo = zero; - - /* t is in [2.4375, big] */ - if (t <= big) t = - x / y; - - /* t is in [big, INF] */ - else - { big+small; /* raise inexact flag */ - t = zero; } - } - /* end of argument reduction */ - - /* compute atan(t) for t in [-.4375, .4375] */ - z = t*t; -#if defined(vax)||defined(tahoe) - z = t*(z*(a1+z*(a2+z*(a3+z*(a4+z*(a5+z*(a6+z*(a7+z*(a8+ - z*(a9+z*(a10+z*(a11+z*a12)))))))))))); -#else /* defined(vax)||defined(tahoe) */ - z = t*(z*(a1+z*(a2+z*(a3+z*(a4+z*(a5+z*(a6+z*(a7+z*(a8+ - z*(a9+z*(a10+z*a11))))))))))); -#endif /* defined(vax)||defined(tahoe) */ - z = lo - z; z += t; z += hi; - - return(copysign((signx>zero)?z:PI-z,signy)); -} diff --git a/sysdeps/generic/atanh.c b/sysdeps/generic/atanh.c deleted file mode 100644 index 89cb61cca2..0000000000 --- a/sysdeps/generic/atanh.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static char sccsid[] = "@(#)atanh.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ - -/* ATANH(X) - * RETURN THE HYPERBOLIC ARC TANGENT OF X - * DOUBLE PRECISION (VAX D format 56 bits, IEEE DOUBLE 53 BITS) - * CODED IN C BY K.C. NG, 1/8/85; - * REVISED BY K.C. NG on 2/7/85, 3/7/85, 8/18/85. - * - * Required kernel function: - * log1p(x) ...return log(1+x) - * - * Method : - * Return - * 1 2x x - * atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------) - * 2 1 - x 1 - x - * - * Special cases: - * atanh(x) is NaN if |x| > 1 with signal; - * atanh(NaN) is that NaN with no signal; - * atanh(+-1) is +-INF with signal. - * - * Accuracy: - * atanh(x) returns the exact hyperbolic arc tangent of x nearly rounded. - * In a test run with 512,000 random arguments on a VAX, the maximum - * observed error was 1.87 ulps (units in the last place) at - * x= -3.8962076028810414000e-03. - */ -#include "mathimpl.h" - -#if defined(vax)||defined(tahoe) -#include -#endif /* defined(vax)||defined(tahoe) */ - -double atanh(x) -double x; -{ - double z; - z = copysign(0.5,x); - x = copysign(x,1.0); -#if defined(vax)||defined(tahoe) - if (x == 1.0) { - return(copysign(1.0,z)*infnan(ERANGE)); /* sign(x)*INF */ - } -#endif /* defined(vax)||defined(tahoe) */ - x = x/(1.0-x); - return( z*log1p(x+x) ); -} diff --git a/sysdeps/generic/cabs.c b/sysdeps/generic/cabs.c deleted file mode 100644 index 6f4e1cd211..0000000000 --- a/sysdeps/generic/cabs.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 1992, 1993 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include -#include - -double -DEFUN(cabs, (z), struct __cabs_complex z) -{ - return hypot (z.__x, z.__y); -} diff --git a/sysdeps/generic/ceil.c b/sysdeps/generic/ceil.c deleted file mode 100644 index 6b7fad3ca8..0000000000 --- a/sysdeps/generic/ceil.c +++ /dev/null @@ -1,68 +0,0 @@ -/* snarfed from BSD common_source/floor.c: - * Copyright (c) 1985 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static char sccsid[] = "@(#)floor.c 5.7 (Berkeley) 10/9/90"; -#endif /* not lint */ - -#include "mathimpl.h" - -vc(L, 4503599627370496.0E0 ,0000,5c00,0000,0000, 55, 1.0) /* 2**55 */ - -ic(L, 4503599627370496.0E0, 52, 1.0) /* 2**52 */ - -#ifdef vccast -#define L vccast(L) -#endif - -double -ceil(x) -double x; -{ - double y; - - if ( -#if !defined(vax)&&!defined(tahoe) - x != x || /* NaN */ -#endif /* !defined(vax)&&!defined(tahoe) */ - x >= L) /* already an even integer */ - return x; - else if (x < (double)0) - return -floor(-x); - else { /* now 0 <= x < L */ - y = L+x; /* destructive store must be forced */ - y -= L; /* an integer, and |x-y| < 1 */ - return x > y ? y+(double)1 : y; - } -} - diff --git a/sysdeps/generic/copysign.c b/sysdeps/generic/copysign.c deleted file mode 100644 index 0bd3ed9360..0000000000 --- a/sysdeps/generic/copysign.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include -#include - -/* Return X with its signed changed to Y's. */ -double -DEFUN(__copysign, (x, y), double x AND double y) -{ - x = fabs (x); - return y < 0 ? - x : x; -} - -weak_alias (__copysign, copysign) diff --git a/sysdeps/generic/cosh.c b/sysdeps/generic/cosh.c deleted file mode 100644 index e2b30731b8..0000000000 --- a/sysdeps/generic/cosh.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static char sccsid[] = "@(#)cosh.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ - -/* COSH(X) - * RETURN THE HYPERBOLIC COSINE OF X - * DOUBLE PRECISION (VAX D format 56 bits, IEEE DOUBLE 53 BITS) - * CODED IN C BY K.C. NG, 1/8/85; - * REVISED BY K.C. NG on 2/8/85, 2/23/85, 3/7/85, 3/29/85, 4/16/85. - * - * Required system supported functions : - * copysign(x,y) - * scalb(x,N) - * - * Required kernel function: - * exp(x) - * exp__E(x,c) ...return exp(x+c)-1-x for |x|<0.3465 - * - * Method : - * 1. Replace x by |x|. - * 2. - * [ exp(x) - 1 ]^2 - * 0 <= x <= 0.3465 : cosh(x) := 1 + ------------------- - * 2*exp(x) - * - * exp(x) + 1/exp(x) - * 0.3465 <= x <= 22 : cosh(x) := ------------------- - * 2 - * 22 <= x <= lnovfl : cosh(x) := exp(x)/2 - * lnovfl <= x <= lnovfl+log(2) - * : cosh(x) := exp(x)/2 (avoid overflow) - * log(2)+lnovfl < x < INF: overflow to INF - * - * Note: .3465 is a number near one half of ln2. - * - * Special cases: - * cosh(x) is x if x is +INF, -INF, or NaN. - * only cosh(0)=1 is exact for finite x. - * - * Accuracy: - * cosh(x) returns the exact hyperbolic cosine of x nearly rounded. - * In a test run with 768,000 random arguments on a VAX, the maximum - * observed error was 1.23 ulps (units in the last place). - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. - */ - -#include "mathimpl.h" - -vc(mln2hi, 8.8029691931113054792E1 ,0f33,43b0,2bdb,c7e2, 7, .B00F33C7E22BDB) -vc(mln2lo,-4.9650192275318476525E-16 ,1b60,a70f,582a,279e, -50,-.8F1B60279E582A) -vc(lnovfl, 8.8029691931113053016E1 ,0f33,43b0,2bda,c7e2, 7, .B00F33C7E22BDA) - -ic(mln2hi, 7.0978271289338397310E2, 10, 1.62E42FEFA39EF) -ic(mln2lo, 2.3747039373786107478E-14, -45, 1.ABC9E3B39803F) -ic(lnovfl, 7.0978271289338397310E2, 9, 1.62E42FEFA39EF) - -#ifdef vccast -#define mln2hi vccast(mln2hi) -#define mln2lo vccast(mln2lo) -#define lnovfl vccast(lnovfl) -#endif - -#if defined(vax)||defined(tahoe) -static max = 126 ; -#else /* defined(vax)||defined(tahoe) */ -static max = 1023 ; -#endif /* defined(vax)||defined(tahoe) */ - -double cosh(x) -double x; -{ - static const double half=1.0/2.0, - one=1.0, small=1.0E-18; /* fl(1+small)==1 */ - double t; - -#if !defined(vax)&&!defined(tahoe) - if(x!=x) return(x); /* x is NaN */ -#endif /* !defined(vax)&&!defined(tahoe) */ - if((x=copysign(x,one)) <= 22) - if(x<0.3465) - if(x= lntiny ) { - - /* argument reduction : x --> x - k*ln2 */ - - k=invln2*x+copysign(0.5,x); /* k=NINT(x/ln2) */ - - /* express x-k*ln2 as hi-lo and let x=hi-lo rounded */ - - hi=x-k*ln2hi; - x=hi-(lo=k*ln2lo); - - /* return 2^k*[1+x+x*c/(2+c)] */ - z=x*x; - c= x - z*(p1+z*(p2+z*(p3+z*(p4+z*p5)))); - return scalb(1.0+(hi-(lo-(x*c)/(2.0-c))),k); - - } - /* end of x > lntiny */ - - else - /* exp(-big#) underflows to zero */ - if(finite(x)) return(scalb(1.0,-5000)); - - /* exp(-INF) is zero */ - else return(0.0); - } - /* end of x < lnhuge */ - - else - /* exp(INF) is INF, exp(+big#) overflows to INF */ - return( finite(x) ? scalb(1.0,5000) : x); -} - -/* returns exp(r = x + c) for |c| < |x| with no overlap. */ - -double __exp__D(x, c) -double x, c; -{ - double z,hi,lo, t; - int k; - -#if !defined(vax)&&!defined(tahoe) - if (x!=x) return(x); /* x is NaN */ -#endif /* !defined(vax)&&!defined(tahoe) */ - if ( x <= lnhuge ) { - if ( x >= lntiny ) { - - /* argument reduction : x --> x - k*ln2 */ - z = invln2*x; - k = z + copysign(.5, x); - - /* express (x+c)-k*ln2 as hi-lo and let x=hi-lo rounded */ - - hi=(x-k*ln2hi); /* Exact. */ - x= hi - (lo = k*ln2lo-c); - /* return 2^k*[1+x+x*c/(2+c)] */ - z=x*x; - c= x - z*(p1+z*(p2+z*(p3+z*(p4+z*p5)))); - c = (x*c)/(2.0-c); - - return scalb(1.+(hi-(lo - c)), k); - } - /* end of x > lntiny */ - - else - /* exp(-big#) underflows to zero */ - if(finite(x)) return(scalb(1.0,-5000)); - - /* exp(-INF) is zero */ - else return(0.0); - } - /* end of x < lnhuge */ - - else - /* exp(INF) is INF, exp(+big#) overflows to INF */ - return( finite(x) ? scalb(1.0,5000) : x); -} diff --git a/sysdeps/generic/expm1.c b/sysdeps/generic/expm1.c deleted file mode 100644 index 383902a928..0000000000 --- a/sysdeps/generic/expm1.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static char sccsid[] = "@(#)expm1.c 8.1 (Berkeley) 6/4/93"; -#endif /* not lint */ - -/* EXPM1(X) - * RETURN THE EXPONENTIAL OF X MINUS ONE - * DOUBLE PRECISION (IEEE 53 BITS, VAX D FORMAT 56 BITS) - * CODED IN C BY K.C. NG, 1/19/85; - * REVISED BY K.C. NG on 2/6/85, 3/7/85, 3/21/85, 4/16/85. - * - * Required system supported functions: - * scalb(x,n) - * copysign(x,y) - * finite(x) - * - * Kernel function: - * exp__E(x,c) - * - * Method: - * 1. Argument Reduction: given the input x, find r and integer k such - * that - * x = k*ln2 + r, |r| <= 0.5*ln2 . - * r will be represented as r := z+c for better accuracy. - * - * 2. Compute EXPM1(r)=exp(r)-1 by - * - * EXPM1(r=z+c) := z + exp__E(z,c) - * - * 3. EXPM1(x) = 2^k * ( EXPM1(r) + 1-2^-k ). - * - * Remarks: - * 1. When k=1 and z < -0.25, we use the following formula for - * better accuracy: - * EXPM1(x) = 2 * ( (z+0.5) + exp__E(z,c) ) - * 2. To avoid rounding error in 1-2^-k where k is large, we use - * EXPM1(x) = 2^k * { [z+(exp__E(z,c)-2^-k )] + 1 } - * when k>56. - * - * Special cases: - * EXPM1(INF) is INF, EXPM1(NaN) is NaN; - * EXPM1(-INF)= -1; - * for finite argument, only EXPM1(0)=0 is exact. - * - * Accuracy: - * EXPM1(x) returns the exact (exp(x)-1) nearly rounded. In a test run with - * 1,166,000 random arguments on a VAX, the maximum observed error was - * .872 ulps (units of the last place). - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. - */ - -#include "mathimpl.h" - -vc(ln2hi, 6.9314718055829871446E-1 ,7217,4031,0000,f7d0, 0, .B17217F7D00000) -vc(ln2lo, 1.6465949582897081279E-12 ,bcd5,2ce7,d9cc,e4f1, -39, .E7BCD5E4F1D9CC) -vc(lnhuge, 9.4961163736712506989E1 ,ec1d,43bd,9010,a73e, 7, .BDEC1DA73E9010) -vc(invln2, 1.4426950408889634148E0 ,aa3b,40b8,17f1,295c, 1, .B8A