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

◆ lfactorial

auto eve::lfactorial = functor<lfactorial_t>
inlineconstexpr

Header file

#include <eve/module/special.hpp>

Callable Signatures

namespace eve
{
// Regular overload
template <value T> constexpr as_wide_as_t<double,T> lfactorial(T x) noexcept; // 1
// Lanes masking
constexpr auto factorial[conditional_expr auto c](value auto n) noexcept; // 2
constexpr auto factorial[logical_value auto m](value auto n) noexcept; // 2
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
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 factorial
elementwise_callable computing .
Definition factorial.hpp:79
constexpr auto lfactorial
elementwise_callable object computing the natural logarithm of the factorial of unsigned integer valu...
Definition lfactorial.hpp:80
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The value of \( \log n!\) is returned with the following considerations:
    • If the entry is an integral value, the result element type is always double to try to avoid overflow as possible.
    • If the entry is a floating point value which must be a flint, the result is of the same type as the entry.
    • If n elements are nor integer nor flint the result is undefined.
  2. The operation is performed conditionnaly

External references

Example

// revision 1
#include <eve/module/special.hpp>
#include <iostream>
int main()
{
eve::wide<float> wf([](auto i, auto c)->float{ return 2*(i+c/2);});
eve::wide wi = {93, 25, 32, 180, 1, 2, 3, 4};
eve::wide<std::uint32_t> wu([](auto i, auto )->std::uint32_t{ return i;});
std::cout << "<- wf = " << wf << "\n";
std::cout << "<- wi = " << wi << "\n";
std::cout << "<- wu = " << wu << "\n";
std::cout << "-> lfactorial(wf) = " << eve::lfactorial(wf) << "\n";
std::cout << "-> lfactorial(wi) = " << eve::lfactorial(wi) << "\n";
std::cout << "-> lfactorial(wu) = " << eve::lfactorial(wu) << "\n";
}
Wrapper for SIMD registers.
Definition wide.hpp:70