x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;t \leq -2.6987007251188735 \cdot 10^{-160}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\mathbf{elif}\;t \leq 2.6649632399056567 \cdot 10^{+158}:\\
\;\;\;\;x + \frac{\left(z - x\right) \cdot \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{\sqrt[3]{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\end{array}(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
(FPCore (x y z t)
:precision binary64
(if (<= t -2.6987007251188735e-160)
(+ x (* (/ y t) (- z x)))
(if (<= t 2.6649632399056567e+158)
(+ x (/ (* (- z x) (/ y (* (cbrt t) (cbrt t)))) (cbrt t)))
(+ x (* (/ y t) (- z x))))))double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.6987007251188735e-160) {
tmp = x + ((y / t) * (z - x));
} else if (t <= 2.6649632399056567e+158) {
tmp = x + (((z - x) * (y / (cbrt(t) * cbrt(t)))) / cbrt(t));
} else {
tmp = x + ((y / t) * (z - x));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 2.1 |
| Herbie | 1.9 |
if t < -2.69870072511887347e-160 or 2.6649632399056567e158 < t Initial program 8.6
rmApplied add-cube-cbrt_binary649.0
Applied associate-/r*_binary649.0
Simplified3.1
Taylor expanded around -inf 8.6
Simplified1.3
Taylor expanded around 0 8.6
Simplified1.3
if -2.69870072511887347e-160 < t < 2.6649632399056567e158Initial program 3.7
rmApplied add-cube-cbrt_binary644.4
Applied associate-/r*_binary644.4
Simplified2.9
Final simplification1.9
herbie shell --seed 2020273
(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)))