E.V.E
v2022.03.00

◆ asinh

eve::asinh = {}
inlineconstexpr

Callable object computing \(\log(x+\sqrt{x^2+1})\).

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T asinh(T x) noexcept; //1
template< eve::floating_value T >
}
constexpr callable_asinh_ asinh
Callable object computing .
Definition: asinh.hpp:84
Definition: all_of.hpp:22
SIMD-compatible representation of complex numbers.
Definition: complex.hpp:40

Parameters

Return value

  1. Returns the elementwise inverse hyperbolic cosine of the input. The inverse hyperbolic sine is semantically equivalent to \(\log(x+\sqrt{x^2+1})\).

    In particular:

    • If the element is \(\pm0\), \(\pm0\) is returned.
    • If the element is \(\pm\infty\), \(\pm\infty\) returned.
    • If the element is a NaN, NaN is returned.
  2. Returns the complex arc hyperbolic sine of z, with branch cuts outside the interval \(i\times[-\pi/2, \pi/2]\) along the imaginary axis.
    • for every z: eve::asinh(eve::conj(z)) == eve::conj(std::asinh(z))
    • for every z: eve::asinh(-z) == -eve::asinh(z)
    • If z is \(+0\), the result is \(+0\)
    • If z is \(x+i \infty\) (for any positive finite x), the result is \(+\infty+i \pi/2\)
    • If z is \(x,NaN\) (for any finite x), the result is \(NaN+ iNaN\)
    • If z is \(+\infty+ iy\) (for any positive finite y), the result is \(+\infty+i 0\)
    • If z is \(+\infty+i \infty\), the result is \(+\infty+ i\pi/4\)
    • If z is \(+\infty+ iNaN\), the result is \(+\infty+ iNaN\)
    • If z is \(NaN+i 0\), the result is \(NaN+i 0\)
    • If z is \(NaN+ iy\) (for any finite nonzero y), the result is \(NaN+ iNaN\)
    • If z is \(NaN+i \infty\), the result is \(\pm \infty+ iNaN\) (the sign of the real part is unspecified)
    • If z is \(NaN+ iNaN\), the result is \(NaN+ iNaN\)

Example

Real version

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {1.0f, 2.0f, eve::inf(eve::as<float>()), eve::nan(eve::as<float>())};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> asinh(pf) = " << eve::asinh(pf) << '\n'
;
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> asinh(xf) = " << eve::asinh(xf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65

Complex version

#include <eve/module/complex.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft ref = { 0.0f, 1.0f, -1.0f, 0.5f};
wide_ft imf = { 2.0f , -1.0, -5.0, 0.0};
auto z = eve::as_complex_t<wide_ft>(ref, imf);
std::cout
<< "---- simd" << '\n'
<< "<- z = " << z << '\n'
<< "-> asinh(z) = " << eve::asinh(z) << '\n';
return 0;
}