An interesting optimization problem to find $(x+y),(x−y),(−x+y),(−x−y)$ such that their result should be exaclty or close to $\pm 2$? I have a very interesting problem. I am not sure if I can solve the problem:
Let $x,y \in R;x,y \ne 0$.
Now $x,y$ has four operation. $(x+y),(x-y),(-x+y),(-x-y)$.
My aim is to find the result of the four operation should be either $+2$ or $-2$.
The only possibility is if $x=2$, $y$ should be zero. and if $y=2$, $x$ has to be zero.
I cannot change the value of $x$ and $y$. One way of finding the result of  operations stated above very close to $\pm 2$ if I find $x$, $y$ such that  $x/y= \pm \epsilon$ and $y/x= 2\pm \epsilon$, Where $\epsilon$ is very small. I don't know If I can use some technique on the real line.
Is there any way I can choose $x,y \in R$, $x,y \ne 0$ such that the result of the four operation stated above will be very exactly or very close to $\pm 2$?
 A: You can introduce an error measure for your problem.
Let's call your operations $o_1, \cdots, o_4$. Then you want $o_i^2 = 4$. So a typical quadratic error measure would be $E = \sum_{i = 1}^4 (o_i^2 - 4)^2$ and when everything is exact, $E=0$ should be achieved.
Evaluating gives $E =  16x^2y^2 + 4(x^2 + y^2 - 4)^2$ and since this is the sum of two squares, making it zero only works with $(x,y) = (0,\pm 2)$ or $(x,y) = (\pm 2, 0)$ so this establishes what you already said.
However, the error measure does more: it gives you a handle on how good an approximate solution is. Putting $x = \epsilon$ and $y = 2+\delta$ gives
$E = 16\epsilon^2(2+\delta)^2 + 4(\epsilon^2 + 4\delta + \delta^2)^2$.
For very small  $\epsilon$ and $\delta$,     in leading (smallest) order, you have $E = 64(\epsilon^2 +\delta^2)$ which means that your quadratic error is equally  sensitive to the deviations from $y=2$ and $x=0$ (or any other exact value combination). Since again this is the sum of two squares, the total error cannot be made smaller than (proportional to) the second power of the deviations.
