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

◆ atan2d

eve::atan2d = functor<atan2d_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto atan2d(floating_value auto x, floating_value auto y) noexcept; // 1
// Semantic option
constexpr auto atan2d[pedantic](floating_value auto x, floating_value auto y) noexcept; // 2
// Lanes masking
constexpr auto atan2d[conditional_expr auto c][floating_value auto x, floating_value auto y) noexcept; // 3
constexpr auto atan2d[logical_value auto m](floating_value auto x, floating_value auto y) noexcept; // 3
}
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
constexpr auto atan2d
elementwise_callable object computing the arc tangent in degrees using the signs of the arguments to ...
Definition atan2d.hpp:101
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107
EVE Main Namespace.
Definition abi.hpp:19

Parameters

Return value

  1. The arc tangent in degrees of \(\frac{y}x\) in the range \([-180 , +180]\), is returned. The IEEE limiting values are almost all satisfied :

    • If x and y are both zero or infinites, Nan is returned (this is not standard conforming)
    • If y is \(\pm0\) and x is strictly negative or \(-0\), \(\pm180\) is returned
    • If y is \(\pm0\) and x is strictly positive or \(+0\), \(\pm0\) is returned
    • If y is \(\pm\infty\) and x is finite, \(\pm90\) is returned
    • If x is \(\pm0\) and y is strictly negative, \(-90\) is returned
    • If x is \(\pm0\) and y is strictly positive, \(+90\) is returned
    • If x is \(-\infty\) and y is finite and positive, \(+180\) is returned
    • If x is \(-\infty\) and y is finite and negative, \(-180\) is returned
    • If x is \(+\infty\) and y is finite and positive, \(+0\) is returned
    • If x is \(+\infty\) and y is finite and negative, \(-0\) is returned
    • If either x is Nan or y is Nan, Nan is returned

    The call will return a NaN if x and y are both either null or infinite: this result is not IEEE conformant, but allows to simplify (and speed) the implementation. In all other cases, the result is standard conformant.

  2. Same as 1, except that all IEEE limiting values are satisfied :
    • If y is \(\pm\infty\) and x is \(-\infty\), \(\pm135\) is returned
    • If y is \(\pm\infty\) and x is \(+\infty\), \(\pm45\) is returned
    • If x is \(\pm0\) and y is \(\pm-0\), \(-90\) is returned
    • If x is \(\pm0\) and y is \(\pm+0\), \(+90\) is returned
  3. The operation is performed conditionnaly.

External references

Example

// revision 1
#include <eve/module/math.hpp>
#include <iostream>
int main()
{
eve::wide pf = { 0.0f, 1.0f, 4.0f, -2.0f, eve::inf(eve::as<float>()), 0.0f, eve::minf(eve::as<float>()), 1.0f};
eve::wide qf = { 1.0f, -1.0f, 3.0f, -0.0f, 1.0f, 0.0f, 0.0f, -0.0f};
std::cout << "<- pf = " << pf << "\n";
std::cout << "<- qf = " << qf << "\n";
std::cout << "-> atan2d(pf, qf) = " << eve::atan2d(pf, qf) << "\n";
std::cout << "-> atan2d[pedantic](pf, qf) = " << eve::atan2d[eve::pedantic](pf, qf) << "\n";
std::cout << "-> atan2d[ignore_last(2)](pf, qf)= " << eve::atan2d[eve::ignore_last(2)](pf, qf) << "\n";
std::cout << "-> atan2d[pf != -2.0f](pf, qf) = " << eve::atan2d[pf != -2.0f](pf, qf) << "\n";
}
constexpr auto minf
Computes the -infinity ieee value.
Definition minf.hpp:67
constexpr auto inf
Computes the infinity ieee value.
Definition inf.hpp:67
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:320
Wrapper for SIMD registers.
Definition wide.hpp:94