x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \le -31789.4821495515171:\\
\;\;\;\;y \cdot \frac{z - t}{a} + x\\
\mathbf{elif}\;y \le 4.0978388594748642 \cdot 10^{-179}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a} + x\\
\mathbf{elif}\;y \le 2.78403719146078999 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{a} \cdot \left(z - t\right) + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a} + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r274342 = x;
double r274343 = y;
double r274344 = z;
double r274345 = t;
double r274346 = r274344 - r274345;
double r274347 = r274343 * r274346;
double r274348 = a;
double r274349 = r274347 / r274348;
double r274350 = r274342 + r274349;
return r274350;
}
double f(double x, double y, double z, double t, double a) {
double r274351 = y;
double r274352 = -31789.482149551517;
bool r274353 = r274351 <= r274352;
double r274354 = z;
double r274355 = t;
double r274356 = r274354 - r274355;
double r274357 = a;
double r274358 = r274356 / r274357;
double r274359 = r274351 * r274358;
double r274360 = x;
double r274361 = r274359 + r274360;
double r274362 = 4.097838859474864e-179;
bool r274363 = r274351 <= r274362;
double r274364 = r274356 * r274351;
double r274365 = r274364 / r274357;
double r274366 = r274365 + r274360;
double r274367 = 2.78403719146079e-66;
bool r274368 = r274351 <= r274367;
double r274369 = r274351 / r274357;
double r274370 = r274369 * r274356;
double r274371 = r274370 + r274360;
double r274372 = r274368 ? r274371 : r274361;
double r274373 = r274363 ? r274366 : r274372;
double r274374 = r274353 ? r274361 : r274373;
return r274374;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 6.0 |
|---|---|
| Target | 0.7 |
| Herbie | 0.9 |
if y < -31789.482149551517 or 2.78403719146079e-66 < y Initial program 12.9
Simplified3.2
rmApplied fma-udef3.2
rmApplied div-inv3.2
Applied associate-*l*1.2
Simplified1.1
if -31789.482149551517 < y < 4.097838859474864e-179Initial program 0.4
Simplified2.1
rmApplied fma-udef2.1
Taylor expanded around 0 0.4
Simplified0.4
if 4.097838859474864e-179 < y < 2.78403719146079e-66Initial program 0.4
Simplified1.4
rmApplied fma-udef1.4
Final simplification0.9
herbie shell --seed 2020018 +o rules:numerics
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:herbie-target
(if (< y -1.0761266216389975e-10) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))