\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \leq -2.8008563787642985 \cdot 10^{+283} \lor \neg \left(\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \leq 3.338319463100624 \cdot 10^{+294}\right):\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2} - \frac{t}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \left(4.5 \cdot \frac{z}{\sqrt[3]{a}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\
\end{array}(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
(FPCore (x y z t a)
:precision binary64
(if (or (<=
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0))
-2.8008563787642985e+283)
(not
(<=
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0))
3.338319463100624e+294)))
(-
(* (/ x a) (/ y 2.0))
(* (/ t (* (cbrt a) (cbrt a))) (* 4.5 (/ z (cbrt a)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0))))double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((((x * y) - ((z * 9.0) * t)) / (a * 2.0)) <= -2.8008563787642985e+283) || !((((x * y) - ((z * 9.0) * t)) / (a * 2.0)) <= 3.338319463100624e+294)) {
tmp = ((x / a) * (y / 2.0)) - ((t / (cbrt(a) * cbrt(a))) * (4.5 * (z / cbrt(a))));
} else {
tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 7.9 |
|---|---|
| Target | 5.3 |
| Herbie | 1.3 |
if (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) (*.f64 a 2)) < -2.80085637876429845e283 or 3.33831946310062391e294 < (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) (*.f64 a 2)) Initial program 52.3
rmApplied div-sub_binary6452.3
Simplified51.7
rmApplied add-cube-cbrt_binary6451.8
Applied times-frac_binary6429.1
Applied associate-*l*_binary6429.1
Simplified29.1
rmApplied times-frac_binary644.3
if -2.80085637876429845e283 < (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) (*.f64 a 2)) < 3.33831946310062391e294Initial program 0.9
rmApplied pow1_binary640.9
Final simplification1.3
herbie shell --seed 2021118
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:herbie-target
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))