For a given u \in \mathbb{R}^n, this method efficiently calculates the Hessian-vector product H(x)u .
The method works by first using forward AD to perform f(x) \rightarrow u^T\nabla f(x), subsequently the method then calculates the gradient of u^T \nabla f(x) using Reverse AD to yield \nabla \left( u \cdot \nabla f(x)\right) = u^T H(x) = (H(x)u)^T.