\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} = -\infty:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le -5.74240735694960229 \cdot 10^{-106}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 1.0101904628573289 \cdot 10^{139}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{y} \le 3.14880917404541375 \cdot 10^{307}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(y - z\right)\\
\end{array}double f(double x, double y, double z) {
double r1009145 = x;
double r1009146 = y;
double r1009147 = z;
double r1009148 = r1009146 - r1009147;
double r1009149 = r1009145 * r1009148;
double r1009150 = r1009149 / r1009146;
return r1009150;
}
double f(double x, double y, double z) {
double r1009151 = x;
double r1009152 = y;
double r1009153 = z;
double r1009154 = r1009152 - r1009153;
double r1009155 = r1009151 * r1009154;
double r1009156 = r1009155 / r1009152;
double r1009157 = -inf.0;
bool r1009158 = r1009156 <= r1009157;
double r1009159 = r1009152 / r1009154;
double r1009160 = r1009151 / r1009159;
double r1009161 = -5.742407356949602e-106;
bool r1009162 = r1009156 <= r1009161;
double r1009163 = 1.0101904628573289e+139;
bool r1009164 = r1009156 <= r1009163;
double r1009165 = 3.1488091740454137e+307;
bool r1009166 = r1009156 <= r1009165;
double r1009167 = r1009151 / r1009152;
double r1009168 = r1009167 * r1009154;
double r1009169 = r1009166 ? r1009156 : r1009168;
double r1009170 = r1009164 ? r1009160 : r1009169;
double r1009171 = r1009162 ? r1009156 : r1009170;
double r1009172 = r1009158 ? r1009160 : r1009171;
return r1009172;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 3.4 |
| Herbie | 0.4 |
if (/ (* x (- y z)) y) < -inf.0 or -5.742407356949602e-106 < (/ (* x (- y z)) y) < 1.0101904628573289e+139Initial program 14.1
rmApplied associate-/l*0.6
if -inf.0 < (/ (* x (- y z)) y) < -5.742407356949602e-106 or 1.0101904628573289e+139 < (/ (* x (- y z)) y) < 3.1488091740454137e+307Initial program 0.3
if 3.1488091740454137e+307 < (/ (* x (- y z)) y) Initial program 63.7
rmApplied associate-/l*0.3
rmApplied associate-/r/0.2
Final simplification0.4
herbie shell --seed 2020060 +o rules:numerics
(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))