atanh(3)
β¨ atanh(3) β¨
okay bestie, pull up a chair πͺ because we're talking about atanh, atanhf, and atanhl β the inverse hyperbolic tangent girlies. they live in section 3 of the Library Functions Manual and they are genuinely so good at what they do. no cap. π
πΈ NAME πΈ
atanh, atanhf, atanhl β inverse hyperbolic tangent function β¨
π LIBRARY π
Math library (libm, link it with -lm) π§
π SYNOPSIS π
like literally just include the header and you're set:
#include <math.h>
double atanh(double x);
float atanhf(float x);
long double atanhl(long double x);
π¦ Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
bestie, glibc is picky about when it lets you have these. here's the whole vibe check:
atanh():
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
|| _XOPEN_SOURCE >= 500
|| /* Since glibc 2.19: */ _DEFAULT_SOURCE
|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
atanhf(), atanhl():
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
|| /* Since glibc 2.19: */ _DEFAULT_SOURCE
|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
π DESCRIPTION π
these functions calculate the inverse hyperbolic tangent of x π« β meaning they hand you back the value whose hyperbolic tangent is x. it's giving reverse-engineering, it's giving un-tanhing. iconic.
π₯ RETURN VALUE π₯
when everything goes right, these functions return the inverse hyperbolic tangent of x. slay.
- if x is a
NaN, aNaNis returned. π - if x is
+0(-0),+0(-0) is returned. π«Ά - if x is
+1or-1, a pole error occurs, and the functions returnHUGE_VAL,HUGE_VALF, orHUGE_VALL, respectively, with the mathematically correct sign. π (that's a real big number bestie, brace yourself) - if the absolute value of x is greater than 1, a domain error occurs, and a
NaNis returned. π
β οΈ ERRORS β οΈ
go read math_error(7) for the whole lore on how to figure out whether an error even happened when you called these functions. iykyk.
these are the errors that can pop up:
- Domain error: x less than -1 or greater than +1 β
errnois set toEDOM. an invalid floating-point exception (FE_INVALID) is raised. π¨ - Pole error: x is +1 or -1 β
errnois set toERANGE(but see BUGS below, it's a whole thing). a divide-by-zero floating-point exception (FE_DIVBYZERO) is raised. π₯
π ATTRIBUTES π
for what all these fancy terms even mean, check attributes(7) β it's required reading fr fr.
- Interface:
atanh(),atanhf(),atanhl()- Attribute: Thread safety
- Value:
MT-Safeβ
π STANDARDS π
C11, POSIX.1-2008. periodt. π
π°οΈ HISTORY π°οΈ
C99, POSIX.1-2001.
the variant returning double also conforms to SVr4, 4.3BSD. a well-traveled legend honestly. β
π BUGS π
in glibc 2.9 and earlier, when a pole error occurs, errno is set to EDOM instead of the POSIX-mandated ERANGE. that's a not it moment. since glibc 2.10, glibc does the right thing. we love growth. π±
π«Ά SEE ALSO π«Ά
and that's the whole page bestie!! this one is from Linux man-pages 6.20, dated 2026-02-08, and it belongs to atanh(3). go forth and invert those hyperbolics πβ¨π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 1993, David Metcalfe <david@prism.demon.co.uk>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms