The Efficient Application of Automatic Differentiation for Computing Gradients in Financial Applications