x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;t \le -1.242968405003153 \cdot 10^{-105}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\mathbf{elif}\;t \le 4.01571900785735227 \cdot 10^{-64}:\\
\;\;\;\;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 (x + ((y * (z - x)) / t));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((t <= -1.242968405003153e-105)) {
VAR = (x + (y / (t / (z - x))));
} else {
double VAR_1;
if ((t <= 4.015719007857352e-64)) {
VAR_1 = (x + (1.0 / (t / (y * (z - x)))));
} else {
VAR_1 = (x + (y * ((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.1 |
| Herbie | 1.8 |
if t < -1.242968405003153e-105Initial program 7.6
rmApplied associate-/l*1.8
if -1.242968405003153e-105 < t < 4.015719007857352e-64Initial program 2.5
rmApplied clear-num2.6
if 4.015719007857352e-64 < t Initial program 7.4
rmApplied *-un-lft-identity7.4
Applied times-frac1.3
Simplified1.3
Final simplification1.8
herbie shell --seed 2020079
(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)))