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 -3.2780186347505555 \cdot 10^{+32}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - B}{B}\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;C \leq -9.829888247783205 \cdot 10^{-172}:\\
\;\;\;\;180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + B \cdot B}}{B}\right)}}\\
\mathbf{elif}\;C \leq 5.241670643923542 \cdot 10^{-301}:\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - B}{B}\right) \cdot \frac{180}{\pi}\\
\mathbf{elif}\;C \leq 2.405665199649213 \cdot 10^{-196}:\\
\;\;\;\;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}\\
\mathbf{elif}\;C \leq 4.617632627264863 \cdot 10^{+151}:\\
\;\;\;\;\left(\tan^{-1} \left(\frac{\left(C - A\right) - B}{B}\right) \cdot 180\right) \cdot \frac{1}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\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 -3.2780186347505555e+32)
(* (atan (/ (- (- C A) B) B)) (/ 180.0 PI))
(if (<= C -9.829888247783205e-172)
(*
180.0
(/
1.0
(/ PI (atan (/ (- (- C A) (sqrt (+ (pow (- A C) 2.0) (* B B)))) B)))))
(if (<= C 5.241670643923542e-301)
(* (atan (/ (- (- C A) B) B)) (/ 180.0 PI))
(if (<= C 2.405665199649213e-196)
(*
180.0
(/
(atan
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI))
(if (<= C 4.617632627264863e+151)
(* (* (atan (/ (- (- C A) B) B)) 180.0) (/ 1.0 PI))
(* 180.0 (/ (atan (/ 0.0 B)) 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 <= -3.2780186347505555e+32) {
tmp = atan(((C - A) - B) / B) * (180.0 / ((double) M_PI));
} else if (C <= -9.829888247783205e-172) {
tmp = 180.0 * (1.0 / (((double) M_PI) / atan(((C - A) - sqrt(pow((A - C), 2.0) + (B * B))) / B)));
} else if (C <= 5.241670643923542e-301) {
tmp = atan(((C - A) - B) / B) * (180.0 / ((double) M_PI));
} else if (C <= 2.405665199649213e-196) {
tmp = 180.0 * (atan((1.0 / B) * ((C - A) - sqrt(pow((A - C), 2.0) + pow(B, 2.0)))) / ((double) M_PI));
} else if (C <= 4.617632627264863e+151) {
tmp = (atan(((C - A) - B) / B) * 180.0) * (1.0 / ((double) M_PI));
} else {
tmp = 180.0 * (atan(0.0 / B) / ((double) M_PI));
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C
Results
if C < -3.2780186347505555e32 or -9.8298882477832054e-172 < C < 5.241670643923542e-301Initial program 18.8
Simplified18.8
Taylor expanded around 0 18.1
rmApplied div-inv_binary64_178018.1
Applied associate-*r*_binary64_172318.1
Simplified18.1
rmApplied associate-*l*_binary64_172418.1
Simplified18.1
if -3.2780186347505555e32 < C < -9.8298882477832054e-172Initial program 22.5
Simplified22.5
rmApplied clear-num_binary64_178222.5
if 5.241670643923542e-301 < C < 2.4056651996492128e-196Initial program 28.5
if 2.4056651996492128e-196 < C < 4.617632627264863e151Initial program 36.1
Simplified36.1
Taylor expanded around 0 39.9
rmApplied div-inv_binary64_178039.9
Applied associate-*r*_binary64_172339.9
Simplified39.9
if 4.617632627264863e151 < C Initial program 57.0
Simplified57.0
Taylor expanded around inf 40.2
Final simplification28.7
herbie shell --seed 2020356
(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)))