terminateRelativeErrorZero function

Terminates if relative deviation from optimum is small. Works at 0.