Eigenvalue computation using automatic differentiation to choose shifts