Could it be that the implementation / int conversion introduces some inaccuracies that some up across time shifts. Did you check at which precesion the two time scales match? Also did you check whether we have some implicit type casting somewhere, e.g. from double to single precesion float (this is a common source of precision mismatch errors)?