FIX formula inversion for sample-based precision/recall