ABCF->ab-angle angle

Percentage Accurate: 53.3% → 87.9%
Time: 20.9s
Alternatives: 29
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 29 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.3% 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: 87.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{B} \cdot \left(\left(A - C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-9} \lor \neg \left(t\_0 \leq 4 \cdot 10^{-5}\right):\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(B \cdot \left(0.125 \cdot \frac{{B}^{2}}{{\left(C - A\right)}^{3}} + \frac{0.5}{A - C}\right)\right) \cdot \frac{180}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0
         (* (/ -1.0 B) (+ (- A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
   (if (or (<= t_0 -5e-9) (not (<= t_0 4e-5)))
     (/ (* 180.0 (atan (/ (- (- C A) (hypot (- A C) B)) B))) PI)
     (*
      (atan
       (* B (+ (* 0.125 (/ (pow B 2.0) (pow (- C A) 3.0))) (/ 0.5 (- A C)))))
      (/ 180.0 PI)))))
double code(double A, double B, double C) {
	double t_0 = (-1.0 / B) * ((A - C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
	double tmp;
	if ((t_0 <= -5e-9) || !(t_0 <= 4e-5)) {
		tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / ((double) M_PI);
	} else {
		tmp = atan((B * ((0.125 * (pow(B, 2.0) / pow((C - A), 3.0))) + (0.5 / (A - C))))) * (180.0 / ((double) M_PI));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = (-1.0 / B) * ((A - C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
	double tmp;
	if ((t_0 <= -5e-9) || !(t_0 <= 4e-5)) {
		tmp = (180.0 * Math.atan((((C - A) - Math.hypot((A - C), B)) / B))) / Math.PI;
	} else {
		tmp = Math.atan((B * ((0.125 * (Math.pow(B, 2.0) / Math.pow((C - A), 3.0))) + (0.5 / (A - C))))) * (180.0 / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = (-1.0 / B) * ((A - C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0))))
	tmp = 0
	if (t_0 <= -5e-9) or not (t_0 <= 4e-5):
		tmp = (180.0 * math.atan((((C - A) - math.hypot((A - C), B)) / B))) / math.pi
	else:
		tmp = math.atan((B * ((0.125 * (math.pow(B, 2.0) / math.pow((C - A), 3.0))) + (0.5 / (A - C))))) * (180.0 / math.pi)
	return tmp
function code(A, B, C)
	t_0 = Float64(Float64(-1.0 / B) * Float64(Float64(A - C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
	tmp = 0.0
	if ((t_0 <= -5e-9) || !(t_0 <= 4e-5))
		tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - hypot(Float64(A - C), B)) / B))) / pi);
	else
		tmp = Float64(atan(Float64(B * Float64(Float64(0.125 * Float64((B ^ 2.0) / (Float64(C - A) ^ 3.0))) + Float64(0.5 / Float64(A - C))))) * Float64(180.0 / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = (-1.0 / B) * ((A - C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0))));
	tmp = 0.0;
	if ((t_0 <= -5e-9) || ~((t_0 <= 4e-5)))
		tmp = (180.0 * atan((((C - A) - hypot((A - C), B)) / B))) / pi;
	else
		tmp = atan((B * ((0.125 * ((B ^ 2.0) / ((C - A) ^ 3.0))) + (0.5 / (A - C))))) * (180.0 / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] * N[(N[(A - C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e-9], N[Not[LessEqual[t$95$0, 4e-5]], $MachinePrecision]], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(N[ArcTan[N[(B * N[(N[(0.125 * N[(N[Power[B, 2.0], $MachinePrecision] / N[Power[N[(C - A), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-1}{B} \cdot \left(\left(A - C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-9} \lor \neg \left(t\_0 \leq 4 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(B \cdot \left(0.125 \cdot \frac{{B}^{2}}{{\left(C - A\right)}^{3}} + \frac{0.5}{A - C}\right)\right) \cdot \frac{180}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -5.0000000000000001e-9 or 4.00000000000000033e-5 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

    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. Step-by-step derivation
      1. associate-*r/63.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/63.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-identity63.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. unpow263.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. unpow263.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-define86.8%

        \[\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-rr86.8%

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

    if -5.0000000000000001e-9 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 4.00000000000000033e-5

    1. Initial program 17.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. Simplified7.3%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 98.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{-1}{B} \cdot \left(\left(A - C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq -5 \cdot 10^{-9} \lor \neg \left(\frac{-1}{B} \cdot \left(\left(A - C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq 4 \cdot 10^{-5}\right):\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(B \cdot \left(0.125 \cdot \frac{{B}^{2}}{{\left(C - A\right)}^{3}} + \frac{0.5}{A - C}\right)\right) \cdot \frac{180}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 78.7% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -3.89999999999999985e-8

    1. Initial program 23.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. Simplified27.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 80.8%

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

    if -3.89999999999999985e-8 < A < 5.9999999999999996e-136

    1. Initial program 64.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/64.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/64.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-identity64.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. unpow264.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. unpow264.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-define83.3%

        \[\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-rr83.3%

      \[\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. Step-by-step derivation
      1. clear-num83.3%

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

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

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

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

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

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

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

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

    if 5.9999999999999996e-136 < A

    1. Initial program 73.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. Simplified93.2%

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

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

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

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

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

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

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

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

Alternative 3: 78.7% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -3.80000000000000011e-9

    1. Initial program 23.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. Simplified27.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 80.8%

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

    if -3.80000000000000011e-9 < A < 1.30000000000000002e-135

    1. Initial program 64.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 0 63.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. unpow263.3%

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

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

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

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

    if 1.30000000000000002e-135 < A

    1. Initial program 73.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. Simplified93.2%

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

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

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

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

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

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

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

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

Alternative 4: 79.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq -5.2 \cdot 10^{+16}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -5.2e16

    1. Initial program 79.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 A around 0 79.4%

      \[\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. unpow279.4%

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

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

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

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

    if -5.2e16 < C < 8.79999999999999986e-13

    1. Initial program 64.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/64.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/64.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-identity64.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. unpow264.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. unpow264.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-define83.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-rr83.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 C around 0 61.9%

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

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

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

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

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

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

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

    if 8.79999999999999986e-13 < C

    1. Initial program 24.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. Simplified47.3%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 75.7%

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

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

Alternative 5: 80.9% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -5.00000000000000031e-10

    1. Initial program 23.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. Simplified27.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 80.8%

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

    if -5.00000000000000031e-10 < A

    1. Initial program 68.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. Simplified87.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num87.6%

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

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

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

Alternative 6: 75.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -2.9 \cdot 10^{-7}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\ \mathbf{elif}\;A \leq 9 \cdot 10^{+132}:\\ \;\;\;\;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(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -2.9e-7)
   (* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A)))))
   (if (<= A 9e+132)
     (* 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 <= -2.9e-7) {
		tmp = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
	} else if (A <= 9e+132) {
		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 <= -2.9e-7) {
		tmp = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
	} else if (A <= 9e+132) {
		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 <= -2.9e-7:
		tmp = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A))))
	elif A <= 9e+132:
		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 <= -2.9e-7)
		tmp = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A)))));
	elseif (A <= 9e+132)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(-1.0 - Float64(A / B))) / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	tmp = 0.0;
	if (A <= -2.9e-7)
		tmp = (180.0 / pi) * atan((-0.5 * (B / (C - A))));
	elseif (A <= 9e+132)
		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, -2.9e-7], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 9e+132], 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[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;A \leq 9 \cdot 10^{+132}:\\
\;\;\;\;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(-1 - \frac{A}{B}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -2.8999999999999998e-7

    1. Initial program 23.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. Simplified27.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 80.8%

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

    if -2.8999999999999998e-7 < A < 8.99999999999999944e132

    1. Initial program 65.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 A around 0 60.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. unpow260.3%

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

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

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

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

    if 8.99999999999999944e132 < A

    1. Initial program 82.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 85.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -2.9 \cdot 10^{-7}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\ \mathbf{elif}\;A \leq 9 \cdot 10^{+132}:\\ \;\;\;\;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(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 81.0% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -2.8999999999999998e-7

    1. Initial program 23.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. Simplified27.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 80.8%

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

    if -2.8999999999999998e-7 < A

    1. Initial program 68.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. Simplified87.6%

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

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

Alternative 8: 46.3% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\ \mathbf{if}\;B \leq -2.2 \cdot 10^{-118}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -3.1 \cdot 10^{-204}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq 6.2 \cdot 10^{-190}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 1.1 \cdot 10^{-158}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq 1.45 \cdot 10^{-127}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{-121} \lor \neg \left(B \leq 3.2 \cdot 10^{-28}\right):\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan (/ A (- B))) PI))))
   (if (<= B -2.2e-118)
     (* 180.0 (/ (atan 1.0) PI))
     (if (<= B -3.1e-204)
       t_0
       (if (<= B 6.2e-190)
         (* 180.0 (/ (atan (/ 0.0 B)) PI))
         (if (<= B 1.1e-158)
           t_0
           (if (<= B 1.45e-127)
             (/ (* 180.0 (atan (/ B A))) PI)
             (if (or (<= B 2.4e-121) (not (<= B 3.2e-28)))
               (* 180.0 (/ (atan -1.0) PI))
               (* 180.0 (/ (atan (/ C B)) PI))))))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan((A / -B)) / ((double) M_PI));
	double tmp;
	if (B <= -2.2e-118) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (B <= -3.1e-204) {
		tmp = t_0;
	} else if (B <= 6.2e-190) {
		tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
	} else if (B <= 1.1e-158) {
		tmp = t_0;
	} else if (B <= 1.45e-127) {
		tmp = (180.0 * atan((B / A))) / ((double) M_PI);
	} else if ((B <= 2.4e-121) || !(B <= 3.2e-28)) {
		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = 180.0 * (Math.atan((A / -B)) / Math.PI);
	double tmp;
	if (B <= -2.2e-118) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (B <= -3.1e-204) {
		tmp = t_0;
	} else if (B <= 6.2e-190) {
		tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
	} else if (B <= 1.1e-158) {
		tmp = t_0;
	} else if (B <= 1.45e-127) {
		tmp = (180.0 * Math.atan((B / A))) / Math.PI;
	} else if ((B <= 2.4e-121) || !(B <= 3.2e-28)) {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 * (math.atan((A / -B)) / math.pi)
	tmp = 0
	if B <= -2.2e-118:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif B <= -3.1e-204:
		tmp = t_0
	elif B <= 6.2e-190:
		tmp = 180.0 * (math.atan((0.0 / B)) / math.pi)
	elif B <= 1.1e-158:
		tmp = t_0
	elif B <= 1.45e-127:
		tmp = (180.0 * math.atan((B / A))) / math.pi
	elif (B <= 2.4e-121) or not (B <= 3.2e-28):
		tmp = 180.0 * (math.atan(-1.0) / math.pi)
	else:
		tmp = 180.0 * (math.atan((C / B)) / math.pi)
	return tmp
function code(A, B, C)
	t_0 = Float64(180.0 * Float64(atan(Float64(A / Float64(-B))) / pi))
	tmp = 0.0
	if (B <= -2.2e-118)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (B <= -3.1e-204)
		tmp = t_0;
	elseif (B <= 6.2e-190)
		tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi));
	elseif (B <= 1.1e-158)
		tmp = t_0;
	elseif (B <= 1.45e-127)
		tmp = Float64(Float64(180.0 * atan(Float64(B / A))) / pi);
	elseif ((B <= 2.4e-121) || !(B <= 3.2e-28))
		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = 180.0 * (atan((A / -B)) / pi);
	tmp = 0.0;
	if (B <= -2.2e-118)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (B <= -3.1e-204)
		tmp = t_0;
	elseif (B <= 6.2e-190)
		tmp = 180.0 * (atan((0.0 / B)) / pi);
	elseif (B <= 1.1e-158)
		tmp = t_0;
	elseif (B <= 1.45e-127)
		tmp = (180.0 * atan((B / A))) / pi;
	elseif ((B <= 2.4e-121) || ~((B <= 3.2e-28)))
		tmp = 180.0 * (atan(-1.0) / pi);
	else
		tmp = 180.0 * (atan((C / B)) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(A / (-B)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -2.2e-118], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -3.1e-204], t$95$0, If[LessEqual[B, 6.2e-190], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.1e-158], t$95$0, If[LessEqual[B, 1.45e-127], N[(N[(180.0 * N[ArcTan[N[(B / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[Or[LessEqual[B, 2.4e-121], N[Not[LessEqual[B, 3.2e-28]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\
\mathbf{if}\;B \leq -2.2 \cdot 10^{-118}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{elif}\;B \leq -3.1 \cdot 10^{-204}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;B \leq 6.2 \cdot 10^{-190}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\

\mathbf{elif}\;B \leq 1.1 \cdot 10^{-158}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;B \leq 1.45 \cdot 10^{-127}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A}\right)}{\pi}\\

\mathbf{elif}\;B \leq 2.4 \cdot 10^{-121} \lor \neg \left(B \leq 3.2 \cdot 10^{-28}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if B < -2.19999999999999984e-118

    1. Initial program 56.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 50.4%

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

    if -2.19999999999999984e-118 < B < -3.0999999999999999e-204 or 6.19999999999999987e-190 < B < 1.1000000000000001e-158

    1. Initial program 75.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 67.6%

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

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

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

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

    if -3.0999999999999999e-204 < B < 6.19999999999999987e-190

    1. Initial program 48.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. Taylor expanded in C around inf 46.2%

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

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

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

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

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

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

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

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

    if 1.1000000000000001e-158 < B < 1.45e-127

    1. Initial program 44.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/44.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/44.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-identity44.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. unpow244.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. unpow244.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-define86.4%

        \[\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-rr86.4%

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

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

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

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

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

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

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

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

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

    if 1.45e-127 < B < 2.40000000000000003e-121 or 3.19999999999999982e-28 < B

    1. Initial program 56.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 B around inf 61.7%

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

    if 2.40000000000000003e-121 < B < 3.19999999999999982e-28

    1. Initial program 61.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 54.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -2.2 \cdot 10^{-118}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -3.1 \cdot 10^{-204}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 6.2 \cdot 10^{-190}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 1.1 \cdot 10^{-158}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 1.45 \cdot 10^{-127}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{-121} \lor \neg \left(B \leq 3.2 \cdot 10^{-28}\right):\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 61.0% accurate, 3.2× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{if}\;A \leq -1.65 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;A \leq -1.3 \cdot 10^{-234}:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -1.6500000000000001e-7 or -1.1199999999999999e-183 < A < -1.29999999999999995e-234

    1. Initial program 27.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. Simplified34.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 77.0%

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

    if -1.6500000000000001e-7 < A < -1.1199999999999999e-183

    1. Initial program 70.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 A around 0 68.6%

      \[\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. unpow268.6%

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

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

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

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

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

    if -1.29999999999999995e-234 < A < -1.1e-286

    1. Initial program 60.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. Step-by-step derivation
      1. associate-*r/60.8%

        \[\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/60.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-identity60.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. unpow260.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. unpow260.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-define89.8%

        \[\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-rr89.8%

      \[\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. Step-by-step derivation
      1. clear-num89.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{1}{\color{blue}{-1 \cdot \frac{C}{B} - 1}}\right)}{\pi} \]
    11. Step-by-step derivation
      1. sub-neg79.5%

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

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

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

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

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

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

    if -1.1e-286 < A

    1. Initial program 71.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. Step-by-step derivation
      1. associate-*r/71.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/71.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-identity71.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. unpow271.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. unpow271.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-define90.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-rr90.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 68.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -1.65 \cdot 10^{-7}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\ \mathbf{elif}\;A \leq -1.12 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -1.3 \cdot 10^{-234}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\ \mathbf{elif}\;A \leq -1.1 \cdot 10^{-286}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{-1 - \frac{C}{B}}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 61.4% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\ \mathbf{if}\;A \leq -4.3 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;A \leq -1.15 \cdot 10^{-183}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;A \leq -7.5 \cdot 10^{-226}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;A \leq -5.2 \cdot 10^{-289}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan (/ (- C B) B)) PI)))
        (t_1 (* (/ 180.0 PI) (atan (* -0.5 (/ B (- C A)))))))
   (if (<= A -4.3e-10)
     t_1
     (if (<= A -1.15e-183)
       t_0
       (if (<= A -7.5e-226)
         t_1
         (if (<= A -5.2e-289)
           t_0
           (/ (* 180.0 (atan (+ 1.0 (/ (- C A) B)))) PI)))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
	double t_1 = (180.0 / ((double) M_PI)) * atan((-0.5 * (B / (C - A))));
	double tmp;
	if (A <= -4.3e-10) {
		tmp = t_1;
	} else if (A <= -1.15e-183) {
		tmp = t_0;
	} else if (A <= -7.5e-226) {
		tmp = t_1;
	} else if (A <= -5.2e-289) {
		tmp = t_0;
	} else {
		tmp = (180.0 * atan((1.0 + ((C - A) / B)))) / ((double) M_PI);
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
	double t_1 = (180.0 / Math.PI) * Math.atan((-0.5 * (B / (C - A))));
	double tmp;
	if (A <= -4.3e-10) {
		tmp = t_1;
	} else if (A <= -1.15e-183) {
		tmp = t_0;
	} else if (A <= -7.5e-226) {
		tmp = t_1;
	} else if (A <= -5.2e-289) {
		tmp = t_0;
	} else {
		tmp = (180.0 * Math.atan((1.0 + ((C - A) / B)))) / Math.PI;
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 * (math.atan(((C - B) / B)) / math.pi)
	t_1 = (180.0 / math.pi) * math.atan((-0.5 * (B / (C - A))))
	tmp = 0
	if A <= -4.3e-10:
		tmp = t_1
	elif A <= -1.15e-183:
		tmp = t_0
	elif A <= -7.5e-226:
		tmp = t_1
	elif A <= -5.2e-289:
		tmp = t_0
	else:
		tmp = (180.0 * math.atan((1.0 + ((C - A) / B)))) / math.pi
	return tmp
function code(A, B, C)
	t_0 = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi))
	t_1 = Float64(Float64(180.0 / pi) * atan(Float64(-0.5 * Float64(B / Float64(C - A)))))
	tmp = 0.0
	if (A <= -4.3e-10)
		tmp = t_1;
	elseif (A <= -1.15e-183)
		tmp = t_0;
	elseif (A <= -7.5e-226)
		tmp = t_1;
	elseif (A <= -5.2e-289)
		tmp = t_0;
	else
		tmp = Float64(Float64(180.0 * atan(Float64(1.0 + Float64(Float64(C - A) / B)))) / pi);
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = 180.0 * (atan(((C - B) / B)) / pi);
	t_1 = (180.0 / pi) * atan((-0.5 * (B / (C - A))));
	tmp = 0.0;
	if (A <= -4.3e-10)
		tmp = t_1;
	elseif (A <= -1.15e-183)
		tmp = t_0;
	elseif (A <= -7.5e-226)
		tmp = t_1;
	elseif (A <= -5.2e-289)
		tmp = t_0;
	else
		tmp = (180.0 * atan((1.0 + ((C - A) / B)))) / pi;
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -4.3e-10], t$95$1, If[LessEqual[A, -1.15e-183], t$95$0, If[LessEqual[A, -7.5e-226], t$95$1, If[LessEqual[A, -5.2e-289], t$95$0, N[(N[(180.0 * N[ArcTan[N[(1.0 + N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{if}\;A \leq -4.3 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;A \leq -1.15 \cdot 10^{-183}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;A \leq -7.5 \cdot 10^{-226}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;A \leq -5.2 \cdot 10^{-289}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -4.30000000000000014e-10 or -1.15000000000000008e-183 < A < -7.50000000000000044e-226

    1. Initial program 26.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. Simplified33.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 78.5%

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

    if -4.30000000000000014e-10 < A < -1.15000000000000008e-183 or -7.50000000000000044e-226 < A < -5.1999999999999998e-289

    1. Initial program 67.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 A around 0 66.0%

      \[\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. unpow266.0%

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

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

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

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

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

    if -5.1999999999999998e-289 < A

    1. Initial program 71.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. Step-by-step derivation
      1. associate-*r/71.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/71.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-identity71.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. unpow271.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. unpow271.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-define90.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-rr90.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 68.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -4.3 \cdot 10^{-10}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\ \mathbf{elif}\;A \leq -1.15 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -7.5 \cdot 10^{-226}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\ \mathbf{elif}\;A \leq -5.2 \cdot 10^{-289}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 61.4% accurate, 3.2× speedup?

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

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)\\
\mathbf{if}\;A \leq -2.15 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;A \leq -3.15 \cdot 10^{-183}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;A \leq -1.18 \cdot 10^{-225}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;A \leq -2.2 \cdot 10^{-288}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -2.15000000000000007e-10 or -3.1499999999999999e-183 < A < -1.18e-225

    1. Initial program 26.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. Simplified33.6%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 78.5%

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

    if -2.15000000000000007e-10 < A < -3.1499999999999999e-183 or -1.18e-225 < A < -2.2000000000000002e-288

    1. Initial program 67.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 A around 0 66.0%

      \[\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. unpow266.0%

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

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

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

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

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

    if -2.2000000000000002e-288 < A

    1. Initial program 71.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 68.7%

      \[\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+68.7%

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

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

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

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

Alternative 12: 53.8% accurate, 3.2× speedup?

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

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

\mathbf{elif}\;A \leq -1.3 \cdot 10^{-181}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;A \leq 4.4 \cdot 10^{+135}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -6.79999999999999997e-63

    1. Initial program 27.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 65.0%

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

    if -6.79999999999999997e-63 < A < -1.29999999999999999e-181 or -3.09999999999999988e-273 < A < 4.3999999999999999e135

    1. Initial program 70.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 63.1%

      \[\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+63.1%

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

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

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

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

    if -1.29999999999999999e-181 < A < -3.09999999999999988e-273

    1. Initial program 44.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 C around inf 46.4%

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

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

    if 4.3999999999999999e135 < A

    1. Initial program 82.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 80.8%

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

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

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

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

Alternative 13: 53.8% accurate, 3.2× speedup?

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

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

\mathbf{elif}\;A \leq -1.1 \cdot 10^{-183}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;A \leq 9 \cdot 10^{+132}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -7.99999999999999972e-64

    1. Initial program 27.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 65.0%

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

    if -7.99999999999999972e-64 < A < -1.1e-183 or -1.29999999999999996e-272 < A < 8.99999999999999944e132

    1. Initial program 70.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 63.1%

      \[\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+63.1%

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

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

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

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

    if -1.1e-183 < A < -1.29999999999999996e-272

    1. Initial program 44.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 C around inf 46.4%

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

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

    if 8.99999999999999944e132 < A

    1. Initial program 82.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 85.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -8 \cdot 10^{-64}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -1.1 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -1.3 \cdot 10^{-272}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;A \leq 9 \cdot 10^{+132}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{-B}\right)}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 62.1% accurate, 3.3× speedup?

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

\\
\begin{array}{l}
t_0 := -1 - \frac{A}{B}\\
\mathbf{if}\;C \leq -6.3 \cdot 10^{-165}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + B \cdot t\_0}{B}\right)\\

\mathbf{elif}\;C \leq -2.5 \cdot 10^{-240}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{t\_0}\right)}{\pi}\\

\mathbf{elif}\;C \leq 2.75 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} t\_0}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if C < -6.3000000000000001e-165

    1. Initial program 72.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. Simplified86.5%

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

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

    if -6.3000000000000001e-165 < C < -2.5000000000000002e-240

    1. Initial program 63.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. Step-by-step derivation
      1. associate-*r/63.1%

        \[\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/63.1%

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

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

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

        \[\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-define83.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-rr83.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. Step-by-step derivation
      1. clear-num83.1%

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

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

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

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

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

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

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

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

    if -2.5000000000000002e-240 < C < 2.7499999999999998e-61

    1. Initial program 66.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 61.2%

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

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

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

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

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

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

    if 2.7499999999999998e-61 < C

    1. Initial program 27.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. Simplified48.4%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 73.6%

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

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

Alternative 15: 62.1% accurate, 3.3× speedup?

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

\\
\begin{array}{l}
t_0 := -1 - \frac{A}{B}\\
\mathbf{if}\;C \leq -6.3 \cdot 10^{-165}:\\
\;\;\;\;180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{C}{B} + t\_0\right)}}\\

\mathbf{elif}\;C \leq -8 \cdot 10^{-240}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{t\_0}\right)}{\pi}\\

\mathbf{elif}\;C \leq 2.85 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} t\_0}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if C < -6.3000000000000001e-165

    1. Initial program 72.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 74.1%

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

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

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

    if -6.3000000000000001e-165 < C < -7.9999999999999998e-240

    1. Initial program 63.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. Step-by-step derivation
      1. associate-*r/63.1%

        \[\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/63.1%

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

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

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

        \[\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-define83.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-rr83.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. Step-by-step derivation
      1. clear-num83.1%

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

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

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

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

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

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

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

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

    if -7.9999999999999998e-240 < C < 2.85000000000000003e-61

    1. Initial program 66.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 61.2%

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

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

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

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

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

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

    if 2.85000000000000003e-61 < C

    1. Initial program 27.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. Simplified48.4%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 73.6%

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

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

Alternative 16: 62.0% accurate, 3.3× speedup?

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

\\
\begin{array}{l}
t_0 := -1 - \frac{A}{B}\\
\mathbf{if}\;C \leq -1.5 \cdot 10^{-165}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + t\_0\right)}{\pi}\\

\mathbf{elif}\;C \leq -1 \cdot 10^{-239}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{t\_0}\right)}{\pi}\\

\mathbf{elif}\;C \leq 2.5 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} t\_0}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if C < -1.49999999999999989e-165

    1. Initial program 72.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 74.1%

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

    if -1.49999999999999989e-165 < C < -1.0000000000000001e-239

    1. Initial program 63.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. Step-by-step derivation
      1. associate-*r/63.1%

        \[\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/63.1%

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

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

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

        \[\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-define83.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-rr83.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. Step-by-step derivation
      1. clear-num83.1%

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

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

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

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

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

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

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

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

    if -1.0000000000000001e-239 < C < 2.4999999999999999e-61

    1. Initial program 66.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 61.2%

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

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

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

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

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

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

    if 2.4999999999999999e-61 < C

    1. Initial program 27.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. Simplified48.4%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right) \cdot \frac{180}{\pi}} \]
    3. Add Preprocessing
    4. Taylor expanded in B around 0 73.6%

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

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

Alternative 17: 55.4% accurate, 3.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -2.2000000000000001e-7

    1. Initial program 23.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/23.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/23.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-identity23.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. unpow223.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. unpow223.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-define46.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-rr46.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 A around -inf 69.7%

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

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

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

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

    if -2.2000000000000001e-7 < A < -3.69999999999999989e-289

    1. Initial program 62.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 A around 0 61.2%

      \[\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. unpow261.2%

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

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

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

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

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

    if -3.69999999999999989e-289 < A < 8.99999999999999944e132

    1. Initial program 67.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/67.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/67.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-identity67.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. unpow267.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. unpow267.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-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. Step-by-step derivation
      1. clear-num88.6%

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

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

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

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

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

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

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

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

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

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

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

    if 8.99999999999999944e132 < A

    1. Initial program 82.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 80.8%

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

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

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

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

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

Alternative 18: 55.3% accurate, 3.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -1.55e-8

    1. Initial program 23.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/23.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/23.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-identity23.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. unpow223.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. unpow223.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-define46.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-rr46.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 A around -inf 69.7%

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

    if -1.55e-8 < A < -5.00000000000000037e-286

    1. Initial program 62.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 A around 0 61.2%

      \[\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. unpow261.2%

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

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

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

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

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

    if -5.00000000000000037e-286 < A < 8.99999999999999944e132

    1. Initial program 67.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/67.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/67.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-identity67.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. unpow267.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. unpow267.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-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. Step-by-step derivation
      1. clear-num88.6%

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

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

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

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

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

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

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

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

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

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

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

    if 8.99999999999999944e132 < A

    1. Initial program 82.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 80.8%

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

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

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

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

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

Alternative 19: 55.3% accurate, 3.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -8.0000000000000002e-8

    1. Initial program 23.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/23.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/23.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-identity23.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. unpow223.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. unpow223.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-define46.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-rr46.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 A around -inf 69.7%

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

    if -8.0000000000000002e-8 < A < -3.7999999999999998e-288

    1. Initial program 62.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 A around 0 61.2%

      \[\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. unpow261.2%

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

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

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

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

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

    if -3.7999999999999998e-288 < A < 8.99999999999999944e132

    1. Initial program 67.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. Taylor expanded in B around -inf 64.6%

      \[\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+64.6%

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

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

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

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

    if 8.99999999999999944e132 < A

    1. Initial program 82.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 80.8%

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

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

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

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

Alternative 20: 55.3% accurate, 3.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -4.3999999999999997e-8

    1. Initial program 23.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 A around -inf 69.6%

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

    if -4.3999999999999997e-8 < A < -5.99999999999999984e-287

    1. Initial program 62.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 A around 0 61.2%

      \[\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. unpow261.2%

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

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

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

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

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

    if -5.99999999999999984e-287 < A < 8.99999999999999944e132

    1. Initial program 67.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. Taylor expanded in B around -inf 64.6%

      \[\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+64.6%

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

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

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

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

    if 8.99999999999999944e132 < A

    1. Initial program 82.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 80.8%

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

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

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

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

Alternative 21: 48.2% accurate, 3.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq -5.8 \cdot 10^{-69}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\

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

\mathbf{elif}\;C \leq 4.2 \cdot 10^{-74}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if C < -5.7999999999999997e-69

    1. Initial program 77.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 C around -inf 66.2%

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

    if -5.7999999999999997e-69 < C < -6.79999999999999979e-240

    1. Initial program 59.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 A around -inf 44.4%

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

    if -6.79999999999999979e-240 < C < 4.2e-74

    1. Initial program 66.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 38.6%

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

    if 4.2e-74 < C

    1. Initial program 29.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 52.3%

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

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

Alternative 22: 48.0% accurate, 3.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq -3.3 \cdot 10^{-69}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\

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

\mathbf{elif}\;C \leq 5.4 \cdot 10^{-73}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if C < -3.3e-69

    1. Initial program 77.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 82.0%

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

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

    if -3.3e-69 < C < -1.26e-241

    1. Initial program 59.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 A around -inf 44.4%

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

    if -1.26e-241 < C < 5.39999999999999989e-73

    1. Initial program 66.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 38.6%

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

    if 5.39999999999999989e-73 < C

    1. Initial program 29.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 52.3%

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

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

Alternative 23: 60.2% accurate, 3.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -5.0000000000000001e-9

    1. Initial program 23.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/23.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/23.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-identity23.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. unpow223.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. unpow223.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-define46.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-rr46.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 A around -inf 69.7%

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

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

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

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

    if -5.0000000000000001e-9 < A < -3.80000000000000009e-289

    1. Initial program 62.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 A around 0 61.2%

      \[\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. unpow261.2%

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

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

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

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

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

    if -3.80000000000000009e-289 < A

    1. Initial program 71.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 68.7%

      \[\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+68.7%

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

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

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

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

Alternative 24: 59.2% accurate, 3.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.7 \cdot 10^{+16}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -4.7e16

    1. Initial program 79.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 A around 0 79.4%

      \[\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. unpow279.4%

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

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

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

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

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

    if -4.7e16 < C < 2.8000000000000001e-61

    1. Initial program 64.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 55.0%

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

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

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

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

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

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

    if 2.8000000000000001e-61 < C

    1. Initial program 27.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/27.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/27.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-identity27.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. unpow227.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. unpow227.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-define51.4%

        \[\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-rr51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 25: 47.1% accurate, 3.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.8 \cdot 10^{+16}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\

\mathbf{elif}\;C \leq 1.25 \cdot 10^{-73}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -4.8e16

    1. Initial program 79.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 B around inf 85.1%

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

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

    if -4.8e16 < C < 1.25e-73

    1. Initial program 64.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 B around inf 34.4%

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

    if 1.25e-73 < C

    1. Initial program 29.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 52.3%

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

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

Alternative 26: 47.2% accurate, 3.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -2.6 \cdot 10^{-93}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 8.2 \cdot 10^{-28}:\\ \;\;\;\;180 \cdot \frac{\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 -2.6e-93)
   (* 180.0 (/ (atan 1.0) PI))
   (if (<= B 8.2e-28)
     (* 180.0 (/ (atan (/ C B)) PI))
     (* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
	double tmp;
	if (B <= -2.6e-93) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (B <= 8.2e-28) {
		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 <= -2.6e-93) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (B <= 8.2e-28) {
		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 <= -2.6e-93:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif B <= 8.2e-28:
		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 <= -2.6e-93)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (B <= 8.2e-28)
		tmp = Float64(180.0 * Float64(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 <= -2.6e-93)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (B <= 8.2e-28)
		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, -2.6e-93], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8.2e-28], N[(180.0 * N[(N[ArcTan[N[(C / B), $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 -2.6 \cdot 10^{-93}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{elif}\;B \leq 8.2 \cdot 10^{-28}:\\
\;\;\;\;180 \cdot \frac{\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 < -2.5999999999999998e-93

    1. Initial program 54.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 B around -inf 50.6%

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

    if -2.5999999999999998e-93 < B < 8.2000000000000005e-28

    1. Initial program 60.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 52.7%

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

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

    if 8.2000000000000005e-28 < B

    1. Initial program 55.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 62.5%

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

Alternative 27: 45.1% accurate, 3.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.2 \cdot 10^{-177}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 5.4 \cdot 10^{-127}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= B -1.2e-177)
   (* 180.0 (/ (atan 1.0) PI))
   (if (<= B 5.4e-127)
     (* 180.0 (/ (atan (/ 0.0 B)) PI))
     (* 180.0 (/ (atan -1.0) PI)))))
double code(double A, double B, double C) {
	double tmp;
	if (B <= -1.2e-177) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (B <= 5.4e-127) {
		tmp = 180.0 * (atan((0.0 / 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 <= -1.2e-177) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (B <= 5.4e-127) {
		tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	tmp = 0
	if B <= -1.2e-177:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif B <= 5.4e-127:
		tmp = 180.0 * (math.atan((0.0 / 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 <= -1.2e-177)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (B <= 5.4e-127)
		tmp = Float64(180.0 * Float64(atan(Float64(0.0 / 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 <= -1.2e-177)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (B <= 5.4e-127)
		tmp = 180.0 * (atan((0.0 / B)) / pi);
	else
		tmp = 180.0 * (atan(-1.0) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := If[LessEqual[B, -1.2e-177], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.4e-127], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $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.2 \cdot 10^{-177}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{elif}\;B \leq 5.4 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{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 < -1.1999999999999999e-177

    1. Initial program 59.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 B around -inf 47.1%

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

    if -1.1999999999999999e-177 < B < 5.3999999999999999e-127

    1. Initial program 54.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 C around inf 38.6%

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

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

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

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

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

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

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

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

    if 5.3999999999999999e-127 < B

    1. Initial program 57.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 B around inf 52.3%

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

Alternative 28: 40.3% accurate, 3.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -2 \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 -2e-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 <= -2e-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 <= -2e-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 <= -2e-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 <= -2e-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 <= -2e-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, -2e-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 -2 \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 < -1.999999999999994e-310

    1. Initial program 56.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
    2. Add Preprocessing
    3. Taylor expanded in B around -inf 37.5%

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

    if -1.999999999999994e-310 < B

    1. Initial program 58.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 41.8%

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

Alternative 29: 21.4% 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 57.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 B around inf 23.2%

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

Reproduce

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