\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -7.9826398313164716 \cdot 10^{-55} \lor \neg \left(x \le 2.32423509502939807 \cdot 10^{98}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot 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 (((x <= -7.982639831316472e-55) || !(x <= 2.324235095029398e+98))) {
VAR = ((x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y));
} else {
VAR = ((x - ((y / z) / 3.0)) + (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 | 2.5 |
if x < -7.982639831316472e-55 or 2.324235095029398e+98 < x Initial program 3.2
rmApplied associate-/r*1.0
if -7.982639831316472e-55 < x < 2.324235095029398e+98Initial program 3.8
rmApplied associate-/r*3.8
Final simplification2.5
herbie shell --seed 2020102 +o rules:numerics
(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))))