Reimplement compute_distance2outer and compute_distance2inner in C