x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \leq -4.469027926732436 \cdot 10^{-111}:\\
\;\;\;\;\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\sqrt[3]{x} \cdot \frac{y}{\sqrt[3]{z}}\right)\right)\\
\mathbf{elif}\;\frac{y}{z} \leq 1.3491676262115018 \cdot 10^{-212}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\
\mathbf{elif}\;\frac{y}{z} \leq 8.244341728009553 \cdot 10^{+226}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\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 (<= (/ y z) -4.469027926732436e-111)
(*
(* (cbrt x) (cbrt x))
(* (/ 1.0 (* (cbrt z) (cbrt z))) (* (cbrt x) (/ y (cbrt z)))))
(if (<= (/ y z) 1.3491676262115018e-212)
(* (* y x) (/ 1.0 z))
(if (<= (/ y z) 8.244341728009553e+226) (* (/ y z) x) (/ (* 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) <= -4.469027926732436e-111) {
tmp = (cbrt(x) * cbrt(x)) * ((1.0 / (cbrt(z) * cbrt(z))) * (cbrt(x) * (y / cbrt(z))));
} else if ((y / z) <= 1.3491676262115018e-212) {
tmp = (y * x) * (1.0 / z);
} else if ((y / z) <= 8.244341728009553e+226) {
tmp = (y / z) * x;
} 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 | 14.5 |
|---|---|
| Target | 1.5 |
| Herbie | 1.9 |
if (/.f64 y z) < -4.46902792673243601e-111Initial program 14.3
Simplified5.6
rmApplied add-cube-cbrt_binary646.6
Applied associate-*l*_binary646.6
Simplified6.6
rmApplied add-cube-cbrt_binary646.9
Applied *-un-lft-identity_binary646.9
Applied times-frac_binary646.9
Applied associate-*l*_binary644.6
Simplified4.6
if -4.46902792673243601e-111 < (/.f64 y z) < 1.34916762621150185e-212Initial program 15.9
Simplified8.7
rmApplied div-inv_binary648.7
Applied associate-*r*_binary641.4
if 1.34916762621150185e-212 < (/.f64 y z) < 8.2443417280095532e226Initial program 8.7
Simplified0.2
if 8.2443417280095532e226 < (/.f64 y z) Initial program 42.7
Simplified31.9
rmApplied associate-*r/_binary640.4
Final simplification1.9
herbie shell --seed 2020220
(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)))