\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}
t_0 := -\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2}\\
\mathbf{if}\;C \leq -8.822223828748478 \cdot 10^{+98}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
\mathbf{if}\;C \leq -3.402280393262435 \cdot 10^{+32}:\\
\;\;\;\;\begin{array}{l}
t_2 := {C}^{2} + {B}^{2}\\
\frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(F \cdot \left(\left(A + \left(C + \sqrt{t_2}\right)\right) - \left(C \cdot A\right) \cdot \sqrt{\frac{1}{t_2}}\right)\right)\right)}}{t_1}
\end{array}\\
\mathbf{elif}\;C \leq -3.262389646343389 \cdot 10^{-33}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := 2 \cdot \left(F \cdot \left(\left(C + A\right) + \mathsf{hypot}\left(B, A - C\right)\right)\right)\\
\mathbf{if}\;C \leq 2.116237083777588 \cdot 10^{-116}:\\
\;\;\;\;-\frac{\sqrt{t_3}}{\mathsf{hypot}\left(\sqrt{A \cdot \left(C \cdot -4\right)}, B\right)}\\
\mathbf{elif}\;C \leq 1.5281556949108983 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{t_1 \cdot t_3}}}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{-0.5 \cdot \frac{F}{A}}\\
\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
(let* ((t_0 (- (* (sqrt (* -0.5 (/ F C))) (sqrt 2.0)))))
(if (<= C -8.822223828748478e+98)
t_0
(let* ((t_1 (fma A (* C -4.0) (* B B))))
(if (<= C -3.402280393262435e+32)
(let* ((t_2 (+ (pow C 2.0) (pow B 2.0))))
(/
(-
(sqrt
(*
t_1
(*
2.0
(*
F
(- (+ A (+ C (sqrt t_2))) (* (* C A) (sqrt (/ 1.0 t_2)))))))))
t_1))
(if (<= C -3.262389646343389e-33)
t_0
(let* ((t_3 (* 2.0 (* F (+ (+ C A) (hypot B (- A C)))))))
(if (<= C 2.116237083777588e-116)
(- (/ (sqrt t_3) (hypot (sqrt (* A (* C -4.0))) B)))
(if (<= C 1.5281556949108983e+153)
(/ 1.0 (/ t_1 (- (sqrt (* t_1 t_3)))))
(- (* (sqrt 2.0) (sqrt (* -0.5 (/ F A))))))))))))))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 t_0 = -(sqrt(-0.5 * (F / C)) * sqrt(2.0));
double tmp;
if (C <= -8.822223828748478e+98) {
tmp = t_0;
} else {
double t_1 = fma(A, (C * -4.0), (B * B));
double tmp_1;
if (C <= -3.402280393262435e+32) {
double t_2_2 = pow(C, 2.0) + pow(B, 2.0);
tmp_1 = -sqrt(t_1 * (2.0 * (F * ((A + (C + sqrt(t_2_2))) - ((C * A) * sqrt(1.0 / t_2_2)))))) / t_1;
} else if (C <= -3.262389646343389e-33) {
tmp_1 = t_0;
} else {
double t_3 = 2.0 * (F * ((C + A) + hypot(B, (A - C))));
double tmp_3;
if (C <= 2.116237083777588e-116) {
tmp_3 = -(sqrt(t_3) / hypot(sqrt(A * (C * -4.0)), B));
} else if (C <= 1.5281556949108983e+153) {
tmp_3 = 1.0 / (t_1 / -sqrt(t_1 * t_3));
} else {
tmp_3 = -(sqrt(2.0) * sqrt(-0.5 * (F / A)));
}
tmp_1 = tmp_3;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C



Bits error versus F
if C < -8.82222382874847772e98 or -3.4022803932624353e32 < C < -3.2623896463433888e-33Initial program 60.4
Simplified59.3
Taylor expanded in A around inf 41.5
Simplified41.5
if -8.82222382874847772e98 < C < -3.4022803932624353e32Initial program 58.1
Simplified56.5
Taylor expanded in A around 0 46.3
if -3.2623896463433888e-33 < C < 2.11623708377758811e-116Initial program 48.6
Simplified45.3
Applied add-sqr-sqrt_binary6447.8
Applied sqrt-prod_binary6442.3
Applied distribute-lft-neg-in_binary6442.3
Applied times-frac_binary6442.2
Simplified41.7
Applied *-un-lft-identity_binary6441.7
Applied sqrt-prod_binary6441.7
Simplified41.7
Simplified40.5
if 2.11623708377758811e-116 < C < 1.5281556949108983e153Initial program 42.4
Simplified40.9
Applied clear-num_binary6441.0
if 1.5281556949108983e153 < C Initial program 63.9
Simplified53.7
Taylor expanded in C around inf 47.9
Simplified47.9
Final simplification42.1
herbie shell --seed 2022082
(FPCore (A B C F)
:name "ABCF->ab-angle a"
: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))))