Algorithm to show how far away a value is from another

Disclaimer: This is a very very difficult question about mathematics and algorithms (in my opinion) – so respect to anyone who makes this. I admire you. I would like to evaluate the performance of my …