offset error calculation