E.V.E  0.1-beta

◆ ellint_rj

eve::ellint_rj = {}
inlineconstexpr

Callable object computing the the Carlson's elliptic integral \(\frac32 \int_{0}^{\infty}\scriptstyle(t+p)^{-1}[(t+x)(t+y)(t+z)]^{-1/2}\scriptstyle\;\mathrm{d}t\).

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

Members Functions

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

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

Parameters

x, y, z, p: floating real values.

This computes the Carlson's elliptic integral

\[ R_J(x, y, z, p) = \frac32 \int_{0}^{\infty} (t+p)^{-1}[(t+x)(t+y)(t+z)]^{-1/2}\mbox{d}t\]

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

Parameters x, y and z must be non negative at most one of them 0, and p non zero. In any other case the result is nan.

Return value

Returns elementwise the 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_rj

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/ellint_rj.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};
// wide_ft sf = {2.2f, 0.5f, 0.3f, 2.4f};
wide_ft pf = {0.0f, 0.0f, 0.0f, 3.0f};
wide_ft qf = {0.19f, 4.0f, 0.4375f, 0.5f};
wide_ft rf = {1.0f, 1.0f, 1.0f, 1.0f};
wide_ft sf = {0.19f, 0.5f, 0.87071f, 2.4f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "<- rf = " << rf << '\n'
<< "<- sf = " << sf << '\n'
<< "-> ellint_rj(pf, qf, rf, sf) = " << eve::ellint_rj(pf, qf, rf, sf) << '\n';
float xf = 3.0f;
float yf = 0.5f;
float zf = 1.0f;
float uf = -3.4f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "<- zf = " << zf << '\n'
<< "<- uf = " << uf << '\n'
<< "-> ellint_rj(xf, yf, zf, uf) = " << eve::ellint_rj(xf, yf, zf, uf) << '\n';
return 0;
}
constexpr callable_ellint_rj_ ellint_rj
Callable object computing the the Carlson's elliptic integral .
Definition: ellint_rj.hpp:87
Wrapper for SIMD registers.
Definition: wide.hpp:65