{\left(x + \varepsilon\right)}^{2} - {x}^{2}
\varepsilon \cdot \mathsf{fma}\left(2, x, \varepsilon\right)
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 2.0) (pow x 2.0)))
(FPCore (x eps) :precision binary64 (* eps (fma 2.0 x eps)))
double code(double x, double eps) {
return pow((x + eps), 2.0) - pow(x, 2.0);
}
double code(double x, double eps) {
return eps * fma(2.0, x, eps);
}



Bits error versus x



Bits error versus eps
Initial program 16.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2022125
(FPCore (x eps)
:name "ENA, Section 1.4, Exercise 4b, n=2"
:precision binary64
:pre (and (and (<= -1000000000.0 x) (<= x 1000000000.0)) (and (<= -1.0 eps) (<= eps 1.0)))
(- (pow (+ x eps) 2.0) (pow x 2.0)))