
(FPCore (x y) :precision binary64 (/ (- x y) (+ x y)))
double code(double x, double y) {
return (x - y) / (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (x + y)
end function
public static double code(double x, double y) {
return (x - y) / (x + y);
}
def code(x, y): return (x - y) / (x + y)
function code(x, y) return Float64(Float64(x - y) / Float64(x + y)) end
function tmp = code(x, y) tmp = (x - y) / (x + y); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{x + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (- x y) (+ x y)))
double code(double x, double y) {
return (x - y) / (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (x + y)
end function
public static double code(double x, double y) {
return (x - y) / (x + y);
}
def code(x, y): return (x - y) / (x + y)
function code(x, y) return Float64(Float64(x - y) / Float64(x + y)) end
function tmp = code(x, y) tmp = (x - y) / (x + y); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{x + y}
\end{array}
(FPCore (x y) :precision binary64 (- (/ x (+ x y)) (/ y (+ x y))))
double code(double x, double y) {
return (x / (x + y)) - (y / (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) - (y / (x + y))
end function
public static double code(double x, double y) {
return (x / (x + y)) - (y / (x + y));
}
def code(x, y): return (x / (x + y)) - (y / (x + y))
function code(x, y) return Float64(Float64(x / Float64(x + y)) - Float64(y / Float64(x + y))) end
function tmp = code(x, y) tmp = (x / (x + y)) - (y / (x + y)); end
code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{x + y} - \frac{y}{x + y}
\end{array}
Initial program 99.9%
div-sub100.0%
Applied egg-rr100.0%
(FPCore (x y) :precision binary64 (if (or (<= y -3.2e-57) (not (<= y 2.2e+15))) (+ (* 2.0 (/ x y)) -1.0) (+ 1.0 (* -2.0 (/ y x)))))
double code(double x, double y) {
double tmp;
if ((y <= -3.2e-57) || !(y <= 2.2e+15)) {
tmp = (2.0 * (x / y)) + -1.0;
} else {
tmp = 1.0 + (-2.0 * (y / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-3.2d-57)) .or. (.not. (y <= 2.2d+15))) then
tmp = (2.0d0 * (x / y)) + (-1.0d0)
else
tmp = 1.0d0 + ((-2.0d0) * (y / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -3.2e-57) || !(y <= 2.2e+15)) {
tmp = (2.0 * (x / y)) + -1.0;
} else {
tmp = 1.0 + (-2.0 * (y / x));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -3.2e-57) or not (y <= 2.2e+15): tmp = (2.0 * (x / y)) + -1.0 else: tmp = 1.0 + (-2.0 * (y / x)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -3.2e-57) || !(y <= 2.2e+15)) tmp = Float64(Float64(2.0 * Float64(x / y)) + -1.0); else tmp = Float64(1.0 + Float64(-2.0 * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -3.2e-57) || ~((y <= 2.2e+15))) tmp = (2.0 * (x / y)) + -1.0; else tmp = 1.0 + (-2.0 * (y / x)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -3.2e-57], N[Not[LessEqual[y, 2.2e+15]], $MachinePrecision]], N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 + N[(-2.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-57} \lor \neg \left(y \leq 2.2 \cdot 10^{+15}\right):\\
\;\;\;\;2 \cdot \frac{x}{y} + -1\\
\mathbf{else}:\\
\;\;\;\;1 + -2 \cdot \frac{y}{x}\\
\end{array}
\end{array}
if y < -3.2000000000000001e-57 or 2.2e15 < y Initial program 99.9%
Taylor expanded in x around 0 77.0%
if -3.2000000000000001e-57 < y < 2.2e15Initial program 99.9%
Taylor expanded in y around 0 75.5%
Final simplification76.3%
(FPCore (x y) :precision binary64 (if (<= y -3.4e-57) (/ (- x y) y) (if (<= y 8.5e+16) (+ 1.0 (* -2.0 (/ y x))) (/ y (- (- x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -3.4e-57) {
tmp = (x - y) / y;
} else if (y <= 8.5e+16) {
tmp = 1.0 + (-2.0 * (y / x));
} else {
tmp = y / (-x - y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-3.4d-57)) then
tmp = (x - y) / y
else if (y <= 8.5d+16) then
tmp = 1.0d0 + ((-2.0d0) * (y / x))
else
tmp = y / (-x - y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.4e-57) {
tmp = (x - y) / y;
} else if (y <= 8.5e+16) {
tmp = 1.0 + (-2.0 * (y / x));
} else {
tmp = y / (-x - y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.4e-57: tmp = (x - y) / y elif y <= 8.5e+16: tmp = 1.0 + (-2.0 * (y / x)) else: tmp = y / (-x - y) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.4e-57) tmp = Float64(Float64(x - y) / y); elseif (y <= 8.5e+16) tmp = Float64(1.0 + Float64(-2.0 * Float64(y / x))); else tmp = Float64(y / Float64(Float64(-x) - y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.4e-57) tmp = (x - y) / y; elseif (y <= 8.5e+16) tmp = 1.0 + (-2.0 * (y / x)); else tmp = y / (-x - y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.4e-57], N[(N[(x - y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 8.5e+16], N[(1.0 + N[(-2.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[((-x) - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-57}:\\
\;\;\;\;\frac{x - y}{y}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+16}:\\
\;\;\;\;1 + -2 \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\left(-x\right) - y}\\
\end{array}
\end{array}
if y < -3.40000000000000016e-57Initial program 99.9%
Taylor expanded in x around 0 72.3%
if -3.40000000000000016e-57 < y < 8.5e16Initial program 99.9%
Taylor expanded in y around 0 75.5%
if 8.5e16 < y Initial program 99.9%
Taylor expanded in x around 0 82.0%
neg-mul-182.0%
Simplified82.0%
Final simplification76.1%
(FPCore (x y) :precision binary64 (if (<= y -650000.0) (/ (- x y) y) (if (<= y 125000000.0) (/ x (+ x y)) (/ y (- (- x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -650000.0) {
tmp = (x - y) / y;
} else if (y <= 125000000.0) {
tmp = x / (x + y);
} else {
tmp = y / (-x - y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-650000.0d0)) then
tmp = (x - y) / y
else if (y <= 125000000.0d0) then
tmp = x / (x + y)
else
tmp = y / (-x - y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -650000.0) {
tmp = (x - y) / y;
} else if (y <= 125000000.0) {
tmp = x / (x + y);
} else {
tmp = y / (-x - y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -650000.0: tmp = (x - y) / y elif y <= 125000000.0: tmp = x / (x + y) else: tmp = y / (-x - y) return tmp
function code(x, y) tmp = 0.0 if (y <= -650000.0) tmp = Float64(Float64(x - y) / y); elseif (y <= 125000000.0) tmp = Float64(x / Float64(x + y)); else tmp = Float64(y / Float64(Float64(-x) - y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -650000.0) tmp = (x - y) / y; elseif (y <= 125000000.0) tmp = x / (x + y); else tmp = y / (-x - y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -650000.0], N[(N[(x - y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 125000000.0], N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(y / N[((-x) - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -650000:\\
\;\;\;\;\frac{x - y}{y}\\
\mathbf{elif}\;y \leq 125000000:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\left(-x\right) - y}\\
\end{array}
\end{array}
if y < -6.5e5Initial program 99.9%
Taylor expanded in x around 0 75.0%
if -6.5e5 < y < 1.25e8Initial program 99.9%
Taylor expanded in x around inf 73.2%
if 1.25e8 < y Initial program 99.9%
Taylor expanded in x around 0 82.0%
neg-mul-182.0%
Simplified82.0%
Final simplification75.7%
(FPCore (x y) :precision binary64 (if (or (<= y -11500.0) (not (<= y 18000000.0))) (/ (- x y) y) (/ x (+ x y))))
double code(double x, double y) {
double tmp;
if ((y <= -11500.0) || !(y <= 18000000.0)) {
tmp = (x - y) / y;
} else {
tmp = x / (x + y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-11500.0d0)) .or. (.not. (y <= 18000000.0d0))) then
tmp = (x - y) / y
else
tmp = x / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -11500.0) || !(y <= 18000000.0)) {
tmp = (x - y) / y;
} else {
tmp = x / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -11500.0) or not (y <= 18000000.0): tmp = (x - y) / y else: tmp = x / (x + y) return tmp
function code(x, y) tmp = 0.0 if ((y <= -11500.0) || !(y <= 18000000.0)) tmp = Float64(Float64(x - y) / y); else tmp = Float64(x / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -11500.0) || ~((y <= 18000000.0))) tmp = (x - y) / y; else tmp = x / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -11500.0], N[Not[LessEqual[y, 18000000.0]], $MachinePrecision]], N[(N[(x - y), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -11500 \lor \neg \left(y \leq 18000000\right):\\
\;\;\;\;\frac{x - y}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y}\\
\end{array}
\end{array}
if y < -11500 or 1.8e7 < y Initial program 99.9%
Taylor expanded in x around 0 78.3%
if -11500 < y < 1.8e7Initial program 99.9%
Taylor expanded in x around inf 73.2%
Final simplification75.6%
(FPCore (x y) :precision binary64 (if (<= y -95000.0) -1.0 (if (<= y 3600000000000.0) (/ x (+ x y)) -1.0)))
double code(double x, double y) {
double tmp;
if (y <= -95000.0) {
tmp = -1.0;
} else if (y <= 3600000000000.0) {
tmp = x / (x + y);
} 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 <= (-95000.0d0)) then
tmp = -1.0d0
else if (y <= 3600000000000.0d0) then
tmp = x / (x + y)
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -95000.0) {
tmp = -1.0;
} else if (y <= 3600000000000.0) {
tmp = x / (x + y);
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -95000.0: tmp = -1.0 elif y <= 3600000000000.0: tmp = x / (x + y) else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -95000.0) tmp = -1.0; elseif (y <= 3600000000000.0) tmp = Float64(x / Float64(x + y)); else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -95000.0) tmp = -1.0; elseif (y <= 3600000000000.0) tmp = x / (x + y); else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -95000.0], -1.0, If[LessEqual[y, 3600000000000.0], N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision], -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -95000:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 3600000000000:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if y < -95000 or 3.6e12 < y Initial program 99.9%
Taylor expanded in x around 0 77.6%
if -95000 < y < 3.6e12Initial program 99.9%
Taylor expanded in x around inf 73.2%
(FPCore (x y) :precision binary64 (if (<= y -1.1e-8) -1.0 (if (<= y 80000000000.0) (- 1.0 (/ y x)) -1.0)))
double code(double x, double y) {
double tmp;
if (y <= -1.1e-8) {
tmp = -1.0;
} else if (y <= 80000000000.0) {
tmp = 1.0 - (y / 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.1d-8)) then
tmp = -1.0d0
else if (y <= 80000000000.0d0) then
tmp = 1.0d0 - (y / x)
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.1e-8) {
tmp = -1.0;
} else if (y <= 80000000000.0) {
tmp = 1.0 - (y / x);
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.1e-8: tmp = -1.0 elif y <= 80000000000.0: tmp = 1.0 - (y / x) else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -1.1e-8) tmp = -1.0; elseif (y <= 80000000000.0) tmp = Float64(1.0 - Float64(y / x)); else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.1e-8) tmp = -1.0; elseif (y <= 80000000000.0) tmp = 1.0 - (y / x); else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.1e-8], -1.0, If[LessEqual[y, 80000000000.0], N[(1.0 - N[(y / x), $MachinePrecision]), $MachinePrecision], -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-8}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 80000000000:\\
\;\;\;\;1 - \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if y < -1.0999999999999999e-8 or 8e10 < y Initial program 99.9%
Taylor expanded in x around 0 77.1%
if -1.0999999999999999e-8 < y < 8e10Initial program 99.9%
Taylor expanded in x around inf 73.5%
Taylor expanded in x around inf 73.4%
mul-1-neg73.4%
unsub-neg73.4%
Simplified73.4%
(FPCore (x y) :precision binary64 (if (<= y -3200000.0) -1.0 (if (<= y 8000000000.0) 1.0 -1.0)))
double code(double x, double y) {
double tmp;
if (y <= -3200000.0) {
tmp = -1.0;
} else if (y <= 8000000000.0) {
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 <= (-3200000.0d0)) then
tmp = -1.0d0
else if (y <= 8000000000.0d0) 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 <= -3200000.0) {
tmp = -1.0;
} else if (y <= 8000000000.0) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3200000.0: tmp = -1.0 elif y <= 8000000000.0: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -3200000.0) tmp = -1.0; elseif (y <= 8000000000.0) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3200000.0) tmp = -1.0; elseif (y <= 8000000000.0) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3200000.0], -1.0, If[LessEqual[y, 8000000000.0], 1.0, -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3200000:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 8000000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if y < -3.2e6 or 8e9 < y Initial program 99.9%
Taylor expanded in x around 0 77.6%
if -3.2e6 < y < 8e9Initial program 99.9%
Taylor expanded in x around inf 72.4%
(FPCore (x y) :precision binary64 (/ 1.0 (/ (+ x y) (- x y))))
double code(double x, double y) {
return 1.0 / ((x + y) / (x - y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / ((x + y) / (x - y))
end function
public static double code(double x, double y) {
return 1.0 / ((x + y) / (x - y));
}
def code(x, y): return 1.0 / ((x + y) / (x - y))
function code(x, y) return Float64(1.0 / Float64(Float64(x + y) / Float64(x - y))) end
function tmp = code(x, y) tmp = 1.0 / ((x + y) / (x - y)); end
code[x_, y_] := N[(1.0 / N[(N[(x + y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{x + y}{x - y}}
\end{array}
Initial program 99.9%
clear-num99.9%
associate-/r/99.8%
Applied egg-rr99.8%
associate-*l/99.9%
*-un-lft-identity99.9%
clear-num99.9%
Applied egg-rr99.9%
(FPCore (x y) :precision binary64 (/ (- x y) (+ x y)))
double code(double x, double y) {
return (x - y) / (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (x + y)
end function
public static double code(double x, double y) {
return (x - y) / (x + y);
}
def code(x, y): return (x - y) / (x + y)
function code(x, y) return Float64(Float64(x - y) / Float64(x + y)) end
function tmp = code(x, y) tmp = (x - y) / (x + y); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{x + y}
\end{array}
Initial program 99.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 99.9%
Taylor expanded in x around 0 50.6%
(FPCore (x y) :precision binary64 (- (/ x (+ x y)) (/ y (+ x y))))
double code(double x, double y) {
return (x / (x + y)) - (y / (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) - (y / (x + y))
end function
public static double code(double x, double y) {
return (x / (x + y)) - (y / (x + y));
}
def code(x, y): return (x / (x + y)) - (y / (x + y))
function code(x, y) return Float64(Float64(x / Float64(x + y)) - Float64(y / Float64(x + y))) end
function tmp = code(x, y) tmp = (x / (x + y)) - (y / (x + y)); end
code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{x + y} - \frac{y}{x + y}
\end{array}
herbie shell --seed 2024180
(FPCore (x y)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, D"
:precision binary64
:alt
(! :herbie-platform default (- (/ x (+ x y)) (/ y (+ x y))))
(/ (- x y) (+ x y)))