kyosu v0.1.0
Complex Without Complexes
Loading...
Searching...
No Matches

◆ exp_int

auto kyosu::exp_int = eve::functor<exp_int_t>
inlineconstexpr

elementwise_callable object computing the exponential integral \( \mathbf{E}_n(x) = \displaystyle \int_1^\infty \frac{e^{-xt}}{t^n}\;\mbox{d}t\).

Header file

#include <eve/module/special.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto exp_int(concepts::cayley_dickson auto x) noexcept; // 1
constexpr auto exp_int(concepts::cayley_dickson auto n, floating_value auto x) noexcept; // 2
}
General Cayley-dickson concept.
Definition concepts.hpp:41
constexpr auto exp_int
elementwise_callable object computing the exponential integral .
Definition exp_int.hpp:81

Parameters

Return value

  1. The value of the exponential integral \( \mathbf{E}_n(x) = \displaystyle \int_1^\infty \frac{e^{-xt}}{t^n}\;\mbox{d}t\), is returned.
  2. The operation is performed conditionnaly.

External references

Example

#include <eve/wide.hpp>
#include <iostream>
#include <kyosu/kyosu.hpp>
int main()
{
using kyosu::exp;
using e_t = float;
using we_t = eve::wide<e_t, eve::fixed<2>>;
using wc_t = eve::wide<c_t, eve::fixed<2>>;
using wq_t = eve::wide<q_t, eve::fixed<2>>;
std::cout << "Real: \n";
e_t e(2.9f);
we_t we = we_t(e);
std::cout << e << " -> " << exp_int(e) << "\n";
std::cout << we << " -> " << exp_int(we) << "\n";
std::cout << exp_int(c_t(e)) << "\n";
std::cout << exp_int(q_t(e)) << "\n";
std::cout << exp_int(wc_t(e)) << "\n";
std::cout << exp_int(wq_t(e)) << "\n";
std::cout << "Complex: \n";
c_t c(3.5f, -2.9f);
wc_t wc = wc_t(c);
std::cout << c << " -> " << exp_int(c) << "\n";
std::cout << wc << " -> " << exp_int(wc) << "\n";
std::cout << exp_int(q_t(c)) << "\n";
std::cout << exp_int(wq_t(c)) << "\n";
std::cout << "Quaternion: \n";
q_t q(3.5f, -2.9f, 2.1f, 3.2f);
wq_t wq = wq_t(q);
std::cout << q << " -> " << exp_int(q) << "\n";
std::cout << wq << " -> " << exp_int(wq) << "\n";
return 0;
}
constexpr auto exp
Computes the exponential of the argument.
Definition exp.hpp:79
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition complex.hpp:27
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition quaternion.hpp:24