|
Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
|
Functions | |
| template<typename Vector, typename Scalar> | |
| void | ddpoly (const Scalar &x, const Vector &c, Vector &pd) |
| template<typename Vector, typename Scalar> | |
| Scalar | polyeval (const Vector &coefficients, int n, const Scalar &x) |
| polyeval evaluates a given n-th degree polynomial at x using Horner's rule. | |
| template<typename Vector, typename Scalar> | |
| Scalar | polyroot (const Vector &c, const Scalar &x0, int max_iter, double threshold=1e-16) |
| polyroot finds a root close to the initial guess x0. | |
| void sw::math::polynomial::ddpoly | ( | const Scalar & | x, |
| const Vector & | c, | ||
| Vector & | pd ) |
|
inline |
polyeval evaluates a given n-th degree polynomial at x using Horner's rule.
The polynomial is given by the array of (n+1) coefficients.
| coefficients | polynomial coefficients |
| n | portion of the polynomial to evaluate |
| x | value to evaluate |
|
inline |
polyroot finds a root close to the initial guess x0.
Will only find a single root as it is using a Newton iteration
| c | n-th degree polynomial |
| x0 | initial guess of the root of interest |
| max_iter | stopping criterium |
| threshold | stopping cirterium |