x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;z \le 1.6218775689393483 \cdot 10^{-99} \lor \neg \left(z \le 1.32166055357661369 \cdot 10^{217}\right):\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z, double t) {
double r399309 = x;
double r399310 = y;
double r399311 = z;
double r399312 = r399310 / r399311;
double r399313 = t;
double r399314 = r399312 * r399313;
double r399315 = r399314 / r399313;
double r399316 = r399309 * r399315;
return r399316;
}
double f(double x, double y, double z, double __attribute__((unused)) t) {
double r399317 = z;
double r399318 = 1.6218775689393483e-99;
bool r399319 = r399317 <= r399318;
double r399320 = 1.3216605535766137e+217;
bool r399321 = r399317 <= r399320;
double r399322 = !r399321;
bool r399323 = r399319 || r399322;
double r399324 = y;
double r399325 = x;
double r399326 = r399324 * r399325;
double r399327 = r399326 / r399317;
double r399328 = r399317 / r399324;
double r399329 = r399325 / r399328;
double r399330 = r399323 ? r399327 : r399329;
return r399330;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.5 |
|---|---|
| Target | 1.5 |
| Herbie | 6.0 |
if z < 1.6218775689393483e-99 or 1.3216605535766137e+217 < z Initial program 15.2
Simplified6.7
if 1.6218775689393483e-99 < z < 1.3216605535766137e+217Initial program 12.7
Simplified4.3
rmApplied clear-num4.8
Simplified4.8
rmApplied *-un-lft-identity4.8
Applied times-frac4.7
Applied associate-/r*4.4
Simplified4.3
Final simplification6.0
herbie shell --seed 2019199 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
:herbie-target
(if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))
(* x (/ (* (/ y z) t) t)))