s_catanhl.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* $OpenBSD: s_catanhl.c,v 1.1 2011/07/08 19:25:31 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. /* catanhl
  18. *
  19. * Complex inverse hyperbolic tangent
  20. *
  21. *
  22. *
  23. * SYNOPSIS:
  24. *
  25. * long double complex catanhl();
  26. * long double complex z, w;
  27. *
  28. * w = catanhl (z);
  29. *
  30. *
  31. *
  32. * DESCRIPTION:
  33. *
  34. * Inverse tanh, equal to -i catan (iz);
  35. *
  36. * ACCURACY:
  37. *
  38. * Relative error:
  39. * arithmetic domain # trials peak rms
  40. * IEEE -10,+10 30000 2.3e-16 6.2e-17
  41. *
  42. */
  43. #include <openlibm_complex.h>
  44. #include <openlibm_math.h>
  45. long double complex
  46. catanhl(long double complex z)
  47. {
  48. long double complex w;
  49. w = -1.0L * I * catanl(z * I);
  50. return (w);
  51. }