dont get why you test for dbl min and max.
But they can stay.
What about also testing for old_val+epsilon