From 651dbab2764a24b5ba62fb0f850d4ddf01ca25d3 Mon Sep 17 00:00:00 2001 From: das Date: Fri, 4 Feb 2005 14:08:32 +0000 Subject: [PATCH] Remove wrappers and other cruft intended to support SVID, mistakes in C90, and other arcana. Most of these features were never fully supported or enabled by default. Ok: bde, stefanf --- lib/msun/Makefile | 45 +- lib/msun/amd64/e_sqrt.S | 2 +- lib/msun/i387/e_acos.S | 2 +- lib/msun/i387/e_asin.S | 2 +- lib/msun/i387/e_atan2.S | 2 +- lib/msun/i387/e_atan2f.S | 2 +- lib/msun/i387/e_exp.S | 2 +- lib/msun/i387/e_fmod.S | 2 +- lib/msun/i387/e_log.S | 2 +- lib/msun/i387/e_log10.S | 2 +- lib/msun/i387/e_log10f.S | 2 +- lib/msun/i387/e_logf.S | 2 +- lib/msun/i387/e_remainder.S | 2 +- lib/msun/i387/e_remainderf.S | 2 +- lib/msun/i387/e_scalb.S | 2 +- lib/msun/i387/e_scalbf.S | 2 +- lib/msun/i387/e_sqrt.S | 2 +- lib/msun/i387/e_sqrtf.S | 2 +- lib/msun/src/k_standard.c | 774 ----------------------------------- lib/msun/src/math.h | 45 -- lib/msun/src/math_private.h | 118 +++--- lib/msun/src/s_lib_version.c | 39 -- lib/msun/src/s_matherr.c | 25 -- lib/msun/src/w_acos.c | 39 -- lib/msun/src/w_acosf.c | 43 -- lib/msun/src/w_acosh.c | 38 -- lib/msun/src/w_acoshf.c | 43 -- lib/msun/src/w_asin.c | 40 -- lib/msun/src/w_asinf.c | 44 -- lib/msun/src/w_atan2.c | 39 -- lib/msun/src/w_atan2f.c | 43 -- lib/msun/src/w_atanh.c | 43 -- lib/msun/src/w_atanhf.c | 48 --- lib/msun/src/w_cosh.c | 38 -- lib/msun/src/w_coshf.c | 42 -- lib/msun/src/w_exp.c | 45 -- lib/msun/src/w_expf.c | 50 --- lib/msun/src/w_fmod.c | 39 -- lib/msun/src/w_fmodf.c | 43 -- lib/msun/src/w_gamma.c | 45 -- lib/msun/src/w_gamma_r.c | 42 -- lib/msun/src/w_gammaf.c | 44 -- lib/msun/src/w_gammaf_r.c | 47 --- lib/msun/src/w_hypot.c | 39 -- lib/msun/src/w_hypotf.c | 43 -- lib/msun/src/w_j0.c | 37 -- lib/msun/src/w_j0f.c | 41 -- lib/msun/src/w_j1.c | 38 -- lib/msun/src/w_j1f.c | 42 -- lib/msun/src/w_jn.c | 38 -- lib/msun/src/w_jnf.c | 38 -- lib/msun/src/w_lgamma.c | 45 -- lib/msun/src/w_lgamma_r.c | 42 -- lib/msun/src/w_lgammaf.c | 44 -- lib/msun/src/w_lgammaf_r.c | 47 --- lib/msun/src/w_log.c | 39 -- lib/msun/src/w_log10.c | 42 -- lib/msun/src/w_log10f.c | 47 --- lib/msun/src/w_logf.c | 44 -- lib/msun/src/w_pow.c | 60 --- lib/msun/src/w_powf.c | 68 --- lib/msun/src/w_remainder.c | 38 -- lib/msun/src/w_remainderf.c | 42 -- lib/msun/src/w_scalb.c | 53 --- lib/msun/src/w_scalbf.c | 58 --- lib/msun/src/w_sinh.c | 38 -- lib/msun/src/w_sinhf.c | 42 -- lib/msun/src/w_sqrt.c | 38 -- lib/msun/src/w_sqrtf.c | 42 -- lib/msun/src/w_y0.c | 46 --- lib/msun/src/w_y0f.c | 50 --- lib/msun/src/w_y1.c | 46 --- lib/msun/src/w_y1f.c | 50 --- lib/msun/src/w_yn.c | 46 --- lib/msun/src/w_ynf.c | 46 --- 75 files changed, 81 insertions(+), 3283 deletions(-) delete mode 100644 lib/msun/src/k_standard.c delete mode 100644 lib/msun/src/s_lib_version.c delete mode 100644 lib/msun/src/s_matherr.c delete mode 100644 lib/msun/src/w_acos.c delete mode 100644 lib/msun/src/w_acosf.c delete mode 100644 lib/msun/src/w_acosh.c delete mode 100644 lib/msun/src/w_acoshf.c delete mode 100644 lib/msun/src/w_asin.c delete mode 100644 lib/msun/src/w_asinf.c delete mode 100644 lib/msun/src/w_atan2.c delete mode 100644 lib/msun/src/w_atan2f.c delete mode 100644 lib/msun/src/w_atanh.c delete mode 100644 lib/msun/src/w_atanhf.c delete mode 100644 lib/msun/src/w_cosh.c delete mode 100644 lib/msun/src/w_coshf.c delete mode 100644 lib/msun/src/w_exp.c delete mode 100644 lib/msun/src/w_expf.c delete mode 100644 lib/msun/src/w_fmod.c delete mode 100644 lib/msun/src/w_fmodf.c delete mode 100644 lib/msun/src/w_gamma.c delete mode 100644 lib/msun/src/w_gamma_r.c delete mode 100644 lib/msun/src/w_gammaf.c delete mode 100644 lib/msun/src/w_gammaf_r.c delete mode 100644 lib/msun/src/w_hypot.c delete mode 100644 lib/msun/src/w_hypotf.c delete mode 100644 lib/msun/src/w_j0.c delete mode 100644 lib/msun/src/w_j0f.c delete mode 100644 lib/msun/src/w_j1.c delete mode 100644 lib/msun/src/w_j1f.c delete mode 100644 lib/msun/src/w_jn.c delete mode 100644 lib/msun/src/w_jnf.c delete mode 100644 lib/msun/src/w_lgamma.c delete mode 100644 lib/msun/src/w_lgamma_r.c delete mode 100644 lib/msun/src/w_lgammaf.c delete mode 100644 lib/msun/src/w_lgammaf_r.c delete mode 100644 lib/msun/src/w_log.c delete mode 100644 lib/msun/src/w_log10.c delete mode 100644 lib/msun/src/w_log10f.c delete mode 100644 lib/msun/src/w_logf.c delete mode 100644 lib/msun/src/w_pow.c delete mode 100644 lib/msun/src/w_powf.c delete mode 100644 lib/msun/src/w_remainder.c delete mode 100644 lib/msun/src/w_remainderf.c delete mode 100644 lib/msun/src/w_scalb.c delete mode 100644 lib/msun/src/w_scalbf.c delete mode 100644 lib/msun/src/w_sinh.c delete mode 100644 lib/msun/src/w_sinhf.c delete mode 100644 lib/msun/src/w_sqrt.c delete mode 100644 lib/msun/src/w_sqrtf.c delete mode 100644 lib/msun/src/w_y0.c delete mode 100644 lib/msun/src/w_y0f.c delete mode 100644 lib/msun/src/w_y1.c delete mode 100644 lib/msun/src/w_y1f.c delete mode 100644 lib/msun/src/w_yn.c delete mode 100644 lib/msun/src/w_ynf.c diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 491771243bab..29881027b1b5 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -12,35 +12,6 @@ # # -# -# There are two options in making libm at fdlibm compile time: -# _IEEE_LIBM --- IEEE libm; smaller, and somewhat faster -# _MULTI_LIBM --- Support multi-standard at runtime by -# imposing wrapper functions defined in -# math.h: -# _IEEE_MODE -- IEEE -# _XOPEN_MODE -- X/OPEN -# _POSIX_MODE -- POSIX/ANSI -# _SVID3_MODE -- SVID -# -# Here is how to set up CFLAGS to create the desired libm at -# compile time: -# -# CFLAGS = -D_IEEE_LIBM ... IEEE libm (recommended) -# CFLAGS = -D_SVID3_MODE ... Multi-standard supported -# libm with SVID as the -# default standard -# CFLAGS = -D_XOPEN_MODE ... Multi-standard supported -# libm with XOPEN as the -# default standard -# CFLAGS = -D_POSIX_MODE ... Multi-standard supported -# libm with POSIX as the -# default standard -# CFLAGS = ... Multi-standard supported -# libm with IEEE as the -# default standard -# - # XXX MD crud should be in separate makefiles .if ${MACHINE_ARCH} == "alpha" ARCH_SRCS = s_copysign.S s_copysignf.S @@ -86,7 +57,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \ e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \ e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c fenv.c \ k_cos.c k_cosf.c k_rem_pio2.c k_rem_pio2f.c k_sin.c k_sinf.c \ - k_standard.c k_tan.c k_tanf.c \ + k_tan.c k_tanf.c \ s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_cbrt.c s_cbrtf.c \ s_ceil.c s_ceilf.c s_ceill.c \ s_copysign.c s_copysignf.c s_cos.c s_cosf.c s_erf.c s_erff.c \ @@ -95,23 +66,15 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \ s_fmax.c s_fmaxf.c s_fmaxl.c s_fmin.c \ s_fminf.c s_fminl.c s_frexp.c s_frexpf.c s_ilogb.c s_ilogbf.c \ s_ilogbl.c s_isfinite.c s_isnan.c s_isnormal.c s_ldexpf.c \ - s_lib_version.c s_llrint.c s_llrintf.c s_llround.c s_llroundf.c \ + s_llrint.c s_llrintf.c s_llround.c s_llroundf.c \ s_log1p.c s_log1pf.c s_logb.c s_logbf.c s_lrint.c s_lrintf.c \ - s_lround.c s_lroundf.c s_matherr.c s_modff.c \ + s_lround.c s_lroundf.c s_modff.c \ s_nearbyint.c s_nextafter.c s_nextafterf.c \ s_rint.c s_rintf.c s_round.c s_roundf.c \ s_scalbln.c s_scalbn.c s_scalbnf.c s_signbit.c \ s_signgam.c s_significand.c s_significandf.c s_sin.c s_sinf.c s_tan.c \ s_tanf.c s_tanh.c s_tanhf.c s_trunc.c s_truncf.c \ - w_acos.c w_acosf.c w_acosh.c w_acoshf.c w_asin.c w_asinf.c w_atan2.c \ - w_atan2f.c w_atanh.c w_atanhf.c w_cabs.c w_cabsf.c w_cosh.c w_coshf.c \ - w_drem.c w_dremf.c w_exp.c w_expf.c w_fmod.c w_fmodf.c w_gamma.c \ - w_gamma_r.c w_gammaf.c w_gammaf_r.c w_hypot.c w_hypotf.c w_j0.c \ - w_j0f.c w_j1.c w_j1f.c w_jn.c w_jnf.c w_lgamma.c w_lgamma_r.c \ - w_lgammaf.c w_lgammaf_r.c w_log.c w_log10.c w_log10f.c w_logf.c \ - w_pow.c w_powf.c w_remainder.c w_remainderf.c w_scalb.c w_scalbf.c \ - w_sinh.c w_sinhf.c w_sqrt.c w_sqrtf.c \ - w_y0.c w_y0f.c w_y1.c w_y1f.c w_yn.c w_ynf.c + w_cabs.c w_cabsf.c w_drem.c w_dremf.c # Location of fpmath.h and _fpmath.h LIBCDIR= ${.CURDIR}/../libc diff --git a/lib/msun/amd64/e_sqrt.S b/lib/msun/amd64/e_sqrt.S index 500c677fa3c0..f4b4f62b5ce0 100644 --- a/lib/msun/amd64/e_sqrt.S +++ b/lib/msun/amd64/e_sqrt.S @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$") -ENTRY(__ieee754_sqrt) +ENTRY(sqrt) sqrtsd %xmm0, %xmm0 ret diff --git a/lib/msun/i387/e_acos.S b/lib/msun/i387/e_acos.S index bd1499c66d5f..8ea130d97135 100644 --- a/lib/msun/i387/e_acos.S +++ b/lib/msun/i387/e_acos.S @@ -42,7 +42,7 @@ RCSID("$FreeBSD$") * Actually evaluate (1 - x^2) as (1 - x) * (1 + x) to avoid loss of * precision when |x| is nearly 1. */ -ENTRY(__ieee754_acos) +ENTRY(acos) fldl 4(%esp) /* x */ fld1 fld %st(0) diff --git a/lib/msun/i387/e_asin.S b/lib/msun/i387/e_asin.S index 1876cfd7d343..add6f32f6b01 100644 --- a/lib/msun/i387/e_asin.S +++ b/lib/msun/i387/e_asin.S @@ -42,7 +42,7 @@ RCSID("$FreeBSD$") * Actually evaluate (1 - x^2) as (1 - x) * (1 + x) to avoid loss of * precision when |x| is nearly 1. */ -ENTRY(__ieee754_asin) +ENTRY(asin) fldl 4(%esp) /* x */ fld1 fld %st(0) diff --git a/lib/msun/i387/e_atan2.S b/lib/msun/i387/e_atan2.S index 456de5636f60..8afa50ba219f 100644 --- a/lib/msun/i387/e_atan2.S +++ b/lib/msun/i387/e_atan2.S @@ -37,7 +37,7 @@ RCSID("$FreeBSD$") -ENTRY(__ieee754_atan2) +ENTRY(atan2) fldl 4(%esp) fldl 12(%esp) fpatan diff --git a/lib/msun/i387/e_atan2f.S b/lib/msun/i387/e_atan2f.S index ca5c79c44ebc..578a47c86739 100644 --- a/lib/msun/i387/e_atan2f.S +++ b/lib/msun/i387/e_atan2f.S @@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$"); /* RCSID("$NetBSD: e_atan2f.S,v 1.1 1995/05/08 23:35:10 jtc Exp $") */ -ENTRY(__ieee754_atan2f) +ENTRY(atan2f) flds 4(%esp) flds 8(%esp) fpatan diff --git a/lib/msun/i387/e_exp.S b/lib/msun/i387/e_exp.S index 9277c87dc92a..d21958c0b4a6 100644 --- a/lib/msun/i387/e_exp.S +++ b/lib/msun/i387/e_exp.S @@ -38,7 +38,7 @@ RCSID("$FreeBSD$") /* e^x = 2^(x * log2(e)) */ -ENTRY(__ieee754_exp) +ENTRY(exp) /* * If x is +-Inf, then the subtraction would give Inf-Inf = NaN. * Avoid this. Also avoid it if x is NaN for convenience. diff --git a/lib/msun/i387/e_fmod.S b/lib/msun/i387/e_fmod.S index d8527b5145f6..71c4c3062ee5 100644 --- a/lib/msun/i387/e_fmod.S +++ b/lib/msun/i387/e_fmod.S @@ -37,7 +37,7 @@ RCSID("$FreeBSD$") -ENTRY(__ieee754_fmod) +ENTRY(fmod) fldl 12(%esp) fldl 4(%esp) 1: fprem diff --git a/lib/msun/i387/e_log.S b/lib/msun/i387/e_log.S index 79a58c1739e3..0d06940a670b 100644 --- a/lib/msun/i387/e_log.S +++ b/lib/msun/i387/e_log.S @@ -37,7 +37,7 @@ RCSID("$FreeBSD$") -ENTRY(__ieee754_log) +ENTRY(log) fldln2 fldl 4(%esp) fyl2x diff --git a/lib/msun/i387/e_log10.S b/lib/msun/i387/e_log10.S index c7f9bc437ac8..edc13ffb8bd2 100644 --- a/lib/msun/i387/e_log10.S +++ b/lib/msun/i387/e_log10.S @@ -37,7 +37,7 @@ RCSID("$FreeBSD$") -ENTRY(__ieee754_log10) +ENTRY(log10) fldlg2 fldl 4(%esp) fyl2x diff --git a/lib/msun/i387/e_log10f.S b/lib/msun/i387/e_log10f.S index 7623938864d9..44410bc2b8ec 100644 --- a/lib/msun/i387/e_log10f.S +++ b/lib/msun/i387/e_log10f.S @@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$"); /* RCSID("$NetBSD: e_log10f.S,v 1.1 1996/07/03 16:50:22 jtc Exp $") */ -ENTRY(__ieee754_log10f) +ENTRY(log10f) fldlg2 flds 4(%esp) fyl2x diff --git a/lib/msun/i387/e_logf.S b/lib/msun/i387/e_logf.S index a8bf1f6376a8..e66c844e20ef 100644 --- a/lib/msun/i387/e_logf.S +++ b/lib/msun/i387/e_logf.S @@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$"); /* RCSID("$NetBSD: e_logf.S,v 1.2 1996/07/06 00:15:45 jtc Exp $") */ -ENTRY(__ieee754_logf) +ENTRY(logf) fldln2 flds 4(%esp) fyl2x diff --git a/lib/msun/i387/e_remainder.S b/lib/msun/i387/e_remainder.S index 67c1de07fdf2..ff2f1426ec14 100644 --- a/lib/msun/i387/e_remainder.S +++ b/lib/msun/i387/e_remainder.S @@ -37,7 +37,7 @@ RCSID("$FreeBSD$") -ENTRY(__ieee754_remainder) +ENTRY(remainder) fldl 12(%esp) fldl 4(%esp) 1: fprem1 diff --git a/lib/msun/i387/e_remainderf.S b/lib/msun/i387/e_remainderf.S index 24857fa66f27..4093c8a289b5 100644 --- a/lib/msun/i387/e_remainderf.S +++ b/lib/msun/i387/e_remainderf.S @@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$"); /* RCSID("$NetBSD: e_remainderf.S,v 1.2 1995/05/08 23:49:47 jtc Exp $") */ -ENTRY(__ieee754_remainderf) +ENTRY(remainderf) flds 8(%esp) flds 4(%esp) 1: fprem1 diff --git a/lib/msun/i387/e_scalb.S b/lib/msun/i387/e_scalb.S index fc8bb779525a..1aa510fece5d 100644 --- a/lib/msun/i387/e_scalb.S +++ b/lib/msun/i387/e_scalb.S @@ -37,7 +37,7 @@ RCSID("$FreeBSD$") -ENTRY(__ieee754_scalb) +ENTRY(scalb) fldl 12(%esp) fldl 4(%esp) fscale diff --git a/lib/msun/i387/e_scalbf.S b/lib/msun/i387/e_scalbf.S index a3911d77f7f5..d937dd50dcb2 100644 --- a/lib/msun/i387/e_scalbf.S +++ b/lib/msun/i387/e_scalbf.S @@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$"); /* RCSID("$NetBSD: e_scalbf.S,v 1.1 1996/07/03 16:50:24 jtc Exp $") */ -ENTRY(__ieee754_scalbf) +ENTRY(scalbf) flds 8(%esp) flds 4(%esp) fscale diff --git a/lib/msun/i387/e_sqrt.S b/lib/msun/i387/e_sqrt.S index f0403f0dfd7f..554beb706eb1 100644 --- a/lib/msun/i387/e_sqrt.S +++ b/lib/msun/i387/e_sqrt.S @@ -37,7 +37,7 @@ RCSID("$FreeBSD$") -ENTRY(__ieee754_sqrt) +ENTRY(sqrt) fldl 4(%esp) fsqrt ret diff --git a/lib/msun/i387/e_sqrtf.S b/lib/msun/i387/e_sqrtf.S index 4c92e0fa1d4e..9d78725030cd 100644 --- a/lib/msun/i387/e_sqrtf.S +++ b/lib/msun/i387/e_sqrtf.S @@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$"); /* RCSID("$NetBSD: e_sqrtf.S,v 1.2 1995/05/08 23:50:14 jtc Exp $") */ -ENTRY(__ieee754_sqrtf) +ENTRY(sqrtf) flds 4(%esp) fsqrt ret diff --git a/lib/msun/src/k_standard.c b/lib/msun/src/k_standard.c deleted file mode 100644 index 2f36ef1f0a53..000000000000 --- a/lib/msun/src/k_standard.c +++ /dev/null @@ -1,774 +0,0 @@ -/* @(#)k_standard.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -#include "math.h" -#include "math_private.h" -#include - -#ifndef _USE_WRITE -#include /* fputs(), stderr */ -#define WRITE2(u,v) fputs(u, stderr) -#else /* !defined(_USE_WRITE) */ -#include /* write */ -#define WRITE2(u,v) write(2, u, v) -#undef fflush -#endif /* !defined(_USE_WRITE) */ - -static const double zero = 0.0; /* used as const */ - -/* - * Standard conformance (non-IEEE) on exception cases. - * Mapping: - * 1 -- acos(|x|>1) - * 2 -- asin(|x|>1) - * 3 -- atan2(+-0,+-0) - * 4 -- hypot overflow - * 5 -- cosh overflow - * 6 -- exp overflow - * 7 -- exp underflow - * 8 -- y0(0) - * 9 -- y0(-ve) - * 10-- y1(0) - * 11-- y1(-ve) - * 12-- yn(0) - * 13-- yn(-ve) - * 14-- lgamma(finite) overflow - * 15-- lgamma(-integer) - * 16-- log(0) - * 17-- log(x<0) - * 18-- log10(0) - * 19-- log10(x<0) - * 20-- pow(0.0,0.0) - * 21-- pow(x,y) overflow - * 22-- pow(x,y) underflow - * 23-- pow(0,negative) - * 24-- pow(neg,non-integral) - * 25-- sinh(finite) overflow - * 26-- sqrt(negative) - * 27-- fmod(x,0) - * 28-- remainder(x,0) - * 29-- acosh(x<1) - * 30-- atanh(|x|>1) - * 31-- atanh(|x|=1) - * 32-- scalb overflow - * 33-- scalb underflow - * 34-- j0(|x|>X_TLOSS) - * 35-- y0(x>X_TLOSS) - * 36-- j1(|x|>X_TLOSS) - * 37-- y1(x>X_TLOSS) - * 38-- jn(|x|>X_TLOSS, n) - * 39-- yn(x>X_TLOSS, n) - * 40-- gamma(finite) overflow - * 41-- gamma(-integer) - * 42-- pow(NaN,0.0) - */ - - -double -__kernel_standard(double x, double y, int type) -{ - struct exception exc; -#ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */ -#define HUGE_VAL inf - double inf = 0.0; - - SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */ -#endif - -#ifdef _USE_WRITE - (void) fflush(stdout); -#endif - exc.arg1 = x; - exc.arg2 = y; - switch(type) { - case 1: - case 101: - /* acos(|x|>1) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "acos" : "acosf"; - exc.retval = zero; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if(_LIB_VERSION == _SVID_) { - (void) WRITE2("acos: DOMAIN error\n", 19); - } - errno = EDOM; - } - break; - case 2: - case 102: - /* asin(|x|>1) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "asin" : "asinf"; - exc.retval = zero; - if(_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if(_LIB_VERSION == _SVID_) { - (void) WRITE2("asin: DOMAIN error\n", 19); - } - errno = EDOM; - } - break; - case 3: - case 103: - /* atan2(+-0,+-0) */ - exc.arg1 = y; - exc.arg2 = x; - exc.type = DOMAIN; - exc.name = type < 100 ? "atan2" : "atan2f"; - exc.retval = zero; - if(_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if(_LIB_VERSION == _SVID_) { - (void) WRITE2("atan2: DOMAIN error\n", 20); - } - errno = EDOM; - } - break; - case 4: - case 104: - /* hypot(finite,finite) overflow */ - exc.type = OVERFLOW; - exc.name = type < 100 ? "hypot" : "hypotf"; - if (_LIB_VERSION == _SVID_) - exc.retval = HUGE; - else - exc.retval = HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 5: - case 105: - /* cosh(finite) overflow */ - exc.type = OVERFLOW; - exc.name = type < 100 ? "cosh" : "coshf"; - if (_LIB_VERSION == _SVID_) - exc.retval = HUGE; - else - exc.retval = HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 6: - case 106: - /* exp(finite) overflow */ - exc.type = OVERFLOW; - exc.name = type < 100 ? "exp" : "expf"; - if (_LIB_VERSION == _SVID_) - exc.retval = HUGE; - else - exc.retval = HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 7: - case 107: - /* exp(finite) underflow */ - exc.type = UNDERFLOW; - exc.name = type < 100 ? "exp" : "expf"; - exc.retval = zero; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 8: - case 108: - /* y0(0) = -inf */ - exc.type = DOMAIN; /* should be SING for IEEE */ - exc.name = type < 100 ? "y0" : "y0f"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("y0: DOMAIN error\n", 17); - } - errno = EDOM; - } - break; - case 9: - case 109: - /* y0(x<0) = NaN */ - exc.type = DOMAIN; - exc.name = type < 100 ? "y0" : "y0f"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("y0: DOMAIN error\n", 17); - } - errno = EDOM; - } - break; - case 10: - case 110: - /* y1(0) = -inf */ - exc.type = DOMAIN; /* should be SING for IEEE */ - exc.name = type < 100 ? "y1" : "y1f"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("y1: DOMAIN error\n", 17); - } - errno = EDOM; - } - break; - case 11: - case 111: - /* y1(x<0) = NaN */ - exc.type = DOMAIN; - exc.name = type < 100 ? "y1" : "y1f"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("y1: DOMAIN error\n", 17); - } - errno = EDOM; - } - break; - case 12: - case 112: - /* yn(n,0) = -inf */ - exc.type = DOMAIN; /* should be SING for IEEE */ - exc.name = type < 100 ? "yn" : "ynf"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("yn: DOMAIN error\n", 17); - } - errno = EDOM; - } - break; - case 13: - case 113: - /* yn(x<0) = NaN */ - exc.type = DOMAIN; - exc.name = type < 100 ? "yn" : "ynf"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("yn: DOMAIN error\n", 17); - } - errno = EDOM; - } - break; - case 14: - case 114: - /* lgamma(finite) overflow */ - exc.type = OVERFLOW; - exc.name = type < 100 ? "lgamma" : "lgammaf"; - if (_LIB_VERSION == _SVID_) - exc.retval = HUGE; - else - exc.retval = HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 15: - case 115: - /* lgamma(-integer) or lgamma(0) */ - exc.type = SING; - exc.name = type < 100 ? "lgamma" : "lgammaf"; - if (_LIB_VERSION == _SVID_) - exc.retval = HUGE; - else - exc.retval = HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("lgamma: SING error\n", 19); - } - errno = EDOM; - } - break; - case 16: - case 116: - /* log(0) */ - exc.type = SING; - exc.name = type < 100 ? "log" : "logf"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("log: SING error\n", 16); - } - errno = EDOM; - } - break; - case 17: - case 117: - /* log(x<0) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "log" : "logf"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("log: DOMAIN error\n", 18); - } - errno = EDOM; - } - break; - case 18: - case 118: - /* log10(0) */ - exc.type = SING; - exc.name = type < 100 ? "log10" : "log10f"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("log10: SING error\n", 18); - } - errno = EDOM; - } - break; - case 19: - case 119: - /* log10(x<0) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "log10" : "log10f"; - if (_LIB_VERSION == _SVID_) - exc.retval = -HUGE; - else - exc.retval = -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("log10: DOMAIN error\n", 20); - } - errno = EDOM; - } - break; - case 20: - case 120: - /* pow(0.0,0.0) */ - /* error only if _LIB_VERSION == _SVID_ */ - exc.type = DOMAIN; - exc.name = type < 100 ? "pow" : "powf"; - exc.retval = zero; - if (_LIB_VERSION != _SVID_) exc.retval = 1.0; - else if (!matherr(&exc)) { - (void) WRITE2("pow(0,0): DOMAIN error\n", 23); - errno = EDOM; - } - break; - case 21: - case 121: - /* pow(x,y) overflow */ - exc.type = OVERFLOW; - exc.name = type < 100 ? "pow" : "powf"; - if (_LIB_VERSION == _SVID_) { - exc.retval = HUGE; - y *= 0.5; - if(xzero) ? HUGE : -HUGE); - else - exc.retval = ( (x>zero) ? HUGE_VAL : -HUGE_VAL); - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 26: - case 126: - /* sqrt(x<0) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "sqrt" : "sqrtf"; - if (_LIB_VERSION == _SVID_) - exc.retval = zero; - else - exc.retval = zero/zero; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("sqrt: DOMAIN error\n", 19); - } - errno = EDOM; - } - break; - case 27: - case 127: - /* fmod(x,0) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "fmod" : "fmodf"; - if (_LIB_VERSION == _SVID_) - exc.retval = x; - else - exc.retval = zero/zero; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("fmod: DOMAIN error\n", 20); - } - errno = EDOM; - } - break; - case 28: - case 128: - /* remainder(x,0) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "remainder" : "remainderf"; - exc.retval = zero/zero; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("remainder: DOMAIN error\n", 24); - } - errno = EDOM; - } - break; - case 29: - case 129: - /* acosh(x<1) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "acosh" : "acoshf"; - exc.retval = zero/zero; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("acosh: DOMAIN error\n", 20); - } - errno = EDOM; - } - break; - case 30: - case 130: - /* atanh(|x|>1) */ - exc.type = DOMAIN; - exc.name = type < 100 ? "atanh" : "atanhf"; - exc.retval = zero/zero; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("atanh: DOMAIN error\n", 20); - } - errno = EDOM; - } - break; - case 31: - case 131: - /* atanh(|x|=1) */ - exc.type = SING; - exc.name = type < 100 ? "atanh" : "atanhf"; - exc.retval = x/zero; /* sign(x)*inf */ - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("atanh: SING error\n", 18); - } - errno = EDOM; - } - break; - case 32: - case 132: - /* scalb overflow; SVID also returns +-HUGE_VAL */ - exc.type = OVERFLOW; - exc.name = type < 100 ? "scalb" : "scalbf"; - exc.retval = x > zero ? HUGE_VAL : -HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 33: - case 133: - /* scalb underflow */ - exc.type = UNDERFLOW; - exc.name = type < 100 ? "scalb" : "scalbf"; - exc.retval = copysign(zero,x); - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 34: - case 134: - /* j0(|x|>X_TLOSS) */ - exc.type = TLOSS; - exc.name = type < 100 ? "j0" : "j0f"; - exc.retval = zero; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2(exc.name, 2); - (void) WRITE2(": TLOSS error\n", 14); - } - errno = ERANGE; - } - break; - case 35: - case 135: - /* y0(x>X_TLOSS) */ - exc.type = TLOSS; - exc.name = type < 100 ? "y0" : "y0f"; - exc.retval = zero; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2(exc.name, 2); - (void) WRITE2(": TLOSS error\n", 14); - } - errno = ERANGE; - } - break; - case 36: - case 136: - /* j1(|x|>X_TLOSS) */ - exc.type = TLOSS; - exc.name = type < 100 ? "j1" : "j1f"; - exc.retval = zero; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2(exc.name, 2); - (void) WRITE2(": TLOSS error\n", 14); - } - errno = ERANGE; - } - break; - case 37: - case 137: - /* y1(x>X_TLOSS) */ - exc.type = TLOSS; - exc.name = type < 100 ? "y1" : "y1f"; - exc.retval = zero; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2(exc.name, 2); - (void) WRITE2(": TLOSS error\n", 14); - } - errno = ERANGE; - } - break; - case 38: - case 138: - /* jn(|x|>X_TLOSS) */ - exc.type = TLOSS; - exc.name = type < 100 ? "jn" : "jnf"; - exc.retval = zero; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2(exc.name, 2); - (void) WRITE2(": TLOSS error\n", 14); - } - errno = ERANGE; - } - break; - case 39: - case 139: - /* yn(x>X_TLOSS) */ - exc.type = TLOSS; - exc.name = type < 100 ? "yn" : "ynf"; - exc.retval = zero; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2(exc.name, 2); - (void) WRITE2(": TLOSS error\n", 14); - } - errno = ERANGE; - } - break; - case 40: - case 140: - /* gamma(finite) overflow */ - exc.type = OVERFLOW; - exc.name = type < 100 ? "gamma" : "gammaf"; - if (_LIB_VERSION == _SVID_) - exc.retval = HUGE; - else - exc.retval = HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = ERANGE; - else if (!matherr(&exc)) { - errno = ERANGE; - } - break; - case 41: - case 141: - /* gamma(-integer) or gamma(0) */ - exc.type = SING; - exc.name = type < 100 ? "gamma" : "gammaf"; - if (_LIB_VERSION == _SVID_) - exc.retval = HUGE; - else - exc.retval = HUGE_VAL; - if (_LIB_VERSION == _POSIX_) - errno = EDOM; - else if (!matherr(&exc)) { - if (_LIB_VERSION == _SVID_) { - (void) WRITE2("gamma: SING error\n", 18); - } - errno = EDOM; - } - break; - case 42: - case 142: - /* pow(NaN,0.0) */ - /* error only if _LIB_VERSION == _SVID_ & _XOPEN_ */ - exc.type = DOMAIN; - exc.name = type < 100 ? "pow" : "powf"; - exc.retval = x; - if (_LIB_VERSION == _IEEE_ || - _LIB_VERSION == _POSIX_) exc.retval = 1.0; - else if (!matherr(&exc)) { - errno = EDOM; - } - break; - } - return exc.retval; -} diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index e250905ed3c4..e00df5a8a6f4 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -150,53 +150,12 @@ extern int signgam; #endif /* __BSD_VISIBLE || __XSI_VISIBLE */ #if __BSD_VISIBLE -enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix}; - -#define _LIB_VERSION_TYPE enum fdversion -#define _LIB_VERSION _fdlib_version - -/* if global variable _LIB_VERSION is not desirable, one may - * change the following to be a constant by: - * #define _LIB_VERSION_TYPE const enum version - * In that case, after one initializes the value _LIB_VERSION (see - * s_lib_version.c) during compile time, it cannot be modified - * in the middle of a program - */ -extern _LIB_VERSION_TYPE _LIB_VERSION; - -#define _IEEE_ fdlibm_ieee -#define _SVID_ fdlibm_svid -#define _XOPEN_ fdlibm_xopen -#define _POSIX_ fdlibm_posix - -/* We have a problem when using C++ since `exception' is a reserved - name in C++. */ -#ifndef __cplusplus -struct exception { - int type; - char *name; - double arg1; - double arg2; - double retval; -}; -#endif - #if 0 /* Old value from 4.4BSD-Lite math.h; this is probably better. */ #define HUGE HUGE_VAL #else #define HUGE MAXFLOAT #endif - -#define X_TLOSS 1.41484755040568800000e+16 /* pi*2**52 */ - -#define DOMAIN 1 -#define SING 2 -#define OVERFLOW 3 -#define UNDERFLOW 4 -#define TLOSS 5 -#define PLOSS 6 - #endif /* __BSD_VISIBLE */ /* @@ -325,10 +284,6 @@ double lgamma_r(double, int *); * IEEE Test Vector */ double significand(double); - -#ifndef __cplusplus -int matherr(struct exception *); -#endif #endif /* __BSD_VISIBLE */ /* float versions of ANSI/POSIX functions */ diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h index 3fa63954c710..0f165db99ade 100644 --- a/lib/msun/src/math_private.h +++ b/lib/msun/src/math_private.h @@ -154,71 +154,73 @@ do { \ (d) = sf_u.value; \ } while (0) -/* ieee style elementary functions */ -double __ieee754_sqrt(double); -double __ieee754_acos(double); -double __ieee754_acosh(double); -double __ieee754_log(double); -double __ieee754_atanh(double); -double __ieee754_asin(double); -double __ieee754_atan2(double,double); -double __ieee754_exp(double); -double __ieee754_cosh(double); -double __ieee754_fmod(double,double); -double __ieee754_pow(double,double); -double __ieee754_lgamma_r(double,int *); -double __ieee754_gamma_r(double,int *); -double __ieee754_lgamma(double); -double __ieee754_gamma(double); -double __ieee754_log10(double); -double __ieee754_sinh(double); -double __ieee754_hypot(double,double); -double __ieee754_j0(double); -double __ieee754_j1(double); -double __ieee754_y0(double); -double __ieee754_y1(double); -double __ieee754_jn(int,double); -double __ieee754_yn(int,double); -double __ieee754_remainder(double,double); -int __ieee754_rem_pio2(double,double*); -double __ieee754_scalb(double,double); +/* + * ieee style elementary functions + * + * We rename functions here to improve other sources' diffability + * against fdlibm. + */ +#define __ieee754_sqrt sqrt +#define __ieee754_acos acos +#define __ieee754_acosh acosh +#define __ieee754_log log +#define __ieee754_atanh atanh +#define __ieee754_asin asin +#define __ieee754_atan2 atan2 +#define __ieee754_exp exp +#define __ieee754_cosh cosh +#define __ieee754_fmod fmod +#define __ieee754_pow pow +#define __ieee754_lgamma lgamma +#define __ieee754_gamma gamma +#define __ieee754_lgamma_r lgamma_r +#define __ieee754_gamma_r gamma_r +#define __ieee754_log10 log10 +#define __ieee754_sinh sinh +#define __ieee754_hypot hypot +#define __ieee754_j0 j0 +#define __ieee754_j1 j1 +#define __ieee754_y0 y0 +#define __ieee754_y1 y1 +#define __ieee754_jn jn +#define __ieee754_yn yn +#define __ieee754_remainder remainder +#define __ieee754_rem rem +#define __ieee754_scalb scalb +#define __ieee754_sqrtf sqrtf +#define __ieee754_acosf acosf +#define __ieee754_acoshf acoshf +#define __ieee754_logf logf +#define __ieee754_atanhf atanhf +#define __ieee754_asinf asinf +#define __ieee754_atan2f atan2f +#define __ieee754_expf expf +#define __ieee754_coshf coshf +#define __ieee754_fmodf fmodf +#define __ieee754_powf powf +#define __ieee754_lgammaf lgammaf +#define __ieee754_gammaf gammaf +#define __ieee754_lgammaf_r lgammaf_r +#define __ieee754_gammaf_r gammaf_r +#define __ieee754_log10f log10f +#define __ieee754_sinhf sinhf +#define __ieee754_hypotf hypotf +#define __ieee754_j0f j0f +#define __ieee754_j1f j1f +#define __ieee754_y0f y0f +#define __ieee754_y1f y1f +#define __ieee754_jnf jnf +#define __ieee754_ynf ynf +#define __ieee754_remainderf remainderf +#define __ieee754_rem rem +#define __ieee754_scalbf scalbf /* fdlibm kernel function */ -double __kernel_standard(double,double,int); double __kernel_sin(double,double,int); double __kernel_cos(double,double); double __kernel_tan(double,double,int); int __kernel_rem_pio2(double*,double*,int,int,int,const int*); -/* ieee style elementary float functions */ -float __ieee754_sqrtf(float); -float __ieee754_acosf(float); -float __ieee754_acoshf(float); -float __ieee754_logf(float); -float __ieee754_atanhf(float); -float __ieee754_asinf(float); -float __ieee754_atan2f(float,float); -float __ieee754_expf(float); -float __ieee754_coshf(float); -float __ieee754_fmodf(float,float); -float __ieee754_powf(float,float); -float __ieee754_lgammaf_r(float,int *); -float __ieee754_gammaf_r(float,int *); -float __ieee754_lgammaf(float); -float __ieee754_gammaf(float); -float __ieee754_log10f(float); -float __ieee754_sinhf(float); -float __ieee754_hypotf(float,float); -float __ieee754_j0f(float); -float __ieee754_j1f(float); -float __ieee754_y0f(float); -float __ieee754_y1f(float); -float __ieee754_jnf(int,float); -float __ieee754_ynf(int,float); -float __ieee754_remainderf(float,float); -int __ieee754_rem_pio2f(float,float*); -float __ieee754_scalbf(float,float); - /* float versions of fdlibm kernel functions */ float __kernel_sinf(float,float,int); float __kernel_cosf(float,float); diff --git a/lib/msun/src/s_lib_version.c b/lib/msun/src/s_lib_version.c deleted file mode 100644 index 29269d3d4fda..000000000000 --- a/lib/msun/src/s_lib_version.c +++ /dev/null @@ -1,39 +0,0 @@ -/* @(#)s_lib_ver.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * MACRO for standards - */ - -#include "math.h" -#include "math_private.h" - -/* - * define and initialize _LIB_VERSION - */ -#ifdef _POSIX_MODE -_LIB_VERSION_TYPE _LIB_VERSION = _POSIX_; -#else -#ifdef _XOPEN_MODE -_LIB_VERSION_TYPE _LIB_VERSION = _XOPEN_; -#else -#ifdef _SVID3_MODE -_LIB_VERSION_TYPE _LIB_VERSION = _SVID_; -#else /* default _IEEE_MODE */ -_LIB_VERSION_TYPE _LIB_VERSION = _IEEE_; -#endif -#endif -#endif diff --git a/lib/msun/src/s_matherr.c b/lib/msun/src/s_matherr.c deleted file mode 100644 index 7b8937b51375..000000000000 --- a/lib/msun/src/s_matherr.c +++ /dev/null @@ -1,25 +0,0 @@ -/* @(#)s_matherr.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -#include "math.h" -#include "math_private.h" - - int matherr(struct exception *x) -{ - int n=0; - if(x->arg1!=x->arg1) return 0; - return n; -} diff --git a/lib/msun/src/w_acos.c b/lib/msun/src/w_acos.c deleted file mode 100644 index 99bdcf1706a4..000000000000 --- a/lib/msun/src/w_acos.c +++ /dev/null @@ -1,39 +0,0 @@ -/* @(#)w_acos.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrap_acos(x) - */ - -#include "math.h" -#include "math_private.h" - - -double -acos(double x) /* wrapper acos */ -{ -#ifdef _IEEE_LIBM - return __ieee754_acos(x); -#else - double z; - z = __ieee754_acos(x); - if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; - if(fabs(x)>1.0) { - return __kernel_standard(x,x,1); /* acos(|x|>1) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_acosf.c b/lib/msun/src/w_acosf.c deleted file mode 100644 index 56bb1de5f48f..000000000000 --- a/lib/msun/src/w_acosf.c +++ /dev/null @@ -1,43 +0,0 @@ -/* w_acosf.c -- float version of w_acos.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrap_acosf(x) - */ - -#include "math.h" -#include "math_private.h" - - -float -acosf(float x) /* wrapper acosf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_acosf(x); -#else - float z; - z = __ieee754_acosf(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - if(fabsf(x)>(float)1.0) { - /* acosf(|x|>1) */ - return (float)__kernel_standard((double)x,(double)x,101); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_acosh.c b/lib/msun/src/w_acosh.c deleted file mode 100644 index 1b783e2a4df5..000000000000 --- a/lib/msun/src/w_acosh.c +++ /dev/null @@ -1,38 +0,0 @@ -/* @(#)w_acosh.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper acosh(x) - */ - -#include "math.h" -#include "math_private.h" - -double -acosh(double x) /* wrapper acosh */ -{ -#ifdef _IEEE_LIBM - return __ieee754_acosh(x); -#else - double z; - z = __ieee754_acosh(x); - if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; - if(x<1.0) { - return __kernel_standard(x,x,29); /* acosh(x<1) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_acoshf.c b/lib/msun/src/w_acoshf.c deleted file mode 100644 index 4b882844f123..000000000000 --- a/lib/msun/src/w_acoshf.c +++ /dev/null @@ -1,43 +0,0 @@ -/* w_acoshf.c -- float version of w_acosh.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - * - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper acoshf(x) - */ - -#include "math.h" -#include "math_private.h" - -float -acoshf(float x) /* wrapper acoshf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_acoshf(x); -#else - float z; - z = __ieee754_acoshf(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - if(x<(float)1.0) { - /* acosh(x<1) */ - return (float)__kernel_standard((double)x,(double)x,129); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_asin.c b/lib/msun/src/w_asin.c deleted file mode 100644 index 2c9491b5a600..000000000000 --- a/lib/msun/src/w_asin.c +++ /dev/null @@ -1,40 +0,0 @@ -/* @(#)w_asin.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper asin(x) - */ - - -#include "math.h" -#include "math_private.h" - - -double -asin(double x) /* wrapper asin */ -{ -#ifdef _IEEE_LIBM - return __ieee754_asin(x); -#else - double z; - z = __ieee754_asin(x); - if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; - if(fabs(x)>1.0) { - return __kernel_standard(x,x,2); /* asin(|x|>1) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_asinf.c b/lib/msun/src/w_asinf.c deleted file mode 100644 index f3e65d867951..000000000000 --- a/lib/msun/src/w_asinf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* w_asinf.c -- float version of w_asin.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper asinf(x) - */ - - -#include "math.h" -#include "math_private.h" - - -float -asinf(float x) /* wrapper asinf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_asinf(x); -#else - float z; - z = __ieee754_asinf(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - if(fabsf(x)>(float)1.0) { - /* asinf(|x|>1) */ - return (float)__kernel_standard((double)x,(double)x,102); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_atan2.c b/lib/msun/src/w_atan2.c deleted file mode 100644 index 22fd791289f7..000000000000 --- a/lib/msun/src/w_atan2.c +++ /dev/null @@ -1,39 +0,0 @@ -/* @(#)w_atan2.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper atan2(y,x) - */ - -#include "math.h" -#include "math_private.h" - - -double -atan2(double y, double x) /* wrapper atan2 */ -{ -#ifdef _IEEE_LIBM - return __ieee754_atan2(y,x); -#else - double z; - z = __ieee754_atan2(y,x); - if(_LIB_VERSION == _IEEE_||isnan(x)||isnan(y)) return z; - if(x==0.0&&y==0.0) { - return __kernel_standard(y,x,3); /* atan2(+-0,+-0) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_atan2f.c b/lib/msun/src/w_atan2f.c deleted file mode 100644 index 7b10abf0a98a..000000000000 --- a/lib/msun/src/w_atan2f.c +++ /dev/null @@ -1,43 +0,0 @@ -/* w_atan2f.c -- float version of w_atan2.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper atan2f(y,x) - */ - -#include "math.h" -#include "math_private.h" - - -float -atan2f(float y, float x) /* wrapper atan2f */ -{ -#ifdef _IEEE_LIBM - return __ieee754_atan2f(y,x); -#else - float z; - z = __ieee754_atan2f(y,x); - if(_LIB_VERSION == _IEEE_||isnanf(x)||isnanf(y)) return z; - if(x==(float)0.0&&y==(float)0.0) { - /* atan2f(+-0,+-0) */ - return (float)__kernel_standard((double)y,(double)x,103); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_atanh.c b/lib/msun/src/w_atanh.c deleted file mode 100644 index f9e26cf90b66..000000000000 --- a/lib/msun/src/w_atanh.c +++ /dev/null @@ -1,43 +0,0 @@ -/* @(#)w_atanh.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper atanh(x) - */ - -#include "math.h" -#include "math_private.h" - - -double -atanh(double x) /* wrapper atanh */ -{ -#ifdef _IEEE_LIBM - return __ieee754_atanh(x); -#else - double z,y; - z = __ieee754_atanh(x); - if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; - y = fabs(x); - if(y>=1.0) { - if(y>1.0) - return __kernel_standard(x,x,30); /* atanh(|x|>1) */ - else - return __kernel_standard(x,x,31); /* atanh(|x|==1) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_atanhf.c b/lib/msun/src/w_atanhf.c deleted file mode 100644 index 12165b45a896..000000000000 --- a/lib/msun/src/w_atanhf.c +++ /dev/null @@ -1,48 +0,0 @@ -/* w_atanhf.c -- float version of w_atanh.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper atanhf(x) - */ - -#include "math.h" -#include "math_private.h" - - -float -atanhf(float x) /* wrapper atanhf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_atanhf(x); -#else - float z,y; - z = __ieee754_atanhf(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - y = fabsf(x); - if(y>=(float)1.0) { - if(y>(float)1.0) - /* atanhf(|x|>1) */ - return (float)__kernel_standard((double)x,(double)x,130); - else - /* atanhf(|x|==1) */ - return (float)__kernel_standard((double)x,(double)x,131); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_cosh.c b/lib/msun/src/w_cosh.c deleted file mode 100644 index c54e44110d6b..000000000000 --- a/lib/msun/src/w_cosh.c +++ /dev/null @@ -1,38 +0,0 @@ -/* @(#)w_cosh.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper cosh(x) - */ - -#include "math.h" -#include "math_private.h" - -double -cosh(double x) /* wrapper cosh */ -{ -#ifdef _IEEE_LIBM - return __ieee754_cosh(x); -#else - double z; - z = __ieee754_cosh(x); - if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; - if(fabs(x)>7.10475860073943863426e+02) { - return __kernel_standard(x,x,5); /* cosh overflow */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_coshf.c b/lib/msun/src/w_coshf.c deleted file mode 100644 index 46952ca6a56d..000000000000 --- a/lib/msun/src/w_coshf.c +++ /dev/null @@ -1,42 +0,0 @@ -/* w_coshf.c -- float version of w_cosh.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper coshf(x) - */ - -#include "math.h" -#include "math_private.h" - -float -coshf(float x) /* wrapper coshf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_coshf(x); -#else - float z; - z = __ieee754_coshf(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - if(fabsf(x)>(float)8.9415985107e+01) { - /* cosh overflow */ - return (float)__kernel_standard((double)x,(double)x,105); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_exp.c b/lib/msun/src/w_exp.c deleted file mode 100644 index f1759979e78d..000000000000 --- a/lib/msun/src/w_exp.c +++ /dev/null @@ -1,45 +0,0 @@ -/* @(#)w_exp.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper exp(x) - */ - -#include "math.h" -#include "math_private.h" - -static const double -o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */ -u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */ - -double -exp(double x) /* wrapper exp */ -{ -#ifdef _IEEE_LIBM - return __ieee754_exp(x); -#else - double z; - z = __ieee754_exp(x); - if(_LIB_VERSION == _IEEE_) return z; - if(finite(x)) { - if(x>o_threshold) - return __kernel_standard(x,x,6); /* exp overflow */ - else if(xo_threshold) - /* exp overflow */ - return (float)__kernel_standard((double)x,(double)x,106); - else if(xX_TLOSS) { - return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_j0f.c b/lib/msun/src/w_j0f.c deleted file mode 100644 index 8530626582e5..000000000000 --- a/lib/msun/src/w_j0f.c +++ /dev/null @@ -1,41 +0,0 @@ -/* w_j0f.c -- float version of w_j0.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper j0f(float x) - */ - -#include "math.h" -#include "math_private.h" - -float -j0f(float x) /* wrapper j0f */ -{ -#ifdef _IEEE_LIBM - return __ieee754_j0f(x); -#else - float z = __ieee754_j0f(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - if(fabsf(x)>(float)X_TLOSS) { - /* j0f(|x|>X_TLOSS) */ - return (float)__kernel_standard((double)x,(double)x,134); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_j1.c b/lib/msun/src/w_j1.c deleted file mode 100644 index aab8e680c315..000000000000 --- a/lib/msun/src/w_j1.c +++ /dev/null @@ -1,38 +0,0 @@ -/* @(#)w_j1.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper of j1 - */ - -#include "math.h" -#include "math_private.h" - -double -j1(double x) /* wrapper j1 */ -{ -#ifdef _IEEE_LIBM - return __ieee754_j1(x); -#else - double z; - z = __ieee754_j1(x); - if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; - if(fabs(x)>X_TLOSS) { - return __kernel_standard(x,x,36); /* j1(|x|>X_TLOSS) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_j1f.c b/lib/msun/src/w_j1f.c deleted file mode 100644 index 74c8714a9f0a..000000000000 --- a/lib/msun/src/w_j1f.c +++ /dev/null @@ -1,42 +0,0 @@ -/* w_j1f.c -- float version of w_j1.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper of j1f - */ - -#include "math.h" -#include "math_private.h" - -float -j1f(float x) /* wrapper j1f */ -{ -#ifdef _IEEE_LIBM - return __ieee754_j1f(x); -#else - float z; - z = __ieee754_j1f(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; - if(fabsf(x)>(float)X_TLOSS) { - /* j1(|x|>X_TLOSS) */ - return (float)__kernel_standard((double)x,(double)x,136); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_jn.c b/lib/msun/src/w_jn.c deleted file mode 100644 index 4094892d3439..000000000000 --- a/lib/msun/src/w_jn.c +++ /dev/null @@ -1,38 +0,0 @@ -/* @(#)w_jn.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper jn(int n, double x) - */ - -#include "math.h" -#include "math_private.h" - -double -jn(int n, double x) /* wrapper jn */ -{ -#ifdef _IEEE_LIBM - return __ieee754_jn(n,x); -#else - double z; - z = __ieee754_jn(n,x); - if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; - if(fabs(x)>X_TLOSS) { - return __kernel_standard((double)n,x,38); /* jn(|x|>X_TLOSS,n) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_jnf.c b/lib/msun/src/w_jnf.c deleted file mode 100644 index 1c755142076d..000000000000 --- a/lib/msun/src/w_jnf.c +++ /dev/null @@ -1,38 +0,0 @@ -/* w_jnf.c -- float version of w_jn.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -#include "math.h" -#include "math_private.h" - -float -jnf(int n, float x) /* wrapper jnf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_jnf(n,x); -#else - float z; - z = __ieee754_jnf(n,x); - if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; - if(fabsf(x)>(float)X_TLOSS) { - /* jn(|x|>X_TLOSS,n) */ - return (float)__kernel_standard((double)n,(double)x,138); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_lgamma.c b/lib/msun/src/w_lgamma.c deleted file mode 100644 index b98cfdeee9e8..000000000000 --- a/lib/msun/src/w_lgamma.c +++ /dev/null @@ -1,45 +0,0 @@ -/* @(#)w_lgamma.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* double lgamma(double x) - * Return the logarithm of the Gamma function of x. - * - * Method: call __ieee754_lgamma_r - */ - -#include "math.h" -#include "math_private.h" - -extern int signgam; - -double -lgamma(double x) -{ -#ifdef _IEEE_LIBM - return __ieee754_lgamma_r(x,&signgam); -#else - double y; - y = __ieee754_lgamma_r(x,&signgam); - if(_LIB_VERSION == _IEEE_) return y; - if(!finite(y)&&finite(x)) { - if(floor(x)==x&&x<=0.0) - return __kernel_standard(x,x,15); /* lgamma pole */ - else - return __kernel_standard(x,x,14); /* lgamma overflow */ - } else - return y; -#endif -} diff --git a/lib/msun/src/w_lgamma_r.c b/lib/msun/src/w_lgamma_r.c deleted file mode 100644 index 34a69d8018ff..000000000000 --- a/lib/msun/src/w_lgamma_r.c +++ /dev/null @@ -1,42 +0,0 @@ -/* @(#)wr_lgamma.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper double lgamma_r(double x, int *signgamp) - */ - -#include "math.h" -#include "math_private.h" - - -double -lgamma_r(double x, int *signgamp) /* wrapper lgamma_r */ -{ -#ifdef _IEEE_LIBM - return __ieee754_lgamma_r(x,signgamp); -#else - double y; - y = __ieee754_lgamma_r(x,signgamp); - if(_LIB_VERSION == _IEEE_) return y; - if(!finite(y)&&finite(x)) { - if(floor(x)==x&&x<=0.0) - return __kernel_standard(x,x,15); /* lgamma pole */ - else - return __kernel_standard(x,x,14); /* lgamma overflow */ - } else - return y; -#endif -} diff --git a/lib/msun/src/w_lgammaf.c b/lib/msun/src/w_lgammaf.c deleted file mode 100644 index 0bfd317ab7ff..000000000000 --- a/lib/msun/src/w_lgammaf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* w_lgammaf.c -- float version of w_lgamma.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -#include "math.h" -#include "math_private.h" - -extern int signgam; - -float -lgammaf(float x) -{ -#ifdef _IEEE_LIBM - return __ieee754_lgammaf_r(x,&signgam); -#else - float y; - y = __ieee754_lgammaf_r(x,&signgam); - if(_LIB_VERSION == _IEEE_) return y; - if(!finitef(y)&&finitef(x)) { - if(floorf(x)==x&&x<=(float)0.0) - /* lgamma pole */ - return (float)__kernel_standard((double)x,(double)x,115); - else - /* lgamma overflow */ - return (float)__kernel_standard((double)x,(double)x,114); - } else - return y; -#endif -} diff --git a/lib/msun/src/w_lgammaf_r.c b/lib/msun/src/w_lgammaf_r.c deleted file mode 100644 index a10328dea9b3..000000000000 --- a/lib/msun/src/w_lgammaf_r.c +++ /dev/null @@ -1,47 +0,0 @@ -/* w_lgammaf_r.c -- float version of w_lgamma_r.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper float lgammaf_r(float x, int *signgamp) - */ - -#include "math.h" -#include "math_private.h" - - -float -lgammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */ -{ -#ifdef _IEEE_LIBM - return __ieee754_lgammaf_r(x,signgamp); -#else - float y; - y = __ieee754_lgammaf_r(x,signgamp); - if(_LIB_VERSION == _IEEE_) return y; - if(!finitef(y)&&finitef(x)) { - if(floorf(x)==x&&x<=(float)0.0) - /* lgamma pole */ - return (float)__kernel_standard((double)x,(double)x,115); - else - /* lgamma overflow */ - return (float)__kernel_standard((double)x,(double)x,114); - } else - return y; -#endif -} diff --git a/lib/msun/src/w_log.c b/lib/msun/src/w_log.c deleted file mode 100644 index 7ee59ea98b7e..000000000000 --- a/lib/msun/src/w_log.c +++ /dev/null @@ -1,39 +0,0 @@ -/* @(#)w_log.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper log(x) - */ - -#include "math.h" -#include "math_private.h" - - -double -log(double x) /* wrapper log */ -{ -#ifdef _IEEE_LIBM - return __ieee754_log(x); -#else - double z; - z = __ieee754_log(x); - if(_LIB_VERSION == _IEEE_ || isnan(x) || x > 0.0) return z; - if(x==0.0) - return __kernel_standard(x,x,16); /* log(0) */ - else - return __kernel_standard(x,x,17); /* log(x<0) */ -#endif -} diff --git a/lib/msun/src/w_log10.c b/lib/msun/src/w_log10.c deleted file mode 100644 index f48ad9d528c7..000000000000 --- a/lib/msun/src/w_log10.c +++ /dev/null @@ -1,42 +0,0 @@ -/* @(#)w_log10.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper log10(X) - */ - -#include "math.h" -#include "math_private.h" - - -double -log10(double x) /* wrapper log10 */ -{ -#ifdef _IEEE_LIBM - return __ieee754_log10(x); -#else - double z; - z = __ieee754_log10(x); - if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; - if(x<=0.0) { - if(x==0.0) - return __kernel_standard(x,x,18); /* log10(0) */ - else - return __kernel_standard(x,x,19); /* log10(x<0) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_log10f.c b/lib/msun/src/w_log10f.c deleted file mode 100644 index f25ffd0412e3..000000000000 --- a/lib/msun/src/w_log10f.c +++ /dev/null @@ -1,47 +0,0 @@ -/* w_log10f.c -- float version of w_log10.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper log10f(X) - */ - -#include "math.h" -#include "math_private.h" - - -float -log10f(float x) /* wrapper log10f */ -{ -#ifdef _IEEE_LIBM - return __ieee754_log10f(x); -#else - float z; - z = __ieee754_log10f(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - if(x<=(float)0.0) { - if(x==(float)0.0) - /* log10(0) */ - return (float)__kernel_standard((double)x,(double)x,118); - else - /* log10(x<0) */ - return (float)__kernel_standard((double)x,(double)x,119); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_logf.c b/lib/msun/src/w_logf.c deleted file mode 100644 index 5a9af66d99fc..000000000000 --- a/lib/msun/src/w_logf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* w_logf.c -- float version of w_log.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper logf(x) - */ - -#include "math.h" -#include "math_private.h" - - -float -logf(float x) /* wrapper logf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_logf(x); -#else - float z; - z = __ieee754_logf(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x) || x > (float)0.0) return z; - if(x==(float)0.0) - /* logf(0) */ - return (float)__kernel_standard((double)x,(double)x,116); - else - /* logf(x<0) */ - return (float)__kernel_standard((double)x,(double)x,117); -#endif -} diff --git a/lib/msun/src/w_pow.c b/lib/msun/src/w_pow.c deleted file mode 100644 index c63bb72700b8..000000000000 --- a/lib/msun/src/w_pow.c +++ /dev/null @@ -1,60 +0,0 @@ - - -/* @(#)w_pow.c 5.2 93/10/01 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper pow(x,y) return x**y - */ - -#include "math.h" -#include "math_private.h" - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -double -pow(double x, double y) /* wrapper pow */ -{ -#ifdef _IEEE_LIBM - return __ieee754_pow(x,y); -#else - double z; - z=__ieee754_pow(x,y); - if(_LIB_VERSION == _IEEE_|| isnan(y)) return z; - if(isnan(x)) { - if(y==0.0) - return __kernel_standard(x,y,42); /* pow(NaN,0.0) */ - else - return z; - } - if(x==0.0){ - if(y==0.0) - return __kernel_standard(x,y,20); /* pow(0.0,0.0) */ - if(finite(y)&&y<0.0) - return __kernel_standard(x,y,23); /* pow(0.0,negative) */ - return z; - } - if(!finite(z)) { - if(finite(x)&&finite(y)) { - if(isnan(z)) - return __kernel_standard(x,y,24); /* pow neg**non-int */ - else - return __kernel_standard(x,y,21); /* pow overflow */ - } - } - if(z==0.0&&finite(x)&&finite(y)) - return __kernel_standard(x,y,22); /* pow underflow */ - return z; -#endif -} diff --git a/lib/msun/src/w_powf.c b/lib/msun/src/w_powf.c deleted file mode 100644 index 1ab76a426135..000000000000 --- a/lib/msun/src/w_powf.c +++ /dev/null @@ -1,68 +0,0 @@ -/* w_powf.c -- float version of w_pow.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper powf(x,y) return x**y - */ - -#include "math.h" -#include "math_private.h" - - -float -powf(float x, float y) /* wrapper powf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_powf(x,y); -#else - float z; - z=__ieee754_powf(x,y); - if(_LIB_VERSION == _IEEE_|| isnanf(y)) return z; - if(isnanf(x)) { - if(y==(float)0.0) - /* powf(NaN,0.0) */ - return (float)__kernel_standard((double)x,(double)y,142); - else - return z; - } - if(x==(float)0.0){ - if(y==(float)0.0) - /* powf(0.0,0.0) */ - return (float)__kernel_standard((double)x,(double)y,120); - if(finitef(y)&&y<(float)0.0) - /* powf(0.0,negative) */ - return (float)__kernel_standard((double)x,(double)y,123); - return z; - } - if(!finitef(z)) { - if(finitef(x)&&finitef(y)) { - if(isnanf(z)) - /* powf neg**non-int */ - return (float)__kernel_standard((double)x,(double)y,124); - else - /* powf overflow */ - return (float)__kernel_standard((double)x,(double)y,121); - } - } - if(z==(float)0.0&&finitef(x)&&finitef(y)) - /* powf underflow */ - return (float)__kernel_standard((double)x,(double)y,122); - return z; -#endif -} diff --git a/lib/msun/src/w_remainder.c b/lib/msun/src/w_remainder.c deleted file mode 100644 index 12f971fe843b..000000000000 --- a/lib/msun/src/w_remainder.c +++ /dev/null @@ -1,38 +0,0 @@ -/* @(#)w_remainder.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper remainder(x,p) - */ - -#include "math.h" -#include "math_private.h" - -double -remainder(double x, double y) /* wrapper remainder */ -{ -#ifdef _IEEE_LIBM - return __ieee754_remainder(x,y); -#else - double z; - z = __ieee754_remainder(x,y); - if(_LIB_VERSION == _IEEE_ || isnan(y)) return z; - if(y==0.0) - return __kernel_standard(x,y,28); /* remainder(x,0) */ - else - return z; -#endif -} diff --git a/lib/msun/src/w_remainderf.c b/lib/msun/src/w_remainderf.c deleted file mode 100644 index ef5381d90509..000000000000 --- a/lib/msun/src/w_remainderf.c +++ /dev/null @@ -1,42 +0,0 @@ -/* w_remainderf.c -- float version of w_remainder.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper remainderf(x,p) - */ - -#include "math.h" -#include "math_private.h" - -float -remainderf(float x, float y) /* wrapper remainder */ -{ -#ifdef _IEEE_LIBM - return __ieee754_remainderf(x,y); -#else - float z; - z = __ieee754_remainderf(x,y); - if(_LIB_VERSION == _IEEE_ || isnanf(y)) return z; - if(y==(float)0.0) - /* remainder(x,0) */ - return (float)__kernel_standard((double)x,(double)y,128); - else - return z; -#endif -} diff --git a/lib/msun/src/w_scalb.c b/lib/msun/src/w_scalb.c deleted file mode 100644 index 6a20164f83b0..000000000000 --- a/lib/msun/src/w_scalb.c +++ /dev/null @@ -1,53 +0,0 @@ -/* @(#)w_scalb.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper scalb(double x, double fn) is provide for - * passing various standard test suite. One - * should use scalbn() instead. - */ - -#include "math.h" -#include "math_private.h" - -#include - -#ifdef _SCALB_INT -double -scalb(double x, int fn) /* wrapper scalb */ -#else -double -scalb(double x, double fn) /* wrapper scalb */ -#endif -{ -#ifdef _IEEE_LIBM - return __ieee754_scalb(x,fn); -#else - double z; - z = __ieee754_scalb(x,fn); - if(_LIB_VERSION == _IEEE_) return z; - if(!(finite(z)||isnan(z))&&finite(x)) { - return __kernel_standard(x,(double)fn,32); /* scalb overflow */ - } - if(z==0.0&&z!=x) { - return __kernel_standard(x,(double)fn,33); /* scalb underflow */ - } -#ifndef _SCALB_INT - if(!finite(fn)) errno = ERANGE; -#endif - return z; -#endif -} diff --git a/lib/msun/src/w_scalbf.c b/lib/msun/src/w_scalbf.c deleted file mode 100644 index 2781833cf3bf..000000000000 --- a/lib/msun/src/w_scalbf.c +++ /dev/null @@ -1,58 +0,0 @@ -/* w_scalbf.c -- float version of w_scalb.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper scalbf(float x, float fn) is provide for - * passing various standard test suite. One - * should use scalbn() instead. - */ - -#include "math.h" -#include "math_private.h" - -#include - -#ifdef _SCALB_INT -float -scalbf(float x, int fn) /* wrapper scalbf */ -#else -float -scalbf(float x, float fn) /* wrapper scalbf */ -#endif -{ -#ifdef _IEEE_LIBM - return __ieee754_scalbf(x,fn); -#else - float z; - z = __ieee754_scalbf(x,fn); - if(_LIB_VERSION == _IEEE_) return z; - if(!(finitef(z)||isnanf(z))&&finitef(x)) { - /* scalbf overflow */ - return (float)__kernel_standard((double)x,(double)fn,132); - } - if(z==(float)0.0&&z!=x) { - /* scalbf underflow */ - return (float)__kernel_standard((double)x,(double)fn,133); - } -#ifndef _SCALB_INT - if(!finitef(fn)) errno = ERANGE; -#endif - return z; -#endif -} diff --git a/lib/msun/src/w_sinh.c b/lib/msun/src/w_sinh.c deleted file mode 100644 index ad3a0a4080e0..000000000000 --- a/lib/msun/src/w_sinh.c +++ /dev/null @@ -1,38 +0,0 @@ -/* @(#)w_sinh.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper sinh(x) - */ - -#include "math.h" -#include "math_private.h" - -double -sinh(double x) /* wrapper sinh */ -{ -#ifdef _IEEE_LIBM - return __ieee754_sinh(x); -#else - double z; - z = __ieee754_sinh(x); - if(_LIB_VERSION == _IEEE_) return z; - if(!finite(z)&&finite(x)) { - return __kernel_standard(x,x,25); /* sinh overflow */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_sinhf.c b/lib/msun/src/w_sinhf.c deleted file mode 100644 index 1b3af08f231d..000000000000 --- a/lib/msun/src/w_sinhf.c +++ /dev/null @@ -1,42 +0,0 @@ -/* w_sinhf.c -- float version of w_sinh.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper sinhf(x) - */ - -#include "math.h" -#include "math_private.h" - -float -sinhf(float x) /* wrapper sinhf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_sinhf(x); -#else - float z; - z = __ieee754_sinhf(x); - if(_LIB_VERSION == _IEEE_) return z; - if(!finitef(z)&&finitef(x)) { - /* sinhf overflow */ - return (float)__kernel_standard((double)x,(double)x,125); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_sqrt.c b/lib/msun/src/w_sqrt.c deleted file mode 100644 index 008c88cd4248..000000000000 --- a/lib/msun/src/w_sqrt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* @(#)w_sqrt.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper sqrt(x) - */ - -#include "math.h" -#include "math_private.h" - -double -sqrt(double x) /* wrapper sqrt */ -{ -#ifdef _IEEE_LIBM - return __ieee754_sqrt(x); -#else - double z; - z = __ieee754_sqrt(x); - if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; - if(x<0.0) { - return __kernel_standard(x,x,26); /* sqrt(negative) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_sqrtf.c b/lib/msun/src/w_sqrtf.c deleted file mode 100644 index f49763871aca..000000000000 --- a/lib/msun/src/w_sqrtf.c +++ /dev/null @@ -1,42 +0,0 @@ -/* w_sqrtf.c -- float version of w_sqrt.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper sqrtf(x) - */ - -#include "math.h" -#include "math_private.h" - -float -sqrtf(float x) /* wrapper sqrtf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_sqrtf(x); -#else - float z; - z = __ieee754_sqrtf(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - if(x<(float)0.0) { - /* sqrtf(negative) */ - return (float)__kernel_standard((double)x,(double)x,126); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_y0.c b/lib/msun/src/w_y0.c deleted file mode 100644 index 2d28e1a8aed0..000000000000 --- a/lib/msun/src/w_y0.c +++ /dev/null @@ -1,46 +0,0 @@ -/* from: @(#)w_j0.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper y0(double x) - */ - -#include "math.h" -#include "math_private.h" - -double -y0(double x) /* wrapper y0 */ -{ -#ifdef _IEEE_LIBM - return __ieee754_y0(x); -#else - double z; - z = __ieee754_y0(x); - if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; - if(x <= 0.0){ - if(x==0.0) - /* d= -one/(x-x); */ - return __kernel_standard(x,x,8); - else - /* d = zero/(x-x); */ - return __kernel_standard(x,x,9); - } - if(x>X_TLOSS) { - return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_y0f.c b/lib/msun/src/w_y0f.c deleted file mode 100644 index bd4d2c7530c5..000000000000 --- a/lib/msun/src/w_y0f.c +++ /dev/null @@ -1,50 +0,0 @@ -/* w_y0f.c -- float version of w_y0.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper y0f(float x) - */ - -#include "math.h" -#include "math_private.h" - -float -y0f(float x) /* wrapper y0f */ -{ -#ifdef _IEEE_LIBM - return __ieee754_y0f(x); -#else - float z; - z = __ieee754_y0f(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; - if(x <= (float)0.0){ - if(x==(float)0.0) - /* d= -one/(x-x); */ - return (float)__kernel_standard((double)x,(double)x,108); - else - /* d = zero/(x-x); */ - return (float)__kernel_standard((double)x,(double)x,109); - } - if(x>(float)X_TLOSS) { - /* y0(x>X_TLOSS) */ - return (float)__kernel_standard((double)x,(double)x,135); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_y1.c b/lib/msun/src/w_y1.c deleted file mode 100644 index 76bb3f08f0d5..000000000000 --- a/lib/msun/src/w_y1.c +++ /dev/null @@ -1,46 +0,0 @@ -/* from: @(#)w_j1.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper of y1 - */ - -#include "math.h" -#include "math_private.h" - -double -y1(double x) /* wrapper y1 */ -{ -#ifdef _IEEE_LIBM - return __ieee754_y1(x); -#else - double z; - z = __ieee754_y1(x); - if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; - if(x <= 0.0){ - if(x==0.0) - /* d= -one/(x-x); */ - return __kernel_standard(x,x,10); - else - /* d = zero/(x-x); */ - return __kernel_standard(x,x,11); - } - if(x>X_TLOSS) { - return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_y1f.c b/lib/msun/src/w_y1f.c deleted file mode 100644 index 75170392ac7d..000000000000 --- a/lib/msun/src/w_y1f.c +++ /dev/null @@ -1,50 +0,0 @@ -/* w_y1f.c -- float version of w_y1.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper of y1f - */ - -#include "math.h" -#include "math_private.h" - -float -y1f(float x) /* wrapper y1f */ -{ -#ifdef _IEEE_LIBM - return __ieee754_y1f(x); -#else - float z; - z = __ieee754_y1f(x); - if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; - if(x <= (float)0.0){ - if(x==(float)0.0) - /* d= -one/(x-x); */ - return (float)__kernel_standard((double)x,(double)x,110); - else - /* d = zero/(x-x); */ - return (float)__kernel_standard((double)x,(double)x,111); - } - if(x>(float)X_TLOSS) { - /* y1(x>X_TLOSS) */ - return (float)__kernel_standard((double)x,(double)x,137); - } else - return z; -#endif -} diff --git a/lib/msun/src/w_yn.c b/lib/msun/src/w_yn.c deleted file mode 100644 index ee5942e25568..000000000000 --- a/lib/msun/src/w_yn.c +++ /dev/null @@ -1,46 +0,0 @@ -/* from: @(#)w_jn.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -/* - * wrapper yn(int n, double x) - */ - -#include "math.h" -#include "math_private.h" - -double -yn(int n, double x) /* wrapper yn */ -{ -#ifdef _IEEE_LIBM - return __ieee754_yn(n,x); -#else - double z; - z = __ieee754_yn(n,x); - if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z; - if(x <= 0.0){ - if(x==0.0) - /* d= -one/(x-x); */ - return __kernel_standard((double)n,x,12); - else - /* d = zero/(x-x); */ - return __kernel_standard((double)n,x,13); - } - if(x>X_TLOSS) { - return __kernel_standard((double)n,x,39); /* yn(x>X_TLOSS,n) */ - } else - return z; -#endif -} diff --git a/lib/msun/src/w_ynf.c b/lib/msun/src/w_ynf.c deleted file mode 100644 index 2dc3903a1c0e..000000000000 --- a/lib/msun/src/w_ynf.c +++ /dev/null @@ -1,46 +0,0 @@ -/* w_ynf.c -- float version of w_yn.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif - -#include "math.h" -#include "math_private.h" - -float -ynf(int n, float x) /* wrapper ynf */ -{ -#ifdef _IEEE_LIBM - return __ieee754_ynf(n,x); -#else - float z; - z = __ieee754_ynf(n,x); - if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; - if(x <= (float)0.0){ - if(x==(float)0.0) - /* d= -one/(x-x); */ - return (float)__kernel_standard((double)n,(double)x,112); - else - /* d = zero/(x-x); */ - return (float)__kernel_standard((double)n,(double)x,113); - } - if(x>(float)X_TLOSS) { - /* yn(x>X_TLOSS,n) */ - return (float)__kernel_standard((double)n,(double)x,139); - } else - return z; -#endif -}