Returns a logical true if and only if the element value of the first parameter is less or equal to the second one.
Defined in Header
#include <eve/module/core.hpp>
{
template< eve::value T, eve::value U >
}
constexpr callable_is_less_equal_ is_less_equal
Returns a logical true if and only if the element value of the first parameter is less or equal to th...
Definition: is_less_equal.hpp:80
Parameters
Return value
The call eve::is_less_equal(x,y)
is semantically equivalent to x >= y
:
#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, -2.0f};
wide_ft qf = {1.0f, -1.0f, 0.0f, -2.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
float xf = 1.0f;
float yf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
return 0;
}
constexpr callable_is_less_ is_less
Returns a logical true if and only if the element value of the first parameter is less than the secon...
Definition: is_less.hpp:81
Wrapper for SIMD registers.
Definition: wide.hpp:65
Masked Call
The call eve;is_less_equal[mask](x,y)
provides a masked version of eve::is_less_equal
which is equivalent to if_else (mask, is_less_equal(x), eve::false( eve::as(x,y)))
.
Example
#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, 2.0f};
wide_ft qf = {1.0f, -1.0f, 0.0f, 3.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<<
"-> is_less[pf > 0](pf, qf) = " <<
eve::is_less[pf > 0](pf, qf) <<
'\n';
return 0;
}
almost
The expression definitely(is_less_equal)(x, y, t)
where x
and y
must be floating point values, evals to true if and only if x
is almost less than y
. This means that:
- if
t
is a floating_value then \(x < y + t \max(|x|, |y|)\)
- if
t
is a positive integral_value then \(x < \mbox{next}(y, t)\);
- if
t
is omitted then the tolerance t
default to 3*eps(as(x))
.
Example
#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, 2.0f};
wide_ft qf = {1.0f, -1.0f, 0.0f, 3.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
return 0;
}
constexpr almost_type const almost
Higher-order Callable Object imbuing a tolerant to little errors semantic onto other Callable Objects...
Definition: fuzzy.hpp:58
Defined in Header
#include <eve/module/core.hpp>
{
template< eve::value T, eve::value U >
}
Parameters
Return value
The call eve::is_less_equal(x,y)
is semantically equivalent to !(x <= y)
:
#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, -2.0f};
wide_ft qf = {1.0f, -1.0f, 0.0f, -2.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
float xf = 1.0f;
float yf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
return 0;
}
Masked Call
The call eve;is_less_equal[mask](x,y)
provides a masked version of eve::is_less_equal
which is equivalent to if_else (mask, is_less_equal(x), eve::false( eve::as(x,y)))
.
Example
#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, 2.0f};
wide_ft qf = {1.0f, -1.0f, 0.0f, 3.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<<
"-> is_less[pf > 0](pf, qf) = " <<
eve::is_less[pf > 0](pf, qf) <<
'\n';
return 0;
}
definitely
The expression definitely(is_not_less_equal)(x, y, t)
where x
and y
must be floating point values, evaluates to true if and only if and only if x
is definitely not less or equal to y
. This means that the pair x, y
is unordered or:
- if
t
is a floating_value then \((x \ge y + t \max(|x|, |y|))\)
- if
t
is a positive integral_value then \((x \ge \mbox{next}(y, t)\);
- if
t
is omitted then the tolerance t
default to 3*eps(as(x))
.
Example
#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.0f, 2.0f};
wide_ft qf = {1.0f, -1.0f, 0.0f, 3.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
return 0;
}