E.V.E
v2022.09.01

◆ log_gamma

eve::log_gamma = {}
inlineconstexpr

Computes the natural logarithm of the \(\Gamma\) function.

Defined in header

#include <eve/module/special.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_real_value T >
T log_gamma(T x) noexcept;
}
constexpr callable_log_gamma_ log_gamma
Computes the natural logarithm of the function.
Definition: log_gamma.hpp:59
Definition: all_of.hpp:22

Parameters

Return value

The value of the logarithm of the \(\Gamma\) function is returned.

Warning
For real floating inputs this callable returns NaN if eve::gamma(x) is less than zero

Example

Real version

#include <eve/module/special.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.5f, -1.5f, -1.0f, 1.0f, 2.0f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> log_gamma(pf) = " << eve::log_gamma(pf) << '\n'
;
float xf = 4.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> log_gamma(xf) = " << eve::log_gamma(xf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
constexpr callable_minf_ minf
Computes the -infinity ieee value.
Definition: minf.hpp:60
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65

Complex version

#include <eve/module/complex.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft ref = { 0.0f, 1.0f, -1.0f, 0.5f};
wide_ft imf = { 2.0f , -1.0, -5.0, 0.0};
auto z = eve::as_complex_t<wide_ft>(ref, imf);
std::cout
<< "---- simd" << std::endl
<< "<- z = " << z << std::endl
<< "-> log_gamma(z) = " << eve::log_gamma(z) << std::endl;
return 0;
}