s_casinhf.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* $OpenBSD: s_casinhf.c,v 1.1 2008/09/07 20:36:09 martynas Exp $ */
  2. /*
  3. * Copyright (c) 2008 Stephen L. Moshier <[email protected]>
  4. *
  5. * Permission to use, copy, modify, and distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /* casinhf
  18. *
  19. * Complex inverse hyperbolic sine
  20. *
  21. *
  22. *
  23. * SYNOPSIS:
  24. *
  25. * float complex casinhf();
  26. * float complex z, w;
  27. *
  28. * w = casinhf (z);
  29. *
  30. *
  31. *
  32. * DESCRIPTION:
  33. *
  34. * casinh z = -i casin iz .
  35. *
  36. * ACCURACY:
  37. *
  38. * Relative error:
  39. * arithmetic domain # trials peak rms
  40. * IEEE -10,+10 30000 1.8e-14 2.6e-15
  41. *
  42. */
  43. #include <complex.h>
  44. #include <math.h>
  45. float complex
  46. casinhf(float complex z)
  47. {
  48. float complex w;
  49. w = -1.0f * I * casinf (z * I);
  50. return (w);
  51. }