Back to index

glibc  2.9
w_j0f.c
Go to the documentation of this file.
00001 /* w_j0f.c -- float version of w_j0.c.
00002  * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
00003  */
00004 
00005 /*
00006  * ====================================================
00007  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00008  *
00009  * Developed at SunPro, a Sun Microsystems, Inc. business.
00010  * Permission to use, copy, modify, and distribute this
00011  * software is freely granted, provided that this notice
00012  * is preserved.
00013  * ====================================================
00014  */
00015 
00016 #if defined(LIBM_SCCS) && !defined(lint)
00017 static char rcsid[] = "$NetBSD: w_j0f.c,v 1.3 1995/05/10 20:49:13 jtc Exp $";
00018 #endif
00019 
00020 /*
00021  * wrapper j0f(float x), y0f(float x)
00022  */
00023 
00024 #include <math.h>
00025 #include "math_private.h"
00026 
00027 #ifdef __STDC__
00028        float j0f(float x)          /* wrapper j0f */
00029 #else
00030        float j0f(x)                /* wrapper j0f */
00031        float x;
00032 #endif
00033 {
00034 #ifdef _IEEE_LIBM
00035        return __ieee754_j0f(x);
00036 #else
00037        float z = __ieee754_j0f(x);
00038        if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
00039        if(fabsf(x)>(float)X_TLOSS) {
00040               /* j0f(|x|>X_TLOSS) */
00041                return (float)__kernel_standard((double)x,(double)x,134);
00042        } else
00043            return z;
00044 #endif
00045 }
00046 
00047 #ifdef __STDC__
00048        float y0f(float x)          /* wrapper y0f */
00049 #else
00050        float y0f(x)                /* wrapper y0f */
00051        float x;
00052 #endif
00053 {
00054 #ifdef _IEEE_LIBM
00055        return __ieee754_y0f(x);
00056 #else
00057        float z;
00058        z = __ieee754_y0f(x);
00059        if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
00060         if(x <= (float)0.0){
00061                 if(x==(float)0.0)
00062                     /* d= -one/(x-x); */
00063                     return (float)__kernel_standard((double)x,(double)x,108);
00064                 else
00065                     /* d = zero/(x-x); */
00066                     return (float)__kernel_standard((double)x,(double)x,109);
00067         }
00068        if(x>(float)X_TLOSS) {
00069               /* y0(x>X_TLOSS) */
00070                return (float)__kernel_standard((double)x,(double)x,135);
00071        } else
00072            return z;
00073 #endif
00074 }