x + \frac{y \cdot \left(z - t\right)}{a}
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t_1 \leq -9.28850039489529 \cdot 10^{-259}:\\
\;\;\;\;x + \frac{1}{\frac{\frac{a}{y}}{z - t}}\\
\mathbf{elif}\;t_1 \leq 5.444881623987164 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y (- z t)) a))))
(if (<= t_1 -9.28850039489529e-259)
(+ x (/ 1.0 (/ (/ a y) (- z t))))
(if (<= t_1 5.444881623987164e+304) t_1 (+ x (/ y (/ a (- z t))))))))double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * (z - t)) / a);
double tmp;
if (t_1 <= -9.28850039489529e-259) {
tmp = x + (1.0 / ((a / y) / (z - t)));
} else if (t_1 <= 5.444881623987164e+304) {
tmp = t_1;
} else {
tmp = x + (y / (a / (z - t)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 6.1 |
|---|---|
| Target | 1.0 |
| Herbie | 1.5 |
if (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) a)) < -9.288500394895289e-259Initial program 5.9
Applied clear-num_binary645.9
Applied associate-/r*_binary642.5
if -9.288500394895289e-259 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) a)) < 5.4448816239871644e304Initial program 0.6
if 5.4448816239871644e304 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) a)) Initial program 58.3
Applied associate-/l*_binary641.3
Final simplification1.5
herbie shell --seed 2022067
(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.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))