x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;t \le -2.3586519208860508 \cdot 10^{25}:\\
\;\;\;\;x + \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{\sqrt[3]{y}}} \cdot \frac{\sqrt[3]{y}}{\frac{\sqrt[3]{t}}{z - x}}\\
\mathbf{elif}\;t \le 6.9694522298809892 \cdot 10^{-21}:\\
\;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - x\right)\\
\end{array}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 VAR;
if ((t <= -2.358651920886051e+25)) {
VAR = (x + ((cbrt(y) / ((cbrt(t) * cbrt(t)) / cbrt(y))) * (cbrt(y) / (cbrt(t) / (z - x)))));
} else {
double VAR_1;
if ((t <= 6.969452229880989e-21)) {
VAR_1 = (x + (((z * y) / t) - ((x * y) / t)));
} else {
VAR_1 = (x + ((y / t) * (z - x)));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 1.9 |
| Herbie | 1.2 |
if t < -2.358651920886051e+25Initial program 10.8
rmApplied associate-/l*1.1
rmApplied *-un-lft-identity1.1
Applied add-cube-cbrt1.5
Applied times-frac1.5
Applied add-cube-cbrt1.6
Applied times-frac0.7
Simplified0.7
if -2.358651920886051e+25 < t < 6.969452229880989e-21Initial program 1.9
rmApplied add-cube-cbrt2.7
Applied times-frac6.0
Taylor expanded around 0 1.9
if 6.969452229880989e-21 < t Initial program 8.8
rmApplied associate-/l*0.8
rmApplied associate-/r/1.0
Final simplification1.2
herbie shell --seed 2020102
(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)))