Script to test diagonal D matrix generation containing the derivatives of activation fuction at u.