\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 r606278 = x;
double r606279 = 2.0;
double r606280 = r606278 * r606279;
double r606281 = y;
double r606282 = r606280 * r606281;
double r606283 = r606278 - r606281;
double r606284 = r606282 / r606283;
return r606284;
}
double f(double x, double y) {
double r606285 = x;
double r606286 = 2.0;
double r606287 = r606285 * r606286;
double r606288 = y;
double r606289 = r606287 * r606288;
double r606290 = r606285 - r606288;
double r606291 = r606289 / r606290;
double r606292 = -2.983744795196586e-65;
bool r606293 = r606291 <= r606292;
double r606294 = -8.215112199764979e-271;
bool r606295 = r606291 <= r606294;
double r606296 = 0.0;
bool r606297 = r606291 <= r606296;
double r606298 = !r606297;
double r606299 = 6.505978645209074e-82;
bool r606300 = r606291 <= r606299;
bool r606301 = r606298 && r606300;
bool r606302 = r606295 || r606301;
double r606303 = !r606302;
bool r606304 = r606293 || r606303;
double r606305 = r606288 / r606290;
double r606306 = r606287 * r606305;
double r606307 = r606304 ? r606306 : r606291;
return r606307;
}




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
(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)))