base/math/w_j0.c

Go to the documentation of this file.
00001 /* @(#)w_j0.c 5.1 93/09/24 */
00002 /*
00003  * ====================================================
00004  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00005  *
00006  * Developed at SunPro, a Sun Microsystems, Inc. business.
00007  * Permission to use, copy, modify, and distribute this
00008  * software is freely granted, provided that this notice 
00009  * is preserved.
00010  * ====================================================
00011  */
00012 
00013 #if defined(LIBM_SCCS) && !defined(lint)
00014 static char rcsid[] = "$NetBSD: w_j0.c,v 1.6 1995/05/10 20:49:11 jtc Exp $";
00015 #endif
00016 
00017 /*
00018  * wrapper j0(double x), y0(double x)
00019  */
00020 
00021 #include "math.h"
00022 #include "mathP.h"
00023 
00024 #ifdef __STDC__
00025     double j0(double x)     /* wrapper j0 */
00026 #else
00027     double j0(x)            /* wrapper j0 */
00028     double x;
00029 #endif
00030 {
00031 #ifdef _IEEE_LIBM
00032     return __ieee754_j0(x);
00033 #else
00034     double z = __ieee754_j0(x);
00035     if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
00036     if(fabs(x)>X_TLOSS) {
00037             return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */
00038     } else
00039         return z;
00040 #endif
00041 }
00042 
00043 #ifdef __STDC__
00044     double y0(double x)     /* wrapper y0 */
00045 #else
00046     double y0(x)            /* wrapper y0 */
00047     double x;
00048 #endif
00049 {
00050 #ifdef _IEEE_LIBM
00051     return __ieee754_y0(x);
00052 #else
00053     double z;
00054     z = __ieee754_y0(x);
00055     if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
00056         if(x <= 0.0){
00057                 if(x==0.0)
00058                     /* d= -one/(x-x); */
00059                     return __kernel_standard(x,x,8);
00060                 else
00061                     /* d = zero/(x-x); */
00062                     return __kernel_standard(x,x,9);
00063         }
00064     if(x>X_TLOSS) {
00065             return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */
00066     } else
00067         return z;
00068 #endif
00069 }

Generated on Tue Feb 2 17:46:05 2010 for RTAI API by  doxygen 1.4.7