w_coshf_compat.c 983 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* w_coshf.c -- float version of w_cosh.c.
  2. * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
  3. * Optimizations by Ulrich Drepper <drepper@gmail.com>, 2011.
  4. */
  5. /*
  6. * ====================================================
  7. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  8. *
  9. * Developed at SunPro, a Sun Microsystems, Inc. business.
  10. * Permission to use, copy, modify, and distribute this
  11. * software is freely granted, provided that this notice
  12. * is preserved.
  13. * ====================================================
  14. */
  15. /*
  16. * wrapper coshf(x)
  17. */
  18. #include <math.h>
  19. #include <math_private.h>
  20. #include <math-svid-compat.h>
  21. #include <libm-alias-float.h>
  22. #if LIBM_SVID_COMPAT
  23. float
  24. __coshf (float x)
  25. {
  26. float z = __ieee754_coshf (x);
  27. if (__builtin_expect (!isfinite (z), 0) && isfinite (x)
  28. && _LIB_VERSION != _IEEE_)
  29. return __kernel_standard_f (x, x, 105); /* cosh overflow */
  30. return z;
  31. }
  32. libm_alias_float (__cosh, cosh)
  33. #endif