x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;y \leq -7.933019809099192 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - x}{t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{y} \cdot \sqrt[3]{y}\\
\mathbf{if}\;y \leq 1.3006984664826421 \cdot 10^{-183}:\\
\;\;\;\;x + \frac{t_1}{t} \cdot \left(\left(z - x\right) \cdot \sqrt[3]{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t_1}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{z - x}}\\
\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 -7.933019809099192e-29)
(fma y (/ (- z x) t) x)
(let* ((t_1 (* (cbrt y) (cbrt y))))
(if (<= y 1.3006984664826421e-183)
(+ x (* (/ t_1 t) (* (- z x) (cbrt y))))
(+
x
(*
(/ t_1 (* (cbrt t) (cbrt t)))
(/ (cbrt y) (/ (cbrt 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 (y <= -7.933019809099192e-29) {
tmp = fma(y, ((z - x) / t), x);
} else {
double t_1 = cbrt(y) * cbrt(y);
double tmp_1;
if (y <= 1.3006984664826421e-183) {
tmp_1 = x + ((t_1 / t) * ((z - x) * cbrt(y)));
} else {
tmp_1 = x + ((t_1 / (cbrt(t) * cbrt(t))) * (cbrt(y) / (cbrt(t) / (z - x))));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.3 |
|---|---|
| Target | 2.0 |
| Herbie | 1.4 |
if y < -7.93301980909919193e-29Initial program 13.3
Simplified1.8
if -7.93301980909919193e-29 < y < 1.300698466482642e-183Initial program 1.1
Applied associate-/l*_binary6410.3
Applied div-inv_binary6410.3
Applied add-cube-cbrt_binary6410.5
Applied times-frac_binary640.9
Simplified0.9
if 1.300698466482642e-183 < y Initial program 8.2
Applied associate-/l*_binary644.0
Applied *-un-lft-identity_binary644.0
Applied add-cube-cbrt_binary644.6
Applied times-frac_binary644.6
Applied add-cube-cbrt_binary644.7
Applied times-frac_binary641.6
Simplified1.6
Final simplification1.4
herbie shell --seed 2021275
(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)))