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}\;C \leq 1116359.8079724736:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)\right) \cdot \frac{1}{B}\right)}{\pi}\\
\mathbf{elif}\;C \leq 1.3262682172405047 \cdot 10^{+154}:\\
\;\;\;\;\begin{array}{l}
t_0 := \mathsf{fma}\left(A, A, C \cdot \left(C - A \cdot 2\right)\right)\\
180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \sqrt{t_0}\right)}{B} - 0.5 \cdot \left(B \cdot \sqrt{\frac{1}{t_0}}\right)\right)}{\pi}
\end{array}\\
\mathbf{elif}\;C \leq 1.2860608303654123 \cdot 10^{+219}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
\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 (<= C 1116359.8079724736)
(* 180.0 (/ (atan (* (- (- C A) (hypot B (- C A))) (/ 1.0 B))) PI))
(if (<= C 1.3262682172405047e+154)
(let* ((t_0 (fma A A (* C (- C (* A 2.0))))))
(*
180.0
(/
(atan
(- (/ (- C (+ A (sqrt t_0))) B) (* 0.5 (* B (sqrt (/ 1.0 t_0))))))
PI)))
(if (<= C 1.2860608303654123e+219)
(/ (* 180.0 (atan (/ (- C (hypot B C)) B))) PI)
(/ (* 180.0 (atan (* -0.5 (/ B C)))) 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 (C <= 1116359.8079724736) {
tmp = 180.0 * (atan(((C - A) - hypot(B, (C - A))) * (1.0 / B)) / ((double) M_PI));
} else if (C <= 1.3262682172405047e+154) {
double t_0 = fma(A, A, (C * (C - (A * 2.0))));
tmp = 180.0 * (atan(((C - (A + sqrt(t_0))) / B) - (0.5 * (B * sqrt(1.0 / t_0)))) / ((double) M_PI));
} else if (C <= 1.2860608303654123e+219) {
tmp = (180.0 * atan((C - hypot(B, C)) / B)) / ((double) M_PI);
} else {
tmp = (180.0 * atan(-0.5 * (B / C))) / ((double) M_PI);
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C
if C < 1116359.8079724736Initial program 22.5
Simplified9.5
Applied div-inv_binary649.5
if 1116359.8079724736 < C < 1.3262682172405047e154Initial program 38.1
Simplified23.0
Applied div-inv_binary6423.0
Taylor expanded in B around 0 52.5
Simplified30.2
if 1.3262682172405047e154 < C < 1.28606083036541231e219Initial program 54.9
Simplified25.5
Applied associate-*r/_binary6425.5
Taylor expanded in A around 0 54.9
Simplified30.2
if 1.28606083036541231e219 < C Initial program 58.3
Simplified29.2
Applied associate-*r/_binary6429.2
Taylor expanded in C around inf 8.0
Final simplification13.1
herbie shell --seed 2021280
(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)))