Average Error: 29.7 → 18.9
Time: 16.9s
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}\;\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq -0.0005467263827186867:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\sqrt[3]{\frac{\left(C - A\right) - B}{B}} \cdot \left(\sqrt[3]{\frac{\left(C - A\right) - B}{B}} \cdot \sqrt[3]{\frac{\left(C - A\right) - B}{B}}\right)\right)}{\pi}\\ \mathbf{elif}\;\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq 0:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-0.5 \cdot \left(\frac{B \cdot B}{C} + \frac{A \cdot \left(B \cdot B\right)}{C \cdot C}\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)}{\pi}\\ \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}\;\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq -0.0005467263827186867:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\sqrt[3]{\frac{\left(C - A\right) - B}{B}} \cdot \left(\sqrt[3]{\frac{\left(C - A\right) - B}{B}} \cdot \sqrt[3]{\frac{\left(C - A\right) - B}{B}}\right)\right)}{\pi}\\

\mathbf{elif}\;\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq 0:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-0.5 \cdot \left(\frac{B \cdot B}{C} + \frac{A \cdot \left(B \cdot B\right)}{C \cdot C}\right)}{B}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(B + C\right) - A}{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 (<=
      (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))
      -0.0005467263827186867)
   (*
    180.0
    (/
     (atan
      (*
       (cbrt (/ (- (- C A) B) B))
       (* (cbrt (/ (- (- C A) B) B)) (cbrt (/ (- (- C A) B) B)))))
     PI))
   (if (<=
        (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))
        0.0)
     (*
      180.0
      (/ (atan (/ (* -0.5 (+ (/ (* B B) C) (/ (* A (* B B)) (* C C)))) B)) PI))
     (* 180.0 (/ (atan (/ (- (+ 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 (((1.0 / B) * ((C - A) - sqrt(pow((A - C), 2.0) + pow(B, 2.0)))) <= -0.0005467263827186867) {
		tmp = 180.0 * (atan(cbrt(((C - A) - B) / B) * (cbrt(((C - A) - B) / B) * cbrt(((C - A) - B) / B))) / ((double) M_PI));
	} else if (((1.0 / B) * ((C - A) - sqrt(pow((A - C), 2.0) + pow(B, 2.0)))) <= 0.0) {
		tmp = 180.0 * (atan((-0.5 * (((B * B) / C) + ((A * (B * B)) / (C * C)))) / B) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan(((B + C) - A) / B) / ((double) M_PI));
	}
	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 3 regimes
  2. if (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -5.46726382718686695e-4

    1. Initial program 25.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. Simplified25.9

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + B \cdot B}}{B}\right)}{\pi}}\]
    3. Taylor expanded around inf 15.3

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \color{blue}{B}}{B}\right)}{\pi}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt_binary64_454615.3

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

    if -5.46726382718686695e-4 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < 0.0

    1. Initial program 51.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. Simplified51.4

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + B \cdot B}}{B}\right)}{\pi}}\]
    3. Taylor expanded around inf 39.9

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

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

    if 0.0 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2)))))

    1. Initial program 26.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. Simplified26.4

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + B \cdot B}}{B}\right)}{\pi}}\]
    3. Taylor expanded around -inf 15.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq -0.0005467263827186867:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\sqrt[3]{\frac{\left(C - A\right) - B}{B}} \cdot \left(\sqrt[3]{\frac{\left(C - A\right) - B}{B}} \cdot \sqrt[3]{\frac{\left(C - A\right) - B}{B}}\right)\right)}{\pi}\\ \mathbf{elif}\;\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq 0:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-0.5 \cdot \left(\frac{B \cdot B}{C} + \frac{A \cdot \left(B \cdot B\right)}{C \cdot C}\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)}{\pi}\\ \end{array}\]

Reproduce

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