E.V.E  0.1-beta

◆ betainc

eve::betainc = {}
inlineconstexpr

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

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

Members Functions

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

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

Parameters

x, y: values.

Return value

return the incomplete beta function value.


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/betainc.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = { 0.0f, 0.1f, 0.5f, 2.0f};
wide_ft qf = { 1.0f, 1.0f, 3.0f, 5.0f};
wide_ft rf = { 4.0f, 2.0f, 1.0f, 0.2f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "<- rf = " << rf << '\n'
<< "-> betainc(pf, qf, rf) = " << eve::betainc(pf, qf, rf) << '\n';
float xf = 0.2f;
float yf = 0.5f;
float zf = 2.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "<- zf = " << zf << '\n'
<< "-> betainc(xf, yf, zf) = " << eve::betainc(xf, yf, zf) << '\n';
return 0;
}
constexpr callable_betainc_ betainc
Callable object computing the beta incomplete function. .
Definition: betainc.hpp:72
Wrapper for SIMD registers.
Definition: wide.hpp:65