\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\begin{array}{l}
\mathbf{if}\;x \leq -4.175740189811104 \cdot 10^{-35}:\\
\;\;\;\;\frac{y}{a} \cdot \frac{x}{2} - t \cdot \left(\frac{z}{a} \cdot \frac{9}{2}\right)\\
\mathbf{elif}\;x \leq 1.1206573610708866 \cdot 10^{+135}:\\
\;\;\;\;\frac{1}{2 \cdot \frac{a}{x \cdot y - z \cdot \left(t \cdot 9\right)}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a \cdot 2} - \frac{9}{2} \cdot \left(t \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 -4.175740189811104e-35)
(- (* (/ y a) (/ x 2.0)) (* t (* (/ z a) (/ 9.0 2.0))))
(if (<= x 1.1206573610708866e+135)
(/ 1.0 (* 2.0 (/ a (- (* x y) (* z (* t 9.0))))))
(- (* y (/ x (* a 2.0))) (* (/ 9.0 2.0) (* t (/ z a)))))))double code(double x, double y, double z, double t, double a) {
return (((double) (((double) (x * y)) - ((double) (((double) (z * 9.0)) * t)))) / ((double) (a * 2.0)));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4.175740189811104e-35)) {
tmp = ((double) (((double) ((y / a) * (x / 2.0))) - ((double) (t * ((double) ((z / a) * (9.0 / 2.0)))))));
} else {
double tmp_1;
if ((x <= 1.1206573610708866e+135)) {
tmp_1 = (1.0 / ((double) (2.0 * (a / ((double) (((double) (x * y)) - ((double) (z * ((double) (t * 9.0))))))))));
} else {
tmp_1 = ((double) (((double) (y * (x / ((double) (a * 2.0))))) - ((double) ((9.0 / 2.0) * ((double) (t * (z / a)))))));
}
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.8 |
|---|---|
| Target | 5.7 |
| Herbie | 5.9 |
if x < -4.17574018981110384e-35Initial program Error: 11.3 bits
rmApplied div-subError: 11.3 bits
SimplifiedError: 8.8 bits
SimplifiedError: 7.4 bits
rmApplied *-un-lft-identityError: 7.4 bits
Applied times-fracError: 7.5 bits
Applied associate-*r*Error: 6.2 bits
SimplifiedError: 6.2 bits
if -4.17574018981110384e-35 < x < 1.1206573610708866e135Initial program Error: 5.0 bits
rmApplied clear-numError: 5.3 bits
SimplifiedError: 5.3 bits
if 1.1206573610708866e135 < x Initial program Error: 15.7 bits
rmApplied div-subError: 15.7 bits
SimplifiedError: 13.1 bits
SimplifiedError: 9.1 bits
rmApplied associate-*r*Error: 9.1 bits
Final simplificationError: 5.9 bits
herbie shell --seed 2020204
(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)))