Let a and b be the two numbers. Then
a + b = -4
a b = -2
Solve the second equation for b :
b = -2/a
Substitute this into the first equation:
a - 2/a = -4
Multiply both sides by a :
a² - 2 = -4a
Move 4a to the left side:
a² + 4a - 2 = 0
Use the quadratic formula to solve for a :
a = (-4 ± √(4² - 4(-2))) / 2
a = -2 ± √6
If a = -2 + √6, then
-2 + √6 + b = -4
b = -2 - √6
In the other case, we end up with the same numbers, but a and b are swapped.