E.V.E  0.1-beta

◆ ellint_1

eve::ellint_1 = {}
inlineconstexpr

Callable object computing the elliptic integrals of the first kind : \(\int_0^{\phi} \frac{\mathrm{d}t}{\sqrt{1-k^2\sin^2 t}}\).

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

Members Functions

Member Effect
operator() the ellint_1 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 elliptic integrals of the first kind :

\[ F(\phi,k) = \int_0^{\phi} \frac{\mbox{d}t}{\sqrt{1-k^2\sin^2 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_1

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/ellint_1.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <eve/constant/pio_2.hpp>
int main()
{
wide_ft pf = {1.0f, 0.0f, 0.75f, 0.5f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> ellint_1(pf) = " << eve::ellint_1(pf) << '\n';
float xf = 0.1f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> ellint_1(xf,) = " << eve::ellint_1(xf) << '\n';
wide_ft phi = {0.2f, 1.0e-30f, 0.5f, 0.0f};
std::cout << "---- simd" << '\n'
<< "<- phi = " << phi << '\n'
<< "-> ellint_1(phi, pf) = " << eve::ellint_1(phi, pf) << '\n'
<< "-> ellint_1(pio2,pf) = " << eve::ellint_1(eve::pio_2(eve::as(phi)), pf) << '\n';
return 0;
}
constexpr callable_pio_2_ pio_2
Callable object computing the value.
Definition: pio_2.hpp:54
constexpr callable_ellint_1_ ellint_1
Callable object computing the elliptic integrals of the first kind : .
Definition: ellint_1.hpp:92
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65