\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;z \le -3.959044911726634905220938628750773223279 \cdot 10^{51}:\\
\;\;\;\;x + \frac{-z}{\frac{y}{x}}\\
\mathbf{elif}\;z \le 2.65441430654303589246643061268787471633 \cdot 10^{-93}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;z \le 4.507467681888386206278845817218710484276 \cdot 10^{241}:\\
\;\;\;\;x + \frac{-1}{y} \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-z}{\frac{y}{x}}\\
\end{array}double f(double x, double y, double z) {
double r663441 = x;
double r663442 = y;
double r663443 = z;
double r663444 = r663442 - r663443;
double r663445 = r663441 * r663444;
double r663446 = r663445 / r663442;
return r663446;
}
double f(double x, double y, double z) {
double r663447 = z;
double r663448 = -3.959044911726635e+51;
bool r663449 = r663447 <= r663448;
double r663450 = x;
double r663451 = -r663447;
double r663452 = y;
double r663453 = r663452 / r663450;
double r663454 = r663451 / r663453;
double r663455 = r663450 + r663454;
double r663456 = 2.654414306543036e-93;
bool r663457 = r663447 <= r663456;
double r663458 = r663452 - r663447;
double r663459 = r663452 / r663458;
double r663460 = r663450 / r663459;
double r663461 = 4.507467681888386e+241;
bool r663462 = r663447 <= r663461;
double r663463 = -1.0;
double r663464 = r663463 / r663452;
double r663465 = r663450 * r663447;
double r663466 = r663464 * r663465;
double r663467 = r663450 + r663466;
double r663468 = r663462 ? r663467 : r663455;
double r663469 = r663457 ? r663460 : r663468;
double r663470 = r663449 ? r663455 : r663469;
return r663470;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.2 |
|---|---|
| Target | 3.1 |
| Herbie | 2.6 |
if z < -3.959044911726635e+51 or 4.507467681888386e+241 < z Initial program 11.5
rmApplied associate-/l*9.5
rmApplied div-inv10.1
Simplified10.1
rmApplied sub-neg10.1
Applied distribute-lft-in10.1
Simplified10.1
Simplified7.0
if -3.959044911726635e+51 < z < 2.654414306543036e-93Initial program 13.3
rmApplied associate-/l*0.1
if 2.654414306543036e-93 < z < 4.507467681888386e+241Initial program 10.5
rmApplied associate-/l*4.1
rmApplied div-inv4.5
Simplified4.4
rmApplied sub-neg4.4
Applied distribute-lft-in4.4
Simplified4.4
Simplified2.1
rmApplied div-inv2.1
Applied neg-mul-12.1
Applied times-frac4.3
Simplified4.3
Final simplification2.6
herbie shell --seed 2019351 +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))