w_j1.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 of j1,y1
  13. */
  14. #include "math.h"
  15. #include "math_private.h"
  16. double j1(double x) /* wrapper j1 */
  17. {
  18. #ifdef _IEEE_LIBM
  19. return __ieee754_j1(x);
  20. #else
  21. double z;
  22. z = __ieee754_j1(x);
  23. if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
  24. if(fabs(x)>X_TLOSS) {
  25. return __kernel_standard(x,x,36); /* j1(|x|>X_TLOSS) */
  26. } else
  27. return z;
  28. #endif
  29. }
  30. double y1(double x) /* wrapper y1 */
  31. {
  32. #ifdef _IEEE_LIBM
  33. return __ieee754_y1(x);
  34. #else
  35. double z;
  36. z = __ieee754_y1(x);
  37. if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
  38. if(x <= 0.0){
  39. if(x==0.0)
  40. /* d= -one/(x-x); */
  41. return __kernel_standard(x,x,10);
  42. else
  43. /* d = zero/(x-x); */
  44. return __kernel_standard(x,x,11);
  45. }
  46. if(x>X_TLOSS) {
  47. return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */
  48. } else
  49. return z;
  50. #endif
  51. }