Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. /* w_jnf.c -- float version of w_jn.c.
  3.  * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
  4.  */
  5.  
  6. /*
  7.  * ====================================================
  8.  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  9.  *
  10.  * Developed at SunPro, a Sun Microsystems, Inc. business.
  11.  * Permission to use, copy, modify, and distribute this
  12.  * software is freely granted, provided that this notice
  13.  * is preserved.
  14.  * ====================================================
  15.  */
  16.  
  17. #if defined(LIBM_SCCS) && !defined(lint)
  18. static char rcsid[] = "$Id: w_jnf.c,v 1.1 1994/08/10 20:34:47 jtc 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.