Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
horners.hpp File Reference
#include <limits>
#include <cmath>
#include <cassert>
#include <cstddef>
#include <iostream>
#include <vector>
#include <universal/number/cfloat/cfloat_fwd.hpp>

Namespaces

namespace  sw
 required std libraries
namespace  sw::universal

Functions

template<unsigned nbits, unsigned es, typename BlockType, bool hasSubnormals, bool hasMaxExpValues, bool isSaturating>
cfloat< nbits, es, BlockType, hasSubnormals, hasMaxExpValues, isSaturating > sw::universal::polyeval (const std::vector< cfloat< nbits, es, BlockType, hasSubnormals, hasMaxExpValues, isSaturating > > &coefficients, int n, const cfloat< nbits, es, BlockType, hasSubnormals, hasMaxExpValues, isSaturating > &x)
 polyeval evaluates a given n-th degree polynomial at x using Horner's rule.
template<unsigned nbits, unsigned es, typename BlockType, bool hasSubnormals, bool hasMaxExpValues, bool isSaturating>
cfloat< nbits, es, BlockType, hasSubnormals, hasMaxExpValues, isSaturating > sw::universal::polyroot (const std::vector< cfloat< nbits, es, BlockType, hasSubnormals, hasMaxExpValues, isSaturating > > &c, const cfloat< nbits, es, BlockType, hasSubnormals, hasMaxExpValues, isSaturating > &x0, int max_iter, double threshold)