w_j0.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * ====================================================
  3. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  4. *
  5. * Developed at SunPro, a Sun Microsystems, Inc. business.
  6. * Permission to use, copy, modify, and distribute this
  7. * software is freely granted, provided that this notice
  8. * is preserved.
  9. * ====================================================
  10. */
  11. /*
  12. * wrapper j0(double x), y0(double x)
  13. */
  14. #include "math.h"
  15. #include "math_private.h"
  16. double j0(double x) /* wrapper j0 */
  17. {
  18. #ifdef _IEEE_LIBM
  19. return __ieee754_j0(x);
  20. #else
  21. double z = __ieee754_j0(x);
  22. if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
  23. if(fabs(x)>X_TLOSS) {
  24. return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */
  25. } else
  26. return z;
  27. #endif
  28. }
  29. double y0(double x) /* wrapper y0 */
  30. {
  31. #ifdef _IEEE_LIBM
  32. return __ieee754_y0(x);
  33. #else
  34. double z;
  35. z = __ieee754_y0(x);
  36. if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
  37. if(x <= 0.0){
  38. if(x==0.0)
  39. /* d= -one/(x-x); */
  40. return __kernel_standard(x,x,8);
  41. else
  42. /* d = zero/(x-x); */
  43. return __kernel_standard(x,x,9);
  44. }
  45. if(x>X_TLOSS) {
  46. return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */
  47. } else
  48. return z;
  49. #endif
  50. }