\sqrt{\left|\frac{a \cdot a - b \cdot b}{a \cdot a}\right|}
\begin{array}{l}
t_0 := \frac{\sqrt{b}}{a}\\
\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\left|\mathsf{fma}\left(b, t_0 \cdot t_0, -1\right)\right|}\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))) (expm1 (log1p (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 expm1(log1p(sqrt(fabs(fma(b, (t_0 * t_0), -1.0)))));
}



Bits error versus a



Bits error versus b
Initial program 14.8
Simplified14.8
rmApplied add-sqr-sqrt_binary6414.8
Simplified14.8
Simplified0.0
rmApplied expm1-log1p-u_binary640.0
Final simplification0.0
herbie shell --seed 2021211
(FPCore (a b)
:name "Eccentricity of an ellipse"
:precision binary64
:pre (<= 0.0 b a 1.0)
(sqrt (fabs (/ (- (* a a) (* b b)) (* a a)))))