
(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 10 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 (/ 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-num100.0%
associate-/r/99.7%
Applied egg-rr99.7%
associate-*l/99.9%
*-un-lft-identity99.9%
clear-num100.0%
Applied egg-rr100.0%
(FPCore (x y) :precision binary64 (if (or (<= x -8500000000.0) (not (<= x 5.3e-12))) (+ 1.0 (* -2.0 (/ y x))) (+ (* 2.0 (/ x y)) -1.0)))
double code(double x, double y) {
double tmp;
if ((x <= -8500000000.0) || !(x <= 5.3e-12)) {
tmp = 1.0 + (-2.0 * (y / x));
} else {
tmp = (2.0 * (x / y)) + -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 <= (-8500000000.0d0)) .or. (.not. (x <= 5.3d-12))) then
tmp = 1.0d0 + ((-2.0d0) * (y / x))
else
tmp = (2.0d0 * (x / y)) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -8500000000.0) || !(x <= 5.3e-12)) {
tmp = 1.0 + (-2.0 * (y / x));
} else {
tmp = (2.0 * (x / y)) + -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -8500000000.0) or not (x <= 5.3e-12): tmp = 1.0 + (-2.0 * (y / x)) else: tmp = (2.0 * (x / y)) + -1.0 return tmp
function code(x, y) tmp = 0.0 if ((x <= -8500000000.0) || !(x <= 5.3e-12)) tmp = Float64(1.0 + Float64(-2.0 * Float64(y / x))); else tmp = Float64(Float64(2.0 * Float64(x / y)) + -1.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -8500000000.0) || ~((x <= 5.3e-12))) tmp = 1.0 + (-2.0 * (y / x)); else tmp = (2.0 * (x / y)) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -8500000000.0], N[Not[LessEqual[x, 5.3e-12]], $MachinePrecision]], N[(1.0 + N[(-2.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8500000000 \lor \neg \left(x \leq 5.3 \cdot 10^{-12}\right):\\
\;\;\;\;1 + -2 \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{x}{y} + -1\\
\end{array}
\end{array}
if x < -8.5e9 or 5.29999999999999963e-12 < x Initial program 99.9%
Taylor expanded in y around 0 80.1%
if -8.5e9 < x < 5.29999999999999963e-12Initial program 99.9%
Taylor expanded in x around 0 81.4%
Final simplification80.7%
(FPCore (x y) :precision binary64 (if (or (<= x -7800000000.0) (not (<= x 1.12e-10))) (+ 1.0 (* -2.0 (/ y x))) (/ (- x y) y)))
double code(double x, double y) {
double tmp;
if ((x <= -7800000000.0) || !(x <= 1.12e-10)) {
tmp = 1.0 + (-2.0 * (y / x));
} else {
tmp = (x - y) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-7800000000.0d0)) .or. (.not. (x <= 1.12d-10))) then
tmp = 1.0d0 + ((-2.0d0) * (y / x))
else
tmp = (x - y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -7800000000.0) || !(x <= 1.12e-10)) {
tmp = 1.0 + (-2.0 * (y / x));
} else {
tmp = (x - y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -7800000000.0) or not (x <= 1.12e-10): tmp = 1.0 + (-2.0 * (y / x)) else: tmp = (x - y) / y return tmp
function code(x, y) tmp = 0.0 if ((x <= -7800000000.0) || !(x <= 1.12e-10)) tmp = Float64(1.0 + Float64(-2.0 * Float64(y / x))); else tmp = Float64(Float64(x - y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -7800000000.0) || ~((x <= 1.12e-10))) tmp = 1.0 + (-2.0 * (y / x)); else tmp = (x - y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -7800000000.0], N[Not[LessEqual[x, 1.12e-10]], $MachinePrecision]], N[(1.0 + N[(-2.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7800000000 \lor \neg \left(x \leq 1.12 \cdot 10^{-10}\right):\\
\;\;\;\;1 + -2 \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{y}\\
\end{array}
\end{array}
if x < -7.8e9 or 1.12e-10 < x Initial program 99.9%
Taylor expanded in y around 0 80.1%
if -7.8e9 < x < 1.12e-10Initial program 99.9%
Taylor expanded in x around 0 80.9%
Final simplification80.5%
(FPCore (x y) :precision binary64 (if (or (<= x -310000000000.0) (not (<= x 1.9e-36))) (- 1.0 (/ y x)) -1.0))
double code(double x, double y) {
double tmp;
if ((x <= -310000000000.0) || !(x <= 1.9e-36)) {
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 ((x <= (-310000000000.0d0)) .or. (.not. (x <= 1.9d-36))) 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 ((x <= -310000000000.0) || !(x <= 1.9e-36)) {
tmp = 1.0 - (y / x);
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -310000000000.0) or not (x <= 1.9e-36): tmp = 1.0 - (y / x) else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if ((x <= -310000000000.0) || !(x <= 1.9e-36)) 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 ((x <= -310000000000.0) || ~((x <= 1.9e-36))) tmp = 1.0 - (y / x); else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -310000000000.0], N[Not[LessEqual[x, 1.9e-36]], $MachinePrecision]], N[(1.0 - N[(y / x), $MachinePrecision]), $MachinePrecision], -1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -310000000000 \lor \neg \left(x \leq 1.9 \cdot 10^{-36}\right):\\
\;\;\;\;1 - \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if x < -3.1e11 or 1.89999999999999985e-36 < x Initial program 99.9%
Taylor expanded in x around inf 79.0%
Taylor expanded in x around inf 78.9%
mul-1-neg78.9%
unsub-neg78.9%
Simplified78.9%
if -3.1e11 < x < 1.89999999999999985e-36Initial program 99.9%
Taylor expanded in x around 0 81.4%
Final simplification80.1%
(FPCore (x y) :precision binary64 (if (<= x -920000000000.0) (/ x (+ x y)) (if (<= x 2.75e-13) (/ (- x y) y) (/ x (- x y)))))
double code(double x, double y) {
double tmp;
if (x <= -920000000000.0) {
tmp = x / (x + y);
} else if (x <= 2.75e-13) {
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 (x <= (-920000000000.0d0)) then
tmp = x / (x + y)
else if (x <= 2.75d-13) 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 (x <= -920000000000.0) {
tmp = x / (x + y);
} else if (x <= 2.75e-13) {
tmp = (x - y) / y;
} else {
tmp = x / (x - y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -920000000000.0: tmp = x / (x + y) elif x <= 2.75e-13: tmp = (x - y) / y else: tmp = x / (x - y) return tmp
function code(x, y) tmp = 0.0 if (x <= -920000000000.0) tmp = Float64(x / Float64(x + y)); elseif (x <= 2.75e-13) 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 (x <= -920000000000.0) tmp = x / (x + y); elseif (x <= 2.75e-13) tmp = (x - y) / y; else tmp = x / (x - y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -920000000000.0], N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.75e-13], N[(N[(x - y), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(x - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -920000000000:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-13}:\\
\;\;\;\;\frac{x - y}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - y}\\
\end{array}
\end{array}
if x < -9.2e11Initial program 99.9%
Taylor expanded in x around inf 81.2%
if -9.2e11 < x < 2.74999999999999989e-13Initial program 99.9%
Taylor expanded in x around 0 80.9%
if 2.74999999999999989e-13 < x Initial program 99.9%
Taylor expanded in x around inf 78.8%
frac-2neg78.8%
div-inv78.7%
+-commutative78.7%
distribute-neg-in78.7%
add-sqr-sqrt47.1%
sqrt-unprod72.9%
sqr-neg72.9%
sqrt-unprod32.1%
add-sqr-sqrt78.8%
Applied egg-rr78.8%
distribute-lft-neg-out78.8%
associate-*r/79.0%
*-rgt-identity79.0%
distribute-neg-frac279.0%
neg-sub079.0%
+-commutative79.0%
associate--r+79.0%
neg-sub079.0%
remove-double-neg79.0%
Simplified79.0%
(FPCore (x y) :precision binary64 (if (<= x -36000000000.0) (/ x (+ x y)) (if (<= x 9.5e-42) -1.0 (/ x (- x y)))))
double code(double x, double y) {
double tmp;
if (x <= -36000000000.0) {
tmp = x / (x + y);
} else if (x <= 9.5e-42) {
tmp = -1.0;
} 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 (x <= (-36000000000.0d0)) then
tmp = x / (x + y)
else if (x <= 9.5d-42) then
tmp = -1.0d0
else
tmp = x / (x - y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -36000000000.0) {
tmp = x / (x + y);
} else if (x <= 9.5e-42) {
tmp = -1.0;
} else {
tmp = x / (x - y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -36000000000.0: tmp = x / (x + y) elif x <= 9.5e-42: tmp = -1.0 else: tmp = x / (x - y) return tmp
function code(x, y) tmp = 0.0 if (x <= -36000000000.0) tmp = Float64(x / Float64(x + y)); elseif (x <= 9.5e-42) tmp = -1.0; else tmp = Float64(x / Float64(x - y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -36000000000.0) tmp = x / (x + y); elseif (x <= 9.5e-42) tmp = -1.0; else tmp = x / (x - y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -36000000000.0], N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-42], -1.0, N[(x / N[(x - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -36000000000:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-42}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - y}\\
\end{array}
\end{array}
if x < -3.6e10Initial program 99.9%
Taylor expanded in x around inf 81.2%
if -3.6e10 < x < 9.49999999999999948e-42Initial program 99.9%
Taylor expanded in x around 0 81.4%
if 9.49999999999999948e-42 < x Initial program 99.9%
Taylor expanded in x around inf 77.3%
frac-2neg77.3%
div-inv77.2%
+-commutative77.2%
distribute-neg-in77.2%
add-sqr-sqrt46.0%
sqrt-unprod71.8%
sqr-neg71.8%
sqrt-unprod31.9%
add-sqr-sqrt77.4%
Applied egg-rr77.4%
distribute-lft-neg-out77.4%
associate-*r/77.5%
*-rgt-identity77.5%
distribute-neg-frac277.5%
neg-sub077.5%
+-commutative77.5%
associate--r+77.5%
neg-sub077.5%
remove-double-neg77.5%
Simplified77.5%
(FPCore (x y) :precision binary64 (if (<= x -18000000000.0) (/ x (+ x y)) (if (<= x 2.5e-28) -1.0 (- 1.0 (/ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -18000000000.0) {
tmp = x / (x + y);
} else if (x <= 2.5e-28) {
tmp = -1.0;
} else {
tmp = 1.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 (x <= (-18000000000.0d0)) then
tmp = x / (x + y)
else if (x <= 2.5d-28) then
tmp = -1.0d0
else
tmp = 1.0d0 - (y / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -18000000000.0) {
tmp = x / (x + y);
} else if (x <= 2.5e-28) {
tmp = -1.0;
} else {
tmp = 1.0 - (y / x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -18000000000.0: tmp = x / (x + y) elif x <= 2.5e-28: tmp = -1.0 else: tmp = 1.0 - (y / x) return tmp
function code(x, y) tmp = 0.0 if (x <= -18000000000.0) tmp = Float64(x / Float64(x + y)); elseif (x <= 2.5e-28) tmp = -1.0; else tmp = Float64(1.0 - Float64(y / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -18000000000.0) tmp = x / (x + y); elseif (x <= 2.5e-28) tmp = -1.0; else tmp = 1.0 - (y / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -18000000000.0], N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-28], -1.0, N[(1.0 - N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -18000000000:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-28}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{x}\\
\end{array}
\end{array}
if x < -1.8e10Initial program 99.9%
Taylor expanded in x around inf 81.2%
if -1.8e10 < x < 2.5000000000000001e-28Initial program 99.9%
Taylor expanded in x around 0 81.4%
if 2.5000000000000001e-28 < x Initial program 99.9%
Taylor expanded in x around inf 77.3%
Taylor expanded in x around inf 77.5%
mul-1-neg77.5%
unsub-neg77.5%
Simplified77.5%
(FPCore (x y) :precision binary64 (if (<= x -235000000000.0) 1.0 (if (<= x 4.6e-39) -1.0 1.0)))
double code(double x, double y) {
double tmp;
if (x <= -235000000000.0) {
tmp = 1.0;
} else if (x <= 4.6e-39) {
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 <= (-235000000000.0d0)) then
tmp = 1.0d0
else if (x <= 4.6d-39) 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 <= -235000000000.0) {
tmp = 1.0;
} else if (x <= 4.6e-39) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -235000000000.0: tmp = 1.0 elif x <= 4.6e-39: tmp = -1.0 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -235000000000.0) tmp = 1.0; elseif (x <= 4.6e-39) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -235000000000.0) tmp = 1.0; elseif (x <= 4.6e-39) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -235000000000.0], 1.0, If[LessEqual[x, 4.6e-39], -1.0, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -235000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-39}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.35e11 or 4.60000000000000016e-39 < x Initial program 99.9%
Taylor expanded in x around inf 78.4%
if -2.35e11 < x < 4.60000000000000016e-39Initial program 99.9%
Taylor expanded in x around 0 81.4%
(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 49.0%
(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 2024172
(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)))