|
inlineconstexpr |
Implement the reverse_horner scheme to evaluate polynomials.
If \((a_i)_{0\le i\le n-1}\) denotes the coefficients of the polynomial by increasing power order, the reverse Horner scheme evaluates the polynom \(p\) at \(x\) by : \(\displaystyle p(x) = (((a_{n-1}x+a_{n-2})x+ ... )x + a_0)\).
For non commutative cases it is a left-reverse_horner scheme: coefficients are at the left of the x powers.
using the right
semantic modifyier allows to use a right-reverse Horner scheme: coefficients are at the right of the x powers).
! Parameters
* `x` : real or cayley-dickson argument. * `coefs...` : real or cayley-dickson arguments. The coefficients by increasing power order * `tup` : kumi tuple containing The coefficients by decreasing power order.
Return value
x
is returned, according to the formula: \(\displaystyle p(x) = (((a_{n-1}x+a_{n-2})x+ ... )x + a_0)\).x
is returned, according to the formula: \(\displaystyle p(x) = (x (x (x a_{n-1}+a_{n-2})+ ... )+a_0)\).Notes
If the coefficients are simd values of cardinal N, this means you simultaneously compute the values of N polynomials.