blob: aaf7b94868559dd6bd077c0861bf0917c314468b [file] [log] [blame]
The Android Open Source Projectb07e1d92009-03-03 19:29:30 -08001
2/* @(#)w_j0.c 1.3 95/01/18 */
3/*
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 *
7 * Developed at SunSoft, a Sun Microsystems, Inc. business.
8 * Permission to use, copy, modify, and distribute this
9 * software is freely granted, provided that this notice
10 * is preserved.
11 * ====================================================
12 */
13
14/*
15 * wrapper ieee_j0(double x), ieee_y0(double x)
16 */
17
18#include "fdlibm.h"
19
20#ifdef __STDC__
21 double ieee_j0(double x) /* wrapper j0 */
22#else
23 double ieee_j0(x) /* wrapper j0 */
24 double x;
25#endif
26{
27#ifdef _IEEE_LIBM
28 return __ieee754_j0(x);
29#else
30 double z = __ieee754_j0(x);
31 if(_LIB_VERSION == _IEEE_ || ieee_isnan(x)) return z;
32 if(ieee_fabs(x)>X_TLOSS) {
33 return __kernel_standard(x,x,34); /* ieee_j0(|x|>X_TLOSS) */
34 } else
35 return z;
36#endif
37}
38
39#ifdef __STDC__
40 double ieee_y0(double x) /* wrapper y0 */
41#else
42 double ieee_y0(x) /* wrapper y0 */
43 double x;
44#endif
45{
46#ifdef _IEEE_LIBM
47 return __ieee754_y0(x);
48#else
49 double z;
50 z = __ieee754_y0(x);
51 if(_LIB_VERSION == _IEEE_ || ieee_isnan(x) ) return z;
52 if(x <= 0.0){
53 if(x==0.0)
54 /* d= -one/(x-x); */
55 return __kernel_standard(x,x,8);
56 else
57 /* d = zero/(x-x); */
58 return __kernel_standard(x,x,9);
59 }
60 if(x>X_TLOSS) {
61 return __kernel_standard(x,x,35); /* ieee_y0(x>X_TLOSS) */
62 } else
63 return z;
64#endif
65}