w_j1.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* @(#)w_j1.c 5.1 93/09/24 */
  2. /*
  3. * ====================================================
  4. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  5. *
  6. * Developed at SunPro, a Sun Microsystems, Inc. business.
  7. * Permission to use, copy, modify, and distribute this
  8. * software is freely granted, provided that this notice
  9. * is preserved.
  10. * ====================================================
  11. */
  12. #if defined(LIBM_SCCS) && !defined(lint)
  13. static char rcsid[] = "$NetBSD: w_j1.c,v 1.6 1995/05/10 20:49:15 jtc Exp $";
  14. #endif
  15. /*
  16. * wrapper of j1,y1
  17. */
  18. #include "math.h"
  19. #include "math_private.h"
  20. #ifdef __STDC__
  21. double j1(double x) /* wrapper j1 */
  22. #else
  23. double j1(x) /* wrapper j1 */
  24. double x;
  25. #endif
  26. {
  27. #ifdef _IEEE_LIBM
  28. return __ieee754_j1(x);
  29. #else
  30. double z;
  31. z = __ieee754_j1(x);
  32. if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
  33. if(fabs(x)>X_TLOSS) {
  34. return __kernel_standard(x,x,36); /* j1(|x|>X_TLOSS) */
  35. } else
  36. return z;
  37. #endif
  38. }
  39. #ifdef __STDC__
  40. double y1(double x) /* wrapper y1 */
  41. #else
  42. double y1(x) /* wrapper y1 */
  43. double x;
  44. #endif
  45. {
  46. #ifdef _IEEE_LIBM
  47. return __ieee754_y1(x);
  48. #else
  49. double z;
  50. z = __ieee754_y1(x);
  51. if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
  52. if(x <= 0.0){
  53. if(x==0.0)
  54. /* d= -one/(x-x); */
  55. return __kernel_standard(x,x,10);
  56. else
  57. /* d = zero/(x-x); */
  58. return __kernel_standard(x,x,11);
  59. }
  60. if(x>X_TLOSS) {
  61. return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */
  62. } else
  63. return z;
  64. #endif
  65. }