How about writing this as "abs(v[cc] - val) <= errorBound"? That will cut the logic in half in these if-statements.