Loosely matching rhymes for arbitrary function