x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;t \le -4.9055154236988358 \cdot 10^{-116}:\\
\;\;\;\;x + \frac{\frac{y}{t}}{\frac{1}{z - x}}\\
\mathbf{elif}\;t \le 1.3978448114834497 \cdot 10^{-40}:\\
\;\;\;\;x + \frac{1}{\frac{t}{y \cdot \left(z - x\right)}}\\
\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 ((t <= -4.905515423698836e-116)) {
VAR = ((double) (x + ((double) (((double) (y / t)) / ((double) (1.0 / ((double) (z - x))))))));
} else {
double VAR_1;
if ((t <= 1.3978448114834497e-40)) {
VAR_1 = ((double) (x + ((double) (1.0 / ((double) (t / ((double) (y * ((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.3 |
|---|---|
| Target | 2.0 |
| Herbie | 1.7 |
if t < -4.905515423698836e-116Initial program 7.0
rmApplied associate-/l*2.0
rmApplied div-inv2.1
Applied associate-/r*1.2
if -4.905515423698836e-116 < t < 1.3978448114834497e-40Initial program 2.5
rmApplied clear-num2.6
if 1.3978448114834497e-40 < t Initial program 8.3
rmApplied *-un-lft-identity8.3
Applied times-frac1.5
Simplified1.5
Final simplification1.7
herbie shell --seed 2020123
(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)))