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_j0f.c -- float version of w_j0.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_j0f.c,v 1.1 1994/08/10 20:34:32 jtc Exp $";
  19. #endif
  20.  
  21. /*
  22.  * wrapper j0f(float x), y0f(float x)
  23.  */
  24.  
  25. #include "math.h"
  26. #include "math_private.h"
  27.  
  28. #ifdef __STDC__
  29.         float j0f(float x)              /* wrapper j0f */
  30. #else
  31.         float j0f(x)                    /* wrapper j0f */
  32.         float x;
  33. #endif
  34. {
  35. #ifdef _IEEE_LIBM
  36.         return __ieee754_j0f(x);
  37. #else
  38.         float z = __ieee754_j0f(x);
  39.         if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z;
  40.         if(fabsf(x)>(float)X_TLOSS) {
  41.                 /* j0f(|x|>X_TLOSS) */
  42.                 return (float)__kernel_standard((double)x,(double)x,134);
  43.         } else
  44.             return z;
  45. #endif
  46. }
  47.  
  48. #ifdef __STDC__
  49.         float y0f(float x)              /* wrapper y0f */
  50. #else
  51.         float y0f(x)                    /* wrapper y0f */
  52.         float x;
  53. #endif
  54. {
  55. #ifdef _IEEE_LIBM
  56.         return __ieee754_y0f(x);
  57. #else
  58.         float z;
  59.         z = __ieee754_y0f(x);
  60.         if(_LIB_VERSION == _IEEE_ || isnanf(x) ) return z;
  61.         if(x <= (float)0.0){
  62.                 if(x==(float)0.0)
  63.                     /* d= -one/(x-x); */
  64.                     return (float)__kernel_standard((double)x,(double)x,108);
  65.                 else
  66.                     /* d = zero/(x-x); */
  67.                     return (float)__kernel_standard((double)x,(double)x,109);
  68.         }
  69.         if(x>(float)X_TLOSS) {
  70.                 /* y0(x>X_TLOSS) */
  71.                 return (float)__kernel_standard((double)x,(double)x,135);
  72.         } else
  73.             return z;
  74. #endif
  75. }
  76.