Interesting! When you assess the equality on a neighborhood, what's the algorithm that decides on the number and location of samples?
For polynomial functions, it's clear how many samples to use; what about others? Do you settle on a magic constant and call it a day?