Callable object computing the phase angle (in radians).
Defined in Header
#include <eve/module/math.hpp>
{
template< eve::floating_value T >
template< eve::floating_value T >
T
arg(eve::as_complex<T> z)
noexcept;
}
constexpr callable_arg_ arg
Callable object computing the phase angle (in radians).
Definition: arg.hpp:61
Parameters
x
: real or complex argument.
Return value
Returns the elementwise the phase angle (in radians) of the input.
Real version
#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = { 0.0f, 1.0f, -1.0f, -0.5f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<<
"-> eve::arg(pf) = " <<
eve::arg(pf) <<
'\n';
float xf = 1.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<<
"-> eve::arg(xf) = " <<
eve::arg(xf) <<
'\n'
<< "<- yf = " << yf << '\n'
<<
"-> eve::arg(yf) = " <<
eve::arg(yf) <<
'\n';
return 0;
}
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
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" << std::endl
<< "<- z = " << z << std::endl
<<
"-> arg(z) = " <<
eve::arg(z) << std::endl;
return 0;
}