ABCF->ab-angle angle

Percentage Accurate: 53.5% → 81.1%
Time: 22.2s
Alternatives: 17
Speedup: 3.5×

Specification

?
\[\begin{array}{l} \\ 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} \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)))
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));
}
public static double code(double A, double B, double C) {
	return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C):
	return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C)
	return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi))
end
function tmp = code(A, B, C)
	tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi);
end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
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}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 53.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 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} \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)))
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));
}
public static double code(double A, double B, double C) {
	return 180.0 * (Math.atan(((1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / Math.PI);
}
def code(A, B, C):
	return 180.0 * (math.atan(((1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / math.pi)
function code(A, B, C)
	return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi))
end
function tmp = code(A, B, C)
	tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi);
end
code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
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}
\end{array}

Alternative 1: 81.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.02 \cdot 10^{+14}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -1.02e+14)
   (* (atan (* 0.5 (/ (fma C (/ B A) B) A))) (/ 180.0 PI))
   (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -1.02e+14) {
		tmp = atan((0.5 * (fma(C, (B / A), B) / A))) * (180.0 / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
	}
	return tmp;
}
function code(A, B, C)
	tmp = 0.0
	if (A <= -1.02e+14)
		tmp = Float64(atan(Float64(0.5 * Float64(fma(C, Float64(B / A), B) / A))) * Float64(180.0 / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi));
	end
	return tmp
end
code[A_, B_, C_] := If[LessEqual[A, -1.02e+14], N[(N[ArcTan[N[(0.5 * N[(N[(C * N[(B / A), $MachinePrecision] + B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.02 \cdot 10^{+14}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right) \cdot \frac{180}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -1.02e14

    1. Initial program 19.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. Add Preprocessing
    3. Taylor expanded in A around -inf 68.2%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{-0.5 \cdot B + -0.5 \cdot \frac{B \cdot C}{A}}{A}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. mul-1-neg68.2%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-0.5 \cdot B + -0.5 \cdot \frac{B \cdot C}{A}}{-A}\right)}}{\pi} \]
      3. distribute-lft-out68.2%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{-0.5 \cdot \left(B + \frac{B \cdot C}{A}\right)}}{-A}\right)}{\pi} \]
      4. associate-/l*72.3%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-0.5 \cdot \left(B + B \cdot \frac{C}{A}\right)}{-A}\right)}}{\pi} \]
    6. Taylor expanded in B around 0 68.2%

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

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

    if -1.02e14 < A

    1. Initial program 58.6%

      \[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. Step-by-step derivation
      1. associate-*l/58.6%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
      2. *-lft-identity58.6%

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}}{B}\right)}{\pi} \]
      6. hypot-define83.4%

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

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

Alternative 2: 78.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.02 \cdot 10^{+14}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq 1.52 \cdot 10^{+33}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -1.02e+14)
   (* (atan (* 0.5 (/ (fma C (/ B A) B) A))) (/ 180.0 PI))
   (if (<= A 1.52e+33)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
     (* 180.0 (/ (atan (/ (+ A (hypot B A)) (- B))) PI)))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -1.02e+14) {
		tmp = atan((0.5 * (fma(C, (B / A), B) / A))) * (180.0 / ((double) M_PI));
	} else if (A <= 1.52e+33) {
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / ((double) M_PI));
	}
	return tmp;
}
function code(A, B, C)
	tmp = 0.0
	if (A <= -1.02e+14)
		tmp = Float64(atan(Float64(0.5 * Float64(fma(C, Float64(B / A), B) / A))) * Float64(180.0 / pi));
	elseif (A <= 1.52e+33)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) / Float64(-B))) / pi));
	end
	return tmp
end
code[A_, B_, C_] := If[LessEqual[A, -1.02e+14], N[(N[ArcTan[N[(0.5 * N[(N[(C * N[(B / A), $MachinePrecision] + B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.52e+33], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.02 \cdot 10^{+14}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right) \cdot \frac{180}{\pi}\\

\mathbf{elif}\;A \leq 1.52 \cdot 10^{+33}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -1.02e14

    1. Initial program 19.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. Add Preprocessing
    3. Taylor expanded in A around -inf 68.2%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{-0.5 \cdot B + -0.5 \cdot \frac{B \cdot C}{A}}{A}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. mul-1-neg68.2%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-0.5 \cdot B + -0.5 \cdot \frac{B \cdot C}{A}}{-A}\right)}}{\pi} \]
      3. distribute-lft-out68.2%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{-0.5 \cdot \left(B + \frac{B \cdot C}{A}\right)}}{-A}\right)}{\pi} \]
      4. associate-/l*72.3%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-0.5 \cdot \left(B + B \cdot \frac{C}{A}\right)}{-A}\right)}}{\pi} \]
    6. Taylor expanded in B around 0 68.2%

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

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

    if -1.02e14 < A < 1.5200000000000001e33

    1. Initial program 52.8%

      \[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. Add Preprocessing
    3. Taylor expanded in A around 0 50.9%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. unpow250.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}}{B}\right)}{\pi} \]
      2. unpow250.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{B \cdot B + \color{blue}{C \cdot C}}}{B}\right)}{\pi} \]
      3. hypot-define78.7%

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

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

    if 1.5200000000000001e33 < A

    1. Initial program 72.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. Add Preprocessing
    3. Taylor expanded in C around 0 72.3%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + \sqrt{{A}^{2} + {B}^{2}}}{B}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. mul-1-neg72.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-\frac{A + \sqrt{{A}^{2} + {B}^{2}}}{B}\right)}}{\pi} \]
      2. distribute-neg-frac272.3%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}}{-B}\right)}{\pi} \]
      4. unpow272.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}}{-B}\right)}{\pi} \]
      5. unpow272.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}}{-B}\right)}{\pi} \]
      6. hypot-define83.4%

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

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

