E.V.E
v2023.02.15

◆ agd

eve::agd = {}
inlineconstexpr

Callable object computing the inverse gudermanian, i.e. \(2\tanh(\tan(x/2))\).

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T agd(T x) noexcept; //1
template< eve::floating_value T >
}
constexpr callable_agd_ agd
Callable object computing the inverse gudermanian, i.e. .
Definition: agd.hpp:65
constexpr callable_acotpi_ acotpi
Callable object computing in multiples.
Definition: acotpi.hpp:66
Definition: abi.hpp:18
SIMD-compatible representation of complex numbers.
Definition: complex.hpp:39

Parameters

Return value

  1. Returns the elementwise inverse gudermanian of the input.

    In particular:

    • If the element is \(\pm0\), 0 is returned.
    • If the element is \(\pm\pi/2\), \(\infty\) is returned.
    • If the element is not in a \([-\pi/2, \pi/2] \), NaN is returned.
  2. Returns elementwise the complex value in of the inverse gudermanian of the input.

Example

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {1.0f, 0.0f, eve::pio_2(eve::as<float>()), eve::pio_4(eve::as<float>())};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> agd(pf) = " << eve::agd(pf) << '\n';
float xf = 3.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> agd(xf) = " << eve::agd(xf) << '\n';
return 0;
}
constexpr callable_pio_4_ pio_4
Callable object computing the constant .
Definition: pio_4.hpp:49
constexpr callable_pio_2_ pio_2
Callable object computing the constant .
Definition: pio_2.hpp:49
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65