\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\begin{array}{l}
\mathbf{if}\;C \leq -4.583468965674152 \cdot 10^{-60}:\\
\;\;\;\;-0.25 \cdot \frac{\sqrt{-16 \cdot \left(C \cdot F\right)}}{C}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := 2 \cdot \left(F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\\
t_1 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
\mathbf{if}\;C \leq -4.1890341447133404 \cdot 10^{-268}:\\
\;\;\;\;\frac{-1}{\frac{t_1}{\sqrt{t_1 \cdot t_0}}}\\
\mathbf{elif}\;C \leq 2.595610150498829 \cdot 10^{-95}:\\
\;\;\;\;-\frac{\sqrt{t_0}}{\sqrt{t_1}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \frac{-1}{0.5 \cdot \sqrt{-4 \cdot \frac{C}{F}}}\\
\mathbf{if}\;C \leq 1.3072799572480792 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_1}\\
\mathbf{if}\;C \leq 1.4999553372101038 \cdot 10^{+103}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;C \leq 2.1421053442050514 \cdot 10^{+178}:\\
\;\;\;\;-2 \cdot \sqrt{-0.25 \cdot \frac{F}{C}}\\
\mathbf{elif}\;C \leq 1.9355356954408794 \cdot 10^{+298}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}\\
\end{array}\\
\end{array}\\
\end{array}
(FPCore (A B C F)
:precision binary64
(/
(-
(sqrt
(*
(* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F))
(- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(- (pow B 2.0) (* (* 4.0 A) C))))(FPCore (A B C F)
:precision binary64
(if (<= C -4.583468965674152e-60)
(* -0.25 (/ (sqrt (* -16.0 (* C F))) C))
(let* ((t_0 (* 2.0 (* F (- (+ C A) (hypot B (- A C))))))
(t_1 (fma A (* C -4.0) (* B B))))
(if (<= C -4.1890341447133404e-268)
(/ -1.0 (/ t_1 (sqrt (* t_1 t_0))))
(if (<= C 2.595610150498829e-95)
(- (/ (sqrt t_0) (sqrt t_1)))
(let* ((t_2 (/ -1.0 (* 0.5 (sqrt (* -4.0 (/ C F)))))))
(if (<= C 1.3072799572480792e+67)
t_2
(let* ((t_3
(/
(-
(sqrt
(*
t_1
(* 2.0 (* F (fma 2.0 A (* -0.5 (/ (* B B) C))))))))
t_1)))
(if (<= C 1.4999553372101038e+103)
t_3
(if (<= C 2.1421053442050514e+178)
(* -2.0 (sqrt (* -0.25 (/ F C))))
(if (<= C 1.9355356954408794e+298) t_3 t_2)))))))))))double code(double A, double B, double C, double F) {
return -sqrt((2.0 * ((pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) - sqrt(pow((A - C), 2.0) + pow(B, 2.0)))) / (pow(B, 2.0) - ((4.0 * A) * C));
}
double code(double A, double B, double C, double F) {
double tmp;
if (C <= -4.583468965674152e-60) {
tmp = -0.25 * (sqrt(-16.0 * (C * F)) / C);
} else {
double t_0 = 2.0 * (F * ((C + A) - hypot(B, (A - C))));
double t_1 = fma(A, (C * -4.0), (B * B));
double tmp_1;
if (C <= -4.1890341447133404e-268) {
tmp_1 = -1.0 / (t_1 / sqrt(t_1 * t_0));
} else if (C <= 2.595610150498829e-95) {
tmp_1 = -(sqrt(t_0) / sqrt(t_1));
} else {
double t_2 = -1.0 / (0.5 * sqrt(-4.0 * (C / F)));
double tmp_2;
if (C <= 1.3072799572480792e+67) {
tmp_2 = t_2;
} else {
double t_3 = -sqrt(t_1 * (2.0 * (F * fma(2.0, A, (-0.5 * ((B * B) / C)))))) / t_1;
double tmp_3;
if (C <= 1.4999553372101038e+103) {
tmp_3 = t_3;
} else if (C <= 2.1421053442050514e+178) {
tmp_3 = -2.0 * sqrt(-0.25 * (F / C));
} else if (C <= 1.9355356954408794e+298) {
tmp_3 = t_3;
} else {
tmp_3 = t_2;
}
tmp_2 = tmp_3;
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C



Bits error versus F
if C < -4.58346896567415184e-60Initial program 54.1
Simplified50.2
Taylor expanded in A around -inf 51.7
Taylor expanded in A around -inf 27.3
if -4.58346896567415184e-60 < C < -4.1890341447133404e-268Initial program 41.9
Simplified33.8
Applied neg-mul-1_binary6433.8
Applied associate-/l*_binary6433.9
if -4.1890341447133404e-268 < C < 2.59561015049882893e-95Initial program 43.7
Simplified38.4
Applied add-sqr-sqrt_binary6439.3
Applied sqrt-prod_binary6431.6
Applied distribute-lft-neg-in_binary6431.6
Applied times-frac_binary6431.5
Simplified31.0
if 2.59561015049882893e-95 < C < 1.30727995724807923e67 or 1.93553569544087942e298 < C Initial program 50.7
Simplified49.0
Taylor expanded in A around -inf 48.4
Applied neg-mul-1_binary6448.4
Applied associate-/l*_binary6448.4
Simplified48.4
Taylor expanded in A around inf 37.0
if 1.30727995724807923e67 < C < 1.4999553372101038e103 or 2.1421053442050514e178 < C < 1.93553569544087942e298Initial program 63.1
Simplified61.8
Taylor expanded in C around inf 42.1
Simplified42.1
if 1.4999553372101038e103 < C < 2.1421053442050514e178Initial program 62.5
Simplified61.6
Taylor expanded in A around -inf 44.7
Taylor expanded in A around inf 34.5
Final simplification35.1
herbie shell --seed 2022019
(FPCore (A B C F)
:name "ABCF->ab-angle b"
:precision binary64
(/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))