w_atanh.c 873 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * ====================================================
  3. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  4. *
  5. * Developed at SunPro, a Sun Microsystems, Inc. business.
  6. * Permission to use, copy, modify, and distribute this
  7. * software is freely granted, provided that this notice
  8. * is preserved.
  9. * ====================================================
  10. */
  11. /*
  12. * wrapper atanh(x)
  13. */
  14. #include "math.h"
  15. #include "math_private.h"
  16. double atanh(double x) /* wrapper atanh */
  17. {
  18. #ifdef _IEEE_LIBM
  19. return __ieee754_atanh(x);
  20. #else
  21. double z,y;
  22. z = __ieee754_atanh(x);
  23. if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
  24. y = fabs(x);
  25. if(y>=1.0) {
  26. if(y>1.0)
  27. return __kernel_standard(x,x,30); /* atanh(|x|>1) */
  28. else
  29. return __kernel_standard(x,x,31); /* atanh(|x|==1) */
  30. } else
  31. return z;
  32. #endif
  33. }
  34. libm_hidden_def(atanh)