Alternative 3: 77.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -86000000000000:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{elif}\;A \leq 7.8 \cdot 10^{+31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -86000000000000.0)
   (* (/ 180.0 PI) (atan (* B (/ 0.5 A))))
   (if (<= A 7.8e+31)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
     (* 180.0 (/ (atan (/ (+ A (hypot B A)) (- B))) PI)))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -86000000000000.0) {
		tmp = (180.0 / ((double) M_PI)) * atan((B * (0.5 / A)));
	} else if (A <= 7.8e+31) {
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double tmp;
	if (A <= -86000000000000.0) {
		tmp = (180.0 / Math.PI) * Math.atan((B * (0.5 / A)));
	} else if (A <= 7.8e+31) {
		tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan(((A + Math.hypot(B, A)) / -B)) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	tmp = 0
	if A <= -86000000000000.0:
		tmp = (180.0 / math.pi) * math.atan((B * (0.5 / A)))
	elif A <= 7.8e+31:
		tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi)
	else:
		tmp = 180.0 * (math.atan(((A + math.hypot(B, A)) / -B)) / math.pi)
	return tmp
function code(A, B, C)
	tmp = 0.0
	if (A <= -86000000000000.0)
		tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(0.5 / A))));
	elseif (A <= 7.8e+31)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(A + hypot(B, A)) / Float64(-B))) / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	tmp = 0.0;
	if (A <= -86000000000000.0)
		tmp = (180.0 / pi) * atan((B * (0.5 / A)));
	elseif (A <= 7.8e+31)
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi);
	else
		tmp = 180.0 * (atan(((A + hypot(B, A)) / -B)) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := If[LessEqual[A, -86000000000000.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7.8e+31], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;A \leq -86000000000000:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\

\mathbf{elif}\;A \leq 7.8 \cdot 10^{+31}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -8.6e13

    1. Initial program 19.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. Add Preprocessing
    3. Taylor expanded in A around -inf 73.3%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{B}{A}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. associate-*r/73.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot B}{A}\right)}}{\pi} \]
    5. Simplified73.3%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot B}{A}\right)}}{\pi} \]
    6. Step-by-step derivation
      1. clear-num73.0%

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

        \[\leadsto 180 \cdot \color{blue}{{\left(\frac{\pi}{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}\right)}^{-1}} \]
      3. associate-/l*73.0%

        \[\leadsto 180 \cdot {\left(\frac{\pi}{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{B}{A}\right)}}\right)}^{-1} \]
    7. Applied egg-rr73.0%

      \[\leadsto 180 \cdot \color{blue}{{\left(\frac{\pi}{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}\right)}^{-1}} \]
    8. Step-by-step derivation
      1. unpow-173.0%

        \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\pi}{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}}} \]
      2. associate-*r/73.0%

        \[\leadsto 180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot B}{A}\right)}}} \]
      3. *-commutative73.0%

        \[\leadsto 180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{\color{blue}{B \cdot 0.5}}{A}\right)}} \]
    9. Simplified73.0%

      \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}}} \]
    10. Taylor expanded in B around 0 73.3%

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}} \]
    11. Step-by-step derivation
      1. associate-*r/73.2%

        \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}} \]
      2. *-commutative73.2%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{B}{A} \cdot 0.5\right)}}{\pi} \]
      3. associate-*l/73.2%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{B \cdot 0.5}{A}\right)}}{\pi} \]
      4. associate-*r/73.3%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(B \cdot \frac{0.5}{A}\right)}}{\pi} \]
      5. associate-*l/73.4%

        \[\leadsto \color{blue}{\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)} \]
      6. *-commutative73.4%

        \[\leadsto \color{blue}{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}} \]
    12. Simplified73.4%

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

    if -8.6e13 < A < 7.79999999999999999e31

    1. Initial program 52.8%

      \[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. Add Preprocessing
    3. Taylor expanded in A around 0 50.9%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. unpow250.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}}{B}\right)}{\pi} \]
      2. unpow250.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{B \cdot B + \color{blue}{C \cdot C}}}{B}\right)}{\pi} \]
      3. hypot-define78.7%

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

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

    if 7.79999999999999999e31 < A

    1. Initial program 72.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. Add Preprocessing
    3. Taylor expanded in C around 0 72.3%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + \sqrt{{A}^{2} + {B}^{2}}}{B}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. mul-1-neg72.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-\frac{A + \sqrt{{A}^{2} + {B}^{2}}}{B}\right)}}{\pi} \]
      2. distribute-neg-frac272.3%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A + \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}}{-B}\right)}{\pi} \]
      4. unpow272.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}}{-B}\right)}{\pi} \]
      5. unpow272.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}}{-B}\right)}{\pi} \]
      6. hypot-define83.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -86000000000000:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{elif}\;A \leq 7.8 \cdot 10^{+31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(B, A\right)}{-B}\right)}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.15 \cdot 10^{+14}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{elif}\;A \leq 1.02 \cdot 10^{+143}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -1.15e+14)
   (* (/ 180.0 PI) (atan (* B (/ 0.5 A))))
   (if (<= A 1.02e+143)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
     (/ (* 180.0 (atan (- -1.0 (/ A B)))) PI))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -1.15e+14) {
		tmp = (180.0 / ((double) M_PI)) * atan((B * (0.5 / A)));
	} else if (A <= 1.02e+143) {
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
	} else {
		tmp = (180.0 * atan((-1.0 - (A / B)))) / ((double) M_PI);
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double tmp;
	if (A <= -1.15e+14) {
		tmp = (180.0 / Math.PI) * Math.atan((B * (0.5 / A)));
	} else if (A <= 1.02e+143) {
		tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
	} else {
		tmp = (180.0 * Math.atan((-1.0 - (A / B)))) / Math.PI;
	}
	return tmp;
}
def code(A, B, C):
	tmp = 0
	if A <= -1.15e+14:
		tmp = (180.0 / math.pi) * math.atan((B * (0.5 / A)))
	elif A <= 1.02e+143:
		tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi)
	else:
		tmp = (180.0 * math.atan((-1.0 - (A / B)))) / math.pi
	return tmp
function code(A, B, C)
	tmp = 0.0
	if (A <= -1.15e+14)
		tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(0.5 / A))));
	elseif (A <= 1.02e+143)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi));
	else
		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 - Float64(A / B)))) / pi);
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	tmp = 0.0;
	if (A <= -1.15e+14)
		tmp = (180.0 / pi) * atan((B * (0.5 / A)));
	elseif (A <= 1.02e+143)
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi);
	else
		tmp = (180.0 * atan((-1.0 - (A / B)))) / pi;
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := If[LessEqual[A, -1.15e+14], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.02e+143], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.15 \cdot 10^{+14}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\

\mathbf{elif}\;A \leq 1.02 \cdot 10^{+143}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -1.15e14

    1. Initial program 19.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. Add Preprocessing
    3. Taylor expanded in A around -inf 73.3%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{B}{A}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. associate-*r/73.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot B}{A}\right)}}{\pi} \]
    5. Simplified73.3%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot B}{A}\right)}}{\pi} \]
    6. Step-by-step derivation
      1. clear-num73.0%

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

        \[\leadsto 180 \cdot \color{blue}{{\left(\frac{\pi}{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}\right)}^{-1}} \]
      3. associate-/l*73.0%

        \[\leadsto 180 \cdot {\left(\frac{\pi}{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{B}{A}\right)}}\right)}^{-1} \]
    7. Applied egg-rr73.0%

      \[\leadsto 180 \cdot \color{blue}{{\left(\frac{\pi}{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}\right)}^{-1}} \]
    8. Step-by-step derivation
      1. unpow-173.0%

        \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\pi}{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}}} \]
      2. associate-*r/73.0%

        \[\leadsto 180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot B}{A}\right)}}} \]
      3. *-commutative73.0%

        \[\leadsto 180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{\color{blue}{B \cdot 0.5}}{A}\right)}} \]
    9. Simplified73.0%

      \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}}} \]
    10. Taylor expanded in B around 0 73.3%

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}} \]
    11. Step-by-step derivation
      1. associate-*r/73.2%

        \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}} \]
      2. *-commutative73.2%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{B}{A} \cdot 0.5\right)}}{\pi} \]
      3. associate-*l/73.2%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{B \cdot 0.5}{A}\right)}}{\pi} \]
      4. associate-*r/73.3%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(B \cdot \frac{0.5}{A}\right)}}{\pi} \]
      5. associate-*l/73.4%

        \[\leadsto \color{blue}{\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)} \]
      6. *-commutative73.4%

        \[\leadsto \color{blue}{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}} \]
    12. Simplified73.4%

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

    if -1.15e14 < A < 1.01999999999999995e143

    1. Initial program 55.5%

      \[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. Add Preprocessing
    3. Taylor expanded in A around 0 51.3%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. unpow251.3%

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

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

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

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

    if 1.01999999999999995e143 < A

    1. Initial program 71.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/71.7%

        \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
      2. associate-*l/71.7%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
      3. *-un-lft-identity71.7%

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\pi} \]
      4. unpow271.7%

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\color{blue}{\left(A - C\right) \cdot \left(A - C\right)} + {B}^{2}}}{B}\right)}{\pi} \]
      5. unpow271.7%

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

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

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

      \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
    6. Taylor expanded in C around 0 78.7%

      \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-1 \cdot \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
    7. Step-by-step derivation
      1. neg-mul-178.7%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-\left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      2. distribute-neg-in78.7%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\left(-1\right) + \left(-\frac{A}{B}\right)\right)}}{\pi} \]
      3. metadata-eval78.7%

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\color{blue}{-1} + \left(-\frac{A}{B}\right)\right)}{\pi} \]
      4. unsub-neg78.7%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-1 - \frac{A}{B}\right)}}{\pi} \]
    8. Simplified78.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -1.15 \cdot 10^{+14}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{elif}\;A \leq 1.02 \cdot 10^{+143}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.16 \cdot 10^{+14}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -1.16e+14)
   (* (atan (* 0.5 (/ (fma C (/ B A) B) A))) (/ 180.0 PI))
   (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -1.16e+14) {
		tmp = atan((0.5 * (fma(C, (B / A), B) / A))) * (180.0 / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan(((C - (A + hypot(B, (A - C)))) / B)) / ((double) M_PI));
	}
	return tmp;
}
function code(A, B, C)
	tmp = 0.0
	if (A <= -1.16e+14)
		tmp = Float64(atan(Float64(0.5 * Float64(fma(C, Float64(B / A), B) / A))) * Float64(180.0 / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + hypot(B, Float64(A - C)))) / B)) / pi));
	end
	return tmp
