x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\begin{array}{l}
\mathbf{if}\;y \le 6.41298001160430249 \cdot 10^{168} \lor \neg \left(y \le 1.7509518152818834 \cdot 10^{246}\right):\\
\;\;\;\;x - \frac{y \cdot 2}{2 \cdot z - t \cdot \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \left(y \cdot 2\right) \cdot \frac{z}{2 \cdot {z}^{2} - t \cdot y}\\
\end{array}double code(double x, double y, double z, double t) {
return (x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t))));
}
double code(double x, double y, double z, double t) {
double temp;
if (((y <= 6.4129800116043025e+168) || !(y <= 1.7509518152818834e+246))) {
temp = (x - ((y * 2.0) / ((2.0 * z) - (t * (y / z)))));
} else {
temp = (x - ((y * 2.0) * (z / ((2.0 * pow(z, 2.0)) - (t * y)))));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 12.0 |
|---|---|
| Target | 0.1 |
| Herbie | 2.7 |
if y < 6.4129800116043025e+168 or 1.7509518152818834e+246 < y Initial program 11.3
rmApplied associate-/l*6.3
Taylor expanded around 0 2.6
rmApplied *-un-lft-identity2.6
Applied times-frac2.1
Simplified2.1
if 6.4129800116043025e+168 < y < 1.7509518152818834e+246Initial program 22.0
rmApplied *-un-lft-identity22.0
Applied times-frac9.8
Simplified9.8
Simplified9.8
Final simplification2.7
herbie shell --seed 2020060
(FPCore (x y z t)
:name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
:precision binary64
:herbie-target
(- x (/ 1 (- (/ z y) (/ (/ t 2) z))))
(- x (/ (* (* y 2) z) (- (* (* z 2) z) (* y t)))))