x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;t \le -1.02195796067103927 \cdot 10^{101} \lor \neg \left(t \le 1.99437682044040998 \cdot 10^{-19}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(z - x\right)\right) \cdot \frac{1}{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 VAR;
if (((t <= -1.0219579606710393e+101) || !(t <= 1.99437682044041e-19))) {
VAR = (x + ((y / t) * (z - x)));
} else {
VAR = (x + ((y * (z - x)) * (1.0 / t)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 5.9 |
|---|---|
| Target | 2.0 |
| Herbie | 1.6 |
if t < -1.0219579606710393e+101 or 1.99437682044041e-19 < t Initial program 9.0
rmApplied associate-/l*1.2
rmApplied associate-/r/1.0
if -1.0219579606710393e+101 < t < 1.99437682044041e-19Initial program 2.3
rmApplied div-inv2.3
Final simplification1.6
herbie shell --seed 2020100
(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)))