\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 -1.446071231350435 \cdot 10^{+278}:\\
\;\;\;\;\frac{x}{\frac{a}{\frac{y}{2}}} - \left(t \cdot 4.5\right) \cdot \frac{z}{a}\\
\mathbf{elif}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq 2.2375349926989337 \cdot 10^{+204}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t \cdot -9\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{2} \cdot \frac{x}{a} - t \cdot \left(4.5 \cdot \frac{z}{a}\right)\\
\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)) -1.446071231350435e+278)
(- (/ x (/ a (/ y 2.0))) (* (* t 4.5) (/ z a)))
(if (<= (- (* x y) (* (* z 9.0) t)) 2.2375349926989337e+204)
(/ (+ (* x y) (* z (* t -9.0))) (* a 2.0))
(- (* (/ y 2.0) (/ x a)) (* t (* 4.5 (/ z a)))))))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)) <= -1.446071231350435e+278) {
tmp = (x / (a / (y / 2.0))) - ((t * 4.5) * (z / a));
} else if (((x * y) - ((z * 9.0) * t)) <= 2.2375349926989337e+204) {
tmp = ((x * y) + (z * (t * -9.0))) / (a * 2.0);
} else {
tmp = ((y / 2.0) * (x / a)) - (t * (4.5 * (z / a)));
}
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.9 |
| Herbie | 1.0 |
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -1.44607123135043502e278Initial program 48.5
rmApplied div-sub_binary6448.6
Simplified25.1
rmApplied associate-/l*_binary640.3
Simplified0.3
rmApplied associate-*r*_binary640.4
if -1.44607123135043502e278 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 2.2375349926989337e204Initial program 0.9
rmApplied sub-neg_binary640.9
Simplified0.9
if 2.2375349926989337e204 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 31.4
rmApplied div-sub_binary6431.4
Simplified19.4
rmApplied times-frac_binary641.8
Final simplification1.0
herbie shell --seed 2020219
(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)))