acosh(3)

πŸ’– acosh(3) β€” the inverse hyperbolic cosine glow-up πŸ’–

okay bestie, gather round, because today we're talking about acosh, acoshf, and acoshl from the acosh(3) manual page. yes that's the whole name of the page, it's giving "title card energy" and we're keeping it. this is the inverse hyperbolic cosine function and she is essential, no cap. πŸ¦‹


✨ NAME ✨

acosh, acoshf, acoshl β€” inverse hyperbolic cosine function, aka the math girlies who undo what cosh did πŸ’…


πŸ“š LIBRARY πŸ“š

Math library (libm, -lm)

fr fr, if you forget the -lm at link time she will simply Not Be There. link the lib, bestie. πŸ™ˆ

πŸŽ€ SYNOPSIS πŸŽ€

#include <math.h>

double acosh(double x);
float acoshf(float x);
long double acoshl(long double x);

🌸 Feature Test Macro Requirements for glibc (see feature_test_macros(7)): 🌸

acosh():

_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
    || _XOPEN_SOURCE >= 500
    || /* Since glibc 2.19: */ _DEFAULT_SOURCE
    || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE

acoshf(), acoshl():

_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
    || /* Since glibc 2.19: */ _DEFAULT_SOURCE
    || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
lowkey the _SVID_SOURCE thing is so retro-coded, and yes it's literally only for glibc <= 2.19, they said what they said. πŸ•°οΈ

πŸ’« DESCRIPTION πŸ’«

These functions calculate the inverse hyperbolic cosine of x; that is, the value whose hyperbolic cosine is x. it's the un-cosh. the reverse card. she looks at your x and says "what did I have to plug into cosh to get you??" and then tells you. iconic behaviour honestly πŸ‘‘


πŸ”₯ RETURN VALUE πŸ”₯

  • On success, these functions return the inverse hyperbolic cosine of x. βœ…
  • If x is a NaN, a NaN is returned. πŸ’€ (NaN in, NaN out, the vibes stay consistent)
  • If x is +1, +0 is returned. 🎯
  • If x is positive infinity, positive infinity is returned. ♾️ (infinity said "I'm gonna keep being infinity, actually")
  • If x is less than 1, a domain error occurs, and the functions return a NaN. 🚨 like why would you even ask that, bestie, cosh never goes below 1, she's just built different

😭 ERRORS 😭

See math_error(7) for information on how to determine whether an error has occurred when calling these functions. (aka: go read that page if you wanna vibe check your errno properly 🫢)

The following errors can occur:

  • Domain error: x is less than 1

errno is set to EDOM. An invalid floating-point exception (FE_INVALID) is raised. 🚩


πŸ‘‘ ATTRIBUTES πŸ‘‘

For an explanation of the terms used in this section, see attributes(7).

  • acosh(), acoshf(), acoshl() β€” Thread safety: MT-Safe βœ…
translation? all three of them can be called from multiple threads at the same time and they will not start drama. MT-Safe girlies. we love a low-maintenance queen 🌸

πŸ† STANDARDS πŸ†

C11, POSIX.1-2008.


πŸ¦‹ HISTORY πŸ¦‹

C99, POSIX.1-2001.

The variant returning double also conforms to SVr4, 4.3BSD. πŸ’Ύ (yes bestie, this math is that old, she's been serving since before your parents were cool)


🌈 SEE ALSO 🌈

asinh(3), atanh(3), cacosh(3), cosh(3), sinh(3), tanh(3)


and that's the whole lore!! πŸ’œ this was the Linux man-pages 6.20 era, dated 2026-02-08, and honestly? she ate. go forth, compute your inverse hyperbolic cosines, stay MT-Safe, and remember: x < 1 is a domain error and we do NOT do that here. periodt πŸ’…βœ¨

πŸ“¦ 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms