An algebra for the propagation of errors in matrix calculus