Computes the linear interpolation.
{
template< eve::value T, eve::value U, eve::floating_value V >
eve::common_compatible_t<T, U>
lerp(T x, U y, V t)
noexcept;
}
constexpr callable_lerp_ lerp
Computes the linear interpolation.
Definition: lerp.hpp:63
Definition: all_of.hpp:22
#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wf_t pf = {3, 2.5, -32.7, 1327.43}, qf = {4.2, 1.5, -100.834, 10.02}, tf = {0, 0.1, -3, 1.0};
std::cout << "---- simd" << '\n'
<< " <- pf = " << pf << '\n'
<< " <- qf = " << qf << '\n'
<< " <- tf = " << tf << '\n'
<<
" -> lerp(pf, qf, tf) = " <<
eve::add(pf, qf, tf) <<
'\n';
double x = 10000, y = 32700, t = 0.5;
std::cout << "---- scalar" << '\n'
<< " <- x = " << x << '\n'
<< " <- y = " << y << '\n'
<< " <- t = " << t << '\n'
<<
" -> lerp(x, y, t) = " <<
eve::add(x, y, t) <<
'\n';
return 0;
}
constexpr callable_add_ add
Computes the sum of its arguments.
Definition: add.hpp:83
Wrapper for SIMD registers.
Definition: wide.hpp:65