\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq -6.866700008068578 \cdot 10^{+228}:\\
\;\;\;\;x + \left(\frac{t}{y} - y\right) \cdot \frac{1}{z \cdot 3}\\
\mathbf{elif}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 3.5032342006610504 \cdot 10^{+298}:\\
\;\;\;\;x + \frac{\frac{t}{y \cdot z} - \frac{y}{z}}{3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{z} \cdot \frac{\frac{t}{y} - y}{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 ((((double) (((double) (x - (y / ((double) (z * 3.0))))) + (t / ((double) (y * ((double) (z * 3.0))))))) <= -6.866700008068578e+228)) {
VAR = ((double) (x + ((double) (((double) ((t / y) - y)) * (1.0 / ((double) (z * 3.0)))))));
} else {
double VAR_1;
if ((((double) (((double) (x - (y / ((double) (z * 3.0))))) + (t / ((double) (y * ((double) (z * 3.0))))))) <= 3.5032342006610504e+298)) {
VAR_1 = ((double) (x + (((double) ((t / ((double) (y * z))) - (y / z))) / 3.0)));
} else {
VAR_1 = ((double) (x + ((double) ((1.0 / z) * (((double) ((t / y) - y)) / 3.0)))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.5 |
|---|---|
| Target | 1.6 |
| Herbie | 1.4 |
if (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) < -6.8667000080685776e228Initial program 11.1
Simplified5.7
rmApplied div-inv5.8
if -6.8667000080685776e228 < (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) < 3.5032342006610504e298Initial program 0.5
Simplified3.5
rmApplied associate-/r*3.5
rmApplied div-sub3.5
Simplified0.5
if 3.5032342006610504e298 < (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) Initial program 40.2
Simplified3.6
rmApplied *-un-lft-identity3.6
Applied times-frac3.6
Final simplification1.4
herbie shell --seed 2020199
(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))))