Optimized Sparse Matrix Operations for Reverse Mode Automatic Differentiation