x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - x\right)}{t} = -\infty \lor \neg \left(x + \frac{y \cdot \left(z - x\right)}{t} \le 1.3494005157116993 \cdot 10^{294}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\end{array}double f(double x, double y, double z, double t) {
double r314822 = x;
double r314823 = y;
double r314824 = z;
double r314825 = r314824 - r314822;
double r314826 = r314823 * r314825;
double r314827 = t;
double r314828 = r314826 / r314827;
double r314829 = r314822 + r314828;
return r314829;
}
double f(double x, double y, double z, double t) {
double r314830 = x;
double r314831 = y;
double r314832 = z;
double r314833 = r314832 - r314830;
double r314834 = r314831 * r314833;
double r314835 = t;
double r314836 = r314834 / r314835;
double r314837 = r314830 + r314836;
double r314838 = -inf.0;
bool r314839 = r314837 <= r314838;
double r314840 = 1.3494005157116993e+294;
bool r314841 = r314837 <= r314840;
double r314842 = !r314841;
bool r314843 = r314839 || r314842;
double r314844 = r314831 / r314835;
double r314845 = r314844 * r314833;
double r314846 = r314830 + r314845;
double r314847 = r314843 ? r314846 : r314837;
return r314847;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.0 |
| Herbie | 0.9 |
if (+ x (/ (* y (- z x)) t)) < -inf.0 or 1.3494005157116993e+294 < (+ x (/ (* y (- z x)) t)) Initial program 56.0
rmApplied clear-num56.0
rmApplied associate-/r*0.8
rmApplied div-inv0.8
Applied add-cube-cbrt0.8
Applied times-frac1.0
Simplified1.0
Simplified0.9
if -inf.0 < (+ x (/ (* y (- z x)) t)) < 1.3494005157116993e+294Initial program 0.9
rmApplied clear-num1.0
rmApplied associate-/r*2.0
rmApplied div-inv2.0
Applied add-cube-cbrt2.0
Applied times-frac2.3
Simplified2.1
Simplified2.1
rmApplied associate-*l/0.9
Final simplification0.9
herbie shell --seed 2020024
(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)))