Compute the relative distance between two values.
This function can be overloaded in the tts namespace to compute the relative distance for external types.