\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}\;A \leq -0.03519957118389417:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{-0.5 \cdot \frac{F}{A}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
\mathbf{if}\;A \leq -7.136749298156744 \cdot 10^{-75}:\\
\;\;\;\;\begin{array}{l}
t_1 := {C}^{2} + {B}^{2}\\
\frac{-\sqrt{t_0 \cdot \left(2 \cdot \left(F \cdot \left(\left(A + \left(C + \sqrt{t_1}\right)\right) - \left(A \cdot C\right) \cdot \sqrt{\frac{1}{t_1}}\right)\right)\right)}}{t_0}
\end{array}\\
\mathbf{elif}\;A \leq 1.0029344104796189 \cdot 10^{-196}:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt{\mathsf{hypot}\left(\sqrt{A \cdot \left(C \cdot -4\right)}, B\right)}\\
-\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}}{t_2 \cdot t_2}
\end{array}\\
\mathbf{elif}\;A \leq 1.20576307541013 \cdot 10^{+208}:\\
\;\;\;\;\frac{-\sqrt{t_0 \cdot \left(2 \cdot \left(F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{-0.5 \cdot \frac{F}{C}}\\
\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 (<= A -0.03519957118389417)
(- (* (sqrt 2.0) (sqrt (* -0.5 (/ F A)))))
(let* ((t_0 (fma A (* C -4.0) (* B B))))
(if (<= A -7.136749298156744e-75)
(let* ((t_1 (+ (pow C 2.0) (pow B 2.0))))
(/
(-
(sqrt
(*
t_0
(*
2.0
(*
F
(- (+ A (+ C (sqrt t_1))) (* (* A C) (sqrt (/ 1.0 t_1)))))))))
t_0))
(if (<= A 1.0029344104796189e-196)
(let* ((t_2 (sqrt (hypot (sqrt (* A (* C -4.0))) B))))
(- (/ (* (sqrt 2.0) (sqrt (* F (+ C (hypot B C))))) (* t_2 t_2))))
(if (<= A 1.20576307541013e+208)
(/
(- (sqrt (* t_0 (* 2.0 (* F (+ A (+ C (hypot B (- A C)))))))))
t_0)
(- (* (sqrt 2.0) (sqrt (* -0.5 (/ F C)))))))))))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 (A <= -0.03519957118389417) {
tmp = -(sqrt(2.0) * sqrt(-0.5 * (F / A)));
} else {
double t_0 = fma(A, (C * -4.0), (B * B));
double tmp_1;
if (A <= -7.136749298156744e-75) {
double t_1_2 = pow(C, 2.0) + pow(B, 2.0);
tmp_1 = -sqrt(t_0 * (2.0 * (F * ((A + (C + sqrt(t_1_2))) - ((A * C) * sqrt(1.0 / t_1_2)))))) / t_0;
} else if (A <= 1.0029344104796189e-196) {
double t_2 = sqrt(hypot(sqrt(A * (C * -4.0)), B));
tmp_1 = -((sqrt(2.0) * sqrt(F * (C + hypot(B, C)))) / (t_2 * t_2));
} else if (A <= 1.20576307541013e+208) {
tmp_1 = -sqrt(t_0 * (2.0 * (F * (A + (C + hypot(B, (A - C))))))) / t_0;
} else {
tmp_1 = -(sqrt(2.0) * sqrt(-0.5 * (F / C)));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C



Bits error versus F
if A < -0.0351995711838941697Initial program 61.1
Simplified59.8
Taylor expanded in C around inf 40.5
if -0.0351995711838941697 < A < -7.13674929815674432e-75Initial program 50.4
Simplified47.9
Taylor expanded in A around 0 46.7
if -7.13674929815674432e-75 < A < 1.00293441047961894e-196Initial program 49.7
Simplified46.8
Applied add-sqr-sqrt_binary6448.6
Applied sqrt-prod_binary6443.2
Applied distribute-lft-neg-in_binary6443.2
Applied times-frac_binary6443.2
Simplified42.7
Applied add-sqr-sqrt_binary6442.7
Simplified47.1
Simplified40.4
Taylor expanded in A around 0 49.6
Simplified40.3
if 1.00293441047961894e-196 < A < 1.20576307541013e208Initial program 47.0
Simplified43.5
Applied associate-+l+_binary6442.7
if 1.20576307541013e208 < A Initial program 64.0
Simplified55.6
Taylor expanded in A around inf 45.6
Simplified45.6
Final simplification42.0
herbie shell --seed 2022068
(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))))