Implement Sum square difference.