std::asinh,...std::asinhl(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

okay bestie, welcome to the std::asinh, std::asinhf, std::asinhl page from the C++ Standard Libary manual β€” section 3, aka std::asinh,...std::asinhl(3). we're about to make inverse hyperbolic sine make sense, and yes it's giving math but make it cute πŸ¦‹βœ¨

✨ NAME ✨

std::asinh,std::asinhf,std::asinhl β€” literally std::asinh,std::asinhf,std::asinhl - std::asinh,std::asinhf,std::asinhl. that's the name line, periodt πŸ’…

🌈 Synopsis 🌈

bestie, the synopsis is an overload buffet, so here it is exactly, no cap:

Defined in header <cmath>
float       asinh ( float num );

double      asinh ( double num );                            (until C++23)

long double asinh ( long double num );
/* floating-point-type */                                    (since C++23)
                asinh ( /* floating-point-type */ num );
(constexpr since C++26)
float       asinhf( float num );                     (1) (2) (since C++11)
                                                             (constexpr since C++26)
long double asinhl( long double num );                   (3) (since C++11)
                                                             (constexpr since C++26)
Additional overloads (since C++11)
Defined in header <cmath>
template< class Integer >                                (A)
(constexpr since C++26)
double      asinh ( Integer num );

1-3) Computes the inverse hyperbolic sine of num.

The library provides overloads of std::asinh for all cv-unqualified floating-point types as the type of the parameter. (since C++23)

A) Additional overloads are provided for all integer types, which are (since C++11) treated as double.

🌸 Parameters 🌸

  • num β€” floating-point or integer value

πŸ’œ Return value πŸ’œ

If no errors occur, the inverse hyperbolic sine of num (sinh-1(num), or arsinh(num)) is returned.

If a range error occurs due to underflow, the correct result (after rounding) is returned.

πŸ’… Error handling πŸ’…

Errors are reported as specified in math_errhandling.

If the implementation supports IEEE floating-point arithmetic (IEC 60559), then:

  • if the argument is Β±0 or ±∞, it is returned unmodified.
  • if the argument is NaN, NaN is returned.

🧚 Notes 🧚

Although the C standard (to which C++ refers for this function) names this function "arc hyperbolic sine", the inverse functions of the hyperbolic functions are the area functions. Their argument is the area of a hyperbolic sector, not an arc. The correct name is "inverse hyperbolic sine" (used by POSIX) or "area hyperbolic sine".

The additional overloads are not required to be provided exactly as (A). They only need to be sufficient to ensure that for their argument num of integer type, std::asinh(num) has the same effect as std::asinh(static_cast<double>(num)).

πŸ“ Examples πŸ“

run this code, bestie:

// Run this code

#include <cmath>
#include <iostream>

int main()
{
    std::cout << "asinh(1) = " << std::asinh(1) << '\n'
              << "asinh(-1) = " << std::asinh(-1) << '\n';

    // special values
    std::cout << "asinh(+0) = " << std::asinh(+0.0) << '\n'
              << "asinh(-0) = " <<  std::asinh(-0.0) << '\n';
}

✨ Output ✨

asinh(1) = 0.881374
asinh(-1) = -0.881374
asinh(+0) = 0
asinh(-0) = -0

πŸ‘‘ See also πŸ‘‘

  • acosh, acoshf, acoshl β€” (C++11) (C++11) (C++11) computes the inverse hyperbolic cosine (\({\small\operatorname{arcosh}{x}}\)arcosh(x)) (function) πŸ’–
  • atanh, atanhf, atanhl β€” (C++11) (C++11) (C++11) computes the inverse hyperbolic tangent (\({\small\operatorname{artanh}{x}}\)artanh(x)) (function) πŸ’–
  • sinh, sinhf, sinhl β€” sinhf and sinhl are (C++11) (C++11); computes hyperbolic sine (\({\small\sinh{x}}\)sinh(x)) (function) πŸ’–
  • asinh(std::complex) β€” (C++11) computes area hyperbolic sine of a complex number (\({\small\operatorname{arsinh}{z}}\)arsinh(z)) (function template) πŸ’–
  • C documentation for asinh β€” yes, the C docs are right there too

Weisstein, Eric W. "Inverse Hyperbolic Sine." From MathWorld β€” A Wolfram Web Resource.


and that's the whole std::asinh,...std::asinhl(3) situation, bestie 🫢 β€” source/version/date core: http://cppreference.com, 2024.06.10, page std::asinh,...std::asinhl(3). byeee, go compute some inverse hyperbolic sine πŸ’–βœ¨

πŸ“¦ where this page comes from