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}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}\\
t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t_1 \leq -3.1369805444534716 \cdot 10^{-79}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq 5.686097070558954 \cdot 10^{-6}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \mathsf{fma}\left(A, \frac{B}{C \cdot C}, \frac{B}{C}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\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
(let* ((t_0 (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- C A))) B)) PI)))
(t_1
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(if (<= t_1 -3.1369805444534716e-79)
t_0
(if (<= t_1 5.686097070558954e-6)
(/ (* 180.0 (atan (* -0.5 (fma A (/ B (* C C)) (/ B C))))) PI)
t_0))))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 t_0 = 180.0 * (atan((((C - A) - hypot(B, (C - A))) / B)) / ((double) M_PI));
double t_1 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
double tmp;
if (t_1 <= -3.1369805444534716e-79) {
tmp = t_0;
} else if (t_1 <= 5.686097070558954e-6) {
tmp = (180.0 * atan((-0.5 * fma(A, (B / (C * C)), (B / C))))) / ((double) M_PI);
} else {
tmp = t_0;
}
return tmp;
}



Bits error versus A



Bits error versus B



Bits error versus C
if (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -3.13698054445347157e-79 or 5.6860970705589539e-6 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) Initial program 25.7
Simplified8.1
if -3.13698054445347157e-79 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < 5.6860970705589539e-6Initial program 51.9
Simplified51.4
Applied egg-rr51.4
Taylor expanded in C around inf 31.7
Simplified31.4
Applied egg-rr31.4
Final simplification11.3
herbie shell --seed 2022130
(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)))