ABCF->ab-angle angle

Percentage Accurate: 53.7% → 88.3%
Time: 12.1s
Alternatives: 15
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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.7% 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: 88.3% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


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

    1. Initial program 58.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. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      2. lift-+.f64N/A

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\mathsf{hypot}\left(C - A, B\right)}\right)\right)}{\pi} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
      2. lift-/.f64N/A

        \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
      3. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
      4. lower-/.f64N/A

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

      \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\mathsf{fma}\left(C - A, C - A, B \cdot B\right)}}{B}\right)}{\pi}} \]
    7. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \color{blue}{\sqrt{\mathsf{fma}\left(C - A, C - A, B \cdot B\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      2. lift-fma.f64N/A

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\color{blue}{\left(C - A\right) \cdot \left(C - A\right) + B \cdot B}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      3. lift-*.f64N/A

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

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

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

    if -1e-3 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.0

    1. Initial program 19.8%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      2. lift-+.f64N/A

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      2. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{-1}{2}}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      4. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{2}\right)}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
      5. distribute-neg-fracN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      6. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2} \cdot 1}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
      7. associate-*r/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
      8. lower-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
      9. associate-*r/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
      10. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
      11. distribute-neg-frac2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{\mathsf{neg}\left(\left(C - A\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
      12. sub-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(C + \left(\mathsf{neg}\left(A\right)\right)\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
      13. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(A\right)\right) + C\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
      14. distribute-neg-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) + \left(\mathsf{neg}\left(C\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
      15. remove-double-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A} + \left(\mathsf{neg}\left(C\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      16. sub-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
      18. lower--.f6498.5

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

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

Alternative 2: 69.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\ t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ t_2 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\ \mathbf{if}\;t\_1 \leq -0.001:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-50}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;t\_1 \leq 10^{+284}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan (+ (/ (- C A) B) -1.0)) PI)))
        (t_1
         (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
        (t_2 (* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI))))
   (if (<= t_1 -0.001)
     t_0
     (if (<= t_1 5e-50)
       t_2
       (if (<= t_1 2.0)
         (* 180.0 (/ (atan 1.0) PI))
         (if (<= t_1 1e+284) t_0 t_2))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan((((C - A) / B) + -1.0)) / ((double) M_PI));
	double t_1 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
	double t_2 = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
	double tmp;
	if (t_1 <= -0.001) {
		tmp = t_0;
	} else if (t_1 <= 5e-50) {
		tmp = t_2;
	} else if (t_1 <= 2.0) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (t_1 <= 1e+284) {
		tmp = t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = 180.0 * (Math.atan((((C - A) / B) + -1.0)) / Math.PI);
	double t_1 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
	double t_2 = 180.0 * (Math.atan((B * (0.5 / (A - C)))) / Math.PI);
	double tmp;
	if (t_1 <= -0.001) {
		tmp = t_0;
	} else if (t_1 <= 5e-50) {
		tmp = t_2;
	} else if (t_1 <= 2.0) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (t_1 <= 1e+284) {
		tmp = t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 * (math.atan((((C - A) / B) + -1.0)) / math.pi)
	t_1 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0))))
	t_2 = 180.0 * (math.atan((B * (0.5 / (A - C)))) / math.pi)
	tmp = 0
	if t_1 <= -0.001:
		tmp = t_0
	elif t_1 <= 5e-50:
		tmp = t_2
	elif t_1 <= 2.0:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif t_1 <= 1e+284:
		tmp = t_0
	else:
		tmp = t_2
	return tmp
