/newlib/libm/complex/casinh.c

https://bitbucket.org/pizzafactory/binutils · C · 97 lines · 8 code · 6 blank · 83 comment · 0 complexity · 7b9904860c7948f790febe873a9b94bb MD5 · raw file

  1. /* $NetBSD: casinh.c,v 1.1 2007/08/20 16:01:31 drochner Exp $ */
  2. /*-
  3. * Copyright (c) 2007 The NetBSD Foundation, Inc.
  4. * All rights reserved.
  5. *
  6. * This code is derived from software written by Stephen L. Moshier.
  7. * It is redistributed by the NetBSD Foundation by permission of the author.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  19. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  20. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  21. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  22. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  23. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  24. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  25. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  26. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  27. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  28. * POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. * imported and modified include for newlib 2010/10/03
  31. * Marco Atzeri <marco_atzeri@yahoo.it>
  32. */
  33. /*
  34. FUNCTION
  35. <<casinh>>, <<casinhf>>---complex arc hyperbolic sine
  36. INDEX
  37. casinh
  38. INDEX
  39. casinhf
  40. ANSI_SYNOPSIS
  41. #include <complex.h>
  42. double complex casinh(double complex <[z]>);
  43. float complex casinhf(float complex <[z]>);
  44. DESCRIPTION
  45. @ifnottex
  46. These functions compute the complex arc hyperbolic sine of <[z]>,
  47. with branch cuts outside the interval [-i, +i] along the
  48. imaginary axis.
  49. @end ifnottex
  50. @tex
  51. These functions compute the complex arc hyperbolic sine of <[z]>,
  52. with branch cuts outside the interval [$-i$, $+i$] along the
  53. imaginary axis.
  54. @end tex
  55. <<casinhf>> is identical to <<casinh>>, except that it performs
  56. its calculations on <<floats complex>>.
  57. RETURNS
  58. @ifnottex
  59. These functions return the complex arc hyperbolic sine value,
  60. in the range of a strip mathematically unbounded along the
  61. real axis and in the interval [-i*p/2, +i*p/2] along the
  62. imaginary axis.
  63. @end ifnottex
  64. @tex
  65. These functions return the complex arc hyperbolic sine value,
  66. in the range of a strip mathematically unbounded along the
  67. real axis and in the interval [$-i\pi/2$, $+i\pi/2$] along the
  68. imaginary axis.
  69. @end tex
  70. PORTABILITY
  71. <<casinh>> and <<casinhf>> are ISO C99
  72. QUICKREF
  73. <<casinh>> and <<casinhf>> are ISO C99
  74. */
  75. #include <complex.h>
  76. double complex
  77. casinh(double complex z)
  78. {
  79. double complex w;
  80. w = -1.0 * I * casin(z * I);
  81. return w;
  82. }