E.V.E
v2023.02.15
Loading...
Searching...
No Matches

◆ arg

auto eve::arg = functor<arg_t>
inlineconstexpr

Callable Signatures

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto arg(floating_value auto x) noexcept; // 1
// Lanes masking
constexpr auto arg[conditional_expr auto c](value auto x) noexcept; // 2
constexpr auto arg[logical_value auto m](value auto x) noexcept; // 2
// Semantic option
constexpr auto arg[pedantic](floating_value auto x) noexcept; // 3
constexpr auto arg[rad](floating_value auto x) noexcept; // 1
constexpr auto arg[deg](floating_value auto x) noexcept; // 4
constexpr auto arg[pirad](floating_value auto x) noexcept; // 5
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:116
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:134
The concept value<T> is satisfied if and only if T satisfies either eve::scalar_value or eve::simd_va...
Definition value.hpp:34
constexpr auto arg
elementwise_callable object computing the phase angle (in radians).
Definition arg.hpp:83
EVE Main Namespace.
Definition abi.hpp:19

Parameters

Return value

  1. Returns elementwise the phase angle (in radians) of the input (0 or \(\pi\)) depending of the bit of sign of the input
  2. The operation is performed conditionnaly.
  3. If the entry is NaN the result is NaN.
  4. Result in degrees
  5. Result in \(\pi\) multiples
Note
phase can be used as an alias

External references

Example

// revision 1
#include <eve/module/math.hpp>
#include <iostream>
int main()
{
eve::wide wf = { 0.0f, -0.0f, 1.0f, -1.0f,
std::cout << "<- wf = " << wf << "\n";
std::cout << "-> arg(wf) = " << eve::arg(wf) << "\n";
std::cout << "-> arg[deg](wf) = " << eve::arg[eve::deg](wf) << "\n";
std::cout << "-> arg[radpi](wf) = " << eve::arg[eve::radpi](wf) << "\n";
std::cout << "-> arg[rad](wf) = " << eve::arg[eve::rad](wf) << "\n";
std::cout << "-> arg[pedantic](wf) = " << eve::arg[eve::pedantic](wf) << "\n";
std::cout << "-> arg[ignore_last(2)](wf) = " << eve::arg[eve::ignore_last(2)](wf) << "\n";
std::cout << "-> arg[wf != 0.5f](wf) = " << eve::arg[wf != 0.5f](wf) << "\n";
}
constexpr auto nan
Computes the IEEE quiet NaN constant.
Definition nan.hpp:67
constexpr auto inf
Computes the infinity ieee value.
Definition inf.hpp:67
Lightweight type-wrapper.
Definition as.hpp:29
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:353
Wrapper for SIMD registers.
Definition wide.hpp:94