Computes the beta function: \(\displaystyle \mathbf{B}(x, y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}\) for real or complex entries.
#include <kyosu/functions.hpp>
{
auto beta(
auto x,
auto y)
noexcept;
}
constexpr auto beta
Computes the beta function: for real or complex entries.
Definition: beta.hpp:70
Main KYOSU namespace.
Definition: cinf.hpp:13
Parameters
x
,y
: Values to process. Can be a mix of Cayley_dickson and real floating values.
Return value
\(\displaystyle \mathbf{B}(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}\) is returned. If x
and y
are real typed values they are treated as complex inputs.
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using wc_t = eve::wide<kyosu::complex_t<float>, eve::fixed<2>>;
std::cout << "Complex: "<< "\n";
c_t c0(1, 5);
c_t c1(5, 9);
std::cout << c0 <<
", " << c1 <<
" -> " <<
beta(c0, c1) <<
"\n";
std::cout << c0 <<
", " << c0 <<
" -> " <<
beta(c0, c0) <<
"\n";
wc_t wc0(c0, c1);
wc_t wc1(c1, c1);
std::cout << wc0 <<
", " << wc1 <<
" -> " <<
beta(wc0, wc1) <<
"\n";
return 0;
}
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27