kyosu v0.1.0
Complex Without Complexes
Loading...
Searching...
No Matches

◆ lbeta

auto kyosu::lbeta = eve::functor<lbeta_t>
inlineconstexpr

Computes the principal branch of the natural logarithm of the beta function.

Header file

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
// regular call
auto lbeta(auto z0,auto z1) noexcept;
auto log(auto z0, auto z1, eve::value n) noexcept;
// semantic modifyers
auto lbeta[real_only](auto z0, auto z1) noexcept;
}
constexpr auto log
Computes the principal value of the natural logarithm of the argument.
Definition log.hpp:99
constexpr auto lbeta
Computes the principal branch of the natural logarithm of the beta function.
Definition lbeta.hpp:84
Main KYOSU namespace.
Definition cinf.hpp:13

Parameters

  • x,y : Values to process.

Return value

  • Real typed input z0 and z1 is treated as if complex(z0) and complex(z1) were entered, unless the option real_only is used in which case the result will the same as to an eve::lbeta call
  • Real typed entries are treated as complex ones. unless the option real_only is used in which case the parameter must be a floating_value, implying a Nan result if the theoretical result is not real.
  • Returns log(beta(x, y)).
Note
lΒ (l followed by upper case greek letter) can be used as an alias in code.

External references

Example

#include <eve/wide.hpp>
#include <iostream>
#include <kyosu/kyosu.hpp>
int main()
{
using kyosu::lbeta;
using e_t = float;
using we_t = eve::wide<float, eve::fixed<2>>;
using wc_t = eve::wide<kyosu::complex_t<float>, eve::fixed<2>>;
std::cout << "Real: " << "\n";
e_t e0(1);
e_t e1(2);
std::cout << e0 << ", " << e1 << " -> " << lbeta(e0, e1) << "\n";
std::cout << e0 << ", " << e0 << " -> " << lbeta(e0, e0) << "\n";
we_t we0(e0);
we_t we1(e1);
std::cout << we0 << ", " << we1 << " -> " << lbeta(we0, we1) << "\n";
std::cout << "Complex: " << "\n";
c_t c0(1, 5);
c_t c1(5, 9);
std::cout << c0 << ", " << c1 << " -> " << lbeta(c0, c1) << "\n";
std::cout << c0 << ", " << c0 << " -> " << lbeta(c0, c0) << "\n";
wc_t wc0(c0, c1);
wc_t wc1(c1, c1);
std::cout << wc0 << ", " << wc1 << " -> " << lbeta(wc0, wc1) << "\n";
double a = 1.5;
double b = -2.6;
auto lbetab = kyosu::lbeta(a, b);
auto lrbetab = eve::lbeta(a, b);
auto lrrbetab = kyosu::lbeta[kyosu::real_only](a, b);
std::cout << "kyosu::lbeta(a, b) "<< lbetab << std::endl;
std::cout << "eve::lbeta(a, b) "<< lrbetab << std::endl;
std::cout << "kyosu::lbeta[kyosu::real_only](a, b) "<< lrrbetab << std::endl;
return 0;
}
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition complex.hpp:27