\sqrt{\left|\frac{a \cdot a - b \cdot b}{a \cdot a}\right|}
\sqrt{\left|\mathsf{fma}\left(\frac{b}{a}, \frac{b}{a}, -1\right)\right|}
(FPCore (a b) :precision binary64 (sqrt (fabs (/ (- (* a a) (* b b)) (* a a)))))
(FPCore (a b) :precision binary64 (sqrt (fabs (fma (/ b a) (/ b a) -1.0))))
double code(double a, double b) {
return sqrt(fabs(((a * a) - (b * b)) / (a * a)));
}
double code(double a, double b) {
return sqrt(fabs(fma((b / a), (b / a), -1.0)));
}



Bits error versus a



Bits error versus b
Initial program 14.0
Taylor expanded in a around 0 14.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021291
(FPCore (a b)
:name "Eccentricity of an ellipse"
:precision binary64
:pre (and (and (<= 0.0 b) (<= b a)) (<= a 1.0))
(sqrt (fabs (/ (- (* a a) (* b b)) (* a a)))))