E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
logspace_add
auto eve::logspace_add =
functor
<logspace_add_t>
inline
constexpr
Defined in Header
#include <eve/module/math.hpp>
Callable Signatures
namespace
eve
{
// Regular overloads
constexpr
auto
logspace_add
(
floating_value
auto
x,
floating_value
auto
... xs)
noexcept
;
// 1
constexpr
auto
logspace_add
(eve::non_empty_product_type
auto
const
& tup)
noexcept
;
// 2
// Lanes masking
constexpr
auto
logspace_add
[
conditional_expr
auto
c](
/*any of the above overloads*/
)
noexcept
;
// 3
constexpr
auto
logspace_add
[
logical_value
auto
m](
/*any of the above overloads*/
)
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::logspace_add
constexpr auto logspace_add
tuple_callable object computing the logspace_add operation:
Definition
logspace_add.hpp:88
eve
EVE Main Namespace.
Definition
abi.hpp:19
Parameters
x
,
...xs
:
real
arguments.
tup
: non empty tuple of arguments.
c
:
Conditional expression
masking the operation.
m
:
Logical value
masking the operation.
Return value
The call
logspace_add(x, xs...)
is semantically equivalent to
log
(
exp(log(x))
+ +
exp(log(xs))
...)
without causing unnecessary overflows or throwing away too much accuracy.
equivalent to the call on the elements of the tuple.
The operation is performed conditionnaly
Example
// revision 1
#include <eve/module/math.hpp>
#include <iostream>
int
main()
{
eve::wide
pf = {0.0, 2.0, 3.0, 30.0};
eve::wide
qf = {0.0, 1.0, 1.0, 29.56};
eve::wide
rf = {0.0, 0.5, 10.0,25.35};
kumi::tuple wt{pf, qf};
std::cout <<
"<- pf = "
<< pf <<
"\n"
;
std::cout <<
"<- qf = "
<< qf <<
"\n"
;
std::cout <<
"<- rf = "
<< rf <<
"\n"
;
std::cout <<
"<- wt = "
<< wt <<
"\n"
;
std::cout <<
"-> logspace_add(pf, qf) = "
<<
eve::logspace_add
(pf, qf) <<
"\n"
;
std::cout <<
"-> logspace_add(wt) = "
<<
eve::logspace_add
(wt) <<
"\n"
;
std::cout <<
"-> logspace_add[ignore_last(2)](pf, qf)= "
<<
eve::logspace_add
[
eve::ignore_last
(2)](pf, qf) <<
"\n"
;
std::cout <<
"-> logspace_add[pf != 3.0](pf, qf) = "
<<
eve::logspace_add
[pf != 3.0](pf, qf) <<
"\n"
;
std::cout <<
"-> logspace_add(pf, qf, rf) = "
<<
eve::logspace_add
(pf, qf, rf) <<
"\n"
;
}
eve::ignore_last
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition
conditional.hpp:353
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:94
eve