\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.5270184564601798 \cdot 10^{134}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + 0.333333333333333315 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{\frac{t}{z}}{3}}{y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (t / ((double) (((double) (z * 3.0)) * y))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((t <= -1.5270184564601798e+134)) {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (0.3333333333333333 * ((double) (t / ((double) (z * y))))))));
} else {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (((double) (((double) (t / z)) / 3.0)) / y))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.6 |
|---|---|
| Target | 1.7 |
| Herbie | 1.3 |
if t < -1.5270184564601798e134Initial program 1.1
Taylor expanded around 0 1.2
if -1.5270184564601798e134 < t Initial program 3.9
rmApplied associate-/r*1.3
rmApplied associate-/r*1.3
Final simplification1.3
herbie shell --seed 2020163
(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))))