On Computing with Diagonally Structured Matrices