  We study the joint distribution of the solutions to the equation $gh=x$ in
$G(\mathbb{F}_p)$ as $p\to\infty$, for any fixed $x\in G(\mathbb{Z})$, where
$G=\operatorname{GL}_n$, $\operatorname{SL}_n$, $\operatorname{Sp}_{2n}$ or
$\operatorname{SO}_{n}^\pm$. In the special linear case, this answers in
particular a question raised by S. Hu and Y. Li, and improves their error
terms. Similar results are derived in certain subgroups, and when the entries
of $g,h$ lie in fixed intervals. The latter shows for example the existence of
$g\in\operatorname{GL}_n(\mathbb{F}_p)$ such that $g,g^{-1}$ have all entries
in $[0, c_np^{1-1/(2n^2+2)+\varepsilon}]$ for some absolute constant $c_n>0$.
The key for these results is to use Deligne's extension of the Weil conjectures
on a sheaf on $G$, along with the stratification theorem of Fouvry, Katz and
Laumon, instead of reducing to bounds on classical Kloosterman sums.
