\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.148830163480626119193023708058808164846 \cdot 10^{-23}:\\
\;\;\;\;x \cdot \left(2 \cdot \frac{y}{x - y}\right)\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le -8.174877329539413749230582362665895049321 \cdot 10^{-304}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 0.0:\\
\;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\
\mathbf{elif}\;\frac{\left(x \cdot 2\right) \cdot y}{x - y} \le 3.016863972527170217327846549438020488946 \cdot 10^{-127}:\\
\;\;\;\;\frac{\left(x \cdot 2\right) \cdot y}{x - y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot \frac{y}{x - y}\right)\\
\end{array}double f(double x, double y) {
double r27275481 = x;
double r27275482 = 2.0;
double r27275483 = r27275481 * r27275482;
double r27275484 = y;
double r27275485 = r27275483 * r27275484;
double r27275486 = r27275481 - r27275484;
double r27275487 = r27275485 / r27275486;
return r27275487;
}
double f(double x, double y) {
double r27275488 = x;
double r27275489 = 2.0;
double r27275490 = r27275488 * r27275489;
double r27275491 = y;
double r27275492 = r27275490 * r27275491;
double r27275493 = r27275488 - r27275491;
double r27275494 = r27275492 / r27275493;
double r27275495 = -2.148830163480626e-23;
bool r27275496 = r27275494 <= r27275495;
double r27275497 = r27275491 / r27275493;
double r27275498 = r27275489 * r27275497;
double r27275499 = r27275488 * r27275498;
double r27275500 = -8.174877329539414e-304;
bool r27275501 = r27275494 <= r27275500;
double r27275502 = 0.0;
bool r27275503 = r27275494 <= r27275502;
double r27275504 = r27275493 / r27275491;
double r27275505 = r27275490 / r27275504;
double r27275506 = 3.0168639725271702e-127;
bool r27275507 = r27275494 <= r27275506;
double r27275508 = r27275507 ? r27275494 : r27275499;
double r27275509 = r27275503 ? r27275505 : r27275508;
double r27275510 = r27275501 ? r27275494 : r27275509;
double r27275511 = r27275496 ? r27275499 : r27275510;
return r27275511;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.4 |
| Herbie | 1.1 |
if (/ (* (* x 2.0) y) (- x y)) < -2.148830163480626e-23 or 3.0168639725271702e-127 < (/ (* (* x 2.0) y) (- x y)) Initial program 20.7
rmApplied *-un-lft-identity20.7
Applied times-frac1.5
Simplified1.5
rmApplied associate-*l*1.5
if -2.148830163480626e-23 < (/ (* (* x 2.0) y) (- x y)) < -8.174877329539414e-304 or 0.0 < (/ (* (* x 2.0) y) (- x y)) < 3.0168639725271702e-127Initial program 0.8
if -8.174877329539414e-304 < (/ (* (* x 2.0) y) (- x y)) < 0.0Initial program 56.9
rmApplied associate-/l*0.7
Final simplification1.1
herbie shell --seed 2019174
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))