| 1 |
# acosh(x): Inverse Hyperbolic Cosine |
| 2 |
|
| 3 |
Inverse hyperbolic cosine function. |
| 4 |
|
| 5 |
## Declaration |
| 6 |
|
| 7 |
### Syntax |
| 8 |
|
| 9 |
```fortran |
| 10 |
retval = acosh(x) |
| 11 |
elemental real(p) function acosh(x) |
| 12 |
elemental complex(p) function acosh(x) |
| 13 |
``` |
| 14 |
### Arguments |
| 15 |
|
| 16 |
`x` the input value, can be real with value greater than or equal to 1 or of |
| 17 |
type complex. |
| 18 |
|
| 19 |
### Return values |
| 20 |
|
| 21 |
The returned value has the kind of the input value and TYPE may be real |
| 22 |
or complex. |
| 23 |
|
| 24 |
## Description |
| 25 |
|
| 26 |
**acosh(x)** computes the inverse hyperbolic cosine function of **x**. |
| 27 |
|
| 28 |
The result type and kind are the same as input value `x`. |
| 29 |
|
| 30 |
If the result is complex, the real part is non-negative, and the imaginary part |
| 31 |
is expressed in radians and lients in the range |
| 32 |
|
| 33 |
$-\pi <= img (acosh(x)) <= \pi$ |
| 34 |
|
| 35 |
For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine |
| 36 |
satisifies: |
| 37 |
|
| 38 |
$cosh^{-1}(x) = \log(x + \sqrt{(x^2 - 1)})$ |
| 39 |
|
| 40 |
For complex numbers $x = x + iy$, as well as real values in the domain |
| 41 |
$-\infty < z <= 1$, the call $acosh(z)$ returns complex results. |
| 42 |
|
| 43 |
## Types |
| 44 |
|
| 45 |
Supported argument types float, double, complex float, complex double. |
| 46 |
|
| 47 |
```fortran |
| 48 |
interface acosh |
| 49 |
module procedure sacosh, dacosh, cacosh, zacosh |
| 50 |
end interface |
| 51 |
|
| 52 |
contains |
| 53 |
|
| 54 |
interface |
| 55 |
elemental real(sp) function sacosh(x) |
| 56 |
real(sp), intent(in) :: x |
| 57 |
end function |
| 58 |
|
| 59 |
elemental real(dp) function dacosh(x) |
| 60 |
real(dp), intent(in) :: x |
| 61 |
end function |
| 62 |
|
| 63 |
elemental complex(sp) function cacosh(x) |
| 64 |
complex(sp), intent(in) :: x |
| 65 |
end function |
| 66 |
|
| 67 |
elemental complex(dp) function zacosh(x) |
| 68 |
complex(dp), intent(in) :: x |
| 69 |
end function |
| 70 |
end interface |
| 71 |
``` |
| 72 |
## Examples |
| 73 |
|
| 74 |
```fortran |
| 75 |
program intrinsics_acosh |
| 76 |
implicit none |
| 77 |
print *, acosh(1.0) |
| 78 |
end program |
| 79 |
``` |
| 80 |
|
| 81 |
**Result**: |
| 82 |
|
| 83 |
``` |
| 84 |
0.0 |
| 85 |
``` |
| 86 |
## See Also |
| 87 |
|
| 88 |
[asinh](asinh.md), [atanh](atanh.md). |