\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\begin{array}{l}
\mathbf{if}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq -5.312039159080881 \cdot 10^{+284}:\\
\;\;\;\;\frac{x}{\frac{a}{\frac{y}{2}}} - t \cdot \left(4.5 \cdot \frac{z}{a}\right)\\
\mathbf{elif}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq 3.4078992350031647 \cdot 10^{+140}:\\
\;\;\;\;\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{2} \cdot \frac{x}{a} - t \cdot \frac{1}{\frac{a}{z \cdot 4.5}}\\
\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 (<= (- (* x y) (* (* z 9.0) t)) -5.312039159080881e+284)
(- (/ x (/ a (/ y 2.0))) (* t (* 4.5 (/ z a))))
(if (<= (- (* x y) (* (* z 9.0) t)) 3.4078992350031647e+140)
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0))
(- (* (/ y 2.0) (/ x a)) (* t (/ 1.0 (/ a (* z 4.5))))))))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)) <= -5.312039159080881e+284) {
tmp = (x / (a / (y / 2.0))) - (t * (4.5 * (z / a)));
} else if (((x * y) - ((z * 9.0) * t)) <= 3.4078992350031647e+140) {
tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
} else {
tmp = ((y / 2.0) * (x / a)) - (t * (1.0 / (a / (z * 4.5))));
}
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.5 |
|---|---|
| Target | 5.5 |
| Herbie | 1.3 |
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -5.3120391590808808e284Initial program 51.5
rmApplied div-sub_binary64_1986151.5
Simplified27.5
rmApplied associate-/l*_binary64_198010.3
Simplified0.3
if -5.3120391590808808e284 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 3.4078992350031647e140Initial program 1.0
if 3.4078992350031647e140 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 19.6
rmApplied div-sub_binary64_1986119.6
Simplified12.5
rmApplied times-frac_binary64_198622.8
rmApplied associate-*r/_binary64_197982.8
rmApplied clear-num_binary64_198553.0
Final simplification1.3
herbie shell --seed 2020342
(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)))