w_j0.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* @(#)w_j0.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_j0.c,v 1.6 1995/05/10 20:49:11 jtc Exp $";
  14. #endif
  15. /*
  16. * wrapper j0(double x), y0(double x)
  17. */
  18. #include "math.h"
  19. #include "math_private.h"
  20. #ifdef __STDC__
  21. double j0(double x) /* wrapper j0 */
  22. #else
  23. double j0(x) /* wrapper j0 */
  24. double x;
  25. #endif
  26. {
  27. #ifdef _IEEE_LIBM
  28. return __ieee754_j0(x);
  29. #else
  30. double z = __ieee754_j0(x);
  31. if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
  32. if(fabs(x)>X_TLOSS) {
  33. return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */
  34. } else
  35. return z;
  36. #endif
  37. }
  38. libm_hidden_def(j0)
  39. #ifdef __STDC__
  40. double y0(double x) /* wrapper y0 */
  41. #else
  42. double y0(x) /* wrapper y0 */
  43. double x;
  44. #endif
  45. {
  46. #ifdef _IEEE_LIBM
  47. return __ieee754_y0(x);
  48. #else
  49. double z;
  50. z = __ieee754_y0(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,8);
  56. else
  57. /* d = zero/(x-x); */
  58. return __kernel_standard(x,x,9);
  59. }
  60. if(x>X_TLOSS) {
  61. return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */
  62. } else
  63. return z;
  64. #endif
  65. }
  66. libm_hidden_def(y0)