E.V.E  0.1-beta

◆ rising_factorial

eve::rising_factorial = {}
inlineconstexpr

Callable object computing rising_factorial function i.e. \(\frac{\Gamma(x+a)}{\Gamma(a)}\).

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

Members Functions

Member Effect
operator() rising_factorial operation
operator[] Construct a conditional version of current function object

auto operator()( real_value auto a, floating_real_value x ) const noexcept;
Definition: value.hpp:103
Definition: value.hpp:93

Parameters

a: value. a must be positive or the result is Nan

x: floating value. a+x must be positive or the result is Nan

Return value


auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::rising_factorial

Parameters

cond : conditional expression

Return value

A Callable object so that the expression rising_factorial[cond](x, ...) is equivalent to if_else(cond,rising_factorial(x, ...),x)


Supported decorators

  • eve::raw

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

    The expression raw(rising_factorial)(a,x) uses the crude formula with all its limitations and inacurracies and return a Nan if a and a+x are not both positive

  • eve::pedantic

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

    The expression pedantic(rising_factorial)(a,x) uses reflection tricks and computes the function for all real a and x, and in fact computes the Pochammer symbol \(x^{\overline a}=\frac{\Gamma(x+a)}{\Gamma(a)}\) returning nan if the result in really undefined.

  • eve::diff, eve::diff_1st, eve::diff_2nd, eve::diff_nth

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

    The expression diff_1st(rising_factorial)(a,x) and diff_2nd(rising_factorial)(a,x) computes the derivative of the function relative to the first or second parameter respectively.

    These decorators can be combined to the other available ones : for instance the call

    pedantic(diff_1st)(rising_factorial)(a,x)

    will compute the derivative of pedantic(rising_factorial) relative to the first parameter.

Example

See it live on Compiler Explorer

#include <eve/function/pedantic/rising_factorial.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
int main()
{
w32_t n = {1, 2, -3, 7};
wf_t x = {1.0f, 1.5f, 2.0f, 2.5f};
std::cout << "---- simd" << std::setprecision(17) << '\n'
<< " <- n = " << n << '\n'
<< " <- x = " << x << '\n'
<< " -> rising_factorial(n, x) = " << eve::rising_factorial(n, x) << '\n'
<< " -> pedantic(rising_factorial)(n, x) = " << eve::pedantic(eve::rising_factorial)(n, x) << '\n';
double xi = 1.8;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " -> rising_factorial(7, xi) = " << eve::rising_factorial(7, xi) << '\n';
return 0;
}
constexpr callable_rising_factorial_ rising_factorial
Callable object computing rising_factorial function i.e. .
Definition: rising_factorial.hpp:98
constexpr pedantic_type const pedantic
Higher-order Callable Object imbuing more standard semantic onto other Callable Objects.
Definition: pedantic.hpp:56
Wrapper for SIMD registers.
Definition: wide.hpp:65