ABCF->ab-angle angle

Percentage Accurate: 53.8% → 81.4%
Time: 17.3s
Alternatives: 14
Speedup: 3.6×

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 14 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.8% accurate, 1.0× speedup?

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

\\
180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi}
\end{array}

Alternative 1: 81.4% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 16.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 -inf 76.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.49999999999999988e70 < A

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

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

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

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

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

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

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

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

Alternative 2: 78.3% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 16.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 -inf 76.5%

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999995e71 < A < 2.4e-94

    1. Initial program 57.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 0 56.8%

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

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

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

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

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

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

    if 2.4e-94 < A

    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 C around 0 74.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{180 \cdot \left(-\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)\right)}{\pi}} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out85.9%

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

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

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

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

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

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

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

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

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

Alternative 3: 74.6% accurate, 1.9× speedup?

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

\mathbf{elif}\;C \leq 1.85 \cdot 10^{+66}:\\
\;\;\;\;-180 \cdot \frac{\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)}{\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 < -1.3000000000000001e-40

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

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

    if -1.3000000000000001e-40 < C < 1.85e66

    1. Initial program 54.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{180 \cdot \left(-\tan^{-1} \left(\frac{A + \mathsf{hypot}\left(A, B\right)}{B}\right)\right)}{\pi}} \]
    8. Step-by-step derivation
      1. distribute-rgt-neg-out79.3%

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

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

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

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

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

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

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

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

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

    if 1.85e66 < C

    1. Initial program 21.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 21.7%

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

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

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

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

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

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

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

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

