\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -2.98374479519658591 \cdot 10^{-65} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -8.21511219976497913 \cdot 10^{-271} \lor \neg \left(\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 0.0\right) \land \frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 6.50597864520907364 \cdot 10^{-82}\right):\\
\;\;\;\;\left(x \cdot 2\right) \cdot \frac{y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\end{array}double f(double x, double y) {
double r579598 = x;
double r579599 = 2.0;
double r579600 = r579598 * r579599;
double r579601 = y;
double r579602 = r579600 * r579601;
double r579603 = r579598 - r579601;
double r579604 = r579602 / r579603;
return r579604;
}
double f(double x, double y) {
double r579605 = x;
double r579606 = 2.0;
double r579607 = r579605 * r579606;
double r579608 = y;
double r579609 = r579607 * r579608;
double r579610 = r579605 - r579608;
double r579611 = r579609 / r579610;
double r579612 = -2.983744795196586e-65;
bool r579613 = r579611 <= r579612;
double r579614 = -8.215112199764979e-271;
bool r579615 = r579611 <= r579614;
double r579616 = 0.0;
bool r579617 = r579611 <= r579616;
double r579618 = !r579617;
double r579619 = 6.505978645209074e-82;
bool r579620 = r579611 <= r579619;
bool r579621 = r579618 && r579620;
bool r579622 = r579615 || r579621;
double r579623 = !r579622;
bool r579624 = r579613 || r579623;
double r579625 = r579608 / r579610;
double r579626 = r579607 * r579625;
double r579627 = r579624 ? r579626 : r579611;
return r579627;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.3 |
| Herbie | 1.5 |
if (/ (* (* x 2.0) y) (- x y)) < -2.983744795196586e-65 or -8.215112199764979e-271 < (/ (* (* x 2.0) y) (- x y)) < 0.0 or 6.505978645209074e-82 < (/ (* (* x 2.0) y) (- x y)) Initial program 28.0
rmApplied *-un-lft-identity28.0
Applied times-frac2.2
Simplified2.2
if -2.983744795196586e-65 < (/ (* (* x 2.0) y) (- x y)) < -8.215112199764979e-271 or 0.0 < (/ (* (* x 2.0) y) (- x y)) < 6.505978645209074e-82Initial program 0.6
Final simplification1.5
herbie shell --seed 2020042 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))