x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;y \leq -2.6226741267212798 \cdot 10^{-79}:\\
\;\;\;\;x - \frac{y}{\frac{t}{x - z}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\\
\mathbf{if}\;y \leq 8997470401671517000:\\
\;\;\;\;x + \frac{t_1 \cdot \left(z - x\right)}{\sqrt[3]{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t_1 \cdot \frac{z - x}{\sqrt[3]{t}}\\
\end{array}\\
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
(FPCore (x y z t)
:precision binary64
(if (<= y -2.6226741267212798e-79)
(- x (/ y (/ t (- x z))))
(let* ((t_1 (/ y (* (cbrt t) (cbrt t)))))
(if (<= y 8997470401671517000.0)
(+ x (/ (* t_1 (- z x)) (cbrt t)))
(+ x (* t_1 (/ (- z x) (cbrt 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 (y <= -2.6226741267212798e-79) {
tmp = x - (y / (t / (x - z)));
} else {
double t_1 = y / (cbrt(t) * cbrt(t));
double tmp_1;
if (y <= 8997470401671517000.0) {
tmp_1 = x + ((t_1 * (z - x)) / cbrt(t));
} else {
tmp_1 = x + (t_1 * ((z - x) / cbrt(t)));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.7 |
|---|---|
| Target | 2.1 |
| Herbie | 1.6 |
if y < -2.62267412672127976e-79Initial program 11.3
rmApplied *-un-lft-identity_binary6411.3
Applied times-frac_binary642.1
Simplified2.1
rmApplied add-cube-cbrt_binary642.7
Applied associate-*l*_binary642.7
Simplified2.7
Taylor expanded around -inf 11.3
Simplified1.9
if -2.62267412672127976e-79 < y < 8997470401671517180Initial program 1.3
rmApplied add-cube-cbrt_binary641.7
Applied associate-/r*_binary641.7
Simplified1.1
if 8997470401671517180 < y Initial program 16.7
rmApplied add-cube-cbrt_binary6417.3
Applied times-frac_binary642.8
Final simplification1.6
herbie shell --seed 2021207
(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)))