Callable object computing the logspace_add operation: \(\log\left(\sum_{i = 0}^n
e^{x_i}\right)\).
Defined in Header
#include <eve/module/math.hpp>
{
}
constexpr callable_logspace_add_ logspace_add
Callable object computing the logspace_add operation: .
Definition: logspace_add.hpp:54
Parameters
arg0
, arg1
, args
, ...: floating values.
Return value
The call logspace_add(arg0, arg1, args...)
is semantically equivalent to log(exp(arg0) + exp(arg1) + exp(args)...)
.
The result type is the common value type of the parameters.
#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
w_t pf = {3, 2, 3, 3}, qf = {4, 1, 1, ~0};
std::cout << "---- simd" << '\n'
<< " <- pf = " << pf << '\n'
<< " <- qf = " << qf << '\n'
;
float xi = 3, yi = 4;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " yi = " << yi << '\n'
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65