function code(A, B, C)
	t_0 = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + -1.0)) / pi))
	t_1 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
	t_2 = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi))
	tmp = 0.0
	if (t_1 <= -0.001)
		tmp = t_0;
	elseif (t_1 <= 5e-50)
		tmp = t_2;
	elseif (t_1 <= 2.0)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (t_1 <= 1e+284)
		tmp = t_0;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = 180.0 * (atan((((C - A) / B) + -1.0)) / pi);
	t_1 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0))));
	t_2 = 180.0 * (atan((B * (0.5 / (A - C)))) / pi);
	tmp = 0.0;
	if (t_1 <= -0.001)
		tmp = t_0;
	elseif (t_1 <= 5e-50)
		tmp = t_2;
	elseif (t_1 <= 2.0)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (t_1 <= 1e+284)
		tmp = t_0;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -0.001], t$95$0, If[LessEqual[t$95$1, 5e-50], t$95$2, If[LessEqual[t$95$1, 2.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+284], t$95$0, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-50}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{elif}\;t\_1 \leq 10^{+284}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
      3. div-subN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
      4. sub-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
      5. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
      6. lower-+.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
      7. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
      8. lower--.f6479.8

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

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

    if -1e-3 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 4.99999999999999968e-50 or 1.00000000000000008e284 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

    1. Initial program 34.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. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
      2. lift-+.f64N/A

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      2. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{-1}{2}}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
      3. associate-/l*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      4. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{2}\right)}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
      5. distribute-neg-fracN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      6. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2} \cdot 1}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
      7. associate-*r/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
      8. lower-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
      9. associate-*r/N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
      10. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
      11. distribute-neg-frac2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{\mathsf{neg}\left(\left(C - A\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
      12. sub-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(C + \left(\mathsf{neg}\left(A\right)\right)\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
      13. +-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(A\right)\right) + C\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
      14. distribute-neg-inN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) + \left(\mathsf{neg}\left(C\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
      15. remove-double-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A} + \left(\mathsf{neg}\left(C\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      16. sub-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
      17. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
      18. lower--.f6461.6

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

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

    if 4.99999999999999968e-50 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 2

    1. Initial program 94.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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites100.0%

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

    Alternative 3: 67.3% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\ t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ \mathbf{if}\;t\_1 \leq -0.001:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + -1\right)\right)\right)}{\pi}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-50}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 10^{+284}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0 (* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI)))
            (t_1
             (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
       (if (<= t_1 -0.001)
         (* 180.0 (/ (atan (* (/ 1.0 B) (* B (+ (/ (- C A) B) -1.0)))) PI))
         (if (<= t_1 5e-50)
           t_0
           (if (<= t_1 1e+284)
             (/ (* 180.0 (atan (/ (- C (sqrt (fma B B (* C C)))) B))) PI)
             t_0)))))
    double code(double A, double B, double C) {
    	double t_0 = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
    	double t_1 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
    	double tmp;
    	if (t_1 <= -0.001) {
    		tmp = 180.0 * (atan(((1.0 / B) * (B * (((C - A) / B) + -1.0)))) / ((double) M_PI));
    	} else if (t_1 <= 5e-50) {
    		tmp = t_0;
    	} else if (t_1 <= 1e+284) {
    		tmp = (180.0 * atan(((C - sqrt(fma(B, B, (C * C)))) / B))) / ((double) M_PI);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(A, B, C)
    	t_0 = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi))
    	t_1 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
    	tmp = 0.0
    	if (t_1 <= -0.001)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(B * Float64(Float64(Float64(C - A) / B) + -1.0)))) / pi));
    	elseif (t_1 <= 5e-50)
    		tmp = t_0;
    	elseif (t_1 <= 1e+284)
    		tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - sqrt(fma(B, B, Float64(C * C)))) / B))) / pi);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -0.001], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(B * N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-50], t$95$0, If[LessEqual[t$95$1, 1e+284], N[(N[(180.0 * N[ArcTan[N[(N[(C - N[Sqrt[N[(B * B + N[(C * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], t$95$0]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\
    t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
    \mathbf{if}\;t\_1 \leq -0.001:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + -1\right)\right)\right)}{\pi}\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-50}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;t\_1 \leq 10^{+284}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}}{B}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -1e-3

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \color{blue}{\left(B \cdot \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \color{blue}{\left(B \cdot \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        2. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C}{B} - \color{blue}{\left(\frac{A}{B} + 1\right)}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        3. associate--r+N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        4. div-subN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\color{blue}{\frac{C - A}{B}} - 1\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        5. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        6. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + \color{blue}{-1}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. lower-+.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\frac{C - A}{B} + -1\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\color{blue}{\frac{C - A}{B}} + -1\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        9. lower--.f6478.1

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

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

      if -1e-3 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 4.99999999999999968e-50 or 1.00000000000000008e284 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

      1. Initial program 34.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. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. lift-+.f64N/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        2. *-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{-1}{2}}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        3. associate-/l*N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        4. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{2}\right)}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        5. distribute-neg-fracN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        6. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2} \cdot 1}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
        9. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        10. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        11. distribute-neg-frac2N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{\mathsf{neg}\left(\left(C - A\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        12. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(C + \left(\mathsf{neg}\left(A\right)\right)\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        13. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(A\right)\right) + C\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        14. distribute-neg-inN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) + \left(\mathsf{neg}\left(C\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        15. remove-double-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A} + \left(\mathsf{neg}\left(C\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        16. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        17. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        18. lower--.f6461.6

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

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

      if 4.99999999999999968e-50 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 1.00000000000000008e284

      1. Initial program 96.9%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. lift-+.f64N/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\mathsf{hypot}\left(C - A, B\right)}\right)\right)}{\pi} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
        2. lift-/.f64N/A

          \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
        3. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
        4. lower-/.f64N/A

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{C - \sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      8. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{C - \sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        2. lower-sqrt.f64N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \color{blue}{\sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        3. unpow2N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        4. lower-fma.f64N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\color{blue}{\mathsf{fma}\left(B, B, {C}^{2}\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        5. unpow2N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, \color{blue}{C \cdot C}\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-*.f6487.7

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, \color{blue}{C \cdot C}\right)}}{B}\right)}{\pi} \]
      9. Applied rewrites87.7%

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

    Alternative 4: 67.3% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\ \mathbf{if}\;t\_0 \leq -0.001:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{+284}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0
             (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
            (t_1 (* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI))))
       (if (<= t_0 -0.001)
         (* 180.0 (/ (atan (+ (/ (- C A) B) -1.0)) PI))
         (if (<= t_0 5e-50)
           t_1
           (if (<= t_0 1e+284)
             (/ (* 180.0 (atan (/ (- C (sqrt (fma B B (* C C)))) B))) PI)
             t_1)))))
    double code(double A, double B, double C) {
    	double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
    	double t_1 = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
    	double tmp;
    	if (t_0 <= -0.001) {
    		tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / ((double) M_PI));
    	} else if (t_0 <= 5e-50) {
    		tmp = t_1;
    	} else if (t_0 <= 1e+284) {
    		tmp = (180.0 * atan(((C - sqrt(fma(B, B, (C * C)))) / B))) / ((double) M_PI);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(A, B, C)
    	t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
    	t_1 = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi))
    	tmp = 0.0
    	if (t_0 <= -0.001)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + -1.0)) / pi));
    	elseif (t_0 <= 5e-50)
    		tmp = t_1;
    	elseif (t_0 <= 1e+284)
    		tmp = Float64(Float64(180.0 * atan(Float64(Float64(C - sqrt(fma(B, B, Float64(C * C)))) / B))) / pi);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[A_, B_, C_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.001], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-50], t$95$1, If[LessEqual[t$95$0, 1e+284], N[(N[(180.0 * N[ArcTan[N[(N[(C - N[Sqrt[N[(B * B + N[(C * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], t$95$1]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
    t_1 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\
    \mathbf{if}\;t\_0 \leq -0.001:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
    
    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-50}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_0 \leq 10^{+284}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}}{B}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -1e-3

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
        3. div-subN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
        4. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
        5. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-+.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
        7. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
        8. lower--.f6478.1

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

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

      if -1e-3 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 4.99999999999999968e-50 or 1.00000000000000008e284 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

      1. Initial program 34.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. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. lift-+.f64N/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        2. *-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{-1}{2}}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        3. associate-/l*N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        4. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{2}\right)}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        5. distribute-neg-fracN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        6. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2} \cdot 1}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
        9. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        10. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        11. distribute-neg-frac2N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{\mathsf{neg}\left(\left(C - A\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        12. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(C + \left(\mathsf{neg}\left(A\right)\right)\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        13. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(A\right)\right) + C\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        14. distribute-neg-inN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) + \left(\mathsf{neg}\left(C\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        15. remove-double-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A} + \left(\mathsf{neg}\left(C\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        16. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        17. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        18. lower--.f6461.6

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

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

      if 4.99999999999999968e-50 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 1.00000000000000008e284

      1. Initial program 96.9%

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. lift-+.f64N/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\mathsf{hypot}\left(C - A, B\right)}\right)\right)}{\pi} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
        2. lift-/.f64N/A

          \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
        3. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \mathsf{hypot}\left(C - A, B\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
        4. lower-/.f64N/A

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{C - \sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
      8. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\color{blue}{C - \sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        2. lower-sqrt.f64N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \color{blue}{\sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        3. unpow2N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        4. lower-fma.f64N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\color{blue}{\mathsf{fma}\left(B, B, {C}^{2}\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        5. unpow2N/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, \color{blue}{C \cdot C}\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-*.f6487.7

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, \color{blue}{C \cdot C}\right)}}{B}\right)}{\pi} \]
      9. Applied rewrites87.7%

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

    Alternative 5: 67.3% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\ \mathbf{if}\;t\_0 \leq -0.001:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{+284}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0
             (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
            (t_1 (* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI))))
       (if (<= t_0 -0.001)
         (* 180.0 (/ (atan (+ (/ (- C A) B) -1.0)) PI))
         (if (<= t_0 5e-50)
           t_1
           (if (<= t_0 1e+284)
             (* 180.0 (/ (atan (/ (- C (sqrt (fma B B (* C C)))) B)) PI))
             t_1)))))
    double code(double A, double B, double C) {
    	double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
    	double t_1 = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
    	double tmp;
    	if (t_0 <= -0.001) {
    		tmp = 180.0 * (atan((((C - A) / B) + -1.0)) / ((double) M_PI));
    	} else if (t_0 <= 5e-50) {
    		tmp = t_1;
    	} else if (t_0 <= 1e+284) {
    		tmp = 180.0 * (atan(((C - sqrt(fma(B, B, (C * C)))) / B)) / ((double) M_PI));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(A, B, C)
    	t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
    	t_1 = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi))
    	tmp = 0.0
    	if (t_0 <= -0.001)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) / B) + -1.0)) / pi));
    	elseif (t_0 <= 5e-50)
    		tmp = t_1;
    	elseif (t_0 <= 1e+284)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - sqrt(fma(B, B, Float64(C * C)))) / B)) / pi));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[A_, B_, C_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.001], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-50], t$95$1, If[LessEqual[t$95$0, 1e+284], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[N[(B * B + N[(C * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
    t_1 := 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\
    \mathbf{if}\;t\_0 \leq -0.001:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\
    
    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-50}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_0 \leq 10^{+284}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, C \cdot C\right)}}{B}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -1e-3

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
        3. div-subN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
        4. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
        5. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-+.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
        7. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
        8. lower--.f6478.1

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

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

      if -1e-3 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 4.99999999999999968e-50 or 1.00000000000000008e284 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

      1. Initial program 34.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. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. lift-+.f64N/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        2. *-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{-1}{2}}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        3. associate-/l*N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        4. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{2}\right)}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        5. distribute-neg-fracN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        6. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2} \cdot 1}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
        9. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        10. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        11. distribute-neg-frac2N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{\mathsf{neg}\left(\left(C - A\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        12. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(C + \left(\mathsf{neg}\left(A\right)\right)\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        13. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(A\right)\right) + C\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        14. distribute-neg-inN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) + \left(\mathsf{neg}\left(C\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        15. remove-double-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A} + \left(\mathsf{neg}\left(C\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        16. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        17. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        18. lower--.f6461.6

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

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

      if 4.99999999999999968e-50 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 1.00000000000000008e284

      1. Initial program 96.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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}}{\mathsf{PI}\left(\right)} \]
        2. lower--.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{C - \sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        3. lower-sqrt.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \color{blue}{\sqrt{{B}^{2} + {C}^{2}}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        4. unpow2N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        5. lower-fma.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\color{blue}{\mathsf{fma}\left(B, B, {C}^{2}\right)}}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        6. unpow2N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(B, B, \color{blue}{C \cdot C}\right)}}{B}\right)}{\mathsf{PI}\left(\right)} \]
        7. lower-*.f6487.6

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

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

    Alternative 6: 71.3% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ \mathbf{if}\;t\_0 \leq -0.001:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + -1\right)\right)\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-50}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\mathsf{fma}\left(A - C, A - C, B \cdot B\right)}}{B}\right)}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0
             (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
       (if (<= t_0 -0.001)
         (* 180.0 (/ (atan (* (/ 1.0 B) (* B (+ (/ (- C A) B) -1.0)))) PI))
         (if (<= t_0 5e-50)
           (* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI))
           (/
            (* 180.0 (atan (/ (- (- C A) (sqrt (fma (- A C) (- A C) (* B B)))) B)))
            PI)))))
    double code(double A, double B, double C) {
    	double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
    	double tmp;
    	if (t_0 <= -0.001) {
    		tmp = 180.0 * (atan(((1.0 / B) * (B * (((C - A) / B) + -1.0)))) / ((double) M_PI));
    	} else if (t_0 <= 5e-50) {
    		tmp = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
    	} else {
    		tmp = (180.0 * atan((((C - A) - sqrt(fma((A - C), (A - C), (B * B)))) / B))) / ((double) M_PI);
    	}
    	return tmp;
    }
    
    function code(A, B, C)
    	t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
    	tmp = 0.0
    	if (t_0 <= -0.001)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(B * Float64(Float64(Float64(C - A) / B) + -1.0)))) / pi));
    	elseif (t_0 <= 5e-50)
    		tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi));
    	else
    		tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - sqrt(fma(Float64(A - C), Float64(A - C), Float64(B * B)))) / B))) / pi);
    	end
    	return tmp
    end
    
    code[A_, B_, C_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -0.001], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(B * N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-50], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[(A - C), $MachinePrecision] * N[(A - C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
    \mathbf{if}\;t\_0 \leq -0.001:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + -1\right)\right)\right)}{\pi}\\
    
    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-50}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\mathsf{fma}\left(A - C, A - C, B \cdot B\right)}}{B}\right)}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -1e-3

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \color{blue}{\left(B \cdot \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \color{blue}{\left(B \cdot \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        2. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C}{B} - \color{blue}{\left(\frac{A}{B} + 1\right)}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        3. associate--r+N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        4. div-subN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\color{blue}{\frac{C - A}{B}} - 1\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        5. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        6. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + \color{blue}{-1}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. lower-+.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\frac{C - A}{B} + -1\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\color{blue}{\frac{C - A}{B}} + -1\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        9. lower--.f6478.1

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

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

      if -1e-3 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 4.99999999999999968e-50

      1. Initial program 19.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. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. lift-+.f64N/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        2. *-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{-1}{2}}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        3. associate-/l*N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        4. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{2}\right)}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        5. distribute-neg-fracN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        6. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2} \cdot 1}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
        9. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        10. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        11. distribute-neg-frac2N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{\mathsf{neg}\left(\left(C - A\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        12. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(C + \left(\mathsf{neg}\left(A\right)\right)\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        13. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(A\right)\right) + C\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        14. distribute-neg-inN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) + \left(\mathsf{neg}\left(C\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        15. remove-double-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A} + \left(\mathsf{neg}\left(C\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        16. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        17. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        18. lower--.f6496.3

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

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

      if 4.99999999999999968e-50 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

      1. Initial program 58.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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{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)}{\mathsf{PI}\left(\right)}} \]
        2. lift-/.f64N/A

          \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}} \]
        3. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}} \]
        4. lower-/.f64N/A

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

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

    Alternative 7: 71.3% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ \mathbf{if}\;t\_0 \leq -0.001:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + -1\right)\right)\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-50}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\mathsf{fma}\left(A - C, A - C, B \cdot B\right)}}{B}\right) \cdot \frac{180}{\pi}\\ \end{array} \end{array} \]
    (FPCore (A B C)
     :precision binary64
     (let* ((t_0
             (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
       (if (<= t_0 -0.001)
         (* 180.0 (/ (atan (* (/ 1.0 B) (* B (+ (/ (- C A) B) -1.0)))) PI))
         (if (<= t_0 5e-50)
           (* 180.0 (/ (atan (* B (/ 0.5 (- A C)))) PI))
           (*
            (atan (/ (- (- C A) (sqrt (fma (- A C) (- A C) (* B B)))) B))
            (/ 180.0 PI))))))
    double code(double A, double B, double C) {
    	double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
    	double tmp;
    	if (t_0 <= -0.001) {
    		tmp = 180.0 * (atan(((1.0 / B) * (B * (((C - A) / B) + -1.0)))) / ((double) M_PI));
    	} else if (t_0 <= 5e-50) {
    		tmp = 180.0 * (atan((B * (0.5 / (A - C)))) / ((double) M_PI));
    	} else {
    		tmp = atan((((C - A) - sqrt(fma((A - C), (A - C), (B * B)))) / B)) * (180.0 / ((double) M_PI));
    	}
    	return tmp;
    }
    
    function code(A, B, C)
    	t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
    	tmp = 0.0
    	if (t_0 <= -0.001)
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(B * Float64(Float64(Float64(C - A) / B) + -1.0)))) / pi));
    	elseif (t_0 <= 5e-50)
    		tmp = Float64(180.0 * Float64(atan(Float64(B * Float64(0.5 / Float64(A - C)))) / pi));
    	else
    		tmp = Float64(atan(Float64(Float64(Float64(C - A) - sqrt(fma(Float64(A - C), Float64(A - C), Float64(B * B)))) / B)) * Float64(180.0 / pi));
    	end
    	return tmp
    end
    
    code[A_, B_, C_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -0.001], N[(180.0 * N[(N[ArcTan[N[(N[(1.0 / B), $MachinePrecision] * N[(B * N[(N[(N[(C - A), $MachinePrecision] / B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-50], N[(180.0 * N[(N[ArcTan[N[(B * N[(0.5 / N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[(A - C), $MachinePrecision] * N[(A - C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
    \mathbf{if}\;t\_0 \leq -0.001:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + -1\right)\right)\right)}{\pi}\\
    
    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-50}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{0.5}{A - C}\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{\mathsf{fma}\left(A - C, A - C, B \cdot B\right)}}{B}\right) \cdot \frac{180}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -1e-3

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \color{blue}{\left(B \cdot \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \color{blue}{\left(B \cdot \left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        2. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C}{B} - \color{blue}{\left(\frac{A}{B} + 1\right)}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        3. associate--r+N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        4. div-subN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\color{blue}{\frac{C - A}{B}} - 1\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        5. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        6. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\frac{C - A}{B} + \color{blue}{-1}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. lower-+.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \color{blue}{\left(\frac{C - A}{B} + -1\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(B \cdot \left(\color{blue}{\frac{C - A}{B}} + -1\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        9. lower--.f6478.1

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

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

      if -1e-3 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < 4.99999999999999968e-50

      1. Initial program 19.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. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{\sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        2. lift-+.f64N/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        2. *-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{-1}{2}}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        3. associate-/l*N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)}}{\mathsf{PI}\left(\right)} \]
        4. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\color{blue}{\mathsf{neg}\left(\frac{1}{2}\right)}}{C - A}\right)}{\mathsf{PI}\left(\right)} \]
        5. distribute-neg-fracN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        6. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2} \cdot 1}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
        9. associate-*r/N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{C - A}}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        10. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{C - A}\right)\right)\right)}{\mathsf{PI}\left(\right)} \]
        11. distribute-neg-frac2N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{\mathsf{neg}\left(\left(C - A\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        12. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(C + \left(\mathsf{neg}\left(A\right)\right)\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        13. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(A\right)\right) + C\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
        14. distribute-neg-inN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) + \left(\mathsf{neg}\left(C\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        15. remove-double-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A} + \left(\mathsf{neg}\left(C\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        16. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \frac{\frac{1}{2}}{\color{blue}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        17. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(B \cdot \color{blue}{\frac{\frac{1}{2}}{A - C}}\right)}{\mathsf{PI}\left(\right)} \]
        18. lower--.f6496.3

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

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

      if 4.99999999999999968e-50 < (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64))))))

      1. Initial program 58.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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{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)}{\mathsf{PI}\left(\right)}} \]
        2. metadata-evalN/A

          \[\leadsto \color{blue}{\frac{180}{1}} \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        3. lift-/.f64N/A

          \[\leadsto \frac{180}{1} \cdot \color{blue}{\frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\mathsf{PI}\left(\right)}} \]
        4. times-fracN/A

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{1 \cdot \mathsf{PI}\left(\right)}} \]
        5. *-commutativeN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\color{blue}{\mathsf{PI}\left(\right) \cdot 1}} \]
        6. times-fracN/A

          \[\leadsto \color{blue}{\frac{180}{\mathsf{PI}\left(\right)} \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{1}} \]
        7. /-rgt-identityN/A

          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \color{blue}{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)} \]
        8. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)} \]
        9. lower-/.f6458.3

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

          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \color{blue}{\left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)} \]
        11. *-commutativeN/A

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

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

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

    Alternative 8: 59.4% accurate, 2.5× speedup?

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

      1. Initial program 22.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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(\frac{-1}{2} \cdot B + \frac{-1}{2} \cdot \frac{B \cdot C}{A}\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]
        2. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(\frac{-1}{2} \cdot B + \frac{-1}{2} \cdot \frac{B \cdot C}{A}\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]
        3. distribute-lft-outN/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right) \cdot \left(B + \frac{B \cdot C}{A}\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
        5. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\frac{1}{2}} \cdot \left(B + \frac{B \cdot C}{A}\right)}{A}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\frac{1}{2} \cdot \left(B + \frac{B \cdot C}{A}\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
        7. +-commutativeN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{B \cdot C}{A} + B\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
        8. associate-/l*N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \left(\color{blue}{B \cdot \frac{C}{A}} + B\right)}{A}\right)}{\mathsf{PI}\left(\right)} \]
        9. lower-fma.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \color{blue}{\mathsf{fma}\left(B, \frac{C}{A}, B\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
        10. lower-/.f6470.8

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}{\pi} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}} \]
        2. lift-/.f64N/A

          \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}} \]
        3. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}} \]
        4. clear-numN/A

          \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
        6. lower-/.f64N/A

          \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
      7. Applied rewrites68.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
      8. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
        3. clear-numN/A

          \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]
        5. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right) \cdot 180}}{\mathsf{PI}\left(\right)} \]
        6. associate-/l*N/A

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}} \]
        7. lower-*.f64N/A

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}} \]
      9. Applied rewrites71.1%

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

        \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)} \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
      11. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{1}{2} \cdot B}{A}\right)} \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
        2. *-commutativeN/A

          \[\leadsto \tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{1}{2}}}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
        3. associate-/l*N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{1}{2}}{A}\right)} \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
        4. lower-*.f64N/A

          \[\leadsto \tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{1}{2}}{A}\right)} \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
        5. lower-/.f6471.0

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

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

      if -0.070000000000000007 < A < 1.9000000000000001e-116

      1. Initial program 58.2%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
        3. div-subN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
        4. sub-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
        5. metadata-evalN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-+.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
        7. lower-/.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
        8. lower--.f6456.6

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + -1\right)}{\mathsf{PI}\left(\right)} \]
      7. Step-by-step derivation
        1. Applied rewrites56.1%

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

        if 1.9000000000000001e-116 < A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
          3. div-subN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
          4. sub-negN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
          5. metadata-evalN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
          6. lower-+.f64N/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
          7. lower-/.f64N/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
          8. lower--.f6474.2

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{A}{B} + -1\right)}{\mathsf{PI}\left(\right)} \]
        7. Step-by-step derivation
          1. Applied rewrites71.8%

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B} + -1\right)}{\pi} \]
        8. Recombined 3 regimes into one program.
        9. Final simplification64.3%

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

        Alternative 9: 59.4% accurate, 2.5× speedup?

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

          1. Initial program 22.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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
          4. Step-by-step derivation
            1. Applied rewrites10.9%

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
            2. Taylor expanded in A around -inf

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
            3. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{1}{2} \cdot B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
              2. *-commutativeN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{1}{2}}}{A}\right)}{\mathsf{PI}\left(\right)} \]
              3. associate-/l*N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{1}{2}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
              4. lower-*.f64N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{1}{2}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
              5. lower-/.f6470.7

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

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

            if -0.070000000000000007 < A < 1.9000000000000001e-116

            1. Initial program 58.2%

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
              3. div-subN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
              4. sub-negN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
              5. metadata-evalN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
              6. lower-+.f64N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
              7. lower-/.f64N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
              8. lower--.f6456.6

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + -1\right)}{\mathsf{PI}\left(\right)} \]
            7. Step-by-step derivation
              1. Applied rewrites56.1%

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

              if 1.9000000000000001e-116 < A

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
              4. Step-by-step derivation
                1. +-commutativeN/A

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
                3. div-subN/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
                4. sub-negN/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
                5. metadata-evalN/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
                6. lower-+.f64N/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
                7. lower-/.f64N/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
                8. lower--.f6474.2

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{A}{B} + -1\right)}{\mathsf{PI}\left(\right)} \]
              7. Step-by-step derivation
                1. Applied rewrites71.8%

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

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

              Alternative 10: 60.9% accurate, 2.5× speedup?

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

                1. Initial program 23.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 -inf

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

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(\frac{-1}{2} \cdot B + \frac{-1}{2} \cdot \frac{B \cdot C}{A}\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]
                  2. lower-/.f64N/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-1 \cdot \left(\frac{-1}{2} \cdot B + \frac{-1}{2} \cdot \frac{B \cdot C}{A}\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]
                  3. distribute-lft-outN/A

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

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right) \cdot \left(B + \frac{B \cdot C}{A}\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
                  5. metadata-evalN/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\frac{1}{2}} \cdot \left(B + \frac{B \cdot C}{A}\right)}{A}\right)}{\mathsf{PI}\left(\right)} \]
                  6. lower-*.f64N/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\frac{1}{2} \cdot \left(B + \frac{B \cdot C}{A}\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
                  7. +-commutativeN/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{B \cdot C}{A} + B\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
                  8. associate-/l*N/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \left(\color{blue}{B \cdot \frac{C}{A}} + B\right)}{A}\right)}{\mathsf{PI}\left(\right)} \]
                  9. lower-fma.f64N/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \color{blue}{\mathsf{fma}\left(B, \frac{C}{A}, B\right)}}{A}\right)}{\mathsf{PI}\left(\right)} \]
                  10. lower-/.f6469.2

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{0.5 \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}{\pi} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}} \]
                  2. lift-/.f64N/A

                    \[\leadsto 180 \cdot \color{blue}{\frac{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}} \]
                  3. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}} \]
                  4. clear-numN/A

                    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
                  5. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
                  6. lower-/.f64N/A

                    \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
                7. Applied rewrites67.2%

                  \[\leadsto \color{blue}{\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(\frac{0.5 \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
                8. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
                  2. lift-/.f64N/A

                    \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{PI}\left(\right)}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}} \]
                  3. clear-numN/A

                    \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}{\mathsf{PI}\left(\right)}} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\color{blue}{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right)}}{\mathsf{PI}\left(\right)} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right) \cdot 180}}{\mathsf{PI}\left(\right)} \]
                  6. associate-/l*N/A

                    \[\leadsto \color{blue}{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}} \]
                  7. lower-*.f64N/A

                    \[\leadsto \color{blue}{\tan^{-1} \left(\frac{\frac{1}{2} \cdot \mathsf{fma}\left(B, \frac{C}{A}, B\right)}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)}} \]
                9. Applied rewrites69.5%

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

                  \[\leadsto \tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)} \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
                11. Step-by-step derivation
                  1. associate-*r/N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\frac{1}{2} \cdot B}{A}\right)} \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
                  2. *-commutativeN/A

                    \[\leadsto \tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{1}{2}}}{A}\right) \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
                  3. associate-/l*N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{1}{2}}{A}\right)} \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
                  4. lower-*.f64N/A

                    \[\leadsto \tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{1}{2}}{A}\right)} \cdot \frac{180}{\mathsf{PI}\left(\right)} \]
                  5. lower-/.f6469.3

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

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

                if -8.50000000000000037e-11 < A

                1. Initial program 63.2%

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

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

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
                  3. div-subN/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
                  4. sub-negN/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
                  5. metadata-evalN/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
                  6. lower-+.f64N/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
                  7. lower-/.f64N/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
                  8. lower--.f6463.9

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

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

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

              Alternative 11: 49.4% accurate, 2.6× speedup?

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

                1. Initial program 22.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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                4. Step-by-step derivation
                  1. Applied rewrites10.9%

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
                  2. Taylor expanded in A around -inf

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
                  3. Step-by-step derivation
                    1. associate-*r/N/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{1}{2} \cdot B}{A}\right)}}{\mathsf{PI}\left(\right)} \]
                    2. *-commutativeN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{B \cdot \frac{1}{2}}}{A}\right)}{\mathsf{PI}\left(\right)} \]
                    3. associate-/l*N/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{1}{2}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
                    4. lower-*.f64N/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(B \cdot \frac{\frac{1}{2}}{A}\right)}}{\mathsf{PI}\left(\right)} \]
                    5. lower-/.f6470.7

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

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

                  if -0.070000000000000007 < A

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

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
                    3. div-subN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
                    4. sub-negN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
                    5. metadata-evalN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
                    6. lower-+.f64N/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
                    7. lower-/.f64N/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
                    8. lower--.f6463.4

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

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

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + -1\right)}{\mathsf{PI}\left(\right)} \]
                  7. Step-by-step derivation
                    1. Applied rewrites51.4%

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + -1\right)}{\pi} \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification56.0%

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

                  Alternative 12: 51.7% accurate, 2.6× speedup?

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

                    1. Initial program 49.1%

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
                    4. Step-by-step derivation
                      1. Applied rewrites53.3%

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

                      if -7.20000000000000038e-35 < B

                      1. Initial program 54.4%

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

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}}{\mathsf{PI}\left(\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)}}{\mathsf{PI}\left(\right)} \]
                        3. div-subN/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right)}{\mathsf{PI}\left(\right)} \]
                        4. sub-negN/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)}}{\mathsf{PI}\left(\right)} \]
                        5. metadata-evalN/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - A}{B} + \color{blue}{-1}\right)}{\mathsf{PI}\left(\right)} \]
                        6. lower-+.f64N/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{C - A}{B} + -1\right)}}{\mathsf{PI}\left(\right)} \]
                        7. lower-/.f64N/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + -1\right)}{\mathsf{PI}\left(\right)} \]
                        8. lower--.f6462.1

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

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

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + -1\right)}{\mathsf{PI}\left(\right)} \]
                      7. Step-by-step derivation
                        1. Applied rewrites52.4%

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} + -1\right)}{\pi} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification52.6%

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

                      Alternative 13: 45.3% accurate, 2.8× speedup?

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

                        1. Initial program 52.2%

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
                        4. Step-by-step derivation
                          1. Applied rewrites50.1%

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

                          if -2.14999999999999999e-85 < B < 3e-171

                          1. Initial program 57.9%

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

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                          4. Step-by-step derivation
                            1. distribute-rgt1-inN/A

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{\left(-1 + 1\right) \cdot A}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                            2. metadata-evalN/A

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{0} \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
                            3. mul0-lftN/A

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{0}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                            4. div0N/A

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \color{blue}{0}\right)}{\mathsf{PI}\left(\right)} \]
                            5. metadata-eval32.1

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\pi} \]
                          5. Applied rewrites32.1%

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

                          if 3e-171 < B

                          1. Initial program 50.3%

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

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                          4. Step-by-step derivation
                            1. Applied rewrites53.3%

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

                          Alternative 14: 29.3% accurate, 2.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 3 \cdot 10^{-171}:\\ \;\;\;\;180 \cdot \frac{\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 3e-171) (* 180.0 (/ (atan 0.0) PI)) (* 180.0 (/ (atan -1.0) PI))))
                          double code(double A, double B, double C) {
                          	double tmp;
                          	if (B <= 3e-171) {
                          		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 <= 3e-171) {
                          		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 <= 3e-171:
                          		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 <= 3e-171)
                          		tmp = Float64(180.0 * Float64(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 <= 3e-171)
                          		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, 3e-171], N[(180.0 * N[(N[ArcTan[0.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 3 \cdot 10^{-171}:\\
                          \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if B < 3e-171

                            1. Initial program 55.3%

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                            4. Step-by-step derivation
                              1. distribute-rgt1-inN/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{\left(-1 + 1\right) \cdot A}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              2. metadata-evalN/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{0} \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              3. mul0-lftN/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{0}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              4. div0N/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \color{blue}{0}\right)}{\mathsf{PI}\left(\right)} \]
                              5. metadata-eval18.8

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\pi} \]
                            5. Applied rewrites18.8%

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

                            if 3e-171 < B

                            1. Initial program 50.3%

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                            4. Step-by-step derivation
                              1. Applied rewrites53.3%

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

                            Alternative 15: 21.1% accurate, 3.1× 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.2%

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                            4. Step-by-step derivation
                              1. Applied rewrites25.3%

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

                              Reproduce

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