  ${\cal H}^2$-matrix constitutes a general mathematical framework for
efficient computation of both partial-differential-equation and
integral-equation-based operators. Existing linear-complexity ${\cal H}^2$
matrix-matrix product (MMP) algorithm lacks explicit accuracy control, while
controlling accuracy without compromising linear complexity is challenging. In
this paper, we develop an accuracy controlled ${\cal H}^2$ matrix-matrix
product algorithm by instantaneously changing the cluster bases during the
matrix product computation based on prescribed accuracy. Meanwhile, we retain
the computational complexity of the overall algorithm to be linear. Different
from the existing ${\cal H}^2$ matrix-matrix product algorithm where formatted
multiplications are performed using the original cluster bases, in the proposed
algorithm, all additions and multiplications are either exact or computed based
on prescribed accuracy. Furthermore, the original ${\cal H}^2$-matrix structure
is preserved in the matrix product. While achieving optimal complexity for
constant-rank matrices, the computational complexity of the proposed algorithm
is also minimized for variable-rank ${\cal H}^2$-matrices. The proposed work
serves as a fundamental arithmetic in the development of fast solvers for
large-scale electromagnetic analysis. Applications to both large-scale
capacitance extraction and electromagnetic scattering problems involving
millions of unknowns on a single core have demonstrated the accuracy and
efficiency of the proposed algorithm.
