terminateLEQ function

Terminates, if the solution is less equal a threshold.