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:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \leq -9.579476509853023 \cdot 10^{-296}:\\
\;\;\;\;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))
(* y (/ x z))
(if (<= (* x (/ (* (/ y z) t) t)) -9.579476509853023e-296)
(* 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 = y * (x / z);
} else if ((x * (((y / z) * t) / t)) <= -9.579476509853023e-296) {
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.6 |
| Herbie | 1.5 |
if (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) < -inf.0Initial program 64.0
Simplified29.4
rmApplied add-cube-cbrt_binary64_1443530.0
Applied associate-*l*_binary64_1434130.0
Simplified30.0
rmApplied *-un-lft-identity_binary64_1440030.0
Applied add-cube-cbrt_binary64_1443530.2
Applied times-frac_binary64_1440630.2
Applied associate-*l*_binary64_1434119.3
Simplified19.3
Taylor expanded around 0 3.4
Simplified2.6
if -inf.0 < (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) < -9.5794765098530229e-296Initial program 0.8
Simplified0.4
if -9.5794765098530229e-296 < (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) Initial program 16.6
Simplified7.2
rmApplied add-cube-cbrt_binary64_144357.9
Applied add-cube-cbrt_binary64_144358.1
Applied times-frac_binary64_144068.1
Applied associate-*r*_binary64_143401.9
Final simplification1.5
herbie shell --seed 2020346
(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)))