Flatness of differentiable functions along a subset of a real analytic set