\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 r34242534 = x;
double r34242535 = y;
double r34242536 = z;
double r34242537 = r34242535 - r34242536;
double r34242538 = r34242534 * r34242537;
double r34242539 = r34242538 / r34242535;
return r34242539;
}
double f(double x, double y, double z) {
double r34242540 = y;
double r34242541 = -1.876455341869721e-13;
bool r34242542 = r34242540 <= r34242541;
double r34242543 = x;
double r34242544 = z;
double r34242545 = r34242540 - r34242544;
double r34242546 = r34242545 / r34242540;
double r34242547 = r34242543 * r34242546;
double r34242548 = 1.1367980230815625e-137;
bool r34242549 = r34242540 <= r34242548;
double r34242550 = r34242543 / r34242540;
double r34242551 = r34242545 * r34242550;
double r34242552 = r34242549 ? r34242551 : r34242547;
double r34242553 = r34242542 ? r34242547 : r34242552;
return r34242553;
}




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 +o rules:numerics
(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))