E.V.E  0.1-beta

◆ ellint_d

eve::ellint_d = {}
inlineconstexpr

Callable object computing the \(\mbox{D}\) elliptic integrals : \(\int_0^{\phi} \frac{\sin^2 t}{\sqrt{1-k^2\sin^2 t}} \scriptstyle\;\mathrm{d}t\).

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

Members Functions

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

auto operator()(floating_real_value auto k) const noexcept;
auto operator()(floating_real_value auto phi, floating_real_value auto k) const noexcept;
Definition: value.hpp:103

Parameters

phi, k: floating real values.

computes the complete and incomplete D elliptic integrals :

\[ F(\phi,k) = \int_0^{\phi} \frac{\sin^2 t}{\sqrt{1-k^2\sin^2 t}}\mbox{d}t\]

The complete case corresponds to \(\phi = \pi/2\).

  • k must verify \(k^2\sin^2\phi \le 1\) or the result is nan.
  • In the complete case this means \(|k| \le 1\).

In any other case the result is nan.

Warning
Be aware that as \(\pi/2\) is not exactly represented by floating point values the result of the incomplete function with a \(\phi\) value near \(\pi/2\) can differ a lot with the result of the complete call.

Return value

Returns elementwise the elliptic integral of the first kind.

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_d

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/ellint_d.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <eve/constant/pio_2.hpp>
int main()
{
wide_ft pf = {1.0f, 0.1f, 0.75f, 0.5f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> ellint_d(pf) = " << eve::ellint_d(pf) << '\n';
float xf = 0.1f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> ellint_d(xf) = " << eve::ellint_d(xf) << '\n';
wide_ft phi = {0.2f, 1.0e-30f, 0.5f, 0.3f};
std::cout << "---- simd" << '\n'
<< "<- phi = " << phi << '\n'
<< "<- pf = " << pf << '\n'
<< "-> ellint_d(phi, pf) = " << eve::ellint_d(phi, pf) << '\n';
}
constexpr callable_ellint_d_ ellint_d
Callable object computing the elliptic integrals : .
Definition: ellint_d.hpp:92
Wrapper for SIMD registers.
Definition: wide.hpp:65