numerical derivative checking script