x \cdot \frac{\frac{y}{z} \cdot t}{t}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \leq -\infty:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y}}\\
\mathbf{elif}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \leq -1.8435525049519473 \cdot 10^{-299}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\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}}\\
\end{array}(FPCore (x y z t) :precision binary64 (* x (/ (* (/ y z) t) t)))
(FPCore (x y z t)
:precision binary64
(if (<= (* x (/ (* (/ y z) t) t)) (- INFINITY))
(/ 1.0 (/ (/ z x) y))
(if (<= (* x (/ (* (/ y z) t) t)) -1.8435525049519473e-299)
(* x (/ y z))
(*
(* x (/ (* (cbrt y) (cbrt y)) (* (cbrt z) (cbrt z))))
(/ (cbrt y) (cbrt 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 ((x * (((y / z) * t) / t)) <= -((double) INFINITY)) {
tmp = 1.0 / ((z / x) / y);
} else if ((x * (((y / z) * t) / t)) <= -1.8435525049519473e-299) {
tmp = x * (y / z);
} else {
tmp = (x * ((cbrt(y) * cbrt(y)) / (cbrt(z) * cbrt(z)))) * (cbrt(y) / cbrt(z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 14.8 |
|---|---|
| Target | 1.5 |
| Herbie | 1.5 |
if (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) < -inf.0Initial program 64.0
Simplified28.0
rmApplied associate-*r/_binary64_165341.6
rmApplied clear-num_binary64_165891.7
rmApplied associate-/r*_binary64_165362.8
if -inf.0 < (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) < -1.8435525049519473e-299Initial program 0.7
Simplified0.4
if -1.8435525049519473e-299 < (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) Initial program 16.5
Simplified6.8
rmApplied add-cube-cbrt_binary64_166227.5
Applied add-cube-cbrt_binary64_166227.7
Applied times-frac_binary64_165967.7
Applied associate-*r*_binary64_165321.9
Final simplification1.5
herbie shell --seed 2020292
(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)))