x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\begin{array}{l}
\mathbf{if}\;t \le -4.9327349569339891 \cdot 10^{-308}:\\
\;\;\;\;x - \frac{y \cdot 2}{z \cdot 2 - t \cdot \frac{y}{z}}\\
\mathbf{elif}\;t \le 7.00890351588839801 \cdot 10^{-130}:\\
\;\;\;\;x - \left(y \cdot 2\right) \cdot \frac{z}{2 \cdot {z}^{2} - t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{z \cdot 2 - \frac{t}{\frac{z}{y}}}{y \cdot 2}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x - ((double) (((double) (((double) (y * 2.0)) * z)) / ((double) (((double) (((double) (z * 2.0)) * z)) - ((double) (y * t))))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((t <= -4.932734956933989e-308)) {
VAR = ((double) (x - ((double) (((double) (y * 2.0)) / ((double) (((double) (z * 2.0)) - ((double) (t * ((double) (y / z))))))))));
} else {
double VAR_1;
if ((t <= 7.008903515888398e-130)) {
VAR_1 = ((double) (x - ((double) (((double) (y * 2.0)) * ((double) (z / ((double) (((double) (2.0 * ((double) pow(z, 2.0)))) - ((double) (t * y))))))))));
} else {
VAR_1 = ((double) (x - ((double) (1.0 / ((double) (((double) (((double) (z * 2.0)) - ((double) (t / ((double) (z / y)))))) / ((double) (y * 2.0))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.6 |
|---|---|
| Target | 0.1 |
| Herbie | 3.0 |
if t < -4.9327349569339891e-308Initial program 11.5
rmApplied associate-/l*6.7
rmApplied div-sub6.7
Simplified2.8
Simplified2.8
rmApplied *-un-lft-identity2.8
Applied times-frac2.5
Simplified2.5
if -4.9327349569339891e-308 < t < 7.00890351588839801e-130Initial program 14.3
rmApplied *-un-lft-identity14.3
Applied times-frac8.6
Simplified8.6
Simplified8.6
if 7.00890351588839801e-130 < t Initial program 10.5
rmApplied associate-/l*5.8
rmApplied div-sub5.8
Simplified2.9
Simplified2.9
rmApplied associate-/l*1.5
rmApplied clear-num1.5
Final simplification3.0
herbie shell --seed 2020153
(FPCore (x y z t)
:name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
:precision binary64
:herbie-target
(- x (/ 1.0 (- (/ z y) (/ (/ t 2.0) z))))
(- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))