w_acos.c 831 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* @(#)w_acos.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. * wrap_acos(x)
  14. */
  15. #include "fdlibm.h"
  16. #ifdef __STDC__
  17. double acos(double x) /* wrapper acos */
  18. #else
  19. double acos(x) /* wrapper acos */
  20. double x;
  21. #endif
  22. {
  23. #ifdef _IEEE_LIBM
  24. return __ieee754_acos(x);
  25. #else
  26. double z;
  27. z = __ieee754_acos(x);
  28. if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
  29. if(fabs(x)>1.0) {
  30. return __kernel_standard(x,x,1); /* acos(|x|>1) */
  31. } else
  32. return z;
  33. #endif
  34. }