eval_distance function

Evaluates a distance function and checks for correct output format