Computes the Carlson's elliptic integral \( \mathbf{R}_\mathbf{G}(x, y) = \frac1{4\pi} \int_{0}^{2\pi}\int_{0}^{\pi}
\scriptstyle\sqrt{x\sin^2\theta\cos^2\phi
+y\sin^2\theta\sin^2\phi
+z\cos^2\theta} \scriptstyle\;\mathrm{d}\theta\;\mathrm{d}\phi\).
#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, 4.0, 3.0};
wide_t im2 = { 1.0 , -4.0, 0.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};
int main()
{
std::cout << "<- p = " << p << "\n";
std::cout << "<- q = " << q << "\n";
std::cout << "<- r = " << r << "\n";
std::cout <<
"-> ellint_rg[ignore_last(2)](p, q, r)= " <<
kyosu::ellint_rg[eve::ignore_last(2)](p, q, r) <<
"\n";
std::cout <<
"-> ellint_rg[q != 4.0](p, q, r) = " <<
kyosu::ellint_rg[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