1 /* wf_j0.c -- float version of w_j0.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
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
13 * ====================================================
17 * wrapper j0f(float x), y0f(float x)
24 float j0f(float x
) /* wrapper j0f */
26 float j0f(x
) /* wrapper j0f */
31 return __ieee754_j0f(x
);
34 float z
= __ieee754_j0f(x
);
35 if(_LIB_VERSION
== _IEEE_
|| isnanf(x
)) return z
;
36 if(fabsf(x
)>(float)X_TLOSS
) {
37 /* j0f(|x|>X_TLOSS) */
41 exc
.arg1
= exc
.arg2
= (double)x
;
43 if (_LIB_VERSION
== _POSIX_
)
45 else if (!matherr(&exc
)) {
50 return (float)exc
.retval
;
57 float y0f(float x
) /* wrapper y0f */
59 float y0f(x
) /* wrapper y0f */
64 return __ieee754_y0f(x
);
69 if(_LIB_VERSION
== _IEEE_
|| isnanf(x
) ) return z
;
75 SET_HIGH_WORD(inf
,0x7ff00000); /* set inf to infinite */
77 /* y0f(0) = -inf or y0f(x<0) = NaN */
78 exc
.type
= DOMAIN
; /* should be SING for IEEE y0f(0) */
81 exc
.arg1
= exc
.arg2
= (double)x
;
82 if (_LIB_VERSION
== _SVID_
)
85 exc
.retval
= -HUGE_VAL
;
86 if (_LIB_VERSION
== _POSIX_
)
88 else if (!matherr(&exc
)) {
93 return (float)exc
.retval
;
95 if(x
>(float)X_TLOSS
) {
100 exc
.arg1
= exc
.arg2
= (double)x
;
102 if (_LIB_VERSION
== _POSIX_
)
104 else if (!matherr(&exc
)) {
109 return (float)exc
.retval
;
115 #ifdef _DOUBLE_IS_32BITS
124 return (double) j0f((float) x
);
134 return (double) y0f((float) x
);
137 #endif /* defined(_DOUBLE_IS_32BITS) */