E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ logspace_sub

auto eve::logspace_sub = functor<logspace_sub_t>
inlineconstexpr

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
// Regular overloads
constexpr auto logspace_sub(floating_value auto x, floating_value auto ... xs) noexcept; // 1
constexpr auto logspace_sub(kumi::non_empty_product_type auto const& tup) noexcept; // 2
// Lanes masking
constexpr auto logspace_sub[conditional_expr auto c](/*any of the above overloads*/) noexcept; // 3
constexpr auto logspace_sub[logical_value auto m](/*any of the above overloads*/) noexcept; // 3
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:116
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
constexpr auto logspace_sub
tuple_callable object computing the logspace_sub operation: .
Definition logspace_sub.hpp:90
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The call logspace_sub(x, xs...) is semantically equivalent tolog(exp(log(x)) - exp(log(xs))...). without causing unnecessary overflows or throwing away too much accuracy.
  2. equivalent to the call on the elements of the tuple.
  3. 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, 2.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_sub(pf, qf) = " << eve::logspace_sub(pf, qf) << "\n";
std::cout << "-> logspace_sub(wt) = " << eve::logspace_sub(wt) << "\n";
std::cout << "-> logspace_sub[ignore_last(2)](pf, qf)= " << eve::logspace_sub[eve::ignore_last(2)](pf, qf) << "\n";
std::cout << "-> logspace_sub[pf != 3.0](pf, qf) = " << eve::logspace_sub[pf != 3.0](pf, qf) << "\n";
std::cout << "-> logspace_sub(pf, qf, rf) = " << eve::logspace_sub(pf, qf, rf) << "\n";
}
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:332
Wrapper for SIMD registers.
Definition wide.hpp:86