Let $M \in \mathbb{Z}_{n \times n}$ be a square matrix with integer coefficients. Let $P(x)$ be its characteristic polynomial $ P(x) = \det\left(x \cdot \mathbb{I}_{n \times n}- M\right) $ I would like to compute the discriminant of $P(x)$, and I am wondering if it can be obtained from $M$ directly.
The intent is to determine whether $M$ has distinct eigenvalues.
I am looking for references, ideas, algorithms. Thank you.