Average Error: 29.9 → 13.3
Time: 14.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}\;A \leq -2.259626659035608 \cdot 10^{+150}:\\ \;\;\;\;\left(180 \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot \frac{B \cdot B}{A}}{B}\right)}{\sqrt{\pi}}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{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}\;A \leq -2.259626659035608 \cdot 10^{+150}:\\
\;\;\;\;\left(180 \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot \frac{B \cdot B}{A}}{B}\right)}{\sqrt{\pi}}\\

\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \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.259626659035608e+150)
   (*
    (* 180.0 (/ 1.0 (sqrt PI)))
    (/ (atan (/ (* 0.5 (/ (* B B) A)) B)) (sqrt 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.259626659035608e+150) {
		tmp = (180.0 * (1.0 / sqrt((double) M_PI))) * (atan((0.5 * ((B * B) / A)) / B) / sqrt((double) M_PI));
	} else {
		tmp = (180.0 * atan(((C - A) - hypot(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 2 regimes
  2. if A < -2.25962665903560801e150

    1. Initial program 56.3

      \[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. Simplified28.1

      \[\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-sqr-sqrt_binary6428.2

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

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

      \[\leadsto 180 \cdot \color{blue}{\left(\frac{1}{\sqrt{\pi}} \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\sqrt{\pi}}\right)} \]
    6. Applied associate-*r*_binary6428.1

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

      \[\leadsto \left(180 \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{0.5 \cdot \frac{{B}^{2}}{A}}}{B}\right)}{\sqrt{\pi}} \]
    8. Simplified21.0

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

    if -2.25962665903560801e150 < A

    1. Initial program 26.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. Simplified12.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 associate-*r/_binary6412.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -2.259626659035608 \cdot 10^{+150}:\\ \;\;\;\;\left(180 \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot \frac{B \cdot B}{A}}{B}\right)}{\sqrt{\pi}}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}\\ \end{array} \]

Reproduce

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