Geometry distance PostGIS query with <-> operator suddenly much slower

$e^{-x}$ will do the trick. If it's any easier, the same is true for any base value greater than 1. So $2^{-x}$ also works. Higher values approach 0 more quickly with respect to $x$.


Another possibility is hyperbolic decay, which is slower than exponential decay:

$$f_\alpha(x)=\frac{1}{\alpha x + 1} $$

Where $\alpha > 0$ is a scaling factor. The larger $\alpha$, the steeper the descent towards $0$.

Here's a plot to compare:

Plot of hyperbolic and vs. exponential decay


This function maps (0,inf) to (0,1):

$$f(x)=1 - \frac{2\arctan(x)}{\pi}$$

You can replace x in the formula with a polynomial or any other function mapping (0, inf) to (0, inf) to alter the rate of change.