\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{2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\\
\mathbf{if}\;B \leq -1.5045379819184283 \cdot 10^{+60}:\\
\;\;\;\;-\frac{t_0}{-B}\\
\mathbf{elif}\;B \leq -1.5618196159827645 \cdot 10^{+41}:\\
\;\;\;\;-\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
\mathbf{if}\;B \leq -9.066057881034669 \cdot 10^{-84}:\\
\;\;\;\;\sqrt{t_1} \cdot \frac{-\sqrt{2} \cdot \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}{t_1}\\
\mathbf{elif}\;B \leq 1.0607308399078237 \cdot 10^{+66}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;-\frac{t_0}{B}\\
\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 (* 2.0 (* F (- (+ A C) (hypot B (- A C))))))))
(if (<= B -1.5045379819184283e+60)
(- (/ t_0 (- B)))
(if (<= B -1.5618196159827645e+41)
(- (* (sqrt (* -0.5 (/ F C))) (sqrt 2.0)))
(let* ((t_1 (fma A (* C -4.0) (* B B))))
(if (<= B -9.066057881034669e-84)
(*
(sqrt t_1)
(/ (- (* (sqrt 2.0) (sqrt (* F (- A (hypot B A)))))) t_1))
(if (<= B 1.0607308399078237e+66)
(/ (- (sqrt (* t_1 (* 2.0 (* F (* 2.0 A)))))) t_1)
(- (/ t_0 B)))))))))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(2.0 * (F * ((A + C) - hypot(B, (A - C)))));
double tmp;
if (B <= -1.5045379819184283e+60) {
tmp = -(t_0 / -B);
} else if (B <= -1.5618196159827645e+41) {
tmp = -(sqrt(-0.5 * (F / C)) * sqrt(2.0));
} else {
double t_1 = fma(A, (C * -4.0), (B * B));
double tmp_1;
if (B <= -9.066057881034669e-84) {
tmp_1 = sqrt(t_1) * (-(sqrt(2.0) * sqrt(F * (A - hypot(B, A)))) / t_1);
} else if (B <= 1.0607308399078237e+66) {
tmp_1 = -sqrt(t_1 * (2.0 * (F * (2.0 * A)))) / t_1;
} else {
tmp_1 = -(t_0 / B);
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C



Bits error versus F
if B < -1.5045379819184283e60Initial program 57.7
Simplified56.3
Applied add-sqr-sqrt_binary6456.5
Applied sqrt-prod_binary6451.0
Applied distribute-lft-neg-in_binary6451.0
Applied times-frac_binary6451.0
Simplified49.6
Taylor expanded in B around -inf 30.1
Simplified30.1
if -1.5045379819184283e60 < B < -1.56181961598276451e41Initial program 36.4
Simplified33.1
Taylor expanded in A around -inf 48.4
Simplified48.4
if -1.56181961598276451e41 < B < -9.0660578810346685e-84Initial program 43.0
Simplified39.0
Applied *-un-lft-identity_binary6439.0
Applied sqrt-prod_binary6439.8
Applied distribute-rgt-neg-in_binary6439.8
Applied times-frac_binary6439.9
Simplified39.9
Taylor expanded in C around 0 40.9
Simplified37.8
if -9.0660578810346685e-84 < B < 1.06073083990782366e66Initial program 49.3
Simplified44.5
Taylor expanded in A around -inf 36.7
if 1.06073083990782366e66 < B Initial program 58.7
Simplified58.0
Applied add-sqr-sqrt_binary6458.0
Applied sqrt-prod_binary6451.9
Applied distribute-lft-neg-in_binary6451.9
Applied times-frac_binary6451.8
Simplified50.4
Taylor expanded in A around 0 29.9
Final simplification34.3
herbie shell --seed 2022067
(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))))