update options for pip installation in README.md
[liba.git] / src / poly.c
blob44791ace12440aa751ccf232fae7a8271373ff0d
1 #define LIBA_POLY_C
2 #include "a/poly.h"
4 a_float *a_poly_swap(a_float *a, a_size n)
6 a_float *b = a, *c = a + n;
7 for (a_float x; b < --c; ++b)
9 x = *b;
10 *b = *c;
11 *c = x;
13 return a;
16 a_float a_poly_eval_(a_float const *a, a_float const *b, a_float x)
18 a_float y;
19 for (y = *--b; b > a;)
21 y = y * x + *--b;
23 return y;
26 a_float a_poly_evar_(a_float const *a, a_float const *b, a_float x)
28 a_float y;
29 for (y = *a; ++a < b;)
31 y = y * x + *a;
33 return y;