x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - x\right)}{t} \le -3.57164337169283755 \cdot 10^{297}:\\
\;\;\;\;\frac{z - x}{\frac{t}{y}} + x\\
\mathbf{elif}\;x + \frac{y \cdot \left(z - x\right)}{t} \le 1.83014942255142419 \cdot 10^{297}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z - x}} + x\\
\end{array}double f(double x, double y, double z, double t) {
double r418581 = x;
double r418582 = y;
double r418583 = z;
double r418584 = r418583 - r418581;
double r418585 = r418582 * r418584;
double r418586 = t;
double r418587 = r418585 / r418586;
double r418588 = r418581 + r418587;
return r418588;
}
double f(double x, double y, double z, double t) {
double r418589 = x;
double r418590 = y;
double r418591 = z;
double r418592 = r418591 - r418589;
double r418593 = r418590 * r418592;
double r418594 = t;
double r418595 = r418593 / r418594;
double r418596 = r418589 + r418595;
double r418597 = -3.5716433716928375e+297;
bool r418598 = r418596 <= r418597;
double r418599 = r418594 / r418590;
double r418600 = r418592 / r418599;
double r418601 = r418600 + r418589;
double r418602 = 1.8301494225514242e+297;
bool r418603 = r418596 <= r418602;
double r418604 = r418594 / r418592;
double r418605 = r418590 / r418604;
double r418606 = r418605 + r418589;
double r418607 = r418603 ? r418596 : r418606;
double r418608 = r418598 ? r418601 : r418607;
return r418608;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.2 |
|---|---|
| Target | 2.0 |
| Herbie | 0.8 |
if (+ x (/ (* y (- z x)) t)) < -3.5716433716928375e+297Initial program 51.7
rmApplied div-inv51.7
rmApplied pow151.7
Applied pow151.7
Applied pow151.7
Applied pow-prod-down51.7
Applied pow-prod-down51.7
Simplified1.4
if -3.5716433716928375e+297 < (+ x (/ (* y (- z x)) t)) < 1.8301494225514242e+297Initial program 0.6
if 1.8301494225514242e+297 < (+ x (/ (* y (- z x)) t)) Initial program 53.1
Simplified1.1
rmApplied fma-udef1.1
Simplified3.0
Final simplification0.8
herbie shell --seed 2020046 +o rules:numerics
(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)))