w_cosh.c 860 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* @(#)w_cosh.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. * wrapper cosh(x)
  14. */
  15. #include "fdlibm.h"
  16. #ifdef __STDC__
  17. double cosh(double x) /* wrapper cosh */
  18. #else
  19. double cosh(x) /* wrapper cosh */
  20. double x;
  21. #endif
  22. {
  23. #ifdef _IEEE_LIBM
  24. return __ieee754_cosh(x);
  25. #else
  26. double z;
  27. z = __ieee754_cosh(x);
  28. if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
  29. if(fabs(x)>7.10475860073943863426e+02) {
  30. return __kernel_standard(x,x,5); /* cosh overflow */
  31. } else
  32. return z;
  33. #endif
  34. }