x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} = -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;\frac{y}{z} \le -1.777824700739059504027072604237357294271 \cdot 10^{-189}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;\frac{y}{z} \le 6.194701076531514820787324531303599279908 \cdot 10^{-141}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;\frac{y}{z} \le 4.487328446405641062208224523193589026226 \cdot 10^{149}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}double f(double x, double y, double z, double t) {
double r358045 = x;
double r358046 = y;
double r358047 = z;
double r358048 = r358046 / r358047;
double r358049 = t;
double r358050 = r358048 * r358049;
double r358051 = r358050 / r358049;
double r358052 = r358045 * r358051;
return r358052;
}
double f(double x, double y, double z, double __attribute__((unused)) t) {
double r358053 = y;
double r358054 = z;
double r358055 = r358053 / r358054;
double r358056 = -inf.0;
bool r358057 = r358055 <= r358056;
double r358058 = x;
double r358059 = r358058 / r358054;
double r358060 = r358053 * r358059;
double r358061 = -1.7778247007390595e-189;
bool r358062 = r358055 <= r358061;
double r358063 = r358055 * r358058;
double r358064 = 6.194701076531515e-141;
bool r358065 = r358055 <= r358064;
double r358066 = r358058 * r358053;
double r358067 = r358066 / r358054;
double r358068 = 4.487328446405641e+149;
bool r358069 = r358055 <= r358068;
double r358070 = r358069 ? r358063 : r358060;
double r358071 = r358065 ? r358067 : r358070;
double r358072 = r358062 ? r358063 : r358071;
double r358073 = r358057 ? r358060 : r358072;
return r358073;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.7 |
|---|---|
| Target | 1.4 |
| Herbie | 0.8 |
if (/ y z) < -inf.0 or 4.487328446405641e+149 < (/ y z) Initial program 41.5
Simplified29.8
rmApplied div-inv29.9
Applied associate-*l*1.9
Simplified1.8
if -inf.0 < (/ y z) < -1.7778247007390595e-189 or 6.194701076531515e-141 < (/ y z) < 4.487328446405641e+149Initial program 7.9
Simplified0.2
if -1.7778247007390595e-189 < (/ y z) < 6.194701076531515e-141Initial program 17.3
Simplified9.0
rmApplied add-cube-cbrt9.5
Applied associate-*l*9.5
rmApplied cbrt-div9.4
Applied associate-*l/9.6
Applied cbrt-div9.6
Applied cbrt-div1.8
Applied frac-times1.8
Applied frac-times2.1
Simplified1.8
Simplified1.3
Final simplification0.8
herbie shell --seed 2019325 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
:precision binary64
: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)))