22 template<
typename Float,
class Tag,
unsigned int order>
25 static inline Float
Coeff(
const Float x);
29 template<
typename Float,
class Tag,
unsigned int order>
31 static Float
Recurse(
const Float term,
const Float x)
35 static Float
Eval(
const Float x)
40 static Float
Recurse(
const Float term,
const Float x,
const Float y)
42 static Float
Eval(
const Float x,
const Float y)
47 template<
typename Float,
class Tag>
48 struct Horner<Float, Tag, 0> {
49 static Float
Recurse(
const Float term,
const Float x)
51 static Float
Eval(
const Float x)
54 static Float
Recurse(
const Float term,
const Float x,
const Float y)
56 static Float
Eval(
const Float x,
const Float y)
61#define HORNER_COEFF(_Tag_, _i_, _c_) \
62 template<typename Float> struct Polynomial<Float, _Tag_, _i_> { static Float Coeff() { return Float(_c_); } }
63#define HORNER_COEFF2(_Tag_, _i_, _c_y_) \
64 template<typename Float> struct Polynomial<Float, _Tag_, _i_> { static Float Coeff(const Float y) { return Float(_c_y_); } }
67#define HORNER0(F, x, c0) (F)(c0)
68#define HORNER1(F, x, c1, c0) HORNER0(F, x, (F)(c1)*(x) + (F)(c0) )
69#define HORNER2(F, x, c2, c1, c0) HORNER1(F, x, (F)(c2)*(x) + (F)(c1), c0)
70#define HORNER3(F, x, c3, c2, c1, c0) HORNER2(F, x, (F)(c3)*(x) + (F)(c2), c1, c0)
71#define HORNER4(F, x, c4, c3, c2, c1, c0) HORNER3(F, x, (F)(c4)*(x) + (F)(c3), c2, c1, c0)
72#define HORNER5(F, x, c5, c4, c3, c2, c1, c0) HORNER4(F, x, (F)(c5)*(x) + (F)(c4), c3, c2, c1, c0)
73#define HORNER6(F, x, c6, c5, c4, c3, c2, c1, c0) HORNER5(F, x, (F)(c6)*(x) + (F)(c5), c4, c3, c2, c1, c0)
74#define HORNER7(F, x, c7, c6, c5, c4, c3, c2, c1, c0) HORNER6(F, x, (F)(c7)*(x) + (F)(c6), c5, c4, c3, c2, c1, c0)
75#define HORNER8(F, x, c8, c7, c6, c5, c4, c3, c2, c1, c0) HORNER7(F, x, (F)(c8)*(x) + (F)(c7), c6, c5, c4, c3, c2, c1, c0)
76#define HORNER9(F, x, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0) HORNER8(F, x, (F)(c9)*(x) + (F)(c8), c7, c6, c5, c4, c3, c2, c1, c0)
static Float Eval(const Float x)
static Float Eval(const Float x, const Float y)
static Float Recurse(const Float term, const Float x)
static Float Recurse(const Float term, const Float x, const Float y)
static Float Recurse(const Float term, const Float x)
static Float EvalAlt(const Float x)
static Float RecurseAlt(const Float term, const Float x)
static Float Eval(const Float x, const Float y)
static Float Eval(const Float x)
static Float Recurse(const Float term, const Float x, const Float y)
static Float Coeff(const Float x)