\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -2079016385846159.2 \lor \neg \left(z \cdot 3 \leq 3.985574761400528 \cdot 10^{-181}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{z \cdot -3} \cdot \left(y - \frac{t}{y}\right)\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
(FPCore (x y z t)
:precision binary64
(if (or (<= (* z 3.0) -2079016385846159.2)
(not (<= (* z 3.0) 3.985574761400528e-181)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y)))
(+ x (* (/ 1.0 (* z -3.0)) (- y (/ t y))))))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 tmp;
if (((z * 3.0) <= -2079016385846159.2) || !((z * 3.0) <= 3.985574761400528e-181)) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + ((1.0 / (z * -3.0)) * (y - (t / y)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.6 |
|---|---|
| Target | 1.6 |
| Herbie | 1.0 |
if (*.f64 z 3) < -2079016385846159.25 or 3.9855747614005278e-181 < (*.f64 z 3) Initial program 1.1
if -2079016385846159.25 < (*.f64 z 3) < 3.9855747614005278e-181Initial program 12.2
Simplified0.3
rmApplied clear-num_binary64_120120.4
rmApplied div-inv_binary64_120100.3
Simplified0.3
Final simplification1.0
herbie shell --seed 2020354
(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))))