Idea of algorithm is based on finding floored "average" of numbers using bit hack.
Then we want to add -1/+1 only if the numbers have different parity.
We can make this decisions only using bit operators.
You can find benchmark of this algorithm against two older here ->
http://quick-bench.com/hqhZWR7IB4IoUj3aLTN28dOUuPY . In this benchmark
you can see that algorithm works faster for signed types and equally
fast for unsigned types. Even if this algorithm uses more instructions it has higher
Block RThroughput as ilustrated here -> https://godbolt.org/z/5TDmr4 .