Given a monic polyomial $P(x)=x^d+r_{d-1}x^{d-1}+\cdots+a_1r+a_0\in\mathbb{R}[x]$ is there a way to manipulate the coefficients of $P$ in an algebraic way such that the new polynomial has exactly as many simple real roots as $P$ has pairs of twofold roots? For example if $d=9$ and
$$P(x)=x^9-15x^8+95x^7-333x^6+719x^5-1029x^4+1057x^3-819x^2+432x-108=(x-1)^2(x-2)^2(x-3)^3(x^2+1)$$
then the transformed polynomial (the coefficients of which should be polynomial expressions in $r_0,\ldots,r_8$) should have exactly two simple real root corresponding to the twofold roots $1$ and $2$ of $P$ (it can have an arbitrary amount of additional multiple real roots or complex roots though).
One trick that almost does it is $Q(x)=P(x)^2+P'(x)^2$. This polynomial has no simple real roots and its twofold real roots are exactly the twofold real roots of $P$. If there was a way to reduce the multiplicity of the twofold real roots without introducing new real roots this would be the solution.
Another idea is to take $\gcd(P(x),P'(x))$ which has exactly as many simple real roots as $P$ has twofold roots. But one cannot compute the gcd in an alebraic way. One needs to know $P$ in order to use the Euclidean algorithm.