x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;t \le -5.69623630598695 \cdot 10^{-44} \lor \neg \left(t \le 1.8302059170575166 \cdot 10^{-153}\right):\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{y \cdot \left(\sqrt[3]{z - x} \cdot \sqrt[3]{z - x}\right)}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{z - x}}{\sqrt[3]{t}}\right) \cdot \frac{1}{\sqrt[3]{t}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((t <= -5.69623630598695e-44) || !(t <= 1.8302059170575166e-153))) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (z - x)) / t))))));
} else {
VAR = ((double) (x + ((double) (((double) (((double) (((double) (y * ((double) (((double) cbrt(((double) (z - x)))) * ((double) cbrt(((double) (z - x)))))))) / ((double) cbrt(t)))) * ((double) (((double) cbrt(((double) (z - x)))) / ((double) cbrt(t)))))) * ((double) (1.0 / ((double) cbrt(t))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.3 |
|---|---|
| Target | 2.1 |
| Herbie | 2.6 |
if t < -5.69623630598695e-44 or 1.8302059170575166e-153 < t Initial program 7.5
rmApplied *-un-lft-identity7.5
Applied times-frac2.6
Simplified2.6
if -5.69623630598695e-44 < t < 1.8302059170575166e-153Initial program 2.4
rmApplied add-cube-cbrt3.4
Applied times-frac8.7
rmApplied div-inv8.7
Applied associate-*r*3.7
Simplified7.4
rmApplied *-un-lft-identity7.4
Applied add-cube-cbrt7.6
Applied times-frac7.6
Applied associate-*r*2.6
Simplified2.5
Final simplification2.6
herbie shell --seed 2020161
(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)) (* (neg z) (/ y t))))
(+ x (/ (* y (- z x)) t)))