E.V.E  0.1-beta

◆ exp_int

eve::exp_int = {}
inlineconstexpr

Callable object computing the exponential integral \(\displaystyle \mbox{E}_{n}(x)=\int_0^\infty \frac{e^{-xt}}{t^{n}} \mbox{d}t\).

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

Members Functions

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

auto operator()( floating_real_value auto n, floating_real_value auto y ) const noexcept
Definition: value.hpp:103

Parameters

n: value.

x: floating value.

Return value

Returns elementwise exponential integral The result type is the common compatible type of the two parameters. If the first parameter inot an integral value it must be a flint, otherwise the result is Nan.


auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::exp_int

Parameters

cond : conditional expression

Return value

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


Supported decorators

  • eve::diff, eve::diff_1st, eve::diff_nth

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

    The expression diff(exp_int)(n,x) computes the derivative (relative to the second parameter) of the function at x.

Example

See it live on Compiler Explorer

#include <eve/function/exp_int.hpp>
#include <eve/wide.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/nan.hpp>
#include <iostream>
int main()
{
wide_ft pd = {0.5, 1.5, 0.1, 1.0, 19.0, 25.0, 21.5, 10000.0};
wide_ft n = {0, 1, 5, -2, 10, 6000, 0, 1.5};
wide_ft r = eve::exp_int(n, pd);
wide_ft r0 = eve::exp_int(pd);
std::cout << "---- simd" << '\n'
<< "<- pd = " << pd << '\n'
<< "<- n = " << n << '\n'
<< "-> exp_int(n, pd) = " << r << '\n'
<< "-> exp_int(pd) = " << r0 << '\n';
float xd = 0.5f;
std::cout << "---- scalar" << '\n'
<< "<- xd = " << xd << '\n'
<< "-> exp_int(1, xd) = " << eve::exp_int(1, xd) << '\n'
<< "-> exp_int(xd) = " << eve::exp_int(xd) << '\n';
return 0;
}
constexpr callable_exp_int_ exp_int
Callable object computing the exponential integral .
Definition: exp_int.hpp:81
Wrapper for SIMD registers.
Definition: wide.hpp:65