E.V.E  0.1-beta

◆ ellint_rg

eve::ellint_rg = {}
inlineconstexpr

Callable object computing the the Carlson's elliptic integral \(\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\).

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

Members Functions

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

auto operator()(floating_real_value auto x
, floating_real_value auto zconst noexcept;
Definition: value.hpp:103

Parameters

x, y, z: floating real values.

This computes the Carlson's elliptic integral

\[ R_G(x, y, z) = \frac1{4\pi} \int_{0}^{2\pi}\int_{0}^{\pi} \sqrt{x\sin^2\theta\cos^2\phi +y\sin^2\theta\sin^2\phi +z\cos^2\theta} \mbox{d}\theta\mbox{d}\phi\]

as described in Carlson, Numerische Mathematik, vol 33, 1 (1979)

Parameters x and y and zmust be non-negative. In any other case the result is nan.

Return value

Returns elementwise Carlson's integral.

The result type is of the compatibility type of the three parameters.


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

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