180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\begin{array}{l}
\mathbf{if}\;A \leq -2.783231107200671 \cdot 10^{+114}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{A} \cdot \left(\frac{C}{A} + 1\right)\right) \cdot 0.5\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \mathsf{hypot}\left(B, C - A\right)\\
\mathbf{if}\;A \leq -4.310305532084718 \cdot 10^{-55}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - t_0}{B}\right)}{\pi}\\
\mathbf{elif}\;A \leq -7.205558733068473 \cdot 10^{-87}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\sqrt[3]{{\left(\frac{C - \left(A + t_0\right)}{B}\right)}^{3}}\right)}{\pi}\\
\end{array}\\
\end{array}
(FPCore (A B C) :precision binary64 (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))
(FPCore (A B C)
:precision binary64
(if (<= A -2.783231107200671e+114)
(/ (* 180.0 (atan (* (* (/ B A) (+ (/ C A) 1.0)) 0.5))) PI)
(let* ((t_0 (hypot B (- C A))))
(if (<= A -4.310305532084718e-55)
(* 180.0 (/ (atan (/ (- (- C A) t_0) B)) PI))
(if (<= A -7.205558733068473e-87)
(* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
(* 180.0 (/ (atan (cbrt (pow (/ (- C (+ A t_0)) B) 3.0))) PI)))))))double code(double A, double B, double C) {
return 180.0 * (atan((1.0 / B) * ((C - A) - sqrt(pow((A - C), 2.0) + pow(B, 2.0)))) / ((double) M_PI));
}
double code(double A, double B, double C) {
double tmp;
if (A <= -2.783231107200671e+114) {
tmp = (180.0 * atan(((B / A) * ((C / A) + 1.0)) * 0.5)) / ((double) M_PI);
} else {
double t_0 = hypot(B, (C - A));
double tmp_1;
if (A <= -4.310305532084718e-55) {
tmp_1 = 180.0 * (atan(((C - A) - t_0) / B) / ((double) M_PI));
} else if (A <= -7.205558733068473e-87) {
tmp_1 = 180.0 * (atan(-0.5 * (B / C)) / ((double) M_PI));
} else {
tmp_1 = 180.0 * (atan(cbrt(pow(((C - (A + t_0)) / B), 3.0))) / ((double) M_PI));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C
Results
if A < -2.7832311072006708e114Initial program 52.9
Simplified27.4
Taylor expanded in A around -inf 17.1
Simplified14.5
Applied associate-*r/_binary6414.5
Simplified14.2
if -2.7832311072006708e114 < A < -4.310305532084718e-55Initial program 37.7
Simplified24.2
Applied *-commutative_binary6424.2
if -4.310305532084718e-55 < A < -7.2055587330684727e-87Initial program 35.4
Simplified19.8
Taylor expanded in C around inf 45.9
if -7.2055587330684727e-87 < A Initial program 22.0
Simplified8.5
Applied add-cbrt-cube_binary648.5
Simplified8.5
Final simplification12.5
herbie shell --seed 2021344
(FPCore (A B C)
:name "ABCF->ab-angle angle"
:precision binary64
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))