\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \le -1.10254487981744727 \cdot 10^{288} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le -1.88409447397914514 \cdot 10^{-83}\right):\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\end{array}double f(double x, double y, double z) {
double r751311 = x;
double r751312 = y;
double r751313 = z;
double r751314 = r751312 - r751313;
double r751315 = r751311 * r751314;
double r751316 = r751315 / r751312;
return r751316;
}
double f(double x, double y, double z) {
double r751317 = x;
double r751318 = y;
double r751319 = z;
double r751320 = r751318 - r751319;
double r751321 = r751317 * r751320;
double r751322 = r751321 / r751318;
double r751323 = -1.1025448798174473e+288;
bool r751324 = r751322 <= r751323;
double r751325 = -1.884094473979145e-83;
bool r751326 = r751322 <= r751325;
double r751327 = !r751326;
bool r751328 = r751324 || r751327;
double r751329 = r751320 / r751318;
double r751330 = r751317 * r751329;
double r751331 = r751328 ? r751330 : r751322;
return r751331;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.2 |
| Herbie | 1.9 |
if (/ (* x (- y z)) y) < -1.1025448798174473e+288 or -1.884094473979145e-83 < (/ (* x (- y z)) y) Initial program 17.0
rmApplied *-un-lft-identity17.0
Applied times-frac2.5
Simplified2.5
if -1.1025448798174473e+288 < (/ (* x (- y z)) y) < -1.884094473979145e-83Initial program 0.3
Final simplification1.9
herbie shell --seed 2020018
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))