|
inlineconstexpr |
Implement the Newton scheme to evaluate polynomials.
If \((a_i)_{0\le i\le n-1}\) denotes the coefficients of the polynomial by decreasing power order, and \((c_i)_{0\le i\le n-2}\) the nodes, the Newton scheme evaluates the polynom \(p\) at \(x\) using the following formula :
\( \displaystyle p(x) = (((a_0(x-c_0)+a_1)(x-c_1)+ ... )(x-c_{n-2}) + a_{n-1})\)
Defined in header
Parameters
x
: real floating argument.r
: range containing The coefficients by decreasing power order.n
: range containing The nodes by decreasing power order.Return value
The value of the polynom at x
is returned.
Notes
If the coefficients or nodes are simd values of cardinal N, this means you simultaneously compute the values of N polynomials.
If d denotes one of these modifiers, the expression d(eve::newton)(...)
computes the result using d(eve::fma)
instead of eve::fma
in internal computation.
This is intended to insure more accurate computations where needed. This has no cost if the system has hard wired fma but is very expansive if it is not the case.