Every signal matches every function that is defined over the same range... to within some error margin.
You need to figure out what you want your error margin to be, and you need to decide whether a longer stretch whose error margin is within the cut-off is to be accepted if there is a sub-sequence over which the error margin is exceeded.