Direct and indirect least-squares approximating polynomials for the first derivative function