
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (/ y x) -1.0)))
(if (<= x -7.5e+45)
t_0
(if (<= x -5e-17)
1.0
(if (<= x -9.4e-144) (* x 0.5) (if (<= x 6.2e+46) 1.0 t_0))))))
double code(double x, double y) {
double t_0 = (y / x) + -1.0;
double tmp;
if (x <= -7.5e+45) {
tmp = t_0;
} else if (x <= -5e-17) {
tmp = 1.0;
} else if (x <= -9.4e-144) {
tmp = x * 0.5;
} else if (x <= 6.2e+46) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y / x) + (-1.0d0)
if (x <= (-7.5d+45)) then
tmp = t_0
else if (x <= (-5d-17)) then
tmp = 1.0d0
else if (x <= (-9.4d-144)) then
tmp = x * 0.5d0
else if (x <= 6.2d+46) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y / x) + -1.0;
double tmp;
if (x <= -7.5e+45) {
tmp = t_0;
} else if (x <= -5e-17) {
tmp = 1.0;
} else if (x <= -9.4e-144) {
tmp = x * 0.5;
} else if (x <= 6.2e+46) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (y / x) + -1.0 tmp = 0 if x <= -7.5e+45: tmp = t_0 elif x <= -5e-17: tmp = 1.0 elif x <= -9.4e-144: tmp = x * 0.5 elif x <= 6.2e+46: tmp = 1.0 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(y / x) + -1.0) tmp = 0.0 if (x <= -7.5e+45) tmp = t_0; elseif (x <= -5e-17) tmp = 1.0; elseif (x <= -9.4e-144) tmp = Float64(x * 0.5); elseif (x <= 6.2e+46) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (y / x) + -1.0; tmp = 0.0; if (x <= -7.5e+45) tmp = t_0; elseif (x <= -5e-17) tmp = 1.0; elseif (x <= -9.4e-144) tmp = x * 0.5; elseif (x <= 6.2e+46) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[x, -7.5e+45], t$95$0, If[LessEqual[x, -5e-17], 1.0, If[LessEqual[x, -9.4e-144], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 6.2e+46], 1.0, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x} + -1\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+45}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-17}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -9.4 \cdot 10^{-144}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+46}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -7.50000000000000058e45 or 6.1999999999999995e46 < x Initial program 100.0%
Taylor expanded in x around inf 82.8%
mul-1-neg82.8%
Simplified82.8%
Taylor expanded in x around 0 82.8%
if -7.50000000000000058e45 < x < -4.9999999999999999e-17 or -9.4000000000000004e-144 < x < 6.1999999999999995e46Initial program 100.0%
Taylor expanded in y around inf 58.8%
if -4.9999999999999999e-17 < x < -9.4000000000000004e-144Initial program 100.0%
Taylor expanded in y around 0 75.0%
Taylor expanded in x around 0 75.0%
*-commutative75.0%
Simplified75.0%
Final simplification70.0%
(FPCore (x y) :precision binary64 (if (<= x -7.2e+46) (+ (/ y x) -1.0) (if (<= x 3.4e+47) (/ (- x y) (- 2.0 y)) (+ (* 2.0 (/ y x)) -1.0))))
double code(double x, double y) {
double tmp;
if (x <= -7.2e+46) {
tmp = (y / x) + -1.0;
} else if (x <= 3.4e+47) {
tmp = (x - y) / (2.0 - y);
} else {
tmp = (2.0 * (y / x)) + -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-7.2d+46)) then
tmp = (y / x) + (-1.0d0)
else if (x <= 3.4d+47) then
tmp = (x - y) / (2.0d0 - y)
else
tmp = (2.0d0 * (y / x)) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -7.2e+46) {
tmp = (y / x) + -1.0;
} else if (x <= 3.4e+47) {
tmp = (x - y) / (2.0 - y);
} else {
tmp = (2.0 * (y / x)) + -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -7.2e+46: tmp = (y / x) + -1.0 elif x <= 3.4e+47: tmp = (x - y) / (2.0 - y) else: tmp = (2.0 * (y / x)) + -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -7.2e+46) tmp = Float64(Float64(y / x) + -1.0); elseif (x <= 3.4e+47) tmp = Float64(Float64(x - y) / Float64(2.0 - y)); else tmp = Float64(Float64(2.0 * Float64(y / x)) + -1.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -7.2e+46) tmp = (y / x) + -1.0; elseif (x <= 3.4e+47) tmp = (x - y) / (2.0 - y); else tmp = (2.0 * (y / x)) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -7.2e+46], N[(N[(y / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[x, 3.4e+47], N[(N[(x - y), $MachinePrecision] / N[(2.0 - y), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(y / x), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+46}:\\
\;\;\;\;\frac{y}{x} + -1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+47}:\\
\;\;\;\;\frac{x - y}{2 - y}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{y}{x} + -1\\
\end{array}
\end{array}
if x < -7.1999999999999997e46Initial program 100.0%
Taylor expanded in x around inf 87.6%
mul-1-neg87.6%
Simplified87.6%
Taylor expanded in x around 0 87.6%
if -7.1999999999999997e46 < x < 3.3999999999999998e47Initial program 100.0%
Taylor expanded in x around 0 92.9%
if 3.3999999999999998e47 < x Initial program 100.0%
clear-num100.0%
inv-pow100.0%
Applied egg-rr100.0%
Taylor expanded in x around -inf 78.2%
sub-neg78.2%
Simplified78.2%
Taylor expanded in y around inf 78.2%
Final simplification89.0%
(FPCore (x y)
:precision binary64
(if (<= x -1.6e+46)
-1.0
(if (<= x -1.2e-16)
1.0
(if (<= x -9.4e-144) (* x 0.5) (if (<= x 1e+41) 1.0 -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.6e+46) {
tmp = -1.0;
} else if (x <= -1.2e-16) {
tmp = 1.0;
} else if (x <= -9.4e-144) {
tmp = x * 0.5;
} else if (x <= 1e+41) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.6d+46)) then
tmp = -1.0d0
else if (x <= (-1.2d-16)) then
tmp = 1.0d0
else if (x <= (-9.4d-144)) then
tmp = x * 0.5d0
else if (x <= 1d+41) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.6e+46) {
tmp = -1.0;
} else if (x <= -1.2e-16) {
tmp = 1.0;
} else if (x <= -9.4e-144) {
tmp = x * 0.5;
} else if (x <= 1e+41) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.6e+46: tmp = -1.0 elif x <= -1.2e-16: tmp = 1.0 elif x <= -9.4e-144: tmp = x * 0.5 elif x <= 1e+41: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -1.6e+46) tmp = -1.0; elseif (x <= -1.2e-16) tmp = 1.0; elseif (x <= -9.4e-144) tmp = Float64(x * 0.5); elseif (x <= 1e+41) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.6e+46) tmp = -1.0; elseif (x <= -1.2e-16) tmp = 1.0; elseif (x <= -9.4e-144) tmp = x * 0.5; elseif (x <= 1e+41) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.6e+46], -1.0, If[LessEqual[x, -1.2e-16], 1.0, If[LessEqual[x, -9.4e-144], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 1e+41], 1.0, -1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+46}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-16}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -9.4 \cdot 10^{-144}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 10^{+41}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -1.5999999999999999e46 or 1.00000000000000001e41 < x Initial program 100.0%
Taylor expanded in x around inf 81.7%
if -1.5999999999999999e46 < x < -1.20000000000000002e-16 or -9.4000000000000004e-144 < x < 1.00000000000000001e41Initial program 100.0%
Taylor expanded in y around inf 58.9%
if -1.20000000000000002e-16 < x < -9.4000000000000004e-144Initial program 100.0%
Taylor expanded in y around 0 75.0%
Taylor expanded in x around 0 75.0%
*-commutative75.0%
Simplified75.0%
Final simplification69.8%
(FPCore (x y) :precision binary64 (if (or (<= y -1.45e+16) (not (<= y 4.5e+109))) (/ (- y x) y) (/ x (- 2.0 x))))
double code(double x, double y) {
double tmp;
if ((y <= -1.45e+16) || !(y <= 4.5e+109)) {
tmp = (y - x) / y;
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.45d+16)) .or. (.not. (y <= 4.5d+109))) then
tmp = (y - x) / y
else
tmp = x / (2.0d0 - x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.45e+16) || !(y <= 4.5e+109)) {
tmp = (y - x) / y;
} else {
tmp = x / (2.0 - x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.45e+16) or not (y <= 4.5e+109): tmp = (y - x) / y else: tmp = x / (2.0 - x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.45e+16) || !(y <= 4.5e+109)) tmp = Float64(Float64(y - x) / y); else tmp = Float64(x / Float64(2.0 - x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.45e+16) || ~((y <= 4.5e+109))) tmp = (y - x) / y; else tmp = x / (2.0 - x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.45e+16], N[Not[LessEqual[y, 4.5e+109]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+16} \lor \neg \left(y \leq 4.5 \cdot 10^{+109}\right):\\
\;\;\;\;\frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 - x}\\
\end{array}
\end{array}
if y < -1.45e16 or 4.4999999999999996e109 < y Initial program 100.0%
Taylor expanded in y around inf 85.6%
neg-mul-185.6%
Simplified85.6%
frac-2neg85.6%
div-inv85.3%
sub-neg85.3%
distribute-neg-in85.3%
remove-double-neg85.3%
remove-double-neg85.3%
Applied egg-rr85.3%
associate-*r/85.6%
+-commutative85.6%
sub-neg85.6%
*-rgt-identity85.6%
Simplified85.6%
if -1.45e16 < y < 4.4999999999999996e109Initial program 100.0%
Taylor expanded in y around 0 74.7%
Final simplification79.1%
(FPCore (x y) :precision binary64 (if (<= y -1.3e+16) 1.0 (if (<= y 5.2e+95) (/ x (- 2.0 x)) 1.0)))
double code(double x, double y) {
double tmp;
if (y <= -1.3e+16) {
tmp = 1.0;
} else if (y <= 5.2e+95) {
tmp = x / (2.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.3d+16)) then
tmp = 1.0d0
else if (y <= 5.2d+95) then
tmp = x / (2.0d0 - x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.3e+16) {
tmp = 1.0;
} else if (y <= 5.2e+95) {
tmp = x / (2.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.3e+16: tmp = 1.0 elif y <= 5.2e+95: tmp = x / (2.0 - x) else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.3e+16) tmp = 1.0; elseif (y <= 5.2e+95) tmp = Float64(x / Float64(2.0 - x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.3e+16) tmp = 1.0; elseif (y <= 5.2e+95) tmp = x / (2.0 - x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.3e+16], 1.0, If[LessEqual[y, 5.2e+95], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+16}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+95}:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.3e16 or 5.19999999999999981e95 < y Initial program 100.0%
Taylor expanded in y around inf 84.5%
if -1.3e16 < y < 5.19999999999999981e95Initial program 100.0%
Taylor expanded in y around 0 75.0%
Final simplification78.9%
(FPCore (x y) :precision binary64 (if (<= y -1.2e+15) 1.0 (if (<= y 1.3e+98) -1.0 1.0)))
double code(double x, double y) {
double tmp;
if (y <= -1.2e+15) {
tmp = 1.0;
} else if (y <= 1.3e+98) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.2d+15)) then
tmp = 1.0d0
else if (y <= 1.3d+98) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.2e+15) {
tmp = 1.0;
} else if (y <= 1.3e+98) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.2e+15: tmp = 1.0 elif y <= 1.3e+98: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.2e+15) tmp = 1.0; elseif (y <= 1.3e+98) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.2e+15) tmp = 1.0; elseif (y <= 1.3e+98) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.2e+15], 1.0, If[LessEqual[y, 1.3e+98], -1.0, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+15}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+98}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.2e15 or 1.3e98 < y Initial program 100.0%
Taylor expanded in y around inf 84.5%
if -1.2e15 < y < 1.3e98Initial program 100.0%
Taylor expanded in x around inf 52.9%
Final simplification65.9%
(FPCore (x y) :precision binary64 -1.0)
double code(double x, double y) {
return -1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -1.0d0
end function
public static double code(double x, double y) {
return -1.0;
}
def code(x, y): return -1.0
function code(x, y) return -1.0 end
function tmp = code(x, y) tmp = -1.0; end
code[x_, y_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 100.0%
Taylor expanded in x around inf 38.0%
Final simplification38.0%
(FPCore (x y) :precision binary64 (let* ((t_0 (- 2.0 (+ x y)))) (- (/ x t_0) (/ y t_0))))
double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = 2.0d0 - (x + y)
code = (x / t_0) - (y / t_0)
end function
public static double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
def code(x, y): t_0 = 2.0 - (x + y) return (x / t_0) - (y / t_0)
function code(x, y) t_0 = Float64(2.0 - Float64(x + y)) return Float64(Float64(x / t_0) - Float64(y / t_0)) end
function tmp = code(x, y) t_0 = 2.0 - (x + y); tmp = (x / t_0) - (y / t_0); end
code[x_, y_] := Block[{t$95$0 = N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]}, N[(N[(x / t$95$0), $MachinePrecision] - N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 - \left(x + y\right)\\
\frac{x}{t_0} - \frac{y}{t_0}
\end{array}
\end{array}
herbie shell --seed 2023334
(FPCore (x y)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, C"
:precision binary64
:herbie-target
(- (/ x (- 2.0 (+ x y))) (/ y (- 2.0 (+ x y))))
(/ (- x y) (- 2.0 (+ x y))))