| 1 |
'\" t |
| 2 |
.\" Copyright 1993, David Metcalfe <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH atanh 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
atanh, atanhf, atanhl \- inverse hyperbolic tangent function |
| 10 |
.SH LIBRARY |
| 11 |
Math library |
| 12 |
.RI ( libm ,\~ \-lm ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <math.h> |
| 16 |
.P |
| 17 |
.BI "double atanh(double " x ); |
| 18 |
.BI "float atanhf(float " x ); |
| 19 |
.BI "long double atanhl(long double " x ); |
| 20 |
.P |
| 21 |
.fi |
| 22 |
.RS -4 |
| 23 |
Feature Test Macro Requirements for glibc (see |
| 24 |
.BR feature_test_macros (7)): |
| 25 |
.RE |
| 26 |
.P |
| 27 |
.BR atanh (): |
| 28 |
.nf |
| 29 |
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L |
| 30 |
|| _XOPEN_SOURCE >= 500 |
| 31 |
.\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED |
| 32 |
|| /* Since glibc 2.19: */ _DEFAULT_SOURCE |
| 33 |
|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE |
| 34 |
.fi |
| 35 |
.P |
| 36 |
.BR atanhf (), |
| 37 |
.BR atanhl (): |
| 38 |
.nf |
| 39 |
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L |
| 40 |
|| /* Since glibc 2.19: */ _DEFAULT_SOURCE |
| 41 |
|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE |
| 42 |
.fi |
| 43 |
.SH DESCRIPTION |
| 44 |
These functions calculate the inverse hyperbolic tangent of |
| 45 |
.IR x ; |
| 46 |
that is the value whose hyperbolic tangent is |
| 47 |
.IR x . |
| 48 |
.SH RETURN VALUE |
| 49 |
On success, these functions return the inverse hyperbolic tangent of |
| 50 |
.IR x . |
| 51 |
.P |
| 52 |
If |
| 53 |
.I x |
| 54 |
is a NaN, a NaN is returned. |
| 55 |
.P |
| 56 |
If |
| 57 |
.I x |
| 58 |
is +0 (\-0), +0 (\-0) is returned. |
| 59 |
.P |
| 60 |
If |
| 61 |
.I x |
| 62 |
is +1 or \-1, |
| 63 |
a pole error occurs, |
| 64 |
and the functions return |
| 65 |
.BR HUGE_VAL , |
| 66 |
.BR HUGE_VALF , |
| 67 |
or |
| 68 |
.BR HUGE_VALL , |
| 69 |
respectively, with the mathematically correct sign. |
| 70 |
.P |
| 71 |
If the absolute value of |
| 72 |
.I x |
| 73 |
is greater than 1, |
| 74 |
a domain error occurs, |
| 75 |
and a NaN is returned. |
| 76 |
.\" |
| 77 |
.\" POSIX.1-2001 documents an optional range error for subnormal x; |
| 78 |
.\" glibc 2.8 does not do this. |
| 79 |
.SH ERRORS |
| 80 |
See |
| 81 |
.BR math_error (7) |
| 82 |
for information on how to determine whether an error has occurred |
| 83 |
when calling these functions. |
| 84 |
.P |
| 85 |
The following errors can occur: |
| 86 |
.TP |
| 87 |
Domain error: \f[I]x\f[] less than \-1 or greater than +1 |
| 88 |
.I errno |
| 89 |
is set to |
| 90 |
.BR EDOM . |
| 91 |
An invalid floating-point exception |
| 92 |
.RB ( FE_INVALID ) |
| 93 |
is raised. |
| 94 |
.TP |
| 95 |
Pole error: \f[I]x\f[] is +1 or \-1 |
| 96 |
.I errno |
| 97 |
is set to |
| 98 |
.B ERANGE |
| 99 |
(but see BUGS). |
| 100 |
A divide-by-zero floating-point exception |
| 101 |
.RB ( FE_DIVBYZERO ) |
| 102 |
is raised. |
| 103 |
.SH ATTRIBUTES |
| 104 |
For an explanation of the terms used in this section, see |
| 105 |
.BR attributes (7). |
| 106 |
.TS |
| 107 |
allbox; |
| 108 |
lbx lb lb |
| 109 |
l l l. |
| 110 |
Interface Attribute Value |
| 111 |
T{ |
| 112 |
.na |
| 113 |
.nh |
| 114 |
.BR atanh (), |
| 115 |
.BR atanhf (), |
| 116 |
.BR atanhl () |
| 117 |
T} Thread safety MT-Safe |
| 118 |
.TE |
| 119 |
.SH STANDARDS |
| 120 |
C11, POSIX.1-2008. |
| 121 |
.SH HISTORY |
| 122 |
C99, POSIX.1-2001. |
| 123 |
.P |
| 124 |
The variant returning |
| 125 |
.I double |
| 126 |
also conforms to |
| 127 |
SVr4, 4.3BSD. |
| 128 |
.SH BUGS |
| 129 |
In glibc 2.9 and earlier, |
| 130 |
.\" Bug: https://www.sourceware.org/bugzilla/show_bug.cgi?id=6759 |
| 131 |
.\" This can be seen in sysdeps/ieee754/k_standard.c |
| 132 |
when a pole error occurs, |
| 133 |
.I errno |
| 134 |
is set to |
| 135 |
.B EDOM |
| 136 |
instead of the POSIX-mandated |
| 137 |
.BR ERANGE . |
| 138 |
Since glibc 2.10, glibc does the right thing. |
| 139 |
.SH SEE ALSO |
| 140 |
.BR acosh (3), |
| 141 |
.BR asinh (3), |
| 142 |
.BR catanh (3), |
| 143 |
.BR cosh (3), |
| 144 |
.BR sinh (3), |
| 145 |
.BR tanh (3) |