Fast computation of real eigenvalues of special $4\times 4$ matrix For distance calculations between ellipses$^1$, I have to find the real eigenvalues of a lot of $4\times 4$ matrices that have the shape
$$\left[ \begin{matrix} -2a & b & 2a & a^2 \\ 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\0&0&1&0 \end{matrix}\right]\tag{1}$$ with $a,b\in \mathbb{R}$ and characteristic polynomial
$$\lambda^4+2a\lambda^3-b\lambda^2-2a\lambda-a^2=0.\tag{2}$$ In the given situation we have $a\approx -10^7$ and $b\approx-10^{14}$. This leads to the observation that the $4$ eigenvalues are always a pair of complex conjugated eigenvalues $\rho = q \pm ir$ and a pair of real eigenvalues $\pm m$. Both pairs are not mathematically identical but identical up to floating point precision that is sufficient for this case.
There is some redundancy as the complex solutions are not needed and the real solutions can be considered identical (except of sign) for practical reasons.
Does this redundancy allow for faster solving of the polynomial to get |m|?
Example
$a=-10^7, b=-3\times 10^{14}$
Eigenvalues (identical only up to floating point precision): $\pm 0.57735, (1\pm i1.41421)10^7 $
Of interest for fast calculation would be only $|m|=0.57735$.
Solution
In the comments the solution
$m\approx |a|/\sqrt{-b}$ was given that seems acceptable for the given number range.

$^1$ Ik-Sung Kim: An algorithm for finding the distance between two ellipses, Commun. Korean Math. Soc.  21, 559 (2006).
 A: The assertion that there are two eigenvalues $\rho = q + ir$ and $\rho^*$ and two $\pm m$ implies that $a$ and $b$ are not separately free parameters. It is equivalent to stating that the characteristic polynomial factorizes as
$$
\lambda^4 + 2a\lambda^3 - b \lambda^2 - 2a \lambda - a^2 = (\lambda^2 - m^2) (\lambda^2 -2q \lambda + \left| \rho \right|^2) = \lambda^4 - 2 q \lambda^3 + \left( \left| \rho \right|^2 - m^2 \right) \lambda^2 + 2qm^2 \lambda - m^2 \left| \rho \right|^2 
$$
Matching coefficients, we have
$$
2a = -2q \\
-b = \left| \rho \right|^2 - m^2 \\
-2a = 2qm^2 \\
-a^2 = - m^2 \left| \rho \right|^2
$$
This has the the solutions $q = -a$ and $m = 1$, from the first and third equations (the sign of $m$ is arbitrary). So, $\rho = -a + ir$ and $\left| \rho \right|^2 = a^2 + r^2$. Then the second and fourth equations become
$$
-b = a^2 + r^2 - 1 \\
-a^2 = -\left| \rho \right|^2 = -a^2-r^2
$$
The latter requires that $r=0$, and therefore the former requires that
$$
b = 1-a^2.
$$
The eigenvalues are, in summary, $\pm 1$ and a double-valued real solution $-a$.

If the two real solutions are not exactly equal, that makes things much harder. Let the roots be $\pm m - \delta$:
$$
\lambda^4 + 2a\lambda^3 - b \lambda^2 - 2a \lambda - a^2 = \left(\lambda -m +\delta \right) \left( \lambda + m + \delta \right) (\lambda^2 -2q \lambda + \left| \rho \right|^2) \\
= \lambda^4 -2(q+\delta) \lambda^3 + \left( \left| \rho \right|^2 + 4 \delta q - m^2 + \delta^2 \right) \lambda^2 + 2(qm^2-q\delta^2-\delta \left| \rho \right|^2 ) \lambda - (m^2-\delta)^2 \left| \rho \right|^2 
$$
Matching terms again gives
$$
a = -q - \delta \\
-b = \left| \rho \right|^2 + 4 \delta q - m^2 + \delta^2 \\
-a = qm^2-q\delta^2-\delta \left| \rho \right|^2 \\
a^2 = (m^2-\delta)^2 \left| \rho \right|^2 
$$
The first equation can be used to eliminate $q$, equal to $-a-\delta$, yielding
$$
-b = (a+\delta)^2 + r^2 - 4 \delta (a+\delta) - m^2 + \delta^2
$$
$$
a = (a+\delta)(m^2-\delta^2)+\delta \left( (a+\delta)^2 + r^2 \right) $$
$$
a^2 = (m^2-\delta)^2 \left( (a+\delta)^2 + r^2 \right)
$$
These are three equations for $\delta$, $r$, and $m$. I am not going to proceed further, but with some effort, it might be possible to eliminate variables and solve for $\delta$. Note that currently they are no simpler than the original (the fourth in particular is quartic in $\delta$), but it may also be useful to simply solve this to first order in $\delta$, since it is empirically small.
