Double precision GPU implementation of exponentiating by squaring for Matrices