\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq -5.317413615517461 \cdot 10^{+285} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \leq -1.1913190036143335 \cdot 10^{+87} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \leq 2.5042457577934314 \cdot 10^{-19}\right) \land \frac{x \cdot \left(y - z\right)}{y} \leq 2.3420284491870442 \cdot 10^{+266}\right):\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \left(x \cdot z\right) \cdot \frac{-1}{y}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z)
:precision binary64
(if (or (<= (/ (* x (- y z)) y) -5.317413615517461e+285)
(not
(or (<= (/ (* x (- y z)) y) -1.1913190036143335e+87)
(and (not (<= (/ (* x (- y z)) y) 2.5042457577934314e-19))
(<= (/ (* x (- y z)) y) 2.3420284491870442e+266)))))
(- x (* x (/ z y)))
(+ x (* (* x z) (/ -1.0 y)))))double code(double x, double y, double z) {
return (((double) (x * ((double) (y - z)))) / y);
}
double code(double x, double y, double z) {
double tmp;
if ((((((double) (x * ((double) (y - z)))) / y) <= -5.317413615517461e+285) || !(((((double) (x * ((double) (y - z)))) / y) <= -1.1913190036143335e+87) || (!((((double) (x * ((double) (y - z)))) / y) <= 2.5042457577934314e-19) && ((((double) (x * ((double) (y - z)))) / y) <= 2.3420284491870442e+266))))) {
tmp = ((double) (x - ((double) (x * (z / y)))));
} else {
tmp = ((double) (x + ((double) (((double) (x * z)) * (-1.0 / y)))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.3 |
| Herbie | 0.8 |
if (/ (* x (- y z)) y) < -5.31741361551746132e285 or -1.1913190036143335e87 < (/ (* x (- y z)) y) < 2.50424575779343136e-19 or 2.3420284491870442e266 < (/ (* x (- y z)) y) Initial program Error: 19.2 bits
SimplifiedError: 1.1 bits
if -5.31741361551746132e285 < (/ (* x (- y z)) y) < -1.1913190036143335e87 or 2.50424575779343136e-19 < (/ (* x (- y z)) y) < 2.3420284491870442e266Initial program Error: 0.2 bits
SimplifiedError: 7.6 bits
rmApplied div-invError: 7.6 bits
Applied associate-*r*Error: 0.2 bits
Final simplificationError: 0.8 bits
herbie shell --seed 2020204
(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))