Given a point x and a direction v, we find the overlap between E[f'(x)] and
v. The emulated derivative has uncertainty associated with it: the variance is taken
into account using \(v^{T} Var[f'(x)] v\).
If sd == NULL, then only the (normed) overlap between the derivative and the direction
vector is returned. Otherwise a pair of values are returned: these are the normed overlap plus
or minus sd times the uncertainty.
This function is concerned with ascertaining whether a direction is oriented in the direction
of the emulator gradient, subject to the uncertainty around the estimate of the derivative.
It allows for a consideration of "emulated gradient descent".