x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
t_1 := \frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\\
\mathbf{if}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \leq -2.6237 \cdot 10^{-319}:\\
\;\;\;\;\left(x \cdot t_1\right) \cdot \frac{y}{\sqrt[3]{z}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt{t_1}\\
\left(t_2 \cdot \left(\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot t_2\right)\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}
\end{array}\\
\end{array}
(FPCore (x y z t) :precision binary64 (* x (/ (* (/ y z) t) t)))
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (* (cbrt z) (cbrt z)))))
(if (<= (* x (/ (* (/ y z) t) t)) -2.6237e-319)
(* (* x t_1) (/ y (cbrt z)))
(let* ((t_2 (sqrt t_1)))
(*
(* t_2 (* (* x (* (cbrt y) (cbrt y))) t_2))
(/ (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 t_1 = 1.0 / (cbrt(z) * cbrt(z));
double tmp;
if ((x * (((y / z) * t) / t)) <= -2.6237e-319) {
tmp = (x * t_1) * (y / cbrt(z));
} else {
double t_2 = sqrt(t_1);
tmp = (t_2 * ((x * (cbrt(y) * cbrt(y))) * t_2)) * (cbrt(y) / cbrt(z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.9 |
|---|---|
| Target | 1.1 |
| Herbie | 3.6 |
if (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) < -2.62369e-319Initial program 8.3
Simplified3.1
Applied add-cube-cbrt_binary643.9
Applied *-un-lft-identity_binary643.9
Applied times-frac_binary643.9
Applied associate-*r*_binary644.8
if -2.62369e-319 < (*.f64 x (/.f64 (*.f64 (/.f64 y z) t) t)) Initial program 14.1
Simplified5.9
Applied *-un-lft-identity_binary645.9
Applied add-cube-cbrt_binary646.5
Applied times-frac_binary646.5
Applied associate-*r*_binary643.7
Simplified3.7
Applied add-cube-cbrt_binary643.9
Applied *-un-lft-identity_binary643.9
Applied times-frac_binary643.9
Applied associate-*r*_binary642.8
Applied add-sqr-sqrt_binary642.9
Applied associate-*r*_binary642.9
Final simplification3.6
herbie shell --seed 2022068
(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)))