x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -1.245947516265854964311200045000519905686 \cdot 10^{-233}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;\frac{y}{z} \le 6.872941476643587911784112841004328702772 \cdot 10^{-272}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z, double t) {
double r43680412 = x;
double r43680413 = y;
double r43680414 = z;
double r43680415 = r43680413 / r43680414;
double r43680416 = t;
double r43680417 = r43680415 * r43680416;
double r43680418 = r43680417 / r43680416;
double r43680419 = r43680412 * r43680418;
return r43680419;
}
double f(double x, double y, double z, double __attribute__((unused)) t) {
double r43680420 = y;
double r43680421 = z;
double r43680422 = r43680420 / r43680421;
double r43680423 = -1.245947516265855e-233;
bool r43680424 = r43680422 <= r43680423;
double r43680425 = x;
double r43680426 = r43680422 * r43680425;
double r43680427 = 6.872941476643588e-272;
bool r43680428 = r43680422 <= r43680427;
double r43680429 = r43680425 * r43680420;
double r43680430 = r43680429 / r43680421;
double r43680431 = r43680421 / r43680420;
double r43680432 = r43680425 / r43680431;
double r43680433 = r43680428 ? r43680430 : r43680432;
double r43680434 = r43680424 ? r43680426 : r43680433;
return r43680434;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.7 |
|---|---|
| Target | 1.4 |
| Herbie | 3.3 |
if (/ y z) < -1.245947516265855e-233Initial program 13.3
Simplified7.8
rmApplied *-un-lft-identity7.8
Applied times-frac4.3
Simplified4.3
if -1.245947516265855e-233 < (/ y z) < 6.872941476643588e-272Initial program 18.6
Simplified0.4
rmApplied add-cube-cbrt0.8
Applied times-frac3.1
rmApplied frac-times0.8
Simplified0.4
if 6.872941476643588e-272 < (/ y z) Initial program 14.0
Simplified8.0
rmApplied associate-/l*3.8
Final simplification3.3
herbie shell --seed 2019171
(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)))