E.V.E
v2022.09.01

◆ ellint_2

eve::ellint_2 = {}
inlineconstexpr

Computes the elliptic integrals of the second kind : \( \mathbf{E}(\phi, k) = \int_0^{\phi} \scriptstyle \sqrt{1-k^2\sin^2 t} \scriptstyle\;\mathrm{d}t\) and \(\mathbf{E}(k) = \int_0^{\pi/2} \scriptstyle \sqrt{1-k^2\sin^2 t} \scriptstyle\;\mathrm{d}t\).

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

Defined in Header

#include <eve/module/elliptic.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_real_value T >
T ellint_2(T k) noexcept; //1
template< eve::floating_real_value T, eve::floating_real_value U >
eve::common_compatible_value<T, U> ellint_2(T phi, U k) noexcept; //2
}
constexpr callable_ellint_2_ ellint_2
Computes the elliptic integrals of the second kind : and .
Definition: ellint_2.hpp:69
constexpr callable_phi_ phi
Callable object computing the golden ratio : .
Definition: phi.hpp:49
Definition: all_of.hpp:22
  1. complete elliptic integrals of the second kind.
  2. incomplete elliptic integrals of the second kind.

Parameters

Return value

  1. the complete ( corresponding to \( \phi = \pi/2 \) ) is returned.
  2. the incomplete elliptic integrals is returned.

Example

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