Average Error: 29.4 → 12.5
Time: 10.5s
Precision: binary64
\[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.783231107200671 \cdot 10^{+114}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{A} \cdot \left(\frac{C}{A} + 1\right)\right) \cdot 0.5\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_0 := \mathsf{hypot}\left(B, C - A\right)\\ \mathbf{if}\;A \leq -4.310305532084718 \cdot 10^{-55}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - t_0}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -7.205558733068473 \cdot 10^{-87}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\sqrt[3]{{\left(\frac{C - \left(A + t_0\right)}{B}\right)}^{3}}\right)}{\pi}\\ \end{array}\\ \end{array} \]
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.783231107200671 \cdot 10^{+114}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{A} \cdot \left(\frac{C}{A} + 1\right)\right) \cdot 0.5\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \mathsf{hypot}\left(B, C - A\right)\\
\mathbf{if}\;A \leq -4.310305532084718 \cdot 10^{-55}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - t_0}{B}\right)}{\pi}\\

\mathbf{elif}\;A \leq -7.205558733068473 \cdot 10^{-87}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\sqrt[3]{{\left(\frac{C - \left(A + t_0\right)}{B}\right)}^{3}}\right)}{\pi}\\


\end{array}\\


\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.783231107200671e+114)
   (/ (* 180.0 (atan (* (* (/ B A) (+ (/ C A) 1.0)) 0.5))) PI)
   (let* ((t_0 (hypot B (- C A))))
     (if (<= A -4.310305532084718e-55)
       (* 180.0 (/ (atan (/ (- (- C A) t_0) B)) PI))
       (if (<= A -7.205558733068473e-87)
         (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
         (* 180.0 (/ (atan (cbrt (pow (/ (- C (+ A t_0)) B) 3.0))) 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.783231107200671e+114) {
		tmp = (180.0 * atan(((B / A) * ((C / A) + 1.0)) * 0.5)) / ((double) M_PI);
	} else {
		double t_0 = hypot(B, (C - A));
		double tmp_1;
		if (A <= -4.310305532084718e-55) {
			tmp_1 = 180.0 * (atan(((C - A) - t_0) / B) / ((double) M_PI));
		} else if (A <= -7.205558733068473e-87) {
			tmp_1 = 180.0 * (atan(-0.5 * (B / C)) / ((double) M_PI));
		} else {
			tmp_1 = 180.0 * (atan(cbrt(pow(((C - (A + t_0)) / B), 3.0))) / ((double) M_PI));
		}
		tmp = tmp_1;
	}
	return tmp;
}

Error

Bits error versus A

Bits error versus B

Bits error versus C

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if A < -2.7832311072006708e114

    1. Initial program 52.9

      \[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} \]
    2. Simplified27.4

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}} \]
    3. Taylor expanded in A around -inf 17.1

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{C \cdot B}{{A}^{2}} + 0.5 \cdot \frac{B}{A}\right)}}{\pi} \]
    4. Simplified14.5

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \left(\frac{C}{\frac{A \cdot A}{B}} + \frac{B}{A}\right)\right)}}{\pi} \]
    5. Applied associate-*r/_binary6414.5

      \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \left(\frac{C}{\frac{A \cdot A}{B}} + \frac{B}{A}\right)\right)}{\pi}} \]
    6. Simplified14.2

      \[\leadsto \frac{\color{blue}{180 \cdot \tan^{-1} \left(\left(\frac{B}{A} \cdot \left(\frac{C}{A} + 1\right)\right) \cdot 0.5\right)}}{\pi} \]

    if -2.7832311072006708e114 < A < -4.310305532084718e-55

    1. Initial program 37.7

      \[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} \]
    2. Simplified24.2

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}} \]
    3. Applied *-commutative_binary6424.2

      \[\leadsto \color{blue}{\frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi} \cdot 180} \]

    if -4.310305532084718e-55 < A < -7.2055587330684727e-87

    1. Initial program 35.4

      \[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} \]
    2. Simplified19.8

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}} \]
    3. Taylor expanded in C around inf 45.9

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{B}{C}\right)}}{\pi} \]

    if -7.2055587330684727e-87 < A

    1. Initial program 22.0

      \[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} \]
    2. Simplified8.5

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}} \]
    3. Applied add-cbrt-cube_binary648.5

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\sqrt[3]{\left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B} \cdot \frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right) \cdot \frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}}\right)}}{\pi} \]
    4. Simplified8.5

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\sqrt[3]{\color{blue}{{\left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right)}^{3}}}\right)}{\pi} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification12.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -2.783231107200671 \cdot 10^{+114}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\left(\frac{B}{A} \cdot \left(\frac{C}{A} + 1\right)\right) \cdot 0.5\right)}{\pi}\\ \mathbf{elif}\;A \leq -4.310305532084718 \cdot 10^{-55}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -7.205558733068473 \cdot 10^{-87}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\sqrt[3]{{\left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right)}^{3}}\right)}{\pi}\\ \end{array} \]

Reproduce

herbie shell --seed 2021344 
(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)))