I'm trying to implement a mathematical method for calculation of injustice. The formula depends on two variables $a>=1$ and $b>=1$ and returns a fraction $a/b$.
$a/b=1$ indicates justice. If $a/b<1$ the injustice is to your advantage. If $a/b>1$ the injustice is to your disadvantage.
Now I would like to set aside advantage/disadvantage and only calculate the size of the injustice. I'm having trouble figuring out an easy way to get the same result for $a/b$ as $b/a$.
Anyone have any idea of how I can do this?
As noted in the comments:
The function $$F\left(\frac ab\right)=|\log \frac ab|=|\log a - \log b|$$
gets the job done.
It is easy to see that $$F\left(\frac ab\right)=F\left(\frac ba\right)$$ and that $$F\left(\frac ab\right)=0\iff a= b$$ which appear to be the two desired properties.