Alternative 4: 81.2% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 16.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 -inf 76.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.8999999999999999e70 < A

    1. Initial program 63.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. Step-by-step derivation
      1. Simplified86.2%

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

    Alternative 5: 46.4% accurate, 3.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{if}\;A \leq -4.15 \cdot 10^{+71}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -9.5 \cdot 10^{-49}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;A \leq -6.2 \cdot 10^{-185}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(C \cdot \frac{2}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -2.4 \cdot 10^{-240}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;A \leq 1.9 \cdot 10^{-47}:\\ \;\;\;\;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 (* -0.5 (/ B C))) PI))))
       (if (<= A -4.15e+71)
         (* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
         (if (<= A -9.5e-49)
           t_0
           (if (<= A -6.2e-185)
             (* 180.0 (/ (atan (* C (/ 2.0 B))) PI))
             (if (<= A -2.4e-240)
               (* 180.0 (/ (atan 1.0) PI))
               (if (<= A 1.9e-47)
                 t_0
                 (* 180.0 (/ (atan (/ (* A -2.0) B)) PI)))))))))
    double code(double A, double B, double C) {
    	double t_0 = 180.0 * (atan((-0.5 * (B / C))) / ((double) M_PI));
    	double tmp;
    	if (A <= -4.15e+71) {
    		tmp = 180.0 * (atan(((B * 0.5) / A)) / ((double) M_PI));
    	} else if (A <= -9.5e-49) {
    		tmp = t_0;
    	} else if (A <= -6.2e-185) {
    		tmp = 180.0 * (atan((C * (2.0 / B))) / ((double) M_PI));
    	} else if (A <= -2.4e-240) {
    		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
    	} else if (A <= 1.9e-47) {
    		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((-0.5 * (B / C))) / Math.PI);
    	double tmp;
    	if (A <= -4.15e+71) {
    		tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / Math.PI);
    	} else if (A <= -9.5e-49) {
    		tmp = t_0;
    	} else if (A <= -6.2e-185) {
    		tmp = 180.0 * (Math.atan((C * (2.0 / B))) / Math.PI);
    	} else if (A <= -2.4e-240) {
    		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
    	} else if (A <= 1.9e-47) {
    		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((-0.5 * (B / C))) / math.pi)
    	tmp = 0
    	if A <= -4.15e+71:
    		tmp = 180.0 * (math.atan(((B * 0.5) / A)) / math.pi)
    	elif A <= -9.5e-49:
    		tmp = t_0
    	elif A <= -6.2e-185:
    		tmp = 180.0 * (math.atan((C * (2.0 / B))) / math.pi)
    	elif A <= -2.4e-240:
    		tmp = 180.0 * (math.atan(1.0) / math.pi)
    	elif A <= 1.9e-47:
    		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(-0.5 * Float64(B / C))) / pi))
    	tmp = 0.0
    	if (A <= -4.15e+71)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / pi));
    	elseif (A <= -9.5e-49)
    		tmp = t_0;
    	elseif (A <= -6.2e-185)
    		tmp = Float64(180.0 * Float64(atan(Float64(C * Float64(2.0 / B))) / pi));
    	elseif (A <= -2.4e-240)
    		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
    	elseif (A <= 1.9e-47)
    		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((-0.5 * (B / C))) / pi);
    	tmp = 0.0;
    	if (A <= -4.15e+71)
    		tmp = 180.0 * (atan(((B * 0.5) / A)) / pi);
    	elseif (A <= -9.5e-49)
    		tmp = t_0;
    	elseif (A <= -6.2e-185)
    		tmp = 180.0 * (atan((C * (2.0 / B))) / pi);
    	elseif (A <= -2.4e-240)
    		tmp = 180.0 * (atan(1.0) / pi);
    	elseif (A <= 1.9e-47)
    		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[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -4.15e+71], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -9.5e-49], t$95$0, If[LessEqual[A, -6.2e-185], N[(180.0 * N[(N[ArcTan[N[(C * N[(2.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.4e-240], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.9e-47], 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(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\
    \mathbf{if}\;A \leq -4.15 \cdot 10^{+71}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\
    
    \mathbf{elif}\;A \leq -9.5 \cdot 10^{-49}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;A \leq -6.2 \cdot 10^{-185}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(C \cdot \frac{2}{B}\right)}{\pi}\\
    
    \mathbf{elif}\;A \leq -2.4 \cdot 10^{-240}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
    
    \mathbf{elif}\;A \leq 1.9 \cdot 10^{-47}:\\
    \;\;\;\;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 5 regimes
    2. if A < -4.1499999999999998e71

      1. Initial program 16.5%

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

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

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

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

      if -4.1499999999999998e71 < A < -9.50000000000000006e-49 or -2.3999999999999999e-240 < A < 1.90000000000000007e-47

      1. Initial program 44.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 43.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. +-commutative43.2%

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

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

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

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

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

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

      if -9.50000000000000006e-49 < A < -6.1999999999999994e-185

      1. Initial program 74.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -6.1999999999999994e-185 < A < -2.3999999999999999e-240

      1. Initial program 65.8%

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

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

      if 1.90000000000000007e-47 < A

      1. Initial program 81.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. Step-by-step derivation
        1. associate-*l/81.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -4.15 \cdot 10^{+71}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -9.5 \cdot 10^{-49}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;A \leq -6.2 \cdot 10^{-185}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(C \cdot \frac{2}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -2.4 \cdot 10^{-240}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;A \leq 1.9 \cdot 10^{-47}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 55.0% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq -2.45 \cdot 10^{-266}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq 6 \cdot 10^{-72}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{1 + \frac{A}{B}}\right)}{\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 -2.45e-266)
       (* 180.0 (/ (atan (/ (- C B) B)) PI))
       (if (<= C 6e-72)
         (* 180.0 (/ (atan (/ 1.0 (+ 1.0 (/ A B)))) PI))
         (* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (C <= -2.45e-266) {
    		tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
    	} else if (C <= 6e-72) {
    		tmp = 180.0 * (atan((1.0 / (1.0 + (A / B)))) / ((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 <= -2.45e-266) {
    		tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
    	} else if (C <= 6e-72) {
    		tmp = 180.0 * (Math.atan((1.0 / (1.0 + (A / B)))) / 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 <= -2.45e-266:
    		tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi)
    	elif C <= 6e-72:
    		tmp = 180.0 * (math.atan((1.0 / (1.0 + (A / B)))) / 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 <= -2.45e-266)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi));
    	elseif (C <= 6e-72)
    		tmp = Float64(180.0 * Float64(atan(Float64(1.0 / Float64(1.0 + Float64(A / B)))) / 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 <= -2.45e-266)
    		tmp = 180.0 * (atan(((C - B) / B)) / pi);
    	elseif (C <= 6e-72)
    		tmp = 180.0 * (atan((1.0 / (1.0 + (A / B)))) / pi);
    	else
    		tmp = 180.0 * (atan((-0.5 * (B / C))) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[C, -2.45e-266], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 6e-72], N[(180.0 * N[(N[ArcTan[N[(1.0 / N[(1.0 + N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 -2.45 \cdot 10^{-266}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
    
    \mathbf{elif}\;C \leq 6 \cdot 10^{-72}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{1 + \frac{A}{B}}\right)}{\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 < -2.4500000000000001e-266

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

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

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

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

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

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

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

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

      if -2.4500000000000001e-266 < C < 6e-72

      1. Initial program 62.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--l-59.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 6e-72 < C

      1. Initial program 26.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 0 20.7%

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

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

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

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

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

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

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

    Alternative 7: 53.3% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq -1.12 \cdot 10^{-255}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq 1.02 \cdot 10^{-51}:\\ \;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\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 -1.12e-255)
       (* 180.0 (/ (atan (/ (- C B) B)) PI))
       (if (<= C 1.02e-51)
         (* (atan (* B (/ 0.5 A))) (/ 180.0 PI))
         (* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (C <= -1.12e-255) {
    		tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
    	} else if (C <= 1.02e-51) {
    		tmp = atan((B * (0.5 / A))) * (180.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 <= -1.12e-255) {
    		tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
    	} else if (C <= 1.02e-51) {
    		tmp = Math.atan((B * (0.5 / A))) * (180.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 <= -1.12e-255:
    		tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi)
    	elif C <= 1.02e-51:
    		tmp = math.atan((B * (0.5 / A))) * (180.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 <= -1.12e-255)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi));
    	elseif (C <= 1.02e-51)
    		tmp = Float64(atan(Float64(B * Float64(0.5 / A))) * Float64(180.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 <= -1.12e-255)
    		tmp = 180.0 * (atan(((C - B) / B)) / pi);
    	elseif (C <= 1.02e-51)
    		tmp = atan((B * (0.5 / A))) * (180.0 / pi);
    	else
    		tmp = 180.0 * (atan((-0.5 * (B / C))) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[C, -1.12e-255], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.02e-51], N[(N[ArcTan[N[(B * N[(0.5 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / 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 -1.12 \cdot 10^{-255}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
    
    \mathbf{elif}\;C \leq 1.02 \cdot 10^{-51}:\\
    \;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\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 < -1.12000000000000009e-255

      1. Initial program 70.8%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
      2. Add Preprocessing
      3. Taylor expanded in A around 0 66.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. +-commutative66.6%

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

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

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

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

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

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

      if -1.12000000000000009e-255 < C < 1.01999999999999998e-51

      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 38.1%

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

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

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

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

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

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

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

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

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

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

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

      if 1.01999999999999998e-51 < C

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

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

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

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

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

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

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

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

    Alternative 8: 53.3% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq -1.75 \cdot 10^{-255}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq 2.4 \cdot 10^{-52}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\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 -1.75e-255)
       (* 180.0 (/ (atan (/ (- C B) B)) PI))
       (if (<= C 2.4e-52)
         (* 180.0 (/ (atan (/ (* B 0.5) A)) PI))
         (* 180.0 (/ (atan (* -0.5 (/ B C))) PI)))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (C <= -1.75e-255) {
    		tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
    	} else if (C <= 2.4e-52) {
    		tmp = 180.0 * (atan(((B * 0.5) / A)) / ((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 <= -1.75e-255) {
    		tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
    	} else if (C <= 2.4e-52) {
    		tmp = 180.0 * (Math.atan(((B * 0.5) / A)) / 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 <= -1.75e-255:
    		tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi)
    	elif C <= 2.4e-52:
    		tmp = 180.0 * (math.atan(((B * 0.5) / A)) / 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 <= -1.75e-255)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi));
    	elseif (C <= 2.4e-52)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * 0.5) / A)) / 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 <= -1.75e-255)
    		tmp = 180.0 * (atan(((C - B) / B)) / pi);
    	elseif (C <= 2.4e-52)
    		tmp = 180.0 * (atan(((B * 0.5) / A)) / pi);
    	else
    		tmp = 180.0 * (atan((-0.5 * (B / C))) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[C, -1.75e-255], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.4e-52], N[(180.0 * N[(N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / A), $MachinePrecision]], $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 -1.75 \cdot 10^{-255}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\
    
    \mathbf{elif}\;C \leq 2.4 \cdot 10^{-52}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\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 < -1.74999999999999989e-255

      1. Initial program 70.8%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
      2. Add Preprocessing
      3. Taylor expanded in A around 0 66.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. +-commutative66.6%

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

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

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

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

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

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

      if -1.74999999999999989e-255 < C < 2.4000000000000002e-52

      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 38.1%

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

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

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

      if 2.4000000000000002e-52 < C

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

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

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

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

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

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

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

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

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

    Alternative 9: 48.4% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq -1.75 \cdot 10^{-41}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(C \cdot \frac{2}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq 1.25 \cdot 10^{-251}:\\ \;\;\;\;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 -1.75e-41)
       (* 180.0 (/ (atan (* C (/ 2.0 B))) PI))
       (if (<= C 1.25e-251)
         (* 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 <= -1.75e-41) {
    		tmp = 180.0 * (atan((C * (2.0 / B))) / ((double) M_PI));
    	} else if (C <= 1.25e-251) {
    		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 <= -1.75e-41) {
    		tmp = 180.0 * (Math.atan((C * (2.0 / B))) / Math.PI);
    	} else if (C <= 1.25e-251) {
    		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 <= -1.75e-41:
    		tmp = 180.0 * (math.atan((C * (2.0 / B))) / math.pi)
    	elif C <= 1.25e-251:
    		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 <= -1.75e-41)
    		tmp = Float64(180.0 * Float64(atan(Float64(C * Float64(2.0 / B))) / pi));
    	elseif (C <= 1.25e-251)
    		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 <= -1.75e-41)
    		tmp = 180.0 * (atan((C * (2.0 / B))) / pi);
    	elseif (C <= 1.25e-251)
    		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, -1.75e-41], N[(180.0 * N[(N[ArcTan[N[(C * N[(2.0 / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.25e-251], 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 -1.75 \cdot 10^{-41}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(C \cdot \frac{2}{B}\right)}{\pi}\\
    
    \mathbf{elif}\;C \leq 1.25 \cdot 10^{-251}:\\
    \;\;\;\;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 < -1.75e-41

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.75e-41 < C < 1.2500000000000001e-251

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

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

      if 1.2500000000000001e-251 < C

      1. Initial program 36.8%

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

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

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

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

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

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

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

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

    Alternative 10: 46.6% accurate, 3.5× speedup?

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

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

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

      if -1.7999999999999999e-23 < B < 8.79999999999999989e-43

      1. Initial program 52.5%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
      2. Add Preprocessing
      3. Taylor expanded in A around 0 44.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. +-commutative44.4%

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

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

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

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

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

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

      if 8.79999999999999989e-43 < B

      1. Initial program 53.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 55.1%

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

    Alternative 11: 60.6% accurate, 3.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;C \leq 3.4 \cdot 10^{-34}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + \left(-1 - \frac{A}{B}\right)\right)}{\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.4e-34)
       (* 180.0 (/ (atan (+ (/ C B) (- -1.0 (/ A B)))) PI))
       (* 180.0 (/ (atan (* -0.5 (/ B C))) PI))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (C <= 3.4e-34) {
    		tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / ((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.4e-34) {
    		tmp = 180.0 * (Math.atan(((C / B) + (-1.0 - (A / B)))) / 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.4e-34:
    		tmp = 180.0 * (math.atan(((C / B) + (-1.0 - (A / B)))) / 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.4e-34)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C / B) + Float64(-1.0 - Float64(A / B)))) / 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.4e-34)
    		tmp = 180.0 * (atan(((C / B) + (-1.0 - (A / B)))) / pi);
    	else
    		tmp = 180.0 * (atan((-0.5 * (B / C))) / pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[A_, B_, C_] := If[LessEqual[C, 3.4e-34], N[(180.0 * N[(N[ArcTan[N[(N[(C / B), $MachinePrecision] + N[(-1.0 - N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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.4 \cdot 10^{-34}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + \left(-1 - \frac{A}{B}\right)\right)}{\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 2 regimes
    2. if C < 3.4000000000000001e-34

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

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

      if 3.4000000000000001e-34 < C

      1. Initial program 25.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 20.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. +-commutative20.4%

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

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

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

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

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

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

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

    Alternative 12: 45.2% accurate, 3.6× speedup?

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

      1. Initial program 55.5%

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

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

      if -4.49999999999999969e-117 < B < 7.39999999999999966e-85

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{180 \cdot \tan^{-1} \color{blue}{0}}{\pi} \]
      7. Applied egg-rr41.4%

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

      if 7.39999999999999966e-85 < B

      1. Initial program 54.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 53.1%

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

    Alternative 13: 40.1% accurate, 3.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1 \cdot 10^{-309}:\\ \;\;\;\;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 -1e-309) (* 180.0 (/ (atan 1.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
    double code(double A, double B, double C) {
    	double tmp;
    	if (B <= -1e-309) {
    		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 <= -1e-309) {
    		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 <= -1e-309:
    		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 <= -1e-309)
    		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 <= -1e-309)
    		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, -1e-309], 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 -1 \cdot 10^{-309}:\\
    \;\;\;\;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.000000000000002e-309

      1. Initial program 54.0%

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

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

      if -1.000000000000002e-309 < B

      1. Initial program 53.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 36.2%

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

    Alternative 14: 20.9% 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 53.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 21.0%

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

    Reproduce

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