x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;t \leq -1.1482738035764579 \cdot 10^{+26}:\\
\;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\
\mathbf{elif}\;t \leq 7.798937390756335 \cdot 10^{+152}:\\
\;\;\;\;x + \left(\frac{y \cdot z}{t} - \frac{x \cdot y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\sqrt{t}} \cdot \frac{z - x}{\sqrt{t}}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
(FPCore (x y z t)
:precision binary64
(if (<= t -1.1482738035764579e+26)
(+ x (* (/ y (* (cbrt t) (cbrt t))) (/ (- z x) (cbrt t))))
(if (<= t 7.798937390756335e+152)
(+ x (- (/ (* y z) t) (/ (* x y) t)))
(+ x (* (/ y (sqrt t)) (/ (- z x) (sqrt t)))))))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 <= -1.1482738035764579e+26) {
tmp = x + ((y / (cbrt(t) * cbrt(t))) * ((z - x) / cbrt(t)));
} else if (t <= 7.798937390756335e+152) {
tmp = x + (((y * z) / t) - ((x * y) / t));
} else {
tmp = x + ((y / sqrt(t)) * ((z - x) / sqrt(t)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.0 |
| Herbie | 1.9 |
if t < -1.1482738035764579e26Initial program 10.3
rmApplied add-cube-cbrt_binary64_1170710.6
Applied times-frac_binary64_116780.9
if -1.1482738035764579e26 < t < 7.79893739075633478e152Initial program 2.8
Taylor expanded around 0 2.8
if 7.79893739075633478e152 < t Initial program 12.8
rmApplied add-sqr-sqrt_binary64_1169412.8
Applied times-frac_binary64_116780.7
Final simplification1.9
herbie shell --seed 2021028
(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)))