\frac{x - y}{2 - \left(x + y\right)}\begin{array}{l}
\mathbf{if}\;x \le -1.8286949592281574 \lor \neg \left(x \le 8.4800696698330235 \cdot 10^{-105}\right):\\
\;\;\;\;\frac{\frac{x}{2 - \left(x + y\right)} \cdot \frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)} \cdot \frac{y}{2 - \left(x + y\right)}}{\frac{x}{2 - \left(x + y\right)} + \frac{y}{2 - \left(x + y\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2 \cdot 2 - \left(x + y\right) \cdot \left(x + y\right)} \cdot \left(2 + \left(x + y\right)\right) - \frac{y}{2 - \left(x + y\right)}\\
\end{array}double f(double x, double y) {
double r967033 = x;
double r967034 = y;
double r967035 = r967033 - r967034;
double r967036 = 2.0;
double r967037 = r967033 + r967034;
double r967038 = r967036 - r967037;
double r967039 = r967035 / r967038;
return r967039;
}
double f(double x, double y) {
double r967040 = x;
double r967041 = -1.8286949592281574;
bool r967042 = r967040 <= r967041;
double r967043 = 8.480069669833023e-105;
bool r967044 = r967040 <= r967043;
double r967045 = !r967044;
bool r967046 = r967042 || r967045;
double r967047 = 2.0;
double r967048 = y;
double r967049 = r967040 + r967048;
double r967050 = r967047 - r967049;
double r967051 = r967040 / r967050;
double r967052 = r967051 * r967051;
double r967053 = r967048 / r967050;
double r967054 = r967053 * r967053;
double r967055 = r967052 - r967054;
double r967056 = r967051 + r967053;
double r967057 = r967055 / r967056;
double r967058 = r967047 * r967047;
double r967059 = r967049 * r967049;
double r967060 = r967058 - r967059;
double r967061 = r967040 / r967060;
double r967062 = r967047 + r967049;
double r967063 = r967061 * r967062;
double r967064 = r967063 - r967053;
double r967065 = r967046 ? r967057 : r967064;
return r967065;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
if x < -1.8286949592281574 or 8.480069669833023e-105 < x Initial program 0.0
rmApplied div-sub0.0
rmApplied flip--0.0
if -1.8286949592281574 < x < 8.480069669833023e-105Initial program 0.0
rmApplied div-sub0.0
rmApplied flip--0.0
Applied associate-/r/0.0
Final simplification0.0
herbie shell --seed 2020065 +o rules:numerics
(FPCore (x y)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, C"
:precision binary64
:herbie-target
(- (/ x (- 2 (+ x y))) (/ y (- 2 (+ x y))))
(/ (- x y) (- 2 (+ x y))))