A new H2-matrix-based representation of electrodynamic systems with minimized rank and prescribed accuracy