\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -2.445545247323066 \cdot 10^{+245}:\\
\;\;\;\;\frac{y}{\frac{a}{\frac{x}{2}}} - \frac{z \cdot t}{a} \cdot 4.5\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;t_1 \leq 2.7505266388208674 \cdot 10^{+198}:\\
\;\;\;\;t_2 - \left(z \cdot t\right) \cdot \frac{4.5}{a}\\
\mathbf{else}:\\
\;\;\;\;t_2 - 4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}\\
\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
(let* ((t_1 (- (* x y) (* (* z 9.0) t))))
(if (<= t_1 -2.445545247323066e+245)
(- (/ y (/ a (/ x 2.0))) (* (/ (* z t) a) 4.5))
(let* ((t_2 (/ (* x y) (* a 2.0))))
(if (<= t_1 2.7505266388208674e+198)
(- t_2 (* (* z t) (/ 4.5 a)))
(- t_2 (* 4.5 (/ t (/ a z)))))))))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 t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if (t_1 <= -2.445545247323066e+245) {
tmp = (y / (a / (x / 2.0))) - (((z * t) / a) * 4.5);
} else {
double t_2 = (x * y) / (a * 2.0);
double tmp_1;
if (t_1 <= 2.7505266388208674e+198) {
tmp_1 = t_2 - ((z * t) * (4.5 / a));
} else {
tmp_1 = t_2 - (4.5 * (t / (a / z)));
}
tmp = tmp_1;
}
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.6 |
|---|---|
| Target | 5.4 |
| Herbie | 4.4 |
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -2.44554524732306611e245Initial program 38.9
rmApplied div-sub_binary6438.9
Simplified38.9
Simplified38.6
rmApplied associate-/l*_binary6419.7
Simplified19.7
if -2.44554524732306611e245 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 2.750526638820867e198Initial program 0.8
rmApplied div-sub_binary640.8
Simplified0.8
Simplified0.8
rmApplied div-inv_binary640.9
Applied associate-*l*_binary640.9
Simplified0.8
if 2.750526638820867e198 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 29.9
rmApplied div-sub_binary6429.9
Simplified29.9
Simplified29.4
rmApplied associate-/l*_binary6417.1
Final simplification4.4
herbie shell --seed 2021204
(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)))