fix npm auto-corrected some errors in your package.json when publishing.
[liba.git] / src / poly.c
blob183dff796e23ff3301c6b986408a32b6dfb2fe20
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 *l = a, *r = a + n;
7 for (a_float x; l < --r; ++l)
9 x = *l;
10 *l = *r;
11 *r = 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;