end
code[A_, B_, C_] := If[LessEqual[A, -1.16e+14], N[(N[ArcTan[N[(0.5 * N[(N[(C * N[(B / A), $MachinePrecision] + B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.16 \cdot 10^{+14}:\\
\;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{\mathsf{fma}\left(C, \frac{B}{A}, B\right)}{A}\right) \cdot \frac{180}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}{B}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -1.16e14

    1. Initial program 19.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. Add Preprocessing
    3. Taylor expanded in A around -inf 68.2%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{-0.5 \cdot B + -0.5 \cdot \frac{B \cdot C}{A}}{A}\right)}}{\pi} \]
    4. Step-by-step derivation
      1. mul-1-neg68.2%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-0.5 \cdot B + -0.5 \cdot \frac{B \cdot C}{A}}{-A}\right)}}{\pi} \]
      3. distribute-lft-out68.2%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{-0.5 \cdot \left(B + \frac{B \cdot C}{A}\right)}}{-A}\right)}{\pi} \]
      4. associate-/l*72.3%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-0.5 \cdot \left(B + B \cdot \frac{C}{A}\right)}{-A}\right)}}{\pi} \]
    6. Taylor expanded in B around 0 68.2%

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

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

    if -1.16e14 < A

    1. Initial program 58.6%

      \[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. Step-by-step derivation
      1. Simplified83.4%

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

    Alternative 6: 60.6% accurate, 3.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \mathbf{if}\;C \leq -9.5 \cdot 10^{-100}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;C \leq 3.3 \cdot 10^{-245}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq 3.15 \cdot 10^{+19}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0 (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))))
       (if (<= C -9.5e-100)
         t_0
         (if (<= C 3.3e-245)
           (/ (* 180.0 (atan (- -1.0 (/ A B)))) PI)
           (if (<= C 3.15e+19) t_0 (* (/ 180.0 PI) (atan (* -0.5 (/ B C)))))))))
    double code(double A, double B, double C) {
    	double t_0 = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
    	double tmp;
    	if (C <= -9.5e-100) {
    		tmp = t_0;
    	} else if (C <= 3.3e-245) {
    		tmp = (180.0 * atan((-1.0 - (A / B)))) / ((double) M_PI);
    	} else if (C <= 3.15e+19) {
    		tmp = t_0;
    	} else {
    		tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / C)));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double t_0 = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
    	double tmp;
    	if (C <= -9.5e-100) {
    		tmp = t_0;
    	} else if (C <= 3.3e-245) {
    		tmp = (180.0 * Math.atan((-1.0 - (A / B)))) / Math.PI;
    	} else if (C <= 3.15e+19) {
    		tmp = t_0;
    	} else {
    		tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / C)));
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	t_0 = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi)
    	tmp = 0
    	if C <= -9.5e-100:
    		tmp = t_0
    	elif C <= 3.3e-245:
    		tmp = (180.0 * math.atan((-1.0 - (A / B)))) / math.pi
    	elif C <= 3.15e+19:
    		tmp = t_0
    	else:
    		tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / C)))
    	return tmp
    
    function code(A, B, C)
    	t_0 = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi))
    	tmp = 0.0
    	if (C <= -9.5e-100)
    		tmp = t_0;
    	elseif (C <= 3.3e-245)
    		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 - Float64(A / B)))) / pi);
    	elseif (C <= 3.15e+19)
    		tmp = t_0;
    	else
    		tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / C))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	t_0 = 180.0 * (atan((1.0 + ((C - A) / B))) / pi);
    	tmp = 0.0;
    	if (C <= -9.5e-100)
    		tmp = t_0;
    	elseif (C <= 3.3e-245)
    		tmp = (180.0 * atan((-1.0 - (A / B)))) / pi;
    	elseif (C <= 3.15e+19)
    		tmp = t_0;
    	else
    		tmp = (180.0 / pi) * atan((-0.5 * (B / C)));
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -9.5e-100], t$95$0, If[LessEqual[C, 3.3e-245], N[(N[(180.0 * N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 3.15e+19], t$95$0, N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
    \mathbf{if}\;C \leq -9.5 \cdot 10^{-100}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;C \leq 3.3 \cdot 10^{-245}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
    
    \mathbf{elif}\;C \leq 3.15 \cdot 10^{+19}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if C < -9.4999999999999992e-100 or 3.3000000000000001e-245 < C < 3.15e19

      1. Initial program 63.6%

        \[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. Add Preprocessing
      3. Taylor expanded in B around -inf 67.8%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}}{\pi} \]
      4. Step-by-step derivation
        1. associate--l+67.8%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)}}{\pi} \]
        2. div-sub67.8%

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

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

      if -9.4999999999999992e-100 < C < 3.3000000000000001e-245

      1. Initial program 54.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. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*r/54.4%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
        2. associate-*l/54.4%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
        3. *-un-lft-identity54.4%

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

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

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}}{B}\right)}{\pi} \]
        6. hypot-define81.1%

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      6. Taylor expanded in C around 0 57.0%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-1 \cdot \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      7. Step-by-step derivation
        1. neg-mul-157.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-\left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
        2. distribute-neg-in57.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\left(-1\right) + \left(-\frac{A}{B}\right)\right)}}{\pi} \]
        3. metadata-eval57.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\color{blue}{-1} + \left(-\frac{A}{B}\right)\right)}{\pi} \]
        4. unsub-neg57.0%

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

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

      if 3.15e19 < C

      1. Initial program 15.8%

        \[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. Add Preprocessing
      3. Taylor expanded in C around inf 68.8%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + -0.5 \cdot \frac{B}{C}\right)}}{\pi} \]
      4. Step-by-step derivation
        1. clear-num67.1%

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

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

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

          \[\leadsto 180 \cdot {\left(\frac{\pi}{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(-0.5, \frac{B}{C}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}}\right)}^{-1} \]
        5. mul-1-neg67.1%

          \[\leadsto 180 \cdot {\left(\frac{\pi}{\tan^{-1} \left(\mathsf{fma}\left(-0.5, \frac{B}{C}, \color{blue}{-\frac{A + -1 \cdot A}{B}}\right)\right)}\right)}^{-1} \]
        6. distribute-rgt1-in67.1%

          \[\leadsto 180 \cdot {\left(\frac{\pi}{\tan^{-1} \left(\mathsf{fma}\left(-0.5, \frac{B}{C}, -\frac{\color{blue}{\left(-1 + 1\right) \cdot A}}{B}\right)\right)}\right)}^{-1} \]
        7. metadata-eval67.1%

          \[\leadsto 180 \cdot {\left(\frac{\pi}{\tan^{-1} \left(\mathsf{fma}\left(-0.5, \frac{B}{C}, -\frac{\color{blue}{0} \cdot A}{B}\right)\right)}\right)}^{-1} \]
      5. Applied egg-rr67.1%

        \[\leadsto 180 \cdot \color{blue}{{\left(\frac{\pi}{\tan^{-1} \left(\mathsf{fma}\left(-0.5, \frac{B}{C}, -\frac{0 \cdot A}{B}\right)\right)}\right)}^{-1}} \]
      6. Simplified67.1%

        \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\pi}{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}}} \]
      7. Taylor expanded in B around 0 68.8%

        \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}} \]
      8. Step-by-step derivation
        1. associate-*r/68.8%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}} \]
        2. associate-*r/68.8%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{-0.5 \cdot B}{C}\right)}}{\pi} \]
        3. *-commutative68.8%

          \[\leadsto \frac{\color{blue}{\tan^{-1} \left(\frac{-0.5 \cdot B}{C}\right) \cdot 180}}{\pi} \]
        4. associate-*r/68.9%

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

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

        \[\leadsto \color{blue}{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right) \cdot \frac{180}{\pi}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification65.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -9.5 \cdot 10^{-100}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq 3.3 \cdot 10^{-245}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq 3.15 \cdot 10^{+19}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 48.3% accurate, 3.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3.6 \cdot 10^{+30}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -1.65 \cdot 10^{-240}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\ \mathbf{elif}\;B \leq 16500000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= B -3.6e+30)
       (* 180.0 (/ (atan 1.0) PI))
       (if (<= B -1.65e-240)
         (* 180.0 (/ (atan (* B (/ -0.5 C))) PI))
         (if (<= B 16500000.0)
           (* 180.0 (/ (atan (* (/ C B) 2.0)) PI))
           (* 180.0 (/ (atan -1.0) PI))))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -3.6e+30) {
    		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
    	} else if (B <= -1.65e-240) {
    		tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
    	} else if (B <= 16500000.0) {
    		tmp = 180.0 * (atan(((C / B) * 2.0)) / ((double) M_PI));
    	} else {
    		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -3.6e+30) {
    		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
    	} else if (B <= -1.65e-240) {
    		tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
    	} else if (B <= 16500000.0) {
    		tmp = 180.0 * (Math.atan(((C / B) * 2.0)) / Math.PI);
    	} else {
    		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if B <= -3.6e+30:
    		tmp = 180.0 * (math.atan(1.0) / math.pi)
    	elif B <= -1.65e-240:
    		tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi)
    	elif B <= 16500000.0:
    		tmp = 180.0 * (math.atan(((C / B) * 2.0)) / math.pi)
    	else:
    		tmp = 180.0 * (math.atan(-1.0) / math.pi)
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (B <= -3.6e+30)
    		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
    	elseif (B <= -1.65e-240)
    		tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi));
    	elseif (B <= 16500000.0)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) * 2.0)) / pi));
    	else
    		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (B <= -3.6e+30)
    		tmp = 180.0 * (atan(1.0) / pi);
    	elseif (B <= -1.65e-240)
    		tmp = 180.0 * (atan((B * (-0.5 / C))) / pi);
    	elseif (B <= 16500000.0)
    		tmp = 180.0 * (atan(((C / B) * 2.0)) / pi);
    	else
    		tmp = 180.0 * (atan(-1.0) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[B, -3.6e+30], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.65e-240], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 16500000.0], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -3.6 \cdot 10^{+30}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
    
    \mathbf{elif}\;B \leq -1.65 \cdot 10^{-240}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
    
    \mathbf{elif}\;B \leq 16500000:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if B < -3.6000000000000002e30

      1. Initial program 45.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. Add Preprocessing
      3. Taylor expanded in B around -inf 70.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\pi} \]

      if -3.6000000000000002e30 < B < -1.6500000000000001e-240

      1. Initial program 39.8%

        \[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. Add Preprocessing
      3. Taylor expanded in C around inf 45.0%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + -0.5 \cdot \frac{B}{C}\right)}}{\pi} \]
      4. Taylor expanded in B around inf 29.4%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(-1 \cdot \frac{A + -1 \cdot A}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}}{\pi} \]
      5. Step-by-step derivation
        1. distribute-rgt1-in29.4%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \frac{\color{blue}{0} \cdot A}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        3. mul0-lft29.4%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \frac{\color{blue}{0}}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        4. div045.1%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \color{blue}{0} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        5. metadata-eval45.1%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\color{blue}{0} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        6. neg-sub045.1%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(-0.5 \cdot \frac{1}{C}\right)}\right)}{\pi} \]
        7. associate-*r/45.1%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-\frac{\color{blue}{0.5}}{C}\right)\right)}{\pi} \]
        9. distribute-neg-frac45.1%

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

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

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

      if -1.6500000000000001e-240 < B < 1.65e7

      1. Initial program 56.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. Add Preprocessing
      3. Taylor expanded in C around -inf 40.9%

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

      if 1.65e7 < B

      1. Initial program 50.5%

        \[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. Add Preprocessing
      3. Taylor expanded in B around inf 63.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification54.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -3.6 \cdot 10^{+30}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -1.65 \cdot 10^{-240}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\ \mathbf{elif}\;B \leq 16500000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 48.3% accurate, 3.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.12 \cdot 10^{+30}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -2.5 \cdot 10^{-240}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;B \leq 4800000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= B -1.12e+30)
       (* 180.0 (/ (atan 1.0) PI))
       (if (<= B -2.5e-240)
         (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
         (if (<= B 4800000.0)
           (* 180.0 (/ (atan (* (/ C B) 2.0)) PI))
           (* 180.0 (/ (atan -1.0) PI))))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -1.12e+30) {
    		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
    	} else if (B <= -2.5e-240) {
    		tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
    	} else if (B <= 4800000.0) {
    		tmp = 180.0 * (atan(((C / B) * 2.0)) / ((double) M_PI));
    	} else {
    		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -1.12e+30) {
    		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
    	} else if (B <= -2.5e-240) {
    		tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
    	} else if (B <= 4800000.0) {
    		tmp = 180.0 * (Math.atan(((C / B) * 2.0)) / Math.PI);
    	} else {
    		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if B <= -1.12e+30:
    		tmp = 180.0 * (math.atan(1.0) / math.pi)
    	elif B <= -2.5e-240:
    		tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi)
    	elif B <= 4800000.0:
    		tmp = 180.0 * (math.atan(((C / B) * 2.0)) / math.pi)
    	else:
    		tmp = 180.0 * (math.atan(-1.0) / math.pi)
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (B <= -1.12e+30)
    		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
    	elseif (B <= -2.5e-240)
    		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi));
    	elseif (B <= 4800000.0)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) * 2.0)) / pi));
    	else
    		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (B <= -1.12e+30)
    		tmp = 180.0 * (atan(1.0) / pi);
    	elseif (B <= -2.5e-240)
    		tmp = 180.0 * (atan((-0.5 * (B / C))) / pi);
    	elseif (B <= 4800000.0)
    		tmp = 180.0 * (atan(((C / B) * 2.0)) / pi);
    	else
    		tmp = 180.0 * (atan(-1.0) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[B, -1.12e+30], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.5e-240], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4800000.0], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -1.12 \cdot 10^{+30}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
    
    \mathbf{elif}\;B \leq -2.5 \cdot 10^{-240}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
    
    \mathbf{elif}\;B \leq 4800000:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if B < -1.12e30

      1. Initial program 45.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. Add Preprocessing
      3. Taylor expanded in B around -inf 70.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\pi} \]

      if -1.12e30 < B < -2.5000000000000002e-240

      1. Initial program 39.8%

        \[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. Add Preprocessing
      3. Taylor expanded in C around inf 45.0%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + -0.5 \cdot \frac{B}{C}\right)}}{\pi} \]
      4. Taylor expanded in A around inf 45.0%

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

      if -2.5000000000000002e-240 < B < 4.8e6

      1. Initial program 56.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. Add Preprocessing
      3. Taylor expanded in C around -inf 40.9%

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

      if 4.8e6 < B

      1. Initial program 50.5%

        \[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. Add Preprocessing
      3. Taylor expanded in B around inf 63.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification54.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1.12 \cdot 10^{+30}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -2.5 \cdot 10^{-240}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;B \leq 4800000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} \cdot 2\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 65.6% accurate, 3.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3.4 \cdot 10^{-117}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq -1.05 \cdot 10^{-241}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - B\right)\right)}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= B -3.4e-117)
       (* 180.0 (/ (atan (+ 1.0 (/ (- C A) B))) PI))
       (if (<= B -1.05e-241)
         (* 180.0 (/ (atan (* B (/ -0.5 C))) PI))
         (* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) B))) PI)))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -3.4e-117) {
    		tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / ((double) M_PI));
    	} else if (B <= -1.05e-241) {
    		tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
    	} else {
    		tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - B))) / ((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -3.4e-117) {
    		tmp = 180.0 * (Math.atan((1.0 + ((C - A) / B))) / Math.PI);
    	} else if (B <= -1.05e-241) {
    		tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
    	} else {
    		tmp = 180.0 * (Math.atan(((1.0 / B) * ((C - A) - B))) / Math.PI);
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if B <= -3.4e-117:
    		tmp = 180.0 * (math.atan((1.0 + ((C - A) / B))) / math.pi)
    	elif B <= -1.05e-241:
    		tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi)
    	else:
    		tmp = 180.0 * (math.atan(((1.0 / B) * ((C - A) - B))) / math.pi)
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (B <= -3.4e-117)
    		tmp = Float64(180.0 * Float64(atan(Float64(1.0 + Float64(Float64(C - A) / B))) / pi));
    	elseif (B <= -1.05e-241)
    		tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi));
    	else
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - B))) / pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (B <= -3.4e-117)
    		tmp = 180.0 * (atan((1.0 + ((C - A) / B))) / pi);
    	elseif (B <= -1.05e-241)
    		tmp = 180.0 * (atan((B * (-0.5 / C))) / pi);
    	else
    		tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - B))) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[B, -3.4e-117], N[(180.0 * N[(N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.05e-241], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -3.4 \cdot 10^{-117}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\
    
    \mathbf{elif}\;B \leq -1.05 \cdot 10^{-241}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - B\right)\right)}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if B < -3.40000000000000035e-117

      1. Initial program 46.2%

        \[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. Add Preprocessing
      3. Taylor expanded in B around -inf 71.5%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}}{\pi} \]
      4. Step-by-step derivation
        1. associate--l+71.5%

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

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

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

      if -3.40000000000000035e-117 < B < -1.05e-241

      1. Initial program 30.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. Add Preprocessing
      3. Taylor expanded in C around inf 59.6%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + -0.5 \cdot \frac{B}{C}\right)}}{\pi} \]
      4. Taylor expanded in B around inf 23.4%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(-1 \cdot \frac{A + -1 \cdot A}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}}{\pi} \]
      5. Step-by-step derivation
        1. distribute-rgt1-in23.4%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \frac{\color{blue}{0} \cdot A}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        3. mul0-lft23.4%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \frac{\color{blue}{0}}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        4. div059.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \color{blue}{0} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        5. metadata-eval59.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\color{blue}{0} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        6. neg-sub059.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(-0.5 \cdot \frac{1}{C}\right)}\right)}{\pi} \]
        7. associate-*r/59.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-\color{blue}{\frac{0.5 \cdot 1}{C}}\right)\right)}{\pi} \]
        8. metadata-eval59.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-\frac{\color{blue}{0.5}}{C}\right)\right)}{\pi} \]
        9. distribute-neg-frac59.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{-0.5}{C}}\right)}{\pi} \]
        10. metadata-eval59.7%

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

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

      if -1.05e-241 < B

      1. Initial program 54.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. Add Preprocessing
      3. Taylor expanded in B around inf 64.1%

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

    Alternative 10: 48.3% accurate, 3.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -5.8 \cdot 10^{+28}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -9.5 \cdot 10^{-241}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;B \leq 4800000:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= B -5.8e+28)
       (* 180.0 (/ (atan 1.0) PI))
       (if (<= B -9.5e-241)
         (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))
         (if (<= B 4800000.0)
           (/ (* 180.0 (atan (/ C B))) PI)
           (* 180.0 (/ (atan -1.0) PI))))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -5.8e+28) {
    		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
    	} else if (B <= -9.5e-241) {
    		tmp = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
    	} else if (B <= 4800000.0) {
    		tmp = (180.0 * atan((C / B))) / ((double) M_PI);
    	} else {
    		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -5.8e+28) {
    		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
    	} else if (B <= -9.5e-241) {
    		tmp = 180.0 * (Math.atan((-0.5 * (B / C))) / Math.PI);
    	} else if (B <= 4800000.0) {
    		tmp = (180.0 * Math.atan((C / B))) / Math.PI;
    	} else {
    		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if B <= -5.8e+28:
    		tmp = 180.0 * (math.atan(1.0) / math.pi)
    	elif B <= -9.5e-241:
    		tmp = 180.0 * (math.atan((-0.5 * (B / C))) / math.pi)
    	elif B <= 4800000.0:
    		tmp = (180.0 * math.atan((C / B))) / math.pi
    	else:
    		tmp = 180.0 * (math.atan(-1.0) / math.pi)
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (B <= -5.8e+28)
    		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
    	elseif (B <= -9.5e-241)
    		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / C))) / pi));
    	elseif (B <= 4800000.0)
    		tmp = Float64(Float64(180.0 * atan(Float64(C / B))) / pi);
    	else
    		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (B <= -5.8e+28)
    		tmp = 180.0 * (atan(1.0) / pi);
    	elseif (B <= -9.5e-241)
    		tmp = 180.0 * (atan((-0.5 * (B / C))) / pi);
    	elseif (B <= 4800000.0)
    		tmp = (180.0 * atan((C / B))) / pi;
    	else
    		tmp = 180.0 * (atan(-1.0) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[B, -5.8e+28], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -9.5e-241], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4800000.0], N[(N[(180.0 * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -5.8 \cdot 10^{+28}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
    
    \mathbf{elif}\;B \leq -9.5 \cdot 10^{-241}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
    
    \mathbf{elif}\;B \leq 4800000:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if B < -5.8000000000000002e28

      1. Initial program 45.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. Add Preprocessing
      3. Taylor expanded in B around -inf 70.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\pi} \]

      if -5.8000000000000002e28 < B < -9.49999999999999971e-241

      1. Initial program 39.8%

        \[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. Add Preprocessing
      3. Taylor expanded in C around inf 45.0%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + -0.5 \cdot \frac{B}{C}\right)}}{\pi} \]
      4. Taylor expanded in A around inf 45.0%

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

      if -9.49999999999999971e-241 < B < 4.8e6

      1. Initial program 56.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. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*r/56.9%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
        2. associate-*l/56.9%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
        3. *-un-lft-identity56.9%

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

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\color{blue}{\left(A - C\right) \cdot \left(A - C\right)} + {B}^{2}}}{B}\right)}{\pi} \]
        5. unpow256.9%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}}{B}\right)}{\pi} \]
        6. hypot-define70.7%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \color{blue}{\mathsf{hypot}\left(A - C, B\right)}}{B}\right)}{\pi} \]
      4. Applied egg-rr70.7%

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      6. Taylor expanded in C around inf 40.9%

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

      if 4.8e6 < B

      1. Initial program 50.5%

        \[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. Add Preprocessing
      3. Taylor expanded in B around inf 63.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
    3. Recombined 4 regimes into one program.
    4. Add Preprocessing

    Alternative 11: 65.6% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{C - A}{B}\\ \mathbf{if}\;B \leq -9.2 \cdot 10^{-117}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_0\right)}{\pi}\\ \mathbf{elif}\;B \leq -2.2 \cdot 10^{-240}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 + t\_0\right)\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0 (/ (- C A) B)))
       (if (<= B -9.2e-117)
         (* 180.0 (/ (atan (+ 1.0 t_0)) PI))
         (if (<= B -2.2e-240)
           (* 180.0 (/ (atan (* B (/ -0.5 C))) PI))
           (* (/ 180.0 PI) (atan (+ -1.0 t_0)))))))
    double code(double A, double B, double C) {
    	double t_0 = (C - A) / B;
    	double tmp;
    	if (B <= -9.2e-117) {
    		tmp = 180.0 * (atan((1.0 + t_0)) / ((double) M_PI));
    	} else if (B <= -2.2e-240) {
    		tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
    	} else {
    		tmp = (180.0 / ((double) M_PI)) * atan((-1.0 + t_0));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double t_0 = (C - A) / B;
    	double tmp;
    	if (B <= -9.2e-117) {
    		tmp = 180.0 * (Math.atan((1.0 + t_0)) / Math.PI);
    	} else if (B <= -2.2e-240) {
    		tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
    	} else {
    		tmp = (180.0 / Math.PI) * Math.atan((-1.0 + t_0));
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	t_0 = (C - A) / B
    	tmp = 0
    	if B <= -9.2e-117:
    		tmp = 180.0 * (math.atan((1.0 + t_0)) / math.pi)
    	elif B <= -2.2e-240:
    		tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi)
    	else:
    		tmp = (180.0 / math.pi) * math.atan((-1.0 + t_0))
    	return tmp
    
    function code(A, B, C)
    	t_0 = Float64(Float64(C - A) / B)
    	tmp = 0.0
    	if (B <= -9.2e-117)
    		tmp = Float64(180.0 * Float64(atan(Float64(1.0 + t_0)) / pi));
    	elseif (B <= -2.2e-240)
    		tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi));
    	else
    		tmp = Float64(Float64(180.0 / pi) * atan(Float64(-1.0 + t_0)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	t_0 = (C - A) / B;
    	tmp = 0.0;
    	if (B <= -9.2e-117)
    		tmp = 180.0 * (atan((1.0 + t_0)) / pi);
    	elseif (B <= -2.2e-240)
    		tmp = 180.0 * (atan((B * (-0.5 / C))) / pi);
    	else
    		tmp = (180.0 / pi) * atan((-1.0 + t_0));
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := Block[{t$95$0 = N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -9.2e-117], N[(180.0 * N[(N[ArcTan[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -2.2e-240], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-1.0 + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{C - A}{B}\\
    \mathbf{if}\;B \leq -9.2 \cdot 10^{-117}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + t\_0\right)}{\pi}\\
    
    \mathbf{elif}\;B \leq -2.2 \cdot 10^{-240}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 + t\_0\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if B < -9.19999999999999978e-117

      1. Initial program 46.2%

        \[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. Add Preprocessing
      3. Taylor expanded in B around -inf 71.5%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}}{\pi} \]
      4. Step-by-step derivation
        1. associate--l+71.5%

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

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

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

      if -9.19999999999999978e-117 < B < -2.1999999999999999e-240

      1. Initial program 30.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. Add Preprocessing
      3. Taylor expanded in C around inf 59.6%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + -0.5 \cdot \frac{B}{C}\right)}}{\pi} \]
      4. Taylor expanded in B around inf 23.4%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(-1 \cdot \frac{A + -1 \cdot A}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}}{\pi} \]
      5. Step-by-step derivation
        1. distribute-rgt1-in23.4%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \frac{\color{blue}{0} \cdot A}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        3. mul0-lft23.4%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \frac{\color{blue}{0}}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        4. div059.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \color{blue}{0} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        5. metadata-eval59.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\color{blue}{0} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        6. neg-sub059.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(-0.5 \cdot \frac{1}{C}\right)}\right)}{\pi} \]
        7. associate-*r/59.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-\color{blue}{\frac{0.5 \cdot 1}{C}}\right)\right)}{\pi} \]
        8. metadata-eval59.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-\frac{\color{blue}{0.5}}{C}\right)\right)}{\pi} \]
        9. distribute-neg-frac59.7%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{-0.5}{C}}\right)}{\pi} \]
        10. metadata-eval59.7%

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

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

      if -2.1999999999999999e-240 < B

      1. Initial program 54.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. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*r/54.0%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
        2. associate-*l/54.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
        3. *-un-lft-identity54.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\pi} \]
        4. unpow254.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\color{blue}{\left(A - C\right) \cdot \left(A - C\right)} + {B}^{2}}}{B}\right)}{\pi} \]
        5. unpow254.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}}{B}\right)}{\pi} \]
        6. hypot-define75.1%

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      6. Taylor expanded in C around 0 64.1%

        \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}{\pi}} \]
      7. Step-by-step derivation
        1. associate-*r/64.1%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}{\pi}} \]
        2. associate--r+64.1%

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

          \[\leadsto \frac{\color{blue}{\tan^{-1} \left(\left(\frac{C}{B} - 1\right) - \frac{A}{B}\right) \cdot 180}}{\pi} \]
        4. associate--r+64.1%

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

          \[\leadsto \frac{\tan^{-1} \left(\frac{C}{B} - \color{blue}{\left(\frac{A}{B} + 1\right)}\right) \cdot 180}{\pi} \]
        6. associate--r+64.1%

          \[\leadsto \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)} \cdot 180}{\pi} \]
        7. sub-neg64.1%

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

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

          \[\leadsto \frac{\tan^{-1} \left(\color{blue}{\left(-1 \cdot \frac{A}{B} + \frac{C}{B}\right)} - 1\right) \cdot 180}{\pi} \]
        10. associate-/l*64.1%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -9.2 \cdot 10^{-117}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq -2.2 \cdot 10^{-240}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 + \frac{C - A}{B}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 12: 59.1% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -7.2 \cdot 10^{-41}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{elif}\;A \leq 21000000000000:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 + \frac{C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= A -7.2e-41)
       (* (/ 180.0 PI) (atan (* B (/ 0.5 A))))
       (if (<= A 21000000000000.0)
         (/ (* 180.0 (atan (+ -1.0 (/ C B)))) PI)
         (/ (* 180.0 (atan (- -1.0 (/ A B)))) PI))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (A <= -7.2e-41) {
    		tmp = (180.0 / ((double) M_PI)) * atan((B * (0.5 / A)));
    	} else if (A <= 21000000000000.0) {
    		tmp = (180.0 * atan((-1.0 + (C / B)))) / ((double) M_PI);
    	} else {
    		tmp = (180.0 * atan((-1.0 - (A / B)))) / ((double) M_PI);
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (A <= -7.2e-41) {
    		tmp = (180.0 / Math.PI) * Math.atan((B * (0.5 / A)));
    	} else if (A <= 21000000000000.0) {
    		tmp = (180.0 * Math.atan((-1.0 + (C / B)))) / Math.PI;
    	} else {
    		tmp = (180.0 * Math.atan((-1.0 - (A / B)))) / Math.PI;
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if A <= -7.2e-41:
    		tmp = (180.0 / math.pi) * math.atan((B * (0.5 / A)))
    	elif A <= 21000000000000.0:
    		tmp = (180.0 * math.atan((-1.0 + (C / B)))) / math.pi
    	else:
    		tmp = (180.0 * math.atan((-1.0 - (A / B)))) / math.pi
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (A <= -7.2e-41)
    		tmp = Float64(Float64(180.0 / pi) * atan(Float64(B * Float64(0.5 / A))));
    	elseif (A <= 21000000000000.0)
    		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 + Float64(C / B)))) / pi);
    	else
    		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 - Float64(A / B)))) / pi);
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (A <= -7.2e-41)
    		tmp = (180.0 / pi) * atan((B * (0.5 / A)));
    	elseif (A <= 21000000000000.0)
    		tmp = (180.0 * atan((-1.0 + (C / B)))) / pi;
    	else
    		tmp = (180.0 * atan((-1.0 - (A / B)))) / pi;
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[A, -7.2e-41], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 21000000000000.0], N[(N[(180.0 * N[ArcTan[N[(-1.0 + N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;A \leq -7.2 \cdot 10^{-41}:\\
    \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\
    
    \mathbf{elif}\;A \leq 21000000000000:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 + \frac{C}{B}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if A < -7.2e-41

      1. Initial program 23.8%

        \[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. Add Preprocessing
      3. Taylor expanded in A around -inf 66.5%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{B}{A}\right)}}{\pi} \]
      4. Step-by-step derivation
        1. associate-*r/66.5%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot B}{A}\right)}}{\pi} \]
      6. Step-by-step derivation
        1. clear-num66.2%

          \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}}} \]
        2. inv-pow66.2%

          \[\leadsto 180 \cdot \color{blue}{{\left(\frac{\pi}{\tan^{-1} \left(\frac{0.5 \cdot B}{A}\right)}\right)}^{-1}} \]
        3. associate-/l*66.2%

          \[\leadsto 180 \cdot {\left(\frac{\pi}{\tan^{-1} \color{blue}{\left(0.5 \cdot \frac{B}{A}\right)}}\right)}^{-1} \]
      7. Applied egg-rr66.2%

        \[\leadsto 180 \cdot \color{blue}{{\left(\frac{\pi}{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}\right)}^{-1}} \]
      8. Step-by-step derivation
        1. unpow-166.2%

          \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\pi}{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}}} \]
        2. associate-*r/66.2%

          \[\leadsto 180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot B}{A}\right)}}} \]
        3. *-commutative66.2%

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

        \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}}} \]
      10. Taylor expanded in B around 0 66.5%

        \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}} \]
      11. Step-by-step derivation
        1. associate-*r/66.4%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}} \]
        2. *-commutative66.4%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{B}{A} \cdot 0.5\right)}}{\pi} \]
        3. associate-*l/66.4%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{B \cdot 0.5}{A}\right)}}{\pi} \]
        4. associate-*r/66.4%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(B \cdot \frac{0.5}{A}\right)}}{\pi} \]
        5. associate-*l/66.6%

          \[\leadsto \color{blue}{\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)} \]
        6. *-commutative66.6%

          \[\leadsto \color{blue}{\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}} \]
      12. Simplified66.6%

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

      if -7.2e-41 < A < 2.1e13

      1. Initial program 53.2%

        \[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. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*r/53.2%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
        2. associate-*l/53.2%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
        3. *-un-lft-identity53.2%

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

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      6. Taylor expanded in A around 0 47.3%

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

      if 2.1e13 < A

      1. Initial program 71.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. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*r/71.0%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
        2. associate-*l/71.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
        3. *-un-lft-identity71.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\pi} \]
        4. unpow271.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\color{blue}{\left(A - C\right) \cdot \left(A - C\right)} + {B}^{2}}}{B}\right)}{\pi} \]
        5. unpow271.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}}{B}\right)}{\pi} \]
        6. hypot-define88.6%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \color{blue}{\mathsf{hypot}\left(A - C, B\right)}}{B}\right)}{\pi} \]
      4. Applied egg-rr88.6%

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      6. Taylor expanded in C around 0 73.0%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-1 \cdot \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      7. Step-by-step derivation
        1. neg-mul-173.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-\left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
        2. distribute-neg-in73.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\left(-1\right) + \left(-\frac{A}{B}\right)\right)}}{\pi} \]
        3. metadata-eval73.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\color{blue}{-1} + \left(-\frac{A}{B}\right)\right)}{\pi} \]
        4. unsub-neg73.0%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -7.2 \cdot 10^{-41}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{elif}\;A \leq 21000000000000:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 + \frac{C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 13: 52.8% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3.8 \cdot 10^{+31}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -8.8 \cdot 10^{-243}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= B -3.8e+31)
       (* 180.0 (/ (atan 1.0) PI))
       (if (<= B -8.8e-243)
         (* 180.0 (/ (atan (* B (/ -0.5 C))) PI))
         (/ (* 180.0 (atan (- -1.0 (/ A B)))) PI))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -3.8e+31) {
    		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
    	} else if (B <= -8.8e-243) {
    		tmp = 180.0 * (atan((B * (-0.5 / C))) / ((double) M_PI));
    	} else {
    		tmp = (180.0 * atan((-1.0 - (A / B)))) / ((double) M_PI);
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -3.8e+31) {
    		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
    	} else if (B <= -8.8e-243) {
    		tmp = 180.0 * (Math.atan((B * (-0.5 / C))) / Math.PI);
    	} else {
    		tmp = (180.0 * Math.atan((-1.0 - (A / B)))) / Math.PI;
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if B <= -3.8e+31:
    		tmp = 180.0 * (math.atan(1.0) / math.pi)
    	elif B <= -8.8e-243:
    		tmp = 180.0 * (math.atan((B * (-0.5 / C))) / math.pi)
    	else:
    		tmp = (180.0 * math.atan((-1.0 - (A / B)))) / math.pi
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (B <= -3.8e+31)
    		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
    	elseif (B <= -8.8e-243)
    		tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(-0.5 / C))) / pi));
    	else
    		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 - Float64(A / B)))) / pi);
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (B <= -3.8e+31)
    		tmp = 180.0 * (atan(1.0) / pi);
    	elseif (B <= -8.8e-243)
    		tmp = 180.0 * (atan((B * (-0.5 / C))) / pi);
    	else
    		tmp = (180.0 * atan((-1.0 - (A / B)))) / pi;
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[B, -3.8e+31], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -8.8e-243], N[(180.0 * N[(N[ArcTan[N[(B * N[(-0.5 / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -3.8 \cdot 10^{+31}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
    
    \mathbf{elif}\;B \leq -8.8 \cdot 10^{-243}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if B < -3.8000000000000001e31

      1. Initial program 45.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. Add Preprocessing
      3. Taylor expanded in B around -inf 70.3%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\pi} \]

      if -3.8000000000000001e31 < B < -8.7999999999999996e-243

      1. Initial program 39.8%

        \[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. Add Preprocessing
      3. Taylor expanded in C around inf 45.0%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B} + -0.5 \cdot \frac{B}{C}\right)}}{\pi} \]
      4. Taylor expanded in B around inf 29.4%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(-1 \cdot \frac{A + -1 \cdot A}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}}{\pi} \]
      5. Step-by-step derivation
        1. distribute-rgt1-in29.4%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \frac{\color{blue}{0} \cdot A}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        3. mul0-lft29.4%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \frac{\color{blue}{0}}{{B}^{2}} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        4. div045.1%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-1 \cdot \color{blue}{0} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        5. metadata-eval45.1%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\color{blue}{0} - 0.5 \cdot \frac{1}{C}\right)\right)}{\pi} \]
        6. neg-sub045.1%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(-0.5 \cdot \frac{1}{C}\right)}\right)}{\pi} \]
        7. associate-*r/45.1%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(-\frac{\color{blue}{0.5}}{C}\right)\right)}{\pi} \]
        9. distribute-neg-frac45.1%

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

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

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

      if -8.7999999999999996e-243 < B

      1. Initial program 54.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. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*r/54.0%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
        2. associate-*l/54.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
        3. *-un-lft-identity54.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{B}\right)}{\pi} \]
        4. unpow254.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\color{blue}{\left(A - C\right) \cdot \left(A - C\right)} + {B}^{2}}}{B}\right)}{\pi} \]
        5. unpow254.0%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}}{B}\right)}{\pi} \]
        6. hypot-define75.1%

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      6. Taylor expanded in C around 0 55.1%

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-1 \cdot \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      7. Step-by-step derivation
        1. neg-mul-155.1%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-\left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
        2. distribute-neg-in55.1%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\left(-1\right) + \left(-\frac{A}{B}\right)\right)}}{\pi} \]
        3. metadata-eval55.1%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\color{blue}{-1} + \left(-\frac{A}{B}\right)\right)}{\pi} \]
        4. unsub-neg55.1%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(-1 - \frac{A}{B}\right)}}{\pi} \]
      8. Simplified55.1%

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

    Alternative 14: 48.4% accurate, 3.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3400000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 60000000:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= B -3400000.0)
       (* 180.0 (/ (atan 1.0) PI))
       (if (<= B 60000000.0)
         (/ (* 180.0 (atan (/ C B))) PI)
         (* 180.0 (/ (atan -1.0) PI)))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -3400000.0) {
    		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
    	} else if (B <= 60000000.0) {
    		tmp = (180.0 * atan((C / B))) / ((double) M_PI);
    	} else {
    		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -3400000.0) {
    		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
    	} else if (B <= 60000000.0) {
    		tmp = (180.0 * Math.atan((C / B))) / Math.PI;
    	} else {
    		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if B <= -3400000.0:
    		tmp = 180.0 * (math.atan(1.0) / math.pi)
    	elif B <= 60000000.0:
    		tmp = (180.0 * math.atan((C / B))) / math.pi
    	else:
    		tmp = 180.0 * (math.atan(-1.0) / math.pi)
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (B <= -3400000.0)
    		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
    	elseif (B <= 60000000.0)
    		tmp = Float64(Float64(180.0 * atan(Float64(C / B))) / pi);
    	else
    		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (B <= -3400000.0)
    		tmp = 180.0 * (atan(1.0) / pi);
    	elseif (B <= 60000000.0)
    		tmp = (180.0 * atan((C / B))) / pi;
    	else
    		tmp = 180.0 * (atan(-1.0) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[B, -3400000.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 60000000.0], N[(N[(180.0 * N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -3400000:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
    
    \mathbf{elif}\;B \leq 60000000:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if B < -3.4e6

      1. Initial program 43.5%

        \[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. Add Preprocessing
      3. Taylor expanded in B around -inf 66.5%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\pi} \]

      if -3.4e6 < B < 6e7

      1. Initial program 51.6%

        \[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. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*r/51.6%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
        2. associate-*l/51.6%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
        3. *-un-lft-identity51.6%

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

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

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}}{B}\right)}{\pi} \]
        6. hypot-define67.9%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \color{blue}{\mathsf{hypot}\left(A - C, B\right)}}{B}\right)}{\pi} \]
      4. Applied egg-rr67.9%

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\pi} \]
      6. Taylor expanded in C around inf 34.0%

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

      if 6e7 < B

      1. Initial program 50.5%

        \[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. Add Preprocessing
      3. Taylor expanded in B around inf 63.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 15: 45.8% accurate, 3.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -6.5 \cdot 10^{-117}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 1.18 \cdot 10^{-64}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= B -6.5e-117)
       (* 180.0 (/ (atan 1.0) PI))
       (if (<= B 1.18e-64)
         (/ (* 180.0 (atan 0.0)) PI)
         (* 180.0 (/ (atan -1.0) PI)))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -6.5e-117) {
    		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
    	} else if (B <= 1.18e-64) {
    		tmp = (180.0 * atan(0.0)) / ((double) M_PI);
    	} else {
    		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -6.5e-117) {
    		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
    	} else if (B <= 1.18e-64) {
    		tmp = (180.0 * Math.atan(0.0)) / Math.PI;
    	} else {
    		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if B <= -6.5e-117:
    		tmp = 180.0 * (math.atan(1.0) / math.pi)
    	elif B <= 1.18e-64:
    		tmp = (180.0 * math.atan(0.0)) / math.pi
    	else:
    		tmp = 180.0 * (math.atan(-1.0) / math.pi)
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (B <= -6.5e-117)
    		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
    	elseif (B <= 1.18e-64)
    		tmp = Float64(Float64(180.0 * atan(0.0)) / pi);
    	else
    		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (B <= -6.5e-117)
    		tmp = 180.0 * (atan(1.0) / pi);
    	elseif (B <= 1.18e-64)
    		tmp = (180.0 * atan(0.0)) / pi;
    	else
    		tmp = 180.0 * (atan(-1.0) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[B, -6.5e-117], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.18e-64], N[(N[(180.0 * N[ArcTan[0.0], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -6.5 \cdot 10^{-117}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
    
    \mathbf{elif}\;B \leq 1.18 \cdot 10^{-64}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if B < -6.5000000000000001e-117

      1. Initial program 46.2%

        \[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. Add Preprocessing
      3. Taylor expanded in B around -inf 54.4%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\pi} \]

      if -6.5000000000000001e-117 < B < 1.17999999999999996e-64

      1. Initial program 48.6%

        \[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. Add Preprocessing
      3. Step-by-step derivation
        1. associate-*r/48.6%

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}} \]
        2. associate-*l/48.6%

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{\left(\frac{1 \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right)}}{\pi} \]
        3. *-un-lft-identity48.6%

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

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{-1 \cdot \left(A + -1 \cdot A\right)}}{B}\right)}{\pi} \]
      6. Step-by-step derivation
        1. distribute-rgt1-in27.9%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot A\right)}}{B}\right)}{\pi} \]
        2. metadata-eval27.9%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1 \cdot \left(\color{blue}{0} \cdot A\right)}{B}\right)}{\pi} \]
        3. mul0-lft27.9%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1 \cdot \color{blue}{0}}{B}\right)}{\pi} \]
        4. metadata-eval27.9%

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{0}}{B}\right)}{\pi} \]
      7. Simplified27.9%

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{0}}{B}\right)}{\pi} \]
      8. Taylor expanded in B around 0 27.9%

        \[\leadsto \frac{\color{blue}{180 \cdot \tan^{-1} 0}}{\pi} \]
      9. Step-by-step derivation
        1. *-commutative27.9%

          \[\leadsto \frac{\color{blue}{\tan^{-1} 0 \cdot 180}}{\pi} \]
      10. Simplified27.9%

        \[\leadsto \frac{\color{blue}{\tan^{-1} 0 \cdot 180}}{\pi} \]

      if 1.17999999999999996e-64 < B

      1. Initial program 53.2%

        \[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. Add Preprocessing
      3. Taylor expanded in B around inf 56.0%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification46.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -6.5 \cdot 10^{-117}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 1.18 \cdot 10^{-64}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 16: 41.1% accurate, 3.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (if (<= B -5e-310) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -5e-310) {
    		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
    	} else {
    		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -5e-310) {
    		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
    	} else {
    		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
    	}
    	return tmp;
    }
    
    def code(A, B, C):
    	tmp = 0
    	if B <= -5e-310:
    		tmp = 180.0 * (math.atan(1.0) / math.pi)
    	else:
    		tmp = 180.0 * (math.atan(-1.0) / math.pi)
    	return tmp
    
    function code(A, B, C)
    	tmp = 0.0
    	if (B <= -5e-310)
    		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
    	else
    		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(A, B, C)
    	tmp = 0.0;
    	if (B <= -5e-310)
    		tmp = 180.0 * (atan(1.0) / pi);
    	else
    		tmp = 180.0 * (atan(-1.0) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[B, -5e-310], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if B < -4.999999999999985e-310

      1. Initial program 45.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. Add Preprocessing
      3. Taylor expanded in B around -inf 43.8%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\pi} \]

      if -4.999999999999985e-310 < B

      1. Initial program 53.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. Add Preprocessing
      3. Taylor expanded in B around inf 37.5%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 17: 21.6% accurate, 4.0× speedup?

    \[\begin{array}{l} \\ 180 \cdot \frac{\tan^{-1} -1}{\pi} \end{array} \]
    (FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
    double code(double A, double B, double C) {
    	return 180.0 * (atan(-1.0) / ((double) M_PI));
    }
    
    public static double code(double A, double B, double C) {
    	return 180.0 * (Math.atan(-1.0) / Math.PI);
    }
    
    def code(A, B, C):
    	return 180.0 * (math.atan(-1.0) / math.pi)
    
    function code(A, B, C)
    	return Float64(180.0 * Float64(atan(-1.0) / pi))
    end
    
    function tmp = code(A, B, C)
    	tmp = 180.0 * (atan(-1.0) / pi);
    end
    
    code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    180 \cdot \frac{\tan^{-1} -1}{\pi}
    \end{array}
    
    Derivation
    1. Initial program 49.1%

      \[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. Add Preprocessing
    3. Taylor expanded in B around inf 20.2%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
    4. Add Preprocessing

    Reproduce

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