1 /* w_jnf.c -- float version of w_jn.c. 2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 */ 4 5 /* 6 * ==================================================== 7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 * 9 * Developed at SunPro, a Sun Microsystems, Inc. business. 10 * Permission to use, copy, modify, and distribute this 11 * software is freely granted, provided that this notice 12 * is preserved. 13 * ==================================================== 14 */ 15 16 #include <sys/cdefs.h> 17 #if defined(LIBM_SCCS) && !defined(lint) 18 __RCSID("$NetBSD: w_jnf.c,v 1.4 1997/10/09 11:35:21 lukem Exp $"); 19 #endif 20 21 #include "math.h" 22 #include "math_private.h" 23 24 #ifdef __STDC__ 25 float jnf(int n, float x) /* wrapper jnf */ 26 #else 27 float jnf(n,x) /* wrapper jnf */ 28 float x; int n; 29 #endif 30 { 31 #ifdef _IEEE_LIBM 32 return __ieee754_jnf(n,x); 33 #else 34 float z; 35 z = __ieee754_jnf(n,x); 36 if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; 37 if(fabsf(x)>(float)X_TLOSS) { 38 /* jn(|x|>X_TLOSS,n) */ 39 return (float)__kernel_standard((double)n,(double)x,138); 40 } else 41 return z; 42 #endif 43 } 44 45 #ifdef __STDC__ 46 float ynf(int n, float x) /* wrapper ynf */ 47 #else 48 float ynf(n,x) /* wrapper ynf */ 49 float x; int n; 50 #endif 51 { 52 #ifdef _IEEE_LIBM 53 return __ieee754_ynf(n,x); 54 #else 55 float z; 56 z = __ieee754_ynf(n,x); 57 if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; 58 if(x <= (float)0.0){ 59 if(x==(float)0.0) 60 /* d= -one/(x-x); */ 61 return (float)__kernel_standard((double)n,(double)x,112); 62 else 63 /* d = zero/(x-x); */ 64 return (float)__kernel_standard((double)n,(double)x,113); 65 } 66 if(x>(float)X_TLOSS) { 67 /* yn(x>X_TLOSS,n) */ 68 return (float)__kernel_standard((double)n,(double)x,139); 69 } else 70 return z; 71 #endif 72 } 73