◆ stirling
Callable object computing an approximation of the \(\Gamma\) function by \(\displaystyle \Gamma(x) \approx \sqrt{2 \pi} x^{x-\frac12} e^{-x} \left( 1 + \frac1{x} P(\frac1{x})\right)\), where \(P\) is a polynomial. Required header: Members Functions
template< value T, floating_value U > auto operator()( Tx ) const noexcept;
Parameters Return value Returns elementwise \(\sqrt{2 \pi} x^{x-\frac12} e^{-x} \left( 1 + \frac1{x} P(\frac1{x})\right)\) auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::stirling Parameters
Return value A Callable object so that the expression Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/stirling.hpp>
#include <eve/wide.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/nan.hpp>
#include <iostream>
using wide_ft = eve::wide<float, eve::fixed<8>>;
int main()
{
using eve::pedantic;
wide_ft pf = {0.0f, -0.0f, -1.0f, 10.0f, 20.0f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
return 0;
}
constexpr callable_minf_ minf Callable object computing the negative infinity value. Definition: minf.hpp:55 constexpr callable_inf_ inf Callable object computing the infinity ieee value. Definition: inf.hpp:54 constexpr pedantic_type const pedantic Higher-order Callable Object imbuing more standard semantic onto other Callable Objects. Definition: pedantic.hpp:56 constexpr callable_stirling_ stirling Callable object computing an approximation of the function by , where is a polynomial. Definition: stirling.hpp:73 |