The radius d of the 4th circle is given by the Descartes formula 2(1/a² + 1/b² + 1/c² + 1/d²) = (1/a + 1/b + 1/c + 1/d)²
which, solved in d, gives
d= abc/(ab + bc + ac ± 2√abc(a + b + c))
This formula may give d infinite (the 4th circle is a straight line) or d < 0 (the 4th circle surrounds the others)
At most one of the 4 circles may surround the 3 other.
The script gives an exact value as (P + u√v)/Q if a,b,c are integers