Line error calculation