Svag matchende rim for arbitrary function