Wrapper for $1
authordrepper <drepper>
Sat, 17 Feb 2001 01:44:23 +0000 (01:44 +0000)
committerdrepper <drepper>
Sat, 17 Feb 2001 01:44:23 +0000 (01:44 +0000)
19 files changed:
sysdeps/generic/w_log.c [new file with mode: 0644]
sysdeps/generic/w_logf.c [new file with mode: 0644]
sysdeps/generic/w_logl.c [new file with mode: 0644]
sysdeps/generic/w_pow.c [new file with mode: 0644]
sysdeps/generic/w_powf.c [new file with mode: 0644]
sysdeps/generic/w_powl.c [new file with mode: 0644]
sysdeps/generic/w_remainder.c [new file with mode: 0644]
sysdeps/generic/w_remainderf.c [new file with mode: 0644]
sysdeps/generic/w_remainderl.c [new file with mode: 0644]
sysdeps/generic/w_scalb.c [new file with mode: 0644]
sysdeps/generic/w_scalbf.c [new file with mode: 0644]
sysdeps/generic/w_scalbl.c [new file with mode: 0644]
sysdeps/generic/w_sinh.c [new file with mode: 0644]
sysdeps/generic/w_sinhf.c [new file with mode: 0644]
sysdeps/generic/w_sinhl.c [new file with mode: 0644]
sysdeps/generic/w_sqrtl.c [new file with mode: 0644]
sysdeps/generic/w_tgamma.c [new file with mode: 0644]
sysdeps/generic/w_tgammaf.c [new file with mode: 0644]
sysdeps/generic/w_tgammal.c [new file with mode: 0644]

