I can not reproduce the example with difference 1e2 right now and I think it was caused by something else at that moment. It seems that my code might be correct after all and that difference is due to floating point precision.