source: trunk/sys/libm/w_j0.c @ 202

Last change on this file since 202 was 1, checked in by alain, 8 years ago

First import

File size: 1.4 KB
Line 
1
2/* @(#)w_j0.c 5.1 93/09/24 */
3/*
4 * ====================================================
5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 *
7 * Developed at SunPro, 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 j0(double x), y0(double x)
16 */
17
18#include <libm/fdlibm.h>
19
20#ifdef __STDC__
21        double j0(double x)             /* wrapper j0 */
22#else
23        double 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_ || isnan(x)) return z;
32        if(fabs(x)>X_TLOSS) {
33                return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */
34        } else
35            return z;
36#endif
37}
38
39#ifdef __STDC__
40        double y0(double x)             /* wrapper y0 */
41#else
42        double 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_ || 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); /* y0(x>X_TLOSS) */
62        } else
63            return z;
64#endif
65}
Note: See TracBrowser for help on using the repository browser.