E.V.E  0.1-beta

◆ lbeta

eve::lbeta = {}
inlineconstexpr

Callable object computing the logarithm of the beta function.

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

Members Functions

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

template< floating_value T, floating_value U > auto operator()( T x, U y ) const noexcept requires compatible< T, U >;

Parameters

x, y: values.

Return value

Returns elementwise \(\displaystyle \log\left(\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}\right)\).

The result type is the common compatible type of the two parameters.


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

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

: The expression derivative_1st(lbeta)(x,y) and derivative_2nd(lbeta)(x,y) computes the partial derivatives of \(f\), where \(f\) is the function \((x,y) \rightarrow \ \log(\mbox{B}(x,y))\).

Example

See it live on Compiler Explorer

#include <eve/function/lbeta.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = { 0.0f, 1.0f, 4.0f, 2.0f };
wide_ft qf = { 1.0f, 1.0f, 3.0f, 5.0f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "-> lbeta(pf, qf) = " << eve::lbeta(pf, qf) << '\n';
float xf = 2.0f;
float yf = 10.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "-> lbeta(xf, yf) = " << eve::lbeta(xf, yf) << '\n';
return 0;
}
constexpr callable_lbeta_ lbeta
Callable object computing the logarithm of the beta function.
Definition: lbeta.hpp:79
Wrapper for SIMD registers.
Definition: wide.hpp:65