Function: round(minus(numbers("xxx") if invert(numbers("xxx")) > numbers('rep') if invert(numbers("xxx")) > numbers("xxx") else numbers('rrr') else numbers('rep'), invert(numbers("xxx")) if numbers("xxx") > numbers('rep') else numbers('rrr')), numbers("xxx") if numbers("xxx") if numbers('rrr') > invert(numbers("xxx")) else numbers('rep') > numbers('rep') else invert(numbers("xxx")))