From 2a8fd4fc31e9bb0c1e4fd76bae95ab3cda6697a6 Mon Sep 17 00:00:00 2001 From: jkh Date: Fri, 19 Aug 1994 09:40:01 +0000 Subject: J.T. Conklin's latest version of the Sun math library. -- Begin comments from J.T. Conklin: The most significant improvement is the addition of "float" versions of the math functions that take float arguments, return floats, and do all operations in floating point. This doesn't help (performance) much on the i386, but they are still nice to have. The float versions were orginally done by Cygnus' Ian Taylor when fdlibm was integrated into the libm we support for embedded systems. I gave Ian a copy of my libm as a starting point since I had already fixed a lot of bugs & problems in Sun's original code. After he was done, I cleaned it up a bit and integrated the changes back into my libm. -- End comments Reviewed by: jkh Submitted by: jtc --- lib/msun/src/w_acos.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lib/msun/src/w_acos.c (limited to 'lib/msun/src/w_acos.c') diff --git a/lib/msun/src/w_acos.c b/lib/msun/src/w_acos.c new file mode 100644 index 0000000..b5fefeb --- /dev/null +++ b/lib/msun/src/w_acos.c @@ -0,0 +1,43 @@ +/* @(#)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[] = "$Id: w_acos.c,v 1.4 1994/08/10 20:33:18 jtc Exp $"; +#endif + +/* + * wrap_acos(x) + */ + +#include "math.h" +#include "math_private.h" + + +#ifdef __STDC__ + double acos(double x) /* wrapper acos */ +#else + double acos(x) /* wrapper acos */ + double x; +#endif +{ +#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 +} -- cgit v1.1