@stdlib/math-base-tools-evalpoly-compile-c
Version:
Compile a C function for evaluating a polynomial.
16 lines (15 loc) • 372 B
Plain Text
/**
* Evaluates a polynomial.
*
* ## Notes
*
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
* @param x value at which to evaluate the polynomial
* @return evaluated polynomial
*/
static {{dtype}} {{fname}}( const {{dtype}} x ) {
return {{horner}};
}