◆ horn1()

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

Computes the value of a polynomial by Horner algorithm which leading 1 coeficient.

This is a static polynomial evaluation.

Header <boost/simd/function/horn1.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 = horn1 <T, c0, c1, c2, ..., cn-1>(x);

is equivalent to:

T r = (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-1), 1:

\( x^n+\sum_0^{n-1} C(i)x^i \)

This differs from horn only by the fact that the leading polynomial coefficient is one, saving one multiplication.