implement code to pass test for calculating errors in hidden layer
adjust for machine numerical precision