coverity appeasement
[minix.git] / lib / libm / src / w_j0.c
blob94679b2077b588feb12d3cc78496659945d4b07d
1 /* @(#)w_j0.c 5.1 93/09/24 */
2 /*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
13 #include <sys/cdefs.h>
14 #if defined(LIBM_SCCS) && !defined(lint)
15 __RCSID("$NetBSD: w_j0.c,v 1.9 2002/05/26 22:02:01 wiz Exp $");
16 #endif
19 * wrapper j0(double x), y0(double x)
22 #include "math.h"
23 #include "math_private.h"
25 double
26 j0(double x) /* wrapper j0 */
28 #ifdef _IEEE_LIBM
29 return __ieee754_j0(x);
30 #else
31 double z = __ieee754_j0(x);
32 if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
33 if(fabs(x)>X_TLOSS) {
34 return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */
35 } else
36 return z;
37 #endif
40 double
41 y0(double x) /* wrapper y0 */
43 #ifdef _IEEE_LIBM
44 return __ieee754_y0(x);
45 #else
46 double z;
47 z = __ieee754_y0(x);
48 if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
49 if(x <= 0.0){
50 if(x==0.0)
51 /* d= -one/(x-x); */
52 return __kernel_standard(x,x,8);
53 else
54 /* d = zero/(x-x); */
55 return __kernel_standard(x,x,9);
57 if(x>X_TLOSS) {
58 return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */
59 } else
60 return z;
61 #endif