x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \le -1.8300468342836098 \cdot 10^{-67} \lor \neg \left(x \le 7.1410784377771534 \cdot 10^{-250}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z + \left(-x\right)}{t}\\
\end{array}double code(double x, double y, double z, double t) {
return (x + ((y * (z - x)) / t));
}
double code(double x, double y, double z, double t) {
double temp;
if (((x <= -1.83004683428361e-67) || !(x <= 7.141078437777153e-250))) {
temp = (x + ((y / t) * (z - x)));
} else {
temp = (x + (y * ((z + -x) / t)));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 2.4 |
| Herbie | 2.3 |
if x < -1.83004683428361e-67 or 7.141078437777153e-250 < x Initial program 7.0
rmApplied sub-neg7.0
Applied distribute-lft-in7.0
rmApplied clear-num7.0
Simplified1.3
rmApplied div-inv1.4
Applied add-cube-cbrt1.4
Applied times-frac1.4
Simplified1.4
Simplified1.3
if -1.83004683428361e-67 < x < 7.141078437777153e-250Initial program 5.4
rmApplied sub-neg5.4
Applied distribute-lft-in5.4
rmApplied *-un-lft-identity5.4
Applied distribute-lft-out5.4
Applied times-frac4.8
Simplified4.8
Final simplification2.3
herbie shell --seed 2020058
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))