7 #include "cln/univpoly.h"
12 #include "cln/integer.h"
16 const cl_UP deriv (const cl_UP& x)
19 // Write x = a0 T^0 + ... + an T^n.
20 // Then deriv(x) = 1*a1 T^0 + ... + n*an T^(n-1) (= 0 if n <= 0).
21 var cl_univpoly_ring UPR = x.ring();
22 var sintL n = degree(x);
26 var cl_UP y = UPR->create(n-1);
28 y.set_coeff(n-1, n * coeff(x,n));