\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 -2.2668851269500015 \cdot 10^{+249}:\\
\;\;\;\;\frac{x}{\frac{a}{\frac{y}{2}}} - \left(t \cdot \frac{z}{a}\right) \cdot 4.5\\
\mathbf{elif}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq 7.503128600354255 \cdot 10^{+142}:\\
\;\;\;\;\frac{x \cdot y}{a \cdot 2} - \frac{4.5 \cdot \left(z \cdot t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{2} \cdot \frac{x}{a} - \left(t \cdot \frac{z}{a}\right) \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)) -2.2668851269500015e+249)
(- (/ x (/ a (/ y 2.0))) (* (* t (/ z a)) 4.5))
(if (<= (- (* x y) (* (* z 9.0) t)) 7.503128600354255e+142)
(- (/ (* x y) (* a 2.0)) (/ (* 4.5 (* z t)) a))
(- (* (/ y 2.0) (/ x a)) (* (* t (/ z a)) 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)) <= -2.2668851269500015e+249) {
tmp = (x / (a / (y / 2.0))) - ((t * (z / a)) * 4.5);
} else if (((x * y) - ((z * 9.0) * t)) <= 7.503128600354255e+142) {
tmp = ((x * y) / (a * 2.0)) - ((4.5 * (z * t)) / a);
} else {
tmp = ((y / 2.0) * (x / a)) - ((t * (z / a)) * 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.4 |
|---|---|
| Target | 5.8 |
| Herbie | 1.2 |
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -2.2668851269500015e249Initial program 38.1
rmApplied div-sub_binary6438.1
Simplified37.8
rmApplied *-un-lft-identity_binary6437.8
Applied times-frac_binary6421.3
Simplified21.3
rmApplied associate-/l*_binary640.7
Simplified0.7
if -2.2668851269500015e249 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 7.50312860035425482e142Initial program 0.9
rmApplied div-sub_binary640.9
Simplified1.0
rmApplied associate-*l/_binary640.9
if 7.50312860035425482e142 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 19.3
rmApplied div-sub_binary6419.3
Simplified19.0
rmApplied *-un-lft-identity_binary6419.0
Applied times-frac_binary6412.2
Simplified12.2
rmApplied times-frac_binary642.5
Final simplification1.2
herbie shell --seed 2021111
(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)))