E.V.E  0.1-beta

◆ beta

eve::beta = {}
inlineconstexpr

Callable object computing the beta function. \(\mbox{B}(x,y)=\int_0^1 t^{x-1}(1-t)^{y-1}\mbox{d}t\).

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

Members Functions

Member Effect
operator() the beta 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 \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}\).

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::beta

Parameters

cond : conditional expression

Return value

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


Supported decorators

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

: The expression diff_1st(beta)(x,y) and diff_2nd(beta)(x,y) computes the partial derivatives of \(f\), where \(f\) is the function \((x,y) \rightarrow \ \mbox{B}(x,y)\).

Example

See it live on Compiler Explorer

#include <eve/function/beta.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'
<< "-> beta(pf, qf) = " << eve::beta(pf, qf) << '\n';
float xf = 2.0f;
float yf = 10.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "-> beta(xf, yf) = " << eve::beta(xf, yf) << '\n';
return 0;
}
constexpr callable_beta_ beta
Callable object computing the beta function. .
Definition: beta.hpp:78
Wrapper for SIMD registers.
Definition: wide.hpp:65