xref: /netbsd-src/lib/libm/src/w_j1.c (revision aa30599e066edca03ae9611c8115625435305425)
113618394Sjtc /* @(#)w_j1.c 5.1 93/09/24 */
213618394Sjtc /*
313618394Sjtc  * ====================================================
413618394Sjtc  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
513618394Sjtc  *
613618394Sjtc  * Developed at SunPro, a Sun Microsystems, Inc. business.
713618394Sjtc  * Permission to use, copy, modify, and distribute this
813618394Sjtc  * software is freely granted, provided that this notice
913618394Sjtc  * is preserved.
1013618394Sjtc  * ====================================================
1113618394Sjtc  */
1213618394Sjtc 
13118c71a6Slukem #include <sys/cdefs.h>
14d1f06e0bSjtc #if defined(LIBM_SCCS) && !defined(lint)
15*aa30599eSwiz __RCSID("$NetBSD: w_j1.c,v 1.9 2002/05/26 22:02:01 wiz Exp $");
16af4a3642Sjtc #endif
17af4a3642Sjtc 
1813618394Sjtc /*
1913618394Sjtc  * wrapper of j1,y1
2013618394Sjtc  */
2113618394Sjtc 
228346e333Sjtc #include "math.h"
238346e333Sjtc #include "math_private.h"
2413618394Sjtc 
25*aa30599eSwiz double
j1(double x)26*aa30599eSwiz j1(double x)		/* wrapper j1 */
2713618394Sjtc {
2813618394Sjtc #ifdef _IEEE_LIBM
2913618394Sjtc 	return __ieee754_j1(x);
3013618394Sjtc #else
3113618394Sjtc 	double z;
3213618394Sjtc 	z = __ieee754_j1(x);
3313618394Sjtc 	if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
3413618394Sjtc 	if(fabs(x)>X_TLOSS) {
3513618394Sjtc 	        return __kernel_standard(x,x,36); /* j1(|x|>X_TLOSS) */
3613618394Sjtc 	} else
3713618394Sjtc 	    return z;
3813618394Sjtc #endif
3913618394Sjtc }
4013618394Sjtc 
41*aa30599eSwiz double
y1(double x)42*aa30599eSwiz y1(double x)		/* wrapper y1 */
4313618394Sjtc {
4413618394Sjtc #ifdef _IEEE_LIBM
4513618394Sjtc 	return __ieee754_y1(x);
4613618394Sjtc #else
4713618394Sjtc 	double z;
4813618394Sjtc 	z = __ieee754_y1(x);
4913618394Sjtc 	if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
5013618394Sjtc         if(x <= 0.0){
5113618394Sjtc                 if(x==0.0)
5213618394Sjtc                     /* d= -one/(x-x); */
5313618394Sjtc                     return __kernel_standard(x,x,10);
5413618394Sjtc                 else
5513618394Sjtc                     /* d = zero/(x-x); */
5613618394Sjtc                     return __kernel_standard(x,x,11);
5713618394Sjtc         }
5813618394Sjtc 	if(x>X_TLOSS) {
5913618394Sjtc 	        return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */
6013618394Sjtc 	} else
6113618394Sjtc 	    return z;
6213618394Sjtc #endif
6313618394Sjtc }
64