w_asin.c 839 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* @(#)w_asin.c 1.3 95/01/18 */
  2. /*
  3. * ====================================================
  4. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  5. *
  6. * Developed at SunSoft, 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. */
  13. /*
  14. * wrapper asin(x)
  15. */
  16. #include "fdlibm.h"
  17. #ifdef __STDC__
  18. double asin(double x) /* wrapper asin */
  19. #else
  20. double asin(x) /* wrapper asin */
  21. double x;
  22. #endif
  23. {
  24. #ifdef _IEEE_LIBM
  25. return __ieee754_asin(x);
  26. #else
  27. double z;
  28. z = __ieee754_asin(x);
  29. if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
  30. if(fabs(x)>1.0) {
  31. return __kernel_standard(x,x,2); /* asin(|x|>1) */
  32. } else
  33. return z;
  34. #endif
  35. }