I have $p_1 = xy$ and the distance between $x$ and $y$ is $d = |x-y|$.
I don’t know the values of $x$ and $y$ but I know the product and distance between them, I want to get new product $p_2$ after moving or shifting $x$ and $y$ by value $s$. I can solve it using quadratic equation based on equations $xy=p_1$ and $|x-y|=d$ but is there a function of $(p_1, d,s)$ to get new value $p_2$ without quadratic equation?
Hints
You are looking for $$ (x-s)(y-s) = xy - s(x+y) + s^2. $$ Since $xy$ and $s$ are known, the only thing you need is $x+y$. To get it, note that $$ (x+y)^2 = (x-y)^2 + 4xy, $$ and again both items on the RHS are known...
Warning The quadraticity of the last equation will allow for both positive and negative values of $x+y$