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

◆ ellint_rd

kyosu::ellint_rd = eve::functor<ellint_rd_t>
inlineconstexpr

Computes the Carlson's elliptic integral \( \mathbf{R}_\mathbf{D}(x, y) = \frac32 \int_{0}^{\infty} \scriptstyle[(t+x)(t+y)]^{-1/2}(t+z)^{-3/2}\;\mathrm{d}t\).

Header file

#include <eve/module/elliptic.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto ellint_rd( auto x, auto y, auto z) noexcept; // 1
// semantic modifier
constexpr auto ellint_rd[threshold = tol](auto x, auto y, auto z) noexcept; // 1
// Lanes masking
constexpr auto ellint_rd[conditional_expr auto c](auto x, auto y, auto z) noexcept; // 2
constexpr auto ellint_rd[logical_value auto m](auto x, auto y, auto z) noexcept; // 2
}
constexpr auto ellint_rd
Computes the Carlson's elliptic integral .
Definition: ellint_rd.hpp:93

Parameters

  • x, y, z: Can be a mix of complex and real floating values. z must be non zero
  • p: floating real arguments.
  • c: Conditional expression masking the operation.
  • m: Logical value masking the operation.

Return value

  1. the value of the \(\mathbf{R}_\mathbf{D}\) Carlson elliptic integral: \( \frac32 \int_{0}^{\infty}\scriptstyle[(t+x)(t+y)]^{-1/2}(t+z)^{-3/2}\;\mathrm{d}t\) is returned with relative error less in magnitude than tol (tol default to eps). The integral is well defined if x, y, z lie in the complex plane cut along the nonpositive real axis, with the exception that at z must be non 0
  2. The operation is performed conditionnaly

External references

Example

// revision 1
#include <eve/module/elliptic.hpp>
#include <iostream>
using wide_t = eve::wide <double, eve::fixed<4>>;
using r_t = double;
wide_t re1 = { 3.0, 2.0, 1.0, 0.5};
wide_t im1 = { 2.0, -1.0, -5.0, 0.0};
wide_t re2 = { 0.0, 1.0, 2.0, 3.0};
wide_t im2 = { 1.0 , -4.0, -2.0, 0.0};
wide_t re3 = { 0.1, -1.0, 2.0, 4.0};
wide_t im3 = { 2.0 , -4.0, -3.0, 0.0};
auto p = kyosu::complex_t<wide_t>(re1, im1);
auto q = kyosu::complex_t<wide_t>(re2, im2);
auto r = kyosu::complex_t<wide_t>(re3, im3);
int main()
{
std::cout << "<- p = " << p << "\n";
std::cout << "<- q = " << q << "\n";
std::cout << "<- r = " << r << "\n";
std::cout << "-> ellint_rd(p, q, r) = " << kyosu::ellint_rd(p, q, r) << "\n";
std::cout << "-> ellint_rd[ignore_last(2)](p, q, r)= " << kyosu::ellint_rd[eve::ignore_last(2)](p, q, r) << "\n";
std::cout << "-> ellint_rd[q != 4.0](p, q, r) = " << kyosu::ellint_rd[q != 4.0](p, q, r) << "\n";
}
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27