E.V.E
v2023.02.15

◆ lambert

eve::lambert = {}
inlineconstexpr

Computes the inverse of the function \( x \rightarrow xe^x \).

Defined in header

#include <eve/module/special.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_ordered_value T >
kumi::tuple<T, T> lambert(T x) noexcept;
}
constexpr callable_lambert_ lambert
Computes the inverse of the function .
Definition: lambert.hpp:54
Definition: abi.hpp:18

Parameters

Return value

A tuple of the two branch values of the Lambert functionis returned with the following considerations:

  • The branches are not defined for input less than \(e^{-1}\) in that case the values returned are NaN.
  • If the inputs are positive, only one branch exist and the two returned values are equal.

Example

#include <eve/module/special.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {-1.0, -0.367879441171441, 0.0, -0.2, 0.2, -0.0, 3.0, 100.0};
auto [w0, wm1] = eve::lambert(pf);
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> w0 = " << w0 << '\n'
<< "-> wm1 = " << wm1<< '\n'
;
float xf = -0.2f;
auto [sw0, swm1] = eve::lambert(xf);
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> sw0 = " << sw0 << '\n'
<< "-> swm1 = " << swm1<< '\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65