This could be due to floating-point precision errors and might require a lot of code to be rewritten.