x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \leq -7.023589217806413 \cdot 10^{-119} \lor \neg \left(\frac{y}{z} \leq 3.751194703123681 \cdot 10^{-270}\right):\\
\;\;\;\;\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}(FPCore (x y z t) :precision binary64 (* x (/ (* (/ y z) t) t)))
(FPCore (x y z t)
:precision binary64
(if (or (<= (/ y z) -7.023589217806413e-119)
(not (<= (/ y z) 3.751194703123681e-270)))
(*
(* x (/ (* (cbrt y) (cbrt y)) (* (cbrt z) (cbrt z))))
(/ (cbrt y) (cbrt z)))
(/ (* y x) z)))double code(double x, double y, double z, double t) {
return x * (((y / z) * t) / t);
}
double code(double x, double y, double z, double t) {
double tmp;
if (((y / z) <= -7.023589217806413e-119) || !((y / z) <= 3.751194703123681e-270)) {
tmp = (x * ((cbrt(y) * cbrt(y)) / (cbrt(z) * cbrt(z)))) * (cbrt(y) / cbrt(z));
} else {
tmp = (y * x) / z;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 15.3 |
|---|---|
| Target | 1.5 |
| Herbie | 1.8 |
if (/.f64 y z) < -7.02358921780641317e-119 or 3.7511947031236809e-270 < (/.f64 y z) Initial program 14.4
Simplified4.7
rmApplied add-cube-cbrt_binary64_159485.7
Applied add-cube-cbrt_binary64_159485.9
Applied times-frac_binary64_159225.9
Applied associate-*r*_binary64_158581.9
if -7.02358921780641317e-119 < (/.f64 y z) < 3.7511947031236809e-270Initial program 17.5
Simplified10.2
rmApplied associate-*r/_binary64_158601.3
Final simplification1.8
herbie shell --seed 2020281
(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)))