\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;t \le -1.5895957554367089 \cdot 10^{-177} \lor \neg \left(t \le 2.09525465107599276 \cdot 10^{-5}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{3 \cdot \left(z \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((t <= -1.5895957554367089e-177) || !(t <= 2.0952546510759928e-05))) {
VAR = ((x - (y / (z * 3.0))) + (t / (3.0 * (z * y))));
} else {
VAR = ((x - (y / (z * 3.0))) + ((1.0 / (z * 3.0)) * (t / y)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.7 |
|---|---|
| Target | 1.6 |
| Herbie | 0.9 |
if t < -1.5895957554367089e-177 or 2.0952546510759928e-05 < t Initial program 1.5
Taylor expanded around 0 1.5
if -1.5895957554367089e-177 < t < 2.0952546510759928e-05Initial program 6.7
rmApplied *-un-lft-identity6.7
Applied times-frac0.2
Final simplification0.9
herbie shell --seed 2020079
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y))
(+ (- x (/ y (* z 3))) (/ t (* (* z 3) y))))