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.28422592167895 \cdot 10^{+91}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \mathsf{fma}\left(\frac{C}{A \cdot A}, B, \frac{B}{A}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{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 (<= A -2.28422592167895e+91) (* 180.0 (/ (atan (* 0.5 (fma (/ C (* A A)) B (/ B A)))) PI)) (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- C A))) 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 (A <= -2.28422592167895e+91) {
tmp = 180.0 * (atan(0.5 * fma((C / (A * A)), B, (B / A))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((C - A) - hypot(B, (C - A))) / B) / ((double) M_PI));
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C
if A < -2.2842259216789502e91Initial program 52.6
Simplified27.8
Taylor expanded in A around -inf 18.5
Simplified15.6
Applied associate-/r/_binary6416.0
Applied fma-def_binary6416.0
if -2.2842259216789502e91 < A Initial program 24.0
Simplified10.5
Final simplification11.5
herbie shell --seed 2022068
(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)))