seperatre numerical differentiation function