E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
rising_factorial
auto eve::rising_factorial =
functor
<rising_factorial_t>
inline
constexpr
Defined in header
#include <eve/module/special.hpp>
Callable Signatures
namespace
eve
{
// Regular overload
template
<
typename
I,
typename
T>
constexpr
as_wide_as_t<T, I>
rising_factorial
(I a, T x)
noexcept
;
// 1
// Lanes masking
constexpr
auto
rising_factorial
[
conditional_expr
auto
c](
/*any of the above overloads*/
)
noexcept
;
// 2
constexpr
auto
rising_factorial
[
logical_value
auto
m](
/*any of the above overloads*/
)
noexcept
;
// 2
// Semantic options
constexpr
auto
rising_factoriale[raw]
/*any of the above overloads*/
)
noexcept
;
// 3
constexpr
auto
rising_factorialee[pedantic](
/*any of the above overloads*/
)
noexcept
;
// 4
}
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:134
eve::rising_factorial
constexpr auto rising_factorial
elementwise_callable object computing the rising Factorial function i.e. .
Definition
rising_factorial.hpp:86
eve
EVE Main Namespace.
Definition
abi.hpp:19
Parameters
a
:
value
.
x
:
floating value
.
c
:
Conditional expression
masking the operation.
m
:
Logical value
masking the operation.
Return value
The value of the rising_factorial is returned(
a
and
x
must be strictly positive).
The operation is performed conditionnaly
.
The
raw
option uses the crude formula with all its limitations and inacurracies and return a Nan if
a
and
a+x
are not both positive.
The
pedantic
option uses reflection tricks and computes the function for all real
a
and
x
, returning nan if the result is really undefined.
External references
Wolfram MathWorld: Rising Factorial
[Wikipedia: Falling and rising factorials](
https://en.wikipedia.org/wiki/Falling_and_rising_factorials
Example
// revision 1
#include <eve/module/special.hpp>
#include <iostream>
int
main()
{
eve::wide
n = {1, 2, -3, 7};
eve::wide
p = {1.0f, 1.5f, 2.0f, 2.5f};
std::cout <<
"<- n = "
<< n <<
"\n"
;
std::cout <<
"<- p = "
<< p <<
"\n"
;
std::cout <<
"-> rising_factorial(n, p) = "
<<
eve::rising_factorial
(n, p) <<
"\n"
;
std::cout <<
"-> rising_factorial[ignore_last(2)](n, p)= "
<<
eve::rising_factorial
[
eve::ignore_last
(2)](n, p) <<
"\n"
;
std::cout <<
"-> rising_factorial[n != 2.0f](n, p) = "
<<
eve::rising_factorial
[n != 2.0f](n, p) <<
"\n"
;
std::cout <<
"-> rising_factorial[raw](n, p) = "
<<
eve::rising_factorial
[eve::raw](n, p) <<
"\n"
;
std::cout <<
"-> rising_factorial[pedantic](n, p) = "
<<
eve::rising_factorial
[eve::pedantic](n, p) <<
"\n"
;
}
eve::ignore_last
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition
conditional.hpp:353
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:94
eve