E.V.E  0.1-beta

◆ maxlog

eve::maxlog = {}
inlineconstexpr

Callable object computing the greatest positive value for which eve::exp returns a finite result.

Required header: #include <eve/function/maxlog.hpp>

Member Effect
operator() Computes the maxlog constant

tempate < floating_value T > T operator()( as<T> const & t) const noexcept;
Lightweight type-wrapper.
Definition: as.hpp:29

Parameters

t: Type wrapper instance embedding the type of the constant.

Return value

the call eve::maxlog(as<T>()) is semantically equivalent to:

  • T(88.37630f) if eve::element_type_t<T> is float
  • T(709.436) if eve::element_type_t<T> is double

Example

See it live on Compiler Explorer

#include <eve/constant/maxlog.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> maxlog(as<wide_ft>()) = " << eve::maxlog(eve::as<wide_ft>()) << std::endl
<< "-> maxlog(as(wxf)) = " << eve::maxlog(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> maxlog(as<float>()) = " << eve::maxlog(eve::as(float())) << std::endl
<< "-> maxlog(as<xf)) = " << eve::maxlog(eve::as(xf)) << std::endl;
return 0;
}
constexpr callable_maxlog_ maxlog
Callable object computing the greatest positive value for which eve::exp returns a finite result.
Definition: maxlog.hpp:57
Wrapper for SIMD registers.
Definition: wide.hpp:65