E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
erf
auto eve::erf =
functor
<erf_t>
inline
constexpr
Header file
#include <eve/module/special.hpp>
Callable Signatures
namespace
eve
{
// Regular overload
constexpr
auto
erf
(
floating_value
auto
x)
noexcept
;
// 1
// Lanes masking
// Lanes masking
constexpr
auto
erf
[
raw
](
floating_value
auto
x)
noexcept
;
// 2
constexpr
auto
erf
[
fast
](
floating_value
auto
x)
noexcept
;
// 2
constexpr
auto
erf
[
conditional_expr
auto
c](
floating_value
auto
x)
noexcept
;
// 3
constexpr
auto
erf
[
logical_value
auto
m](
floating_value
auto
x)
noexcept
;
// 3
}
eve::conditional_expr
Specifies that a type is a Conditional Expression.
Definition
conditional.hpp:28
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:116
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:134
eve::raw
constexpr auto raw
Performs the operation minimally, trading accuracy for speed.
Definition
core.hpp:95
eve::fast
constexpr auto fast
Performs the operation faster than the regular call while keeping more accuracy than raw.
Definition
core.hpp:79
eve::erf
constexpr auto erf
elementwise_callable object computing the error function: .
Definition
erf.hpp:84
eve
EVE Main Namespace.
Definition
abi.hpp:19
Parameters
x
:
floating value
.
c
:
Conditional expression
masking the operation.
m
:
Logical value
masking the operation.
Return value
The value of the error function is returned: \( \displaystyle \mbox{erf}(x)=\frac{2}{\sqrt\pi}\int_0^{x} e^{-t^2}\mbox{d}t\). In particular:
If the argument is \(\pm0\), \(\pm0\) is returned.
If the argument is \(\pm\infty\), \(\pm1\) is returned.
If the argument is Nan, nan returned.
faster computations at accuracy price, based on
atanh(erf(x))
expansion.
The operation is performed conditionally
.
External references
C++ standard reference: erf
Wolfram MathWorld: Erf
DLMF: Error Functions
Wikipedia: Error Function
Example
// revision 1
#include <eve/module/special.hpp>
#include <iostream>
int
main()
{
eve::wide
wf = {0.0f, -0.0f, -1.0f, 1.0f, 2.0f,
eve::inf
(
eve::as<float>
()),
eve::minf
(
eve::as<float>
()),
eve::nan
(
eve::as<float>
())};
std::cout <<
"<- wf = "
<< wf <<
"\n"
;
std::cout <<
"-> erf(wf) = "
<<
eve::erf
(wf) <<
"\n"
;
std::cout <<
"-> erf[ignore_last(2)](wf)= "
<<
eve::erf
[
eve::ignore_last
(2)](wf) <<
"\n"
;
std::cout <<
"-> erf[wf <= 2.0f](wf) = "
<<
eve::erf
[wf <= 2.0f](wf) <<
"\n"
;
}
eve::nan
constexpr auto nan
Computes the IEEE quiet NaN constant.
Definition
nan.hpp:67
eve::inf
constexpr auto inf
Computes the infinity ieee value.
Definition
inf.hpp:67
eve::minf
constexpr auto minf
Computes the -infinity ieee value.
Definition
minf.hpp:67
eve::as
Lightweight type-wrapper.
Definition
as.hpp:29
eve::ignore_last
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition
conditional.hpp:361
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:94
eve