|
inlineconstexpr |
Implement the horner scheme to evaluate polynomials.
If (a_i)_{0\le i\le n-1} denotes the coefficients of the polynomial by decreasing power order, the Horner scheme evaluates the polynom p at x by : \displaystyle p(x) = (((a_0x+a_1)x+ ... )x + a_{n-1}).
For non commutative cases it is a left-horner scheme: coefficients are at the left of the x powers.
using the right
semantic modifyier allows to use a right-horner scheme: coefficients are at the right of the x powers).
! Parameters
Return value
x
is returned, according to the formula: \displaystyle p(x) = (((a_0x+a_1)x+ ... )x + a_{n-1}).right
modifyier is useful only when dealing wirh cayley-dickson non commutative algebras.x
is returned, according to the formula: \displaystyle p(x) = (x (x (x a_0+a_1)+ ... )+a_{n-1}).left
and right
leads to the same resultNotes
If the coefficients are simd values of cardinal N, this means you simultaneously compute the values of N polynomials.