\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 := -\frac{{\left(-F\right)}^{0.5}}{\sqrt{C}}\\
\mathbf{if}\;B \leq -2.9228459489893423 \cdot 10^{+102}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
t_2 := 2 \cdot \left(F \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\\
\mathbf{if}\;B \leq -8.101188799698452 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sqrt{t_1}}{\frac{t_1}{-\sqrt{t_2}}}\\
\mathbf{elif}\;B \leq 7.250586550384806 \cdot 10^{-280}:\\
\;\;\;\;\frac{-1}{\frac{\sqrt{C}}{\sqrt{-F}}}\\
\mathbf{elif}\;B \leq 1.0618671080824585 \cdot 10^{-266}:\\
\;\;\;\;\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{elif}\;B \leq 4.975272536947154 \cdot 10^{-246}:\\
\;\;\;\;\begin{array}{l}
t_3 := \sqrt{\sqrt{C}}\\
\frac{\frac{-1}{\frac{t_3}{\sqrt{F \cdot -0.5}}}}{\frac{t_3}{\sqrt{2}}}
\end{array}\\
\mathbf{elif}\;B \leq 1.6492372060764243 \cdot 10^{-136}:\\
\;\;\;\;\frac{A \cdot \left(\sqrt{2} \cdot \sqrt{-8 \cdot \left(F \cdot C\right)}\right)}{t_1}\\
\mathbf{elif}\;B \leq 1.0293379345528187 \cdot 10^{-124}:\\
\;\;\;\;-\frac{\sqrt{t_1 \cdot t_2}}{t_1}\\
\mathbf{elif}\;B \leq 1.8232299960392075 \cdot 10^{+25}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{\sqrt{2}}{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 (- (/ (pow (- F) 0.5) (sqrt C)))))
(if (<= B -2.9228459489893423e+102)
t_0
(let* ((t_1 (fma A (* C -4.0) (* B B)))
(t_2 (* 2.0 (* F (- (+ C A) (hypot B (- A C)))))))
(if (<= B -8.101188799698452e-29)
(/ (sqrt t_1) (/ t_1 (- (sqrt t_2))))
(if (<= B 7.250586550384806e-280)
(/ -1.0 (/ (sqrt C) (sqrt (- F))))
(if (<= B 1.0618671080824585e-266)
(/
(-
(sqrt (* t_1 (* 2.0 (* F (fma 2.0 A (* -0.5 (/ (* B B) C))))))))
t_1)
(if (<= B 4.975272536947154e-246)
(let* ((t_3 (sqrt (sqrt C))))
(/ (/ -1.0 (/ t_3 (sqrt (* F -0.5)))) (/ t_3 (sqrt 2.0))))
(if (<= B 1.6492372060764243e-136)
(/ (* A (* (sqrt 2.0) (sqrt (* -8.0 (* F C))))) t_1)
(if (<= B 1.0293379345528187e-124)
(- (/ (sqrt (* t_1 t_2)) t_1))
(if (<= B 1.8232299960392075e+25)
t_0
(-
(*
(sqrt (* F (- A (hypot A B))))
(/ (sqrt 2.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 = -(pow(-F, 0.5) / sqrt(C));
double tmp;
if (B <= -2.9228459489893423e+102) {
tmp = t_0;
} else {
double t_1 = fma(A, (C * -4.0), (B * B));
double t_2 = 2.0 * (F * ((C + A) - hypot(B, (A - C))));
double tmp_1;
if (B <= -8.101188799698452e-29) {
tmp_1 = sqrt(t_1) / (t_1 / -sqrt(t_2));
} else if (B <= 7.250586550384806e-280) {
tmp_1 = -1.0 / (sqrt(C) / sqrt(-F));
} else if (B <= 1.0618671080824585e-266) {
tmp_1 = -sqrt(t_1 * (2.0 * (F * fma(2.0, A, (-0.5 * ((B * B) / C)))))) / t_1;
} else if (B <= 4.975272536947154e-246) {
double t_3 = sqrt(sqrt(C));
tmp_1 = (-1.0 / (t_3 / sqrt(F * -0.5))) / (t_3 / sqrt(2.0));
} else if (B <= 1.6492372060764243e-136) {
tmp_1 = (A * (sqrt(2.0) * sqrt(-8.0 * (F * C)))) / t_1;
} else if (B <= 1.0293379345528187e-124) {
tmp_1 = -(sqrt(t_1 * t_2) / t_1);
} else if (B <= 1.8232299960392075e+25) {
tmp_1 = t_0;
} else {
tmp_1 = -(sqrt(F * (A - hypot(A, B))) * (sqrt(2.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 < -2.9228459489893423e102 or 1.02933793455281871e-124 < B < 1.82322999603920747e25Initial program 53.4
Simplified51.3
Taylor expanded in A around -inf 50.5
Simplified50.5
Applied associate-*r/_binary6450.5
Applied sqrt-div_binary6446.2
Applied associate-*l/_binary6446.2
Applied pow1/2_binary6446.2
Applied pow1/2_binary6446.2
Applied pow-prod-down_binary6446.2
Simplified46.2
if -2.9228459489893423e102 < B < -8.10118879969845242e-29Initial program 43.5
Simplified39.8
Applied sqrt-prod_binary6435.5
Applied distribute-rgt-neg-in_binary6435.5
Applied associate-/l*_binary6435.5
if -8.10118879969845242e-29 < B < 7.25058655038480578e-280Initial program 50.9
Simplified46.2
Taylor expanded in A around -inf 40.5
Simplified40.5
Applied associate-*r/_binary6440.5
Applied sqrt-div_binary6433.3
Applied associate-*l/_binary6433.3
Applied clear-num_binary6433.3
Applied sqrt-unprod_binary6433.3
Simplified33.3
if 7.25058655038480578e-280 < B < 1.0618671080824585e-266Initial program 55.2
Simplified48.5
Taylor expanded in C around inf 34.7
Simplified34.7
if 1.0618671080824585e-266 < B < 4.9752725369471542e-246Initial program 56.4
Simplified51.9
Taylor expanded in A around -inf 40.9
Simplified40.9
Applied associate-*r/_binary6440.9
Applied sqrt-div_binary6436.8
Applied associate-*l/_binary6436.8
Applied clear-num_binary6436.8
Applied add-sqr-sqrt_binary6436.9
Applied times-frac_binary6436.9
Applied associate-/r*_binary6436.9
if 4.9752725369471542e-246 < B < 1.6492372060764243e-136Initial program 51.8
Simplified46.2
Taylor expanded in A around -inf 35.7
Simplified35.7
if 1.6492372060764243e-136 < B < 1.02933793455281871e-124Initial program 53.1
Simplified47.8
Applied *-un-lft-identity_binary6447.8
Applied neg-mul-1_binary6447.8
Applied times-frac_binary6447.8
Simplified47.8
if 1.82322999603920747e25 < B Initial program 56.6
Simplified55.1
Taylor expanded in C around 0 52.6
Simplified32.0
Final simplification37.4
herbie shell --seed 2021313
(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))))