POK
|
00001 /* 00002 * POK header 00003 * 00004 * The following file is a part of the POK project. Any modification should 00005 * made according to the POK licence. You CANNOT use this file or a part of 00006 * this file is this part of a file for your own project 00007 * 00008 * For more information on the POK licence, please see our LICENCE FILE 00009 * 00010 * Please follow the coding guidelines described in doc/CODING_GUIDELINES 00011 * 00012 * Copyright (c) 2007-2009 POK team 00013 * 00014 * Created by julien on Fri Jan 30 14:41:34 2009 00015 */ 00016 00017 /* w_jnf.c -- float version of w_jn.c. 00018 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 00019 */ 00020 00021 /* 00022 * ==================================================== 00023 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 00024 * 00025 * Developed at SunPro, a Sun Microsystems, Inc. business. 00026 * Permission to use, copy, modify, and distribute this 00027 * software is freely granted, provided that this notice 00028 * is preserved. 00029 * ==================================================== 00030 */ 00031 00032 00033 #ifdef POK_NEEDS_LIBMATH 00034 00035 #include <libm.h> 00036 #include "math_private.h" 00037 00038 float 00039 jnf(int n, float x) /* wrapper jnf */ 00040 { 00041 #ifdef _IEEE_LIBM 00042 return __ieee754_jnf(n,x); 00043 #else 00044 float z; 00045 z = __ieee754_jnf(n,x); 00046 if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; 00047 if(fabsf(x)>(float)X_TLOSS) { 00048 /* jn(|x|>X_TLOSS,n) */ 00049 return (float)__kernel_standard((double)n,(double)x,138); 00050 } else 00051 return z; 00052 #endif 00053 } 00054 00055 float 00056 ynf(int n, float x) /* wrapper ynf */ 00057 { 00058 #ifdef _IEEE_LIBM 00059 return __ieee754_ynf(n,x); 00060 #else 00061 float z; 00062 z = __ieee754_ynf(n,x); 00063 if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z; 00064 if(x <= (float)0.0){ 00065 if(x==(float)0.0) 00066 /* d= -one/(x-x); */ 00067 return (float)__kernel_standard((double)n,(double)x,112); 00068 else 00069 /* d = zero/(x-x); */ 00070 return (float)__kernel_standard((double)n,(double)x,113); 00071 } 00072 if(x>(float)X_TLOSS) { 00073 /* yn(x>X_TLOSS,n) */ 00074 return (float)__kernel_standard((double)n,(double)x,139); 00075 } else 00076 return z; 00077 #endif 00078 } 00079 00080 #endif 00081