Squared deviation formula