x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;y \leq -1.8785827045278664 \cdot 10^{-119}:\\
\;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\
\mathbf{elif}\;y \leq 2.0458176807427126 \cdot 10^{-151}:\\
\;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
(FPCore (x y z t)
:precision binary64
(if (<= y -1.8785827045278664e-119)
(+ x (* (/ y (* (cbrt t) (cbrt t))) (/ (- z x) (cbrt t))))
(if (<= y 2.0458176807427126e-151)
(+ x (/ (* y (- z x)) t))
(+ x (* (- z x) (/ y t))))))double code(double x, double y, double z, double t) {
return ((double) (x + (((double) (y * ((double) (z - x)))) / t)));
}
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8785827045278664e-119)) {
tmp = ((double) (x + ((double) ((y / ((double) (((double) cbrt(t)) * ((double) cbrt(t))))) * (((double) (z - x)) / ((double) cbrt(t)))))));
} else {
double tmp_1;
if ((y <= 2.0458176807427126e-151)) {
tmp_1 = ((double) (x + (((double) (y * ((double) (z - x)))) / t)));
} else {
tmp_1 = ((double) (x + ((double) (((double) (z - x)) * (y / 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.9 |
|---|---|
| Target | 2.2 |
| Herbie | 2.0 |
if y < -1.87858270452786636e-119Initial program 10.6
rmApplied add-cube-cbrt_binary6411.2
Applied times-frac_binary642.1
if -1.87858270452786636e-119 < y < 2.04581768074271265e-151Initial program 1.4
if 2.04581768074271265e-151 < y Initial program 9.5
rmApplied add-cube-cbrt_binary6410.0
Applied times-frac_binary642.0
rmApplied pow1_binary642.0
Applied pow1_binary642.0
Applied pow-prod-down_binary642.0
Simplified2.5
Final simplification2.0
herbie shell --seed 2020219
(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)))