◆ horn()

template<typename Value , uintmax_t... Coef>
Value boost::simd::horn ( Value const &  x)

Computes the value of a polynomial by Horner algorithm.

This is a static polynomial evaluation.

Header <boost/simd/function/horn.hpp>

For any value x of floating point type T, and any integral constants c0, c1, ..., cn representing floating point values bits in hexadecimal:

T r = horn <T, c0, c1, c2, ..., cn>(x);

is equivalent to:

T r = (C(n)*x+C(n-1))*x+C(n-2))*x+...+C(1))*x+C(0));

where C(i) is Constant<T, ci>(), that is the corresponding floating point value.

This function evaluates the polynomial of degree n, whose increasing degrees coefficients are given by C(0), C(1), ..., C(n) :

\(\sum_0^n C(i)x^i\)