x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;y \le -8.0142020729490171 \cdot 10^{-97}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\mathbf{elif}\;y \le 3.9095692807924123 \cdot 10^{135}:\\
\;\;\;\;x + \frac{\frac{y}{t}}{\frac{1}{z - x}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((y <= -8.014202072949017e-97)) {
VAR = ((double) (x + ((double) (y / ((double) (t / ((double) (z - x))))))));
} else {
double VAR_1;
if ((y <= 3.909569280792412e+135)) {
VAR_1 = ((double) (x + ((double) (((double) (y / t)) / ((double) (1.0 / ((double) (z - x))))))));
} else {
VAR_1 = ((double) (x + ((double) (y * ((double) (((double) (z - x)) / t))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.4 |
|---|---|
| Target | 2.1 |
| Herbie | 1.7 |
if y < -8.0142020729490171e-97Initial program 10.5
rmApplied associate-/l*2.5
if -8.0142020729490171e-97 < y < 3.9095692807924123e135Initial program 2.7
rmApplied associate-/l*8.1
rmApplied div-inv8.1
Applied associate-/r*1.2
if 3.9095692807924123e135 < y Initial program 21.3
Simplified2.6
Final simplification1.7
herbie shell --seed 2020184
(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)) (* (neg z) (/ y t))))
(+ x (/ (* y (- z x)) t)))