Home | History | Annotate | Line # | Download | only in src
      1 /*	$NetBSD: w_acosf.c,v 1.8 2024/06/09 13:35:38 riastradh Exp $	*/
      2 
      3 /*
      4  * w_acosf.c -- float version of w_acos.c.
      5  * Conversion to float by Ian Lance Taylor, Cygnus Support, ian (at) cygnus.com.
      6  */
      7 
      8 /*
      9  * ====================================================
     10  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
     11  *
     12  * Developed at SunPro, a Sun Microsystems, Inc. business.
     13  * Permission to use, copy, modify, and distribute this
     14  * software is freely granted, provided that this notice
     15  * is preserved.
     16  * ====================================================
     17  */
     18 
     19 #include <sys/cdefs.h>
     20 #if defined(LIBM_SCCS) && !defined(lint)
     21 __RCSID("$NetBSD: w_acosf.c,v 1.8 2024/06/09 13:35:38 riastradh Exp $");
     22 #endif
     23 
     24 /*
     25  * wrap_acosf(x)
     26  */
     27 
     28 #include "namespace.h"
     29 
     30 #include "math.h"
     31 #include "math_private.h"
     32 
     33 __weak_alias(acosf, _acosf)
     34 
     35 float
     36 acosf(float x)		/* wrapper acosf */
     37 {
     38 #ifdef _IEEE_LIBM
     39 	return __ieee754_acosf(x);
     40 #else
     41 	float z;
     42 	z = __ieee754_acosf(x);
     43 	if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z;
     44 	if(fabsf(x)>(float)1.0) {
     45 	        /* acosf(|x|>1) */
     46 	        return (float)__kernel_standard((double)x,(double)x,101);
     47 	} else
     48 	    return z;
     49 #endif
     50 }
     51