Function which evaluates conditionally?
Rather than calculating the distance between two points on the fly, you can narrow your selection by approximation.
Since we know that one degree of latitude is a nearly-constant 111km, a search for locations within 100km should rule out points greater than one degree of latitude distant.
Longitude is more complex because of the latitudinal delta (~111km per degree at the equator to 0 at the poles), but there are ways to approximate it. One method would be to simply calculate, in advance, the distance between degrees of longitude for each whole degree of latitude and store the result in a table. That table could be joined on the search target table using a rounded value for the input latitude.
Movable Type has a well-known, informative page dedicated to great circle navigation and related calculations.
Note: I realize this doesn't answer the actual question, but it does address the underlying need for a performant method of lat-long distance calculation, which I hope is helpful.