\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 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
t_1 := \frac{-\sqrt{t_0 \cdot \left(2 \cdot \left(F \cdot \left(C \cdot 2 - 0.5 \cdot \frac{{B}^{2}}{A}\right)\right)\right)}}{t_0}\\
\mathbf{if}\;A \leq -1.547843111002865 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := -\sqrt{2} \cdot \sqrt{-0.5 \cdot \frac{F}{A}}\\
\mathbf{if}\;A \leq -6.715914155896905 \cdot 10^{+93}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;A \leq -1.0277110279859103 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\\
t_4 := 2 \cdot \left(F \cdot t_3\right)\\
t_5 := -\frac{\sqrt{t_4}}{B}\\
\mathbf{if}\;A \leq -13902718134128933000:\\
\;\;\;\;t_5\\
\mathbf{elif}\;A \leq -7.898288287255473 \cdot 10^{-59}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_6 := \sqrt[3]{\mathsf{hypot}\left(\sqrt{A \cdot \left(C \cdot -4\right)}, B\right)}\\
t_7 := t_6 \cdot \left(t_6 \cdot t_6\right)\\
\mathbf{if}\;A \leq 1.461074009586978 \cdot 10^{-196}:\\
\;\;\;\;-\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}}{t_7}\\
\mathbf{elif}\;A \leq 1.525172088274872 \cdot 10^{+28}:\\
\;\;\;\;\begin{array}{l}
t_8 := \sqrt{t_3}\\
\frac{-\sqrt{t_0 \cdot \left(2 \cdot \left(F \cdot \left(t_8 \cdot t_8\right)\right)\right)}}{t_0}
\end{array}\\
\mathbf{elif}\;A \leq 7.020914566277488 \cdot 10^{+115}:\\
\;\;\;\;-\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}}{t_7}\\
\mathbf{elif}\;A \leq 1.8247188167373362 \cdot 10^{+153}:\\
\;\;\;\;\begin{array}{l}
t_9 := \sqrt{\left(A \cdot A + \left(B \cdot B + C \cdot C\right)\right) - 2 \cdot \left(A \cdot C\right)}\\
\frac{-\sqrt{F \cdot \left(\mathsf{fma}\left(2, C \cdot \left(B \cdot B\right), 2 \cdot \left(\left(B \cdot B\right) \cdot t_9 + A \cdot \left(B \cdot B\right)\right)\right) - \mathsf{fma}\left(8, C \cdot \left(A \cdot A\right), 8 \cdot \left(A \cdot \left(C \cdot C\right) + \left(A \cdot C\right) \cdot t_9\right)\right)\right)}}{t_0}
\end{array}\\
\mathbf{elif}\;A \leq 5.48701879697187 \cdot 10^{+159}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;A \leq 9.070489695444037 \cdot 10^{+172}:\\
\;\;\;\;\begin{array}{l}
t_10 := \sqrt{t_0}\\
\frac{-\sqrt{t_10 \cdot \left(t_4 \cdot t_10\right)}}{t_0}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2} \cdot \sqrt{-0.5 \cdot \frac{F}{C}}\\
\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
(let* ((t_0 (fma A (* C -4.0) (* B B)))
(t_1
(/
(-
(sqrt
(* t_0 (* 2.0 (* F (- (* C 2.0) (* 0.5 (/ (pow B 2.0) A))))))))
t_0)))
(if (<= A -1.547843111002865e+160)
t_1
(let* ((t_2 (- (* (sqrt 2.0) (sqrt (* -0.5 (/ F A)))))))
(if (<= A -6.715914155896905e+93)
t_2
(if (<= A -1.0277110279859103e+73)
t_1
(let* ((t_3 (+ (+ A C) (hypot B (- A C))))
(t_4 (* 2.0 (* F t_3)))
(t_5 (- (/ (sqrt t_4) B))))
(if (<= A -13902718134128933000.0)
t_5
(if (<= A -7.898288287255473e-59)
t_2
(let* ((t_6 (cbrt (hypot (sqrt (* A (* C -4.0))) B)))
(t_7 (* t_6 (* t_6 t_6))))
(if (<= A 1.461074009586978e-196)
(- (/ (* (sqrt 2.0) (sqrt (* F (+ C (hypot B C))))) t_7))
(if (<= A 1.525172088274872e+28)
(let* ((t_8 (sqrt t_3)))
(/ (- (sqrt (* t_0 (* 2.0 (* F (* t_8 t_8)))))) t_0))
(if (<= A 7.020914566277488e+115)
(-
(/
(* (sqrt 2.0) (sqrt (* F (+ A (hypot B A)))))
t_7))
(if (<= A 1.8247188167373362e+153)
(let* ((t_9
(sqrt
(-
(+ (* A A) (+ (* B B) (* C C)))
(* 2.0 (* A C))))))
(/
(-
(sqrt
(*
F
(-
(fma
2.0
(* C (* B B))
(* 2.0 (+ (* (* B B) t_9) (* A (* B B)))))
(fma
8.0
(* C (* A A))
(*
8.0
(+ (* A (* C C)) (* (* A C) t_9))))))))
t_0))
(if (<= A 5.48701879697187e+159)
t_5
(if (<= A 9.070489695444037e+172)
(let* ((t_10 (sqrt t_0)))
(/ (- (sqrt (* t_10 (* t_4 t_10)))) 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 t_0 = fma(A, (C * -4.0), (B * B));
double t_1 = -sqrt(t_0 * (2.0 * (F * ((C * 2.0) - (0.5 * (pow(B, 2.0) / A)))))) / t_0;
double tmp;
if (A <= -1.547843111002865e+160) {
tmp = t_1;
} else {
double t_2 = -(sqrt(2.0) * sqrt(-0.5 * (F / A)));
double tmp_1;
if (A <= -6.715914155896905e+93) {
tmp_1 = t_2;
} else if (A <= -1.0277110279859103e+73) {
tmp_1 = t_1;
} else {
double t_3 = (A + C) + hypot(B, (A - C));
double t_4 = 2.0 * (F * t_3);
double t_5 = -(sqrt(t_4) / B);
double tmp_2;
if (A <= -13902718134128933000.0) {
tmp_2 = t_5;
} else if (A <= -7.898288287255473e-59) {
tmp_2 = t_2;
} else {
double t_6 = cbrt(hypot(sqrt(A * (C * -4.0)), B));
double t_7 = t_6 * (t_6 * t_6);
double tmp_3;
if (A <= 1.461074009586978e-196) {
tmp_3 = -((sqrt(2.0) * sqrt(F * (C + hypot(B, C)))) / t_7);
} else if (A <= 1.525172088274872e+28) {
double t_8 = sqrt(t_3);
tmp_3 = -sqrt(t_0 * (2.0 * (F * (t_8 * t_8)))) / t_0;
} else if (A <= 7.020914566277488e+115) {
tmp_3 = -((sqrt(2.0) * sqrt(F * (A + hypot(B, A)))) / t_7);
} else if (A <= 1.8247188167373362e+153) {
double t_9 = sqrt(((A * A) + ((B * B) + (C * C))) - (2.0 * (A * C)));
tmp_3 = -sqrt(F * (fma(2.0, (C * (B * B)), (2.0 * (((B * B) * t_9) + (A * (B * B))))) - fma(8.0, (C * (A * A)), (8.0 * ((A * (C * C)) + ((A * C) * t_9)))))) / t_0;
} else if (A <= 5.48701879697187e+159) {
tmp_3 = t_5;
} else if (A <= 9.070489695444037e+172) {
double t_10 = sqrt(t_0);
tmp_3 = -sqrt(t_10 * (t_4 * t_10)) / t_0;
} else {
tmp_3 = -(sqrt(2.0) * sqrt(-0.5 * (F / C)));
}
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 A < -1.5478431110028651e160 or -6.71591415589690537e93 < A < -1.0277110279859103e73Initial program 63.3
Simplified61.9
Taylor expanded in A around -inf 44.5
if -1.5478431110028651e160 < A < -6.71591415589690537e93 or -13902718134128932900 < A < -7.898288287255473e-59Initial program 55.7
Simplified54.2
Taylor expanded in C around inf 41.1
Simplified41.1
if -1.0277110279859103e73 < A < -13902718134128932900 or 1.82471881673734e153 < A < 5.4870187969718703e159Initial program 57.7
Simplified54.6
Applied add-sqr-sqrt_binary6456.6
Applied sqrt-prod_binary6451.9
Applied distribute-lft-neg-in_binary6451.9
Applied times-frac_binary6451.9
Simplified51.2
Taylor expanded in A around 0 55.6
if -7.898288287255473e-59 < A < 1.4610740095869779e-196Initial program 48.9
Simplified45.7
Applied add-sqr-sqrt_binary6447.7
Applied sqrt-prod_binary6441.7
Applied distribute-lft-neg-in_binary6441.7
Applied times-frac_binary6441.7
Simplified41.2
Applied add-cube-cbrt_binary6441.5
Simplified46.1
Simplified39.4
Taylor expanded in A around 0 48.7
Simplified39.3
if 1.4610740095869779e-196 < A < 1.5251720882748719e28Initial program 45.7
Simplified43.3
Applied add-sqr-sqrt_binary6443.3
if 1.5251720882748719e28 < A < 7.02091456627748789e115Initial program 40.3
Simplified39.5
Applied add-sqr-sqrt_binary6448.6
Applied sqrt-prod_binary6445.1
Applied distribute-lft-neg-in_binary6445.1
Applied times-frac_binary6445.0
Simplified44.2
Applied add-cube-cbrt_binary6444.5
Simplified49.3
Simplified44.2
Taylor expanded in C around 0 45.6
Simplified40.4
if 7.02091456627748789e115 < A < 1.82471881673734e153Initial program 40.3
Simplified41.3
Taylor expanded in F around 0 45.1
Simplified45.1
if 5.4870187969718703e159 < A < 9.0704896954440372e172Initial program 64.0
Simplified46.3
Applied add-sqr-sqrt_binary6452.8
Applied associate-*l*_binary6452.8
if 9.0704896954440372e172 < A Initial program 64.0
Simplified54.5
Taylor expanded in A around inf 45.4
Simplified45.4
Final simplification42.9
herbie shell --seed 2022103
(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))))