E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
lfactorial
auto eve::lfactorial =
functor
<lfactorial_t>
inline
constexpr
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
}
eve::conditional_expr
Specifies that a type is a Conditional Expression.
Definition
conditional.hpp:28
eve::logical_value
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition
value.hpp:132
eve::value
The concept value<T> is satisfied if and only if T satisfies either eve::scalar_value or eve::simd_va...
Definition
value.hpp:34
eve::factorial
constexpr auto factorial
elementwise_callable computing .
Definition
factorial.hpp:79
eve::lfactorial
constexpr auto lfactorial
elementwise_callable object computing the natural logarithm of the factorial of unsigned integer valu...
Definition
lfactorial.hpp:80
eve
EVE Main Namespace.
Definition
abi.hpp:18
Parameters
n
:
integral or flint argument
.
Return value
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.
The operation is performed conditionnaly
External references
Wolfram MathWorld: Erf
Wikipedia: Error Function
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"
;
}
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:86
eve