E.V.E
v2023.02.15

◆ erfc

eve::erfc = {}
inlineconstexpr

Computes the complementar error function \( \displaystyle \mbox{erf}(x)=1-\frac{2}{\sqrt\pi}\int_0^{x} e^{-t^2}\mbox{d}t\).

Defined in header

#include <eve/module/special.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_ordered_value T >
T erfc(T x) noexcept;
}
constexpr callable_erfc_ erfc
Computes the complementar error function .
Definition: erfc.hpp:55
Definition: abi.hpp:18

Parameters

Return value

The value of the complementary error function is returned. In particular:

  • If the argument is \(\pm0\), \(1\) is returned.
  • If the argument is \(\infty\), \(1\) is returned.
  • If the argument is \(-\infty\), \(2\) is returned.
  • If the argument is Nan, nan is returned.

Example

#include <eve/module/special.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, -0.0f, -1.0f, 1.0f, 2.0f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> erf(pf) = " << eve::erf(pf) << '\n'
;
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> erf(xf) = " << eve::erf(xf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
constexpr callable_minf_ minf
Computes the -infinity ieee value.
Definition: minf.hpp:60
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
constexpr callable_erf_ erf
Computes the error function: or its analytic continuation in the complex plane.
Definition: erf.hpp:65
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65