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

◆ safe_scale

eve::safe_scale = functor<safe_scale_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto safe_scale(floating_value auto x) noexcept; // 1
// Lanes masking
constexpr auto safe_scale[conditional_expr auto c](value auto x) noexcept; // 2
constexpr auto safe_scale[logical_value auto m](value auto x) noexcept; // 2
// Semantic options
constexpr auto safe_scale[pedantic](value auto x) 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:134
The concept value<T> is satisfied if and only if T satisfies either eve::scalar_value or eve::simd_va...
Definition value.hpp:34
constexpr auto safe_scale
elementwise_callable object computing underflow-safe and almost overflow-free scaling factor for the ...
Definition safe_scale.hpp:80
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107
EVE Main Namespace.
Definition abi.hpp:19

Parameters

Return value

  1. provide a value s such that |x|/s, is much above the underflow threshold and much below the overflow threshold (so that, for example, we can safely square it); (return maxflint for 0); moreover it is an integer power of 2 (in order to avoid rounding errors when multiplying or dividing by it).
  2. The operation is performed conditionnaly.
  3. same as 1. but return 1 for 0

External references

Example