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}\;B \leq -3.032600957837696 \cdot 10^{-278}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + B \cdot B}}{B}\right) \cdot 180}{\pi}\\
\mathbf{elif}\;B \leq 1.1652315596202954 \cdot 10^{-273}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - B}{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 (<= B -3.032600957837696e-278)
(/
(* (atan (/ (- (- C A) (sqrt (+ (pow (- A C) 2.0) (* B B)))) B)) 180.0)
PI)
(if (<= B 1.1652315596202954e-273)
(* 180.0 (/ (atan (/ 0.0 B)) PI))
(/ (* 180.0 (atan (/ (- (- C A) B) 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 (B <= -3.032600957837696e-278) {
tmp = (atan(((C - A) - sqrt(pow((A - C), 2.0) + (B * B))) / B) * 180.0) / ((double) M_PI);
} else if (B <= 1.1652315596202954e-273) {
tmp = 180.0 * (atan(0.0 / B) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((C - A) - B) / B)) / ((double) M_PI);
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C
Results
if B < -3.032600957837696e-278Initial program 29.1
Simplified29.1
rmApplied associate-*r/_binary64_206629.1
Simplified29.1
if -3.032600957837696e-278 < B < 1.16523155962029538e-273Initial program 22.2
Simplified22.2
Taylor expanded around inf 39.9
if 1.16523155962029538e-273 < B Initial program 30.0
Simplified30.0
rmApplied associate-*r/_binary64_206630.0
Simplified30.0
Taylor expanded around 0 20.4
Final simplification25.7
herbie shell --seed 2020346
(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)))