E.V.E
v2023.02.15

◆ ellint_1

eve::ellint_1 = {}
inlineconstexpr

Computes the elliptic integrals of the first kind : \(\mathbf{F}(\phi, k) = \int_0^{\phi} \frac{\mathrm{d}t}{\sqrt{1-k^2\sin^2 t}}\) and \(\mathbf{K}(k) = \int_0^{\pi/2} \frac{\mathrm{d}t}{\sqrt{1-k^2\sin^2 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_ordered_value T >
T ellint_1(T k) noexcept; //1
template< eve::floating_ordered_value T, eve::floating_ordered_value U >
eve::common_value_t<T, U> ellint_1(T phi, U k) noexcept; //2
}
constexpr callable_ellint_1_ ellint_1
Computes the elliptic integrals of the first kind : and .
Definition: ellint_1.hpp:66
constexpr callable_phi_ phi
Callable object computing the golden ratio : .
Definition: phi.hpp:49
Definition: abi.hpp:18
typename eve::detail::common_value_impl< void, Ts... >::type common_value_t
Computes the SIMD-compatible common type between all Ts.
Definition: common_value.hpp:50
  1. complete elliptic integrals of the first kind.
  2. incomplete elliptic integrals of the first kind.

Parameters

Return value

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

Example

#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_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 constant .
Definition: pio_2.hpp:49
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65