Let's assume that the array C
contains the coefficients of an n-th degree polynomial in descending order of degree (e.g. for f(x) = C[0]*x^n + ... + C[n-1]*x + C[n]
)
Then D
is your array of derivatives:
double D[] = new double[C.length-1];
for(int i = 0; i < C.length-1; i++)
D[i] = C[i]*(C.length-i-1);