\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;t \leq -1.8595142289576375 \cdot 10^{-07} \lor \neg \left(t \leq 4.6861036274789447 \cdot 10^{+27}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{\frac{t}{y} - y}{z}}{3}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (x - (y / ((double) (z * 3.0))))) + (t / ((double) (((double) (z * 3.0)) * y)))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((t <= -1.8595142289576375e-07) || !(t <= 4.6861036274789447e+27))) {
VAR = ((double) (((double) (x - (y / ((double) (z * 3.0))))) + (t / ((double) (y * ((double) (z * 3.0)))))));
} else {
VAR = ((double) (x + ((((double) ((t / y) - y)) / z) / 3.0)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.8 |
|---|---|
| Target | 1.8 |
| Herbie | 0.4 |
if t < -1.85951422895763749e-7 or 4.6861036274789447e27 < t Initial program 0.7
if -1.85951422895763749e-7 < t < 4.6861036274789447e27Initial program 6.0
Simplified0.3
rmApplied associate-/r*0.3
Final simplification0.4
herbie shell --seed 2020196
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))