Function: logn(numbers("xxr") if mean(minus(numbers("xxr"), numbers('rep')), numbers("xxr")) > numbers('rep') else minus(numbers("xxr"), numbers('rep')) if minus(numbers("xxr"), numbers('rep')) > mean(minus(numbers("xxr"), numbers('rep')), numbers("xxr")) else numbers("xxr"))