implement and test for calculating error derivatives after back propagation