5

Is it possible to reformulate this expression to only list $x$ and $y$ once using common math functions? The ranges of $x$ and $y$ are both $0$ to $1$ inclusive if that helps.

Common being those typically found on a scientific calculator.

Arctic Char
  • 16,007
Chris
  • 230

2 Answers2

5

This is slightly more complicated, but $\frac{1}{1+\frac{y}{x}}$ is one possibility.

Aaa Lol_dude
  • 1,624
  • 4
  • 22
  • 1
    Not to be a pedant, but I would argue that this is not technically a reformulation, as it doesn't include the possibility of $x = 0$ (which is explicitly included in the question). – Theo Bendit Oct 13 '21 at 23:38
  • if x = 0 then there is no need for reformulaton. – Aaa Lol_dude Oct 13 '21 at 23:40
4

First, if $x=0$ then $$\frac{x}{x+y}=\frac{0}{y}=0$$ provided $y\neq 0$. As $x,y\in[0,1]$, it follows that we exclude the case $x=y=0$. More specially, if $x=0$ then $y\neq 0$ and if $y=0$ then $x\neq 0$. Next, if $x+y\neq 0$ then we may let $$A=\frac{x}{x+y}.$$ Taking the reciprocal of $A$ gives

$$\frac{1}{A}=\frac{x+y}{x}=1+\frac{y}{x}.$$

Then since the reciprocal of the reciprocal is our original function we have

$$A=\frac{1}{\left(\frac{1}{A}\right)}=\frac{1}{1+\frac{y}{x}}.$$ By our analysis above, we see that this is true provided $x\neq 0$ and $x \neq -y$. Since $x,y\in[0,1]$, the second condition is only valid when $x=y=0$ which we excluded.

Axion004
  • 10,056
  • 1
    Indeed it's a simple check for near zero within a tolerance to avoid floating point underflow. :) – Chris Oct 31 '21 at 14:29