x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;t \le -4.8433825726185352 \cdot 10^{-33} \lor \neg \left(t \le 3.59028723149019767 \cdot 10^{27}\right):\\
\;\;\;\;\frac{y}{t} \cdot \left(z - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{t}{y \cdot \left(z - x\right)}}\\
\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 VAR;
if (((t <= -4.843382572618535e-33) || !(t <= 3.5902872314901977e+27))) {
VAR = (((y / t) * (z - x)) + x);
} else {
VAR = (x + (1.0 / (t / (y * (z - x)))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.4 |
|---|---|
| Target | 2.0 |
| Herbie | 1.2 |
if t < -4.843382572618535e-33 or 3.5902872314901977e+27 < t Initial program 9.3
Simplified1.0
rmApplied fma-udef1.0
if -4.843382572618535e-33 < t < 3.5902872314901977e+27Initial program 1.5
rmApplied clear-num1.6
Final simplification1.2
herbie shell --seed 2020105 +o rules:numerics
(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)))