xref: /netbsd-src/lib/libm/src/w_j0f.c (revision 2a399c6883d870daece976daec6ffa7bb7f934ce)
1 /* w_j0f.c -- float version of w_j0.c.
2  * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3  */
4 
5 /*
6  * ====================================================
7  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8  *
9  * Developed at SunPro, a Sun Microsystems, Inc. business.
10  * Permission to use, copy, modify, and distribute this
11  * software is freely granted, provided that this notice
12  * is preserved.
13  * ====================================================
14  */
15 
16 #include <sys/cdefs.h>
17 #if defined(LIBM_SCCS) && !defined(lint)
18 __RCSID("$NetBSD: w_j0f.c,v 1.4 1997/10/09 11:35:09 lukem Exp $");
19 #endif
20 
21 /*
22  * wrapper j0f(float x), y0f(float x)
23  */
24 
25 #include "math.h"
26 #include "math_private.h"
27 
28 #ifdef __STDC__
29 	float j0f(float x)		/* wrapper j0f */
30 #else
31 	float j0f(x)			/* wrapper j0f */
32 	float x;
33 #endif
34 {
35 #ifdef _IEEE_LIBM
36 	return __ieee754_j0f(x);
37 #else
38 	float z = __ieee754_j0f(x);
39 	if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z;
40 	if(fabsf(x)>(float)X_TLOSS) {
41 		/* j0f(|x|>X_TLOSS) */
42 	        return (float)__kernel_standard((double)x,(double)x,134);
43 	} else
44 	    return z;
45 #endif
46 }
47 
48 #ifdef __STDC__
49 	float y0f(float x)		/* wrapper y0f */
50 #else
51 	float y0f(x)			/* wrapper y0f */
52 	float x;
53 #endif
54 {
55 #ifdef _IEEE_LIBM
56 	return __ieee754_y0f(x);
57 #else
58 	float z;
59 	z = __ieee754_y0f(x);
60 	if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z;
61         if(x <= (float)0.0){
62                 if(x==(float)0.0)
63                     /* d= -one/(x-x); */
64                     return (float)__kernel_standard((double)x,(double)x,108);
65                 else
66                     /* d = zero/(x-x); */
67                     return (float)__kernel_standard((double)x,(double)x,109);
68         }
69 	if(x>(float)X_TLOSS) {
70 		/* y0(x>X_TLOSS) */
71 	        return (float)__kernel_standard((double)x,(double)x,135);
72 	} else
73 	    return z;
74 #endif
75 }
76