x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(z - x\right) \cdot y}{t} = -\infty:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\mathbf{elif}\;x + \frac{\left(z - x\right) \cdot y}{t} \le 6.397153737655851 \cdot 10^{+305}:\\
\;\;\;\;x + \frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - x}{\frac{t}{y}} + x\\
\end{array}double f(double x, double y, double z, double t) {
double r29145217 = x;
double r29145218 = y;
double r29145219 = z;
double r29145220 = r29145219 - r29145217;
double r29145221 = r29145218 * r29145220;
double r29145222 = t;
double r29145223 = r29145221 / r29145222;
double r29145224 = r29145217 + r29145223;
return r29145224;
}
double f(double x, double y, double z, double t) {
double r29145225 = x;
double r29145226 = z;
double r29145227 = r29145226 - r29145225;
double r29145228 = y;
double r29145229 = r29145227 * r29145228;
double r29145230 = t;
double r29145231 = r29145229 / r29145230;
double r29145232 = r29145225 + r29145231;
double r29145233 = -inf.0;
bool r29145234 = r29145232 <= r29145233;
double r29145235 = r29145230 / r29145227;
double r29145236 = r29145228 / r29145235;
double r29145237 = r29145225 + r29145236;
double r29145238 = 6.397153737655851e+305;
bool r29145239 = r29145232 <= r29145238;
double r29145240 = r29145230 / r29145228;
double r29145241 = r29145227 / r29145240;
double r29145242 = r29145241 + r29145225;
double r29145243 = r29145239 ? r29145232 : r29145242;
double r29145244 = r29145234 ? r29145237 : r29145243;
return r29145244;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 5.9 |
|---|---|
| Target | 2.0 |
| Herbie | 0.8 |
if (+ x (/ (* y (- z x)) t)) < -inf.0Initial program 60.2
rmApplied associate-/l*0.2
if -inf.0 < (+ x (/ (* y (- z x)) t)) < 6.397153737655851e+305Initial program 0.8
if 6.397153737655851e+305 < (+ x (/ (* y (- z x)) t)) Initial program 57.9
rmApplied *-un-lft-identity57.9
Applied *-commutative57.9
Applied times-frac0.5
Simplified0.5
rmApplied clear-num0.6
Applied un-div-inv0.5
Final simplification0.8
herbie shell --seed 2019158
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))