Back to index

glibc  2.9
w_jnf.c
Go to the documentation of this file.
00001 /* w_jnf.c -- float version of w_jn.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_jnf.c,v 1.3 1995/05/10 20:49:21 jtc Exp $";
00018 #endif
00019 
00020 #include <math.h>
00021 #include "math_private.h"
00022 
00023 #ifdef __STDC__
00024        float jnf(int n, float x)   /* wrapper jnf */
00025 #else
00026        float jnf(n,x)                     /* wrapper jnf */
00027        float x; int n;
00028 #endif
00029 {
00030 #ifdef _IEEE_LIBM
00031        return __ieee754_jnf(n,x);
00032 #else
00033        float z;
00034        z = __ieee754_jnf(n,x);
00035        if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
00036        if(fabsf(x)>(float)X_TLOSS) {
00037            /* jn(|x|>X_TLOSS,n) */
00038            return (float)__kernel_standard((double)n,(double)x,138);
00039        } else
00040            return z;
00041 #endif
00042 }
00043 
00044 #ifdef __STDC__
00045        float ynf(int n, float x)   /* wrapper ynf */
00046 #else
00047        float ynf(n,x)                     /* wrapper ynf */
00048        float x; int n;
00049 #endif
00050 {
00051 #ifdef _IEEE_LIBM
00052        return __ieee754_ynf(n,x);
00053 #else
00054        float z;
00055        z = __ieee754_ynf(n,x);
00056        if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
00057         if(x <= (float)0.0){
00058                 if(x==(float)0.0)
00059                     /* d= -one/(x-x); */
00060                     return (float)__kernel_standard((double)n,(double)x,112);
00061                 else
00062                     /* d = zero/(x-x); */
00063                     return (float)__kernel_standard((double)n,(double)x,113);
00064         }
00065        if(x>(float)X_TLOSS) {
00066            /* yn(x>X_TLOSS,n) */
00067            return (float)__kernel_standard((double)n,(double)x,139);
00068        } else
00069            return z;
00070 #endif
00071 }