\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \le -1.876455341869721 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;y \le 1.1367980230815625 \cdot 10^{-137}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\end{array}double f(double x, double y, double z) {
double r39891390 = x;
double r39891391 = y;
double r39891392 = z;
double r39891393 = r39891391 - r39891392;
double r39891394 = r39891390 * r39891393;
double r39891395 = r39891394 / r39891391;
return r39891395;
}
double f(double x, double y, double z) {
double r39891396 = y;
double r39891397 = -1.876455341869721e-13;
bool r39891398 = r39891396 <= r39891397;
double r39891399 = x;
double r39891400 = z;
double r39891401 = r39891396 - r39891400;
double r39891402 = r39891401 / r39891396;
double r39891403 = r39891399 * r39891402;
double r39891404 = 1.1367980230815625e-137;
bool r39891405 = r39891396 <= r39891404;
double r39891406 = r39891399 / r39891396;
double r39891407 = r39891401 * r39891406;
double r39891408 = r39891405 ? r39891407 : r39891403;
double r39891409 = r39891398 ? r39891403 : r39891408;
return r39891409;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 11.7 |
|---|---|
| Target | 2.9 |
| Herbie | 3.1 |
if y < -1.876455341869721e-13 or 1.1367980230815625e-137 < y Initial program 13.3
rmApplied *-un-lft-identity13.3
Applied times-frac0.6
Simplified0.6
if -1.876455341869721e-13 < y < 1.1367980230815625e-137Initial program 8.4
rmApplied associate-/l*8.3
rmApplied associate-/r/8.8
Final simplification3.1
herbie shell --seed 2019162
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
: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))