diff --git a/sysdeps/generic/w_log.c b/sysdeps/generic/w_log.c
new file mode 100644 (file)
index 0000000..5f0af79
--- /dev/null
@@ -0,0 +1,48 @@
+/* @(#)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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_log.c,v 1.6 1995/05/10 20:49:33 jtc Exp $";
+#endif
+
+/*
+ * wrapper log(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+
+#ifdef __STDC__
+       double __log(double x)          /* wrapper log */
+#else
+       double __log(x)                 /* wrapper log */
+       double x;
+#endif
+{
+#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
+}
+weak_alias (__log, log)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__log, __logl)
+weak_alias (__log, logl)
+#endif
diff --git a/sysdeps/generic/w_logf.c b/sysdeps/generic/w_logf.c
new file mode 100644 (file)
index 0000000..9eabe4b
--- /dev/null
@@ -0,0 +1,49 @@
+/* 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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_logf.c,v 1.3 1995/05/10 20:49:40 jtc Exp $";
+#endif
+
+/*
+ * wrapper logf(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+
+#ifdef __STDC__
+       float __logf(float x)           /* wrapper logf */
+#else
+       float __logf(x)                 /* wrapper logf */
+       float x;
+#endif
+{
+#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
+}
+weak_alias (__logf, logf)
diff --git a/sysdeps/generic/w_logl.c b/sysdeps/generic/w_logl.c
new file mode 100644 (file)
index 0000000..bb979c2
--- /dev/null
@@ -0,0 +1,48 @@
+/* w_logl.c -- long double version of w_log.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: $";
+#endif
+
+/*
+ * wrapper logl(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+
+#ifdef __STDC__
+       long double __logl(long double x)       /* wrapper logl */
+#else
+       long double __logl(x)                   /* wrapper logl */
+       long double x;
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_logl(x);
+#else
+       long double z;
+       z = __ieee754_logl(x);
+       if(_LIB_VERSION == _IEEE_ || __isnanl(x) || x > 0.0) return z;
+       if(x==0.0)
+           return __kernel_standard(x,x,216); /* log(0) */
+       else
+           return __kernel_standard(x,x,217); /* log(x<0) */
+#endif
+}
+weak_alias (__logl, logl)
diff --git a/sysdeps/generic/w_pow.c b/sysdeps/generic/w_pow.c
new file mode 100644 (file)
index 0000000..5850651
--- /dev/null
@@ -0,0 +1,70 @@
+
+
+/* @(#)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"
+
+
+#ifdef __STDC__
+       double __pow(double x, double y)        /* wrapper pow */
+#else
+       double __pow(x,y)                       /* wrapper pow */
+       double x,y;
+#endif
+{
+#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) {
+             if (signbit (x) && signbit (z))
+               return __kernel_standard(x,y,23); /* pow(-0.0,negative) */
+             else
+               return __kernel_standard(x,y,43); /* 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
+}
+weak_alias (__pow, pow)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__pow, __powl)
+weak_alias (__pow, powl)
+#endif
diff --git a/sysdeps/generic/w_powf.c b/sysdeps/generic/w_powf.c
new file mode 100644 (file)
index 0000000..32196fd
--- /dev/null
@@ -0,0 +1,77 @@
+/* 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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_powf.c,v 1.3 1995/05/10 20:49:41 jtc Exp $";
+#endif
+
+/*
+ * wrapper powf(x,y) return x**y
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+
+#ifdef __STDC__
+       float __powf(float x, float y)  /* wrapper powf */
+#else
+       float __powf(x,y)                       /* wrapper powf */
+       float x,y;
+#endif
+{
+#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) {
+             if (signbit (x) && signbit (z))
+               /* powf(0.0,negative) */
+               return (float)__kernel_standard((double)x,(double)y,123);
+             else
+               return (float)__kernel_standard((double)x,(double)y,143);
+           }
+           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
+}
+weak_alias (__powf, powf)
diff --git a/sysdeps/generic/w_powl.c b/sysdeps/generic/w_powl.c
new file mode 100644 (file)
index 0000000..17feb9f
--- /dev/null
@@ -0,0 +1,68 @@
+/* w_powl.c -- long double version of w_pow.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@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.
+ * ====================================================
+ */
+
+/*
+ * wrapper powl(x,y) return x**y
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+
+#ifdef __STDC__
+       long double __powl(long double x, long double y)/* wrapper powl */
+#else
+       long double __powl(x,y)                 /* wrapper powl */
+       long double x,y;
+#endif
+{
+#ifdef _IEEE_LIBM
+       return  __ieee754_powl(x,y);
+#else
+       long double z;
+       z=__ieee754_powl(x,y);
+       if(_LIB_VERSION == _IEEE_|| __isnanl(y)) return z;
+       if(__isnanl(x)) {
+           if(y==0.0)
+               return __kernel_standard(x,y,242); /* pow(NaN,0.0) */
+           else
+               return z;
+       }
+       if(x==0.0) {
+           if(y==0.0)
+               return __kernel_standard(x,y,220); /* pow(0.0,0.0) */
+           if(__finitel(y)&&y<0.0) {
+             if (signbit (x) && signbit (z))
+               return __kernel_standard(x,y,223); /* pow(-0.0,negative) */
+             else
+               return __kernel_standard(x,y,243); /* pow(+0.0,negative) */
+           }
+           return z;
+       }
+       if(!__finitel(z)) {
+           if(__finitel(x)&&__finitel(y)) {
+               if(__isnanl(z))
+                   return __kernel_standard(x,y,224); /* pow neg**non-int */
+               else
+                   return __kernel_standard(x,y,221); /* pow overflow */
+           }
+       }
+       if(z==0.0&&__finitel(x)&&__finitel(y))
+           return __kernel_standard(x,y,222); /* pow underflow */
+       return z;
+#endif
+}
+weak_alias (__powl, powl)
diff --git a/sysdeps/generic/w_remainder.c b/sysdeps/generic/w_remainder.c
new file mode 100644 (file)
index 0000000..d85a3fe
--- /dev/null
@@ -0,0 +1,47 @@
+/* @(#)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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_remainder.c,v 1.6 1995/05/10 20:49:44 jtc Exp $";
+#endif
+
+/*
+ * wrapper remainder(x,p)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       double __remainder(double x, double y)  /* wrapper remainder */
+#else
+       double __remainder(x,y)                 /* wrapper remainder */
+       double x,y;
+#endif
+{
+#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
+}
+weak_alias (__remainder, remainder)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__remainder, __remainderl)
+weak_alias (__remainder, remainderl)
+#endif
diff --git a/sysdeps/generic/w_remainderf.c b/sysdeps/generic/w_remainderf.c
new file mode 100644 (file)
index 0000000..58255f5
--- /dev/null
@@ -0,0 +1,47 @@
+/* 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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_remainderf.c,v 1.3 1995/05/10 20:49:46 jtc Exp $";
+#endif
+
+/* 
+ * wrapper remainderf(x,p)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       float __remainderf(float x, float y)    /* wrapper remainder */
+#else
+       float __remainderf(x,y)                 /* wrapper remainder */
+       float x,y;
+#endif
+{
+#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
+}
+weak_alias (__remainderf, remainderf)
diff --git a/sysdeps/generic/w_remainderl.c b/sysdeps/generic/w_remainderl.c
new file mode 100644 (file)
index 0000000..2841401
--- /dev/null
@@ -0,0 +1,48 @@
+/* w_remainderl.c -- long double version of w_remainder.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: $";
+#endif
+
+/*
+ * wrapper remainderl(x,p)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       long double __remainderl(long double x, long double y)
+               /* wrapper remainderl */
+#else
+       long double __remainderl(x,y)                   /* wrapper remainder */
+       long double x,y;
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_remainderl(x,y);
+#else
+       long double z;
+       z = __ieee754_remainderl(x,y);
+       if(_LIB_VERSION == _IEEE_ || __isnanl(y)) return z;
+       if(y==0.0)
+           return __kernel_standard(x,y,228); /* remainder(x,0) */
+       else
+           return z;
+#endif
+}
+weak_alias (__remainderl, remainderl)
diff --git a/sysdeps/generic/w_scalb.c b/sysdeps/generic/w_scalb.c
new file mode 100644 (file)
index 0000000..c981b85
--- /dev/null
@@ -0,0 +1,65 @@
+/* @(#)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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_scalb.c,v 1.6 1995/05/10 20:49:48 jtc Exp $";
+#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 <errno.h>
+
+#ifdef __STDC__
+#ifdef _SCALB_INT
+       double __scalb(double x, int fn)                /* wrapper scalb */
+#else
+       double __scalb(double x, double fn)     /* wrapper scalb */
+#endif
+#else
+       double __scalb(x,fn)                    /* wrapper scalb */
+#ifdef _SCALB_INT
+       double x; int fn;
+#else
+       double x,fn;
+#endif
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_scalb(x,fn);
+#else
+       double z;
+       z = __ieee754_scalb(x,fn);
+       if(_LIB_VERSION != _SVID_) 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)) __set_errno (ERANGE);
+#endif
+       return z;
+#endif
+}
+weak_alias (__scalb, scalb)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__scalb, __scalbl)
+weak_alias (__scalb, scalbl)
+#endif
diff --git a/sysdeps/generic/w_scalbf.c b/sysdeps/generic/w_scalbf.c
new file mode 100644 (file)
index 0000000..5105608
--- /dev/null
@@ -0,0 +1,66 @@
+/* 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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_scalbf.c,v 1.3 1995/05/10 20:49:50 jtc Exp $";
+#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 <errno.h>
+
+#ifdef __STDC__
+#ifdef _SCALB_INT
+       float __scalbf(float x, int fn)         /* wrapper scalbf */
+#else
+       float __scalbf(float x, float fn)               /* wrapper scalbf */
+#endif
+#else
+       float __scalbf(x,fn)                    /* wrapper scalbf */
+#ifdef _SCALB_INT
+       float x; int fn;
+#else
+       float x,fn;
+#endif
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_scalbf(x,fn);
+#else
+       float z;
+       z = __ieee754_scalbf(x,fn);
+       if(_LIB_VERSION != _SVID_) 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)) __set_errno (ERANGE);
+#endif
+       return z;
+#endif
+}
+weak_alias (__scalbf, scalbf)
diff --git a/sysdeps/generic/w_scalbl.c b/sysdeps/generic/w_scalbl.c
new file mode 100644 (file)
index 0000000..6a7d307
--- /dev/null
@@ -0,0 +1,65 @@
+/* w_scalbl.c -- long double version of w_scalb.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: $";
+#endif
+
+/*
+ * wrapper scalbl(long double x, long double fn) is provide for
+ * passing various standard test suite. One
+ * should use scalbnl() instead.
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#include <errno.h>
+
+#ifdef __STDC__
+#ifdef _SCALB_INT
+       long double __scalbl(long double x, int fn)     /* wrapper scalbl */
+#else
+       long double __scalbl(long double x, long double fn)/* wrapper scalbl */
+#endif
+#else
+       long double __scalbl(x,fn)                      /* wrapper scalbl */
+#ifdef _SCALB_INT
+       long double x; int fn;
+#else
+       long double x,fn;
+#endif
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_scalbl(x,fn);
+#else
+       long double z;
+       z = __ieee754_scalbl(x,fn);
+       if(_LIB_VERSION != _SVID_) return z;
+       if(!(__finitel(z)||__isnanl(z))&&__finitel(x)) {
+           return __kernel_standard(x,(double)fn,232); /* scalb overflow */
+       }
+       if(z==0.0&&z!=x) {
+           return __kernel_standard(x,(double)fn,233); /* scalb underflow */
+       }
+#ifndef _SCALB_INT
+       if(!__finitel(fn)) __set_errno (ERANGE);
+#endif
+       return z;
+#endif
+}
+weak_alias (__scalbl, scalbl)
diff --git a/sysdeps/generic/w_sinh.c b/sysdeps/generic/w_sinh.c
new file mode 100644 (file)
index 0000000..9b34cd1
--- /dev/null
@@ -0,0 +1,47 @@
+/* @(#)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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_sinh.c,v 1.6 1995/05/10 20:49:51 jtc Exp $";
+#endif
+
+/*
+ * wrapper sinh(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       double __sinh(double x)         /* wrapper sinh */
+#else
+       double __sinh(x)                        /* wrapper sinh */
+       double x;
+#endif
+{
+#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
+}
+weak_alias (__sinh, sinh)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__sinh, __sinhl)
+weak_alias (__sinh, sinhl)
+#endif
diff --git a/sysdeps/generic/w_sinhf.c b/sysdeps/generic/w_sinhf.c
new file mode 100644 (file)
index 0000000..a69cf30
--- /dev/null
@@ -0,0 +1,47 @@
+/* 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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_sinhf.c,v 1.3 1995/05/10 20:49:54 jtc Exp $";
+#endif
+
+/* 
+ * wrapper sinhf(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       float __sinhf(float x)          /* wrapper sinhf */
+#else
+       float __sinhf(x)                        /* wrapper sinhf */
+       float x;
+#endif
+{
+#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
+}
+weak_alias (__sinhf, sinhf)
diff --git a/sysdeps/generic/w_sinhl.c b/sysdeps/generic/w_sinhl.c
new file mode 100644 (file)
index 0000000..3e93cc5
--- /dev/null
@@ -0,0 +1,47 @@
+/* w_sinhl.c -- long double version of w_sinh.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: $";
+#endif
+
+/*
+ * wrapper sinhl(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       long double __sinhl(long double x)      /* wrapper sinhl */
+#else
+       long double __sinhl(x)                  /* wrapper sinhl */
+       long double x;
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_sinhl(x);
+#else
+       long double z;
+       z = __ieee754_sinhl(x);
+       if(_LIB_VERSION == _IEEE_) return z;
+       if(!__finitel(z)&&__finitel(x)) {
+           return __kernel_standard(x,x,225); /* sinh overflow */
+       } else
+           return z;
+#endif
+}
+weak_alias (__sinhl, sinhl)
diff --git a/sysdeps/generic/w_sqrtl.c b/sysdeps/generic/w_sqrtl.c
new file mode 100644 (file)
index 0000000..5873ce9
--- /dev/null
@@ -0,0 +1,47 @@
+/* w_sqrtl.c -- long double version of w_sqrt.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: $";
+#endif
+
+/*
+ * wrapper sqrtl(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       long double __sqrtl(long double x)      /* wrapper sqrtl */
+#else
+       long double __sqrtl(x)                  /* wrapper sqrtl */
+       long double x;
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_sqrtl(x);
+#else
+       long double z;
+       z = __ieee754_sqrtl(x);
+       if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
+       if(x<0.0) {
+           return __kernel_standard(x,x,226); /* sqrt(negative) */
+       } else
+           return z;
+#endif
+}
+weak_alias (__sqrtl, sqrtl)
diff --git a/sysdeps/generic/w_tgamma.c b/sysdeps/generic/w_tgamma.c
new file mode 100644 (file)
index 0000000..2adbc2e
--- /dev/null
@@ -0,0 +1,54 @@
+/* @(#)w_gamma.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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_gamma.c,v 1.7 1995/11/20 22:06:43 jtc Exp $";
+#endif
+
+/* double gamma(double x)
+ * Return  the logarithm of the Gamma function of x or the Gamma function of x,
+ * depending on the library mode.
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       double __tgamma(double x)
+#else
+       double __tgamma(x)
+       double x;
+#endif
+{
+        double y;
+       int local_signgam;
+       y = __ieee754_gamma_r(x,&local_signgam);
+       if (local_signgam < 0) y = -y;
+#ifdef _IEEE_LIBM
+       return y;
+#else
+       if(_LIB_VERSION == _IEEE_) return y;
+
+       if(!__finite(y)&&__finite(x)) {
+         if(__floor(x)==x&&x<=0.0)
+           return __kernel_standard(x,x,41); /* tgamma pole */
+         else
+           return __kernel_standard(x,x,40); /* tgamma overflow */
+       }
+       return y;
+#endif
+}
+weak_alias (__tgamma, tgamma)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__tgamma, __tgammal)
+weak_alias (__tgamma, tgammal)
+#endif
diff --git a/sysdeps/generic/w_tgammaf.c b/sysdeps/generic/w_tgammaf.c
new file mode 100644 (file)
index 0000000..152f4be
--- /dev/null
@@ -0,0 +1,50 @@
+/* w_gammaf.c -- float version of w_gamma.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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_gammaf.c,v 1.4 1995/11/20 22:06:48 jtc Exp $";
+#endif
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       float __tgammaf(float x)
+#else
+       float __tgammaf(x)
+       float x;
+#endif
+{
+        float y;
+       int local_signgam;
+       y = __ieee754_gammaf_r(x,&local_signgam);
+       if (local_signgam < 0) y = -y;
+#ifdef _IEEE_LIBM
+       return y;
+#else
+       if(_LIB_VERSION == _IEEE_) return y;
+
+       if(!__finitef(y)&&__finitef(x)) {
+         if(__floorf(x)==x&&x<=(float)0.0)
+           /* tgammaf pole */
+           return (float)__kernel_standard((double)x,(double)x,141);
+         else
+           /* tgammaf overflow */
+           return (float)__kernel_standard((double)x,(double)x,140);
+       }
+       return y;
+#endif
+}
+weak_alias (__tgammaf, tgammaf)
diff --git a/sysdeps/generic/w_tgammal.c b/sysdeps/generic/w_tgammal.c
new file mode 100644 (file)
index 0000000..9efce2b
--- /dev/null
@@ -0,0 +1,53 @@
+/* w_gammal.c -- long double version of w_gamma.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: $";
+#endif
+
+/* long double gammal(double x)
+ * Return the Gamma function of x.
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+       long double __tgammal(long double x)
+#else
+       long double __tgammal(x)
+       long double x;
+#endif
+{
+        long double y;
+       int local_signgam;
+       y = __ieee754_gammal_r(x,&local_signgam);
+       if (local_signgam < 0) y = -y;
+#ifdef _IEEE_LIBM
+       return y;
+#else
+       if(_LIB_VERSION == _IEEE_) return y;
+
+       if(!__finitel(y)&&__finitel(x)) {
+         if(__floorl(x)==x&&x<=0.0)
+           return __kernel_standard(x,x,241); /* tgamma pole */
+         else
+           return __kernel_standard(x,x,240); /* tgamma overflow */
+       }
+       return y;
+#endif
+}
+weak_alias (__tgammal, tgammal)