w_j1.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. libm_hidden_def(j1)
  40. #ifdef __STDC__
  41. double y1(double x) /* wrapper y1 */
  42. #else
  43. double y1(x) /* wrapper y1 */
  44. double x;
  45. #endif
  46. {
  47. #ifdef _IEEE_LIBM
  48. return __ieee754_y1(x);
  49. #else
  50. double z;
  51. z = __ieee754_y1(x);
  52. if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
  53. if(x <= 0.0){
  54. if(x==0.0)
  55. /* d= -one/(x-x); */
  56. return __kernel_standard(x,x,10);
  57. else
  58. /* d = zero/(x-x); */
  59. return __kernel_standard(x,x,11);
  60. }
  61. if(x>X_TLOSS) {
  62. return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */
  63. } else
  64. return z;
  65. #endif
  66. }
  67. libm_hidden_def(y1)