x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \le -1.046404802305749277589115866530867327017 \cdot 10^{-290}:\\
\;\;\;\;x + \frac{\frac{y}{t}}{\frac{1}{z - x}}\\
\mathbf{elif}\;x \le 2.249132071309161299573562256453440442682 \cdot 10^{-171}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{\frac{t}{y}}{z - x}}\\
\end{array}double f(double x, double y, double z, double t) {
double r326846 = x;
double r326847 = y;
double r326848 = z;
double r326849 = r326848 - r326846;
double r326850 = r326847 * r326849;
double r326851 = t;
double r326852 = r326850 / r326851;
double r326853 = r326846 + r326852;
return r326853;
}
double f(double x, double y, double z, double t) {
double r326854 = x;
double r326855 = -1.0464048023057493e-290;
bool r326856 = r326854 <= r326855;
double r326857 = y;
double r326858 = t;
double r326859 = r326857 / r326858;
double r326860 = 1.0;
double r326861 = z;
double r326862 = r326861 - r326854;
double r326863 = r326860 / r326862;
double r326864 = r326859 / r326863;
double r326865 = r326854 + r326864;
double r326866 = 2.2491320713091613e-171;
bool r326867 = r326854 <= r326866;
double r326868 = r326858 / r326862;
double r326869 = r326857 / r326868;
double r326870 = r326854 + r326869;
double r326871 = r326858 / r326857;
double r326872 = r326871 / r326862;
double r326873 = r326860 / r326872;
double r326874 = r326854 + r326873;
double r326875 = r326867 ? r326870 : r326874;
double r326876 = r326856 ? r326865 : r326875;
return r326876;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.2 |
| Herbie | 2.1 |
if x < -1.0464048023057493e-290Initial program 6.4
rmApplied clear-num6.5
rmApplied associate-/r*2.0
rmApplied div-inv2.0
Applied associate-/r*2.1
Simplified2.0
if -1.0464048023057493e-290 < x < 2.2491320713091613e-171Initial program 5.5
rmApplied associate-/l*5.0
if 2.2491320713091613e-171 < x Initial program 6.9
rmApplied clear-num6.9
rmApplied associate-/r*1.1
Final simplification2.1
herbie shell --seed 2019356
(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)))