E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
acosd
eve::acosd =
functor
<acosd_t>
inline
constexpr
Header file
#include <eve/module/math.hpp>
Callable Signatures
namespace
eve
{
// Regular overloads
constexpr
auto
acosd
(
floating_value
auto
x)
noexcept
;
// 1
// Semantic option
constexpr
auto
acosd
[raw](
floating_value
auto
x)
noexcept
;
// 2
// Lanes masking
constexpr
auto
acosd
[
conditional_expr
auto
c](
floating_value
auto
x)
noexcept
;
// 3
constexpr
auto
acosd
[
logical_value
auto
m](
floating_value
auto
x)
noexcept
;
// 3
}
eve::conditional_expr
Specifies that a type is a Conditional Expression.
Definition:
conditional.hpp:27
eve::floating_value
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition:
value.hpp:95
eve::logical_value
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition:
value.hpp:107
eve::acosd
constexpr auto acosd
elementwise_callable object computing the arc cosine in degree.
Definition:
acosd.hpp:82
eve
EVE Main Namespace.
Definition:
abi.hpp:18
Parameters
x
:
floating value
.
c
: Conditional expression masking the operation.
m
: Logical value masking the operation.
Return value
Returns the
elementwise
value in degrees of the arc cosine of the input in the range \([0 , 180]\). In particular:
If
x
is \(1\), \(+0\) is returned.
If \(|x| > 1\),
NaN
is returned.
If
x
is a
NaN
,
NaN
is returned.
Same as 1 but uses a faster implementation which can be slightly less accurate near
x = 1
The operation is performed conditionnaly
.
External references
C++ standard reference: acos
Wolfram MathWorld: Inverse Cosine
DLMF: Error Functions
Wikipedia: Arc cosinus
Example
// revision 1
#include <eve/module/math.hpp>
#include <iostream>
#include <iomanip>
int
main()
{
eve::wide
wf = { 0.0f, 0.99f, -1.0f, -0.5f, -0.0f, 0.25f, 1.0f, -2.0f};
std::cout <<
"<- wf = "
<< wf <<
"\n"
;
std::cout << std::setprecision(10);
std::cout <<
"-> acosd(wf) = "
<<
eve::acosd
(wf) <<
"\n"
;
std::cout <<
"-> acosd[raw](wf) = "
<<
eve::acosd
[eve::raw](wf) <<
"\n"
;
std::cout <<
"-> acosd[ignore_last(2)](wf)= "
<<
eve::acosd
[
eve::ignore_last
(2)](wf) <<
"\n"
;
std::cout <<
"-> acosd[wf != -2.0f](wf) = "
<<
eve::acosd
[wf != -2.0f](wf) <<
"\n"
;
}
eve::ignore_last
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition:
conditional.hpp:304
eve::wide
Wrapper for SIMD registers.
Definition:
wide.hpp:71
eve