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



Bits error versus a



Bits error versus b
Initial program 14.4
Simplified14.4
Applied add-sqr-sqrt_binary6414.4
Applied times-frac_binary640.0
Final simplification0.0
herbie shell --seed 2022081
(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)))))