ABCF->ab-angle angle

Percentage Accurate: 54.0% → 82.7%
Time: 7.5s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 54.0% 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: 82.7% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 8.2000000000000003e-140

    1. Initial program 65.8%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
    2. Add Preprocessing
    3. 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)}{\pi}} \]
      2. lift-PI.f64N/A

        \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
      3. 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)}} \]
    4. Applied rewrites90.7%

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

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

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

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

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

    if 8.2000000000000003e-140 < C

    1. Initial program 30.4%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
    2. Add Preprocessing
    3. 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)}{\pi}} \]
      2. lift-PI.f64N/A

        \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
      3. 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)}} \]
    4. Applied rewrites58.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(-1 \cdot \frac{B}{C + \sqrt{B \cdot B + C \cdot C}}\right)}{\pi} \]
      6. lift-hypot.f6478.1

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

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

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

Alternative 2: 72.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := 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}\\
\mathbf{if}\;t\_0 \leq -40:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - B\right)\right)}{\pi}\\

\mathbf{elif}\;t\_0 \leq 0.1:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64))) < -40

    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 B around inf

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

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

      if -40 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64))) < 0.10000000000000001

      1. Initial program 25.4%

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

          \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
        3. 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)}} \]
      4. Applied rewrites25.4%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(A + -1 \cdot A\right) \cdot -1}{B}\right)\right)}{\pi} \]
        7. distribute-rgt1-inN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(\left(-1 + 1\right) \cdot A\right) \cdot -1}{B}\right)\right)}{\pi} \]
        8. metadata-evalN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(0 \cdot A\right) \cdot -1}{B}\right)\right)}{\pi} \]
        9. mul0-lftN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0 \cdot -1}{B}\right)\right)}{\pi} \]
        10. metadata-evalN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\pi} \]
        11. mul0-lftN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0 \cdot A}{B}\right)\right)}{\pi} \]
        12. metadata-evalN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(-1 + 1\right) \cdot A}{B}\right)\right)}{\pi} \]
        13. distribute-rgt1-inN/A

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

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{A + -1 \cdot A}{B}\right)\right)}{\pi} \]
        15. distribute-rgt1-inN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(-1 + 1\right) \cdot A}{B}\right)\right)}{\pi} \]
        16. metadata-evalN/A

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0 \cdot A}{B}\right)\right)}{\pi} \]
        17. mul0-lft56.9

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}{\pi} \]
      9. Applied rewrites56.9%

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

      if 0.10000000000000001 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64)))

      1. Initial program 57.1%

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

          \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
        3. 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)}} \]
      4. Applied rewrites91.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;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} \leq -40:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - B\right)\right)}{\pi}\\ \mathbf{elif}\;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} \leq 0.1:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C - A}{B}\right)}{\pi}\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 73.0% accurate, 0.4× speedup?

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

      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} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{B}\right)\right)}{\pi} \]
      4. Step-by-step derivation
        1. Applied rewrites75.1%

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

        if -1 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64))) < 0.0

        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. 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)}{\pi}} \]
          2. lift-PI.f64N/A

            \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
          3. 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)}} \]
        4. Applied rewrites22.5%

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

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

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

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

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

        if 0.0 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64)))

        1. Initial program 57.0%

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

            \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
          3. 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)}} \]
        4. Applied rewrites90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 67.6% accurate, 0.4× speedup?

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

        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} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \color{blue}{B}\right)\right)}{\pi} \]
        4. Step-by-step derivation
          1. Applied rewrites75.1%

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

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

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

            if -1 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64))) < 0.0

            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. 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)}{\pi}} \]
              2. lift-PI.f64N/A

                \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
              3. 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)}} \]
            4. Applied rewrites22.5%

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

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

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

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

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

            if 0.0 < (*.f64 #s(literal 180 binary64) (/.f64 (atan.f64 (*.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))))))) (PI.f64)))

            1. Initial program 57.0%

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

                \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
              3. 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)}} \]
            4. Applied rewrites90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 86.4% accurate, 1.5× speedup?

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

            1. Initial program 26.5%

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

                \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
              3. 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)}} \]
            4. Applied rewrites71.5%

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

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

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

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

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

            if -3.39999999999999999e120 < A < 9.5999999999999994e103

            1. Initial program 50.4%

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

                \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
              3. 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)}} \]
            4. Applied rewrites74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(-1 \cdot \frac{B}{C + \sqrt{B \cdot B + C \cdot C}}\right)}{\pi} \]
              6. lift-hypot.f6487.3

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

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

            if 9.5999999999999994e103 < A

            1. Initial program 74.6%

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

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

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

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\sqrt{{A}^{2} + {B}^{2}} + A}{B}\right)}{\pi} \]
              5. lower-+.f64N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\sqrt{{A}^{2} + {B}^{2}} + A}{B}\right)}{\pi} \]
              6. unpow2N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\sqrt{A \cdot A + {B}^{2}} + A}{B}\right)}{\pi} \]
              7. unpow2N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\sqrt{A \cdot A + B \cdot B} + A}{B}\right)}{\pi} \]
              8. lower-hypot.f6484.9

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

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

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

          Alternative 6: 77.8% accurate, 1.5× speedup?

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

            1. Initial program 77.4%

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

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}{\pi} \]
              3. +-commutativeN/A

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{C \cdot C + B \cdot B}}{B}\right)}{\pi} \]
              6. lower-hypot.f6488.2

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

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

            if -3.00000000000000002e66 < C < 1.10000000000000005e113

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

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

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

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\sqrt{{A}^{2} + {B}^{2}} + A}{B}\right)}{\pi} \]
              5. lower-+.f64N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\sqrt{{A}^{2} + {B}^{2}} + A}{B}\right)}{\pi} \]
              6. unpow2N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\sqrt{A \cdot A + {B}^{2}} + A}{B}\right)}{\pi} \]
              7. unpow2N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\sqrt{A \cdot A + B \cdot B} + A}{B}\right)}{\pi} \]
              8. lower-hypot.f6475.0

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\mathsf{hypot}\left(A, B\right) + A}{B}\right)}{\pi} \]
            5. Applied rewrites75.0%

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

            if 1.10000000000000005e113 < C

            1. Initial program 20.5%

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

                \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
              3. 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)}} \]
            4. Applied rewrites55.7%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(A + -1 \cdot A\right) \cdot -1}{B}\right)\right)}{\pi} \]
              7. distribute-rgt1-inN/A

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(\left(-1 + 1\right) \cdot A\right) \cdot -1}{B}\right)\right)}{\pi} \]
              8. metadata-evalN/A

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(0 \cdot A\right) \cdot -1}{B}\right)\right)}{\pi} \]
              9. mul0-lftN/A

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0 \cdot -1}{B}\right)\right)}{\pi} \]
              10. metadata-evalN/A

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0}{B}\right)\right)}{\pi} \]
              11. mul0-lftN/A

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0 \cdot A}{B}\right)\right)}{\pi} \]
              12. metadata-evalN/A

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(-1 + 1\right) \cdot A}{B}\right)\right)}{\pi} \]
              13. distribute-rgt1-inN/A

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

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{A + -1 \cdot A}{B}\right)\right)}{\pi} \]
              15. distribute-rgt1-inN/A

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{\left(-1 + 1\right) \cdot A}{B}\right)\right)}{\pi} \]
              16. metadata-evalN/A

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{0 \cdot A}{B}\right)\right)}{\pi} \]
              17. mul0-lft79.8

                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, \frac{0}{B}\right)\right)}{\pi} \]
            9. Applied rewrites79.8%

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

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

          Alternative 7: 45.6% accurate, 2.4× speedup?

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

            1. Initial program 37.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}}{\pi} \]
            4. Step-by-step derivation
              1. Applied rewrites77.3%

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

              if -4.30000000000000001e74 < B < -6.39999999999999976e-163

              1. Initial program 59.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(-2 \cdot \frac{A}{B}\right)}}{\pi} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

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

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi} \]
              5. Applied rewrites40.3%

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

              if -6.39999999999999976e-163 < B < 8.1999999999999997e-27

              1. Initial program 54.4%

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

                  \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
                3. 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)}} \]
              4. Applied rewrites75.0%

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

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

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

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

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

              if 8.1999999999999997e-27 < B

              1. Initial program 52.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}}{\pi} \]
              4. Step-by-step derivation
                1. Applied rewrites59.3%

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -4.3 \cdot 10^{+74}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -6.4 \cdot 10^{-163}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\ \mathbf{elif}\;B \leq 8.2 \cdot 10^{-27}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
              7. Add Preprocessing

              Alternative 8: 45.6% accurate, 2.4× speedup?

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

                1. Initial program 37.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}}{\pi} \]
                4. Step-by-step derivation
                  1. Applied rewrites77.3%

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

                  if -4.30000000000000001e74 < B < -6.39999999999999976e-163

                  1. Initial program 59.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(-2 \cdot \frac{A}{B}\right)}}{\pi} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi} \]
                  5. Applied rewrites40.3%

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

                  if -6.39999999999999976e-163 < B < 8.1999999999999997e-27

                  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 A around -inf

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot \color{blue}{\frac{1}{2}}\right)}{\pi} \]
                    3. lower-/.f6441.9

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

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

                  if 8.1999999999999997e-27 < B

                  1. Initial program 52.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}}{\pi} \]
                  4. Step-by-step derivation
                    1. Applied rewrites59.3%

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -4.3 \cdot 10^{+74}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -6.4 \cdot 10^{-163}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\ \mathbf{elif}\;B \leq 8.2 \cdot 10^{-27}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 9: 44.9% accurate, 2.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -4.3 \cdot 10^{+74}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -5.5 \cdot 10^{-155}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\ \mathbf{elif}\;B \leq 4.6 \cdot 10^{-80}:\\ \;\;\;\;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 -4.3e+74)
                     (* 180.0 (/ (atan 1.0) PI))
                     (if (<= B -5.5e-155)
                       (* 180.0 (/ (atan (* (/ A B) -2.0)) PI))
                       (if (<= B 4.6e-80)
                         (* 180.0 (/ (atan 0.0) PI))
                         (* 180.0 (/ (atan -1.0) PI))))))
                  double code(double A, double B, double C) {
                  	double tmp;
                  	if (B <= -4.3e+74) {
                  		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
                  	} else if (B <= -5.5e-155) {
                  		tmp = 180.0 * (atan(((A / B) * -2.0)) / ((double) M_PI));
                  	} else if (B <= 4.6e-80) {
                  		tmp = 180.0 * (atan(0.0) / ((double) M_PI));
                  	} else {
                  		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
                  	}
                  	return tmp;
                  }
                  
                  public static double code(double A, double B, double C) {
                  	double tmp;
                  	if (B <= -4.3e+74) {
                  		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
                  	} else if (B <= -5.5e-155) {
                  		tmp = 180.0 * (Math.atan(((A / B) * -2.0)) / Math.PI);
                  	} else if (B <= 4.6e-80) {
                  		tmp = 180.0 * (Math.atan(0.0) / Math.PI);
                  	} else {
                  		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
                  	}
                  	return tmp;
                  }
                  
                  def code(A, B, C):
                  	tmp = 0
                  	if B <= -4.3e+74:
                  		tmp = 180.0 * (math.atan(1.0) / math.pi)
                  	elif B <= -5.5e-155:
                  		tmp = 180.0 * (math.atan(((A / B) * -2.0)) / math.pi)
                  	elif B <= 4.6e-80:
                  		tmp = 180.0 * (math.atan(0.0) / math.pi)
                  	else:
                  		tmp = 180.0 * (math.atan(-1.0) / math.pi)
                  	return tmp
                  
                  function code(A, B, C)
                  	tmp = 0.0
                  	if (B <= -4.3e+74)
                  		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
                  	elseif (B <= -5.5e-155)
                  		tmp = Float64(180.0 * Float64(atan(Float64(Float64(A / B) * -2.0)) / pi));
                  	elseif (B <= 4.6e-80)
                  		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 <= -4.3e+74)
                  		tmp = 180.0 * (atan(1.0) / pi);
                  	elseif (B <= -5.5e-155)
                  		tmp = 180.0 * (atan(((A / B) * -2.0)) / pi);
                  	elseif (B <= 4.6e-80)
                  		tmp = 180.0 * (atan(0.0) / pi);
                  	else
                  		tmp = 180.0 * (atan(-1.0) / pi);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[A_, B_, C_] := If[LessEqual[B, -4.3e+74], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -5.5e-155], N[(180.0 * N[(N[ArcTan[N[(N[(A / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.6e-80], 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 -4.3 \cdot 10^{+74}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
                  
                  \mathbf{elif}\;B \leq -5.5 \cdot 10^{-155}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\
                  
                  \mathbf{elif}\;B \leq 4.6 \cdot 10^{-80}:\\
                  \;\;\;\;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 4 regimes
                  2. if B < -4.30000000000000001e74

                    1. Initial program 37.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}}{\pi} \]
                    4. Step-by-step derivation
                      1. Applied rewrites77.3%

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

                      if -4.30000000000000001e74 < B < -5.50000000000000018e-155

                      1. Initial program 61.3%

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot \color{blue}{-2}\right)}{\pi} \]
                        3. lower-/.f6441.6

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi} \]
                      5. Applied rewrites41.6%

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

                      if -5.50000000000000018e-155 < B < 4.5999999999999996e-80

                      1. Initial program 51.6%

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{A + -1 \cdot A}{B}\right)}{\pi} \]
                        3. lower-/.f64N/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{A + -1 \cdot A}{B}\right)}{\pi} \]
                        4. distribute-rgt1-inN/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\left(-1 + 1\right) \cdot A}{B}\right)}{\pi} \]
                        5. metadata-evalN/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{0 \cdot A}{B}\right)}{\pi} \]
                        6. lower-*.f6436.3

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{0 \cdot A}{B}\right)}{\pi} \]
                      5. Applied rewrites36.3%

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

                        \[\leadsto 180 \cdot \frac{\tan^{-1} 0}{\pi} \]
                      7. Step-by-step derivation
                        1. Applied rewrites36.3%

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

                        if 4.5999999999999996e-80 < B

                        1. Initial program 53.9%

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
                        4. Step-by-step derivation
                          1. Applied rewrites56.2%

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -4.3 \cdot 10^{+74}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -5.5 \cdot 10^{-155}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A}{B} \cdot -2\right)}{\pi}\\ \mathbf{elif}\;B \leq 4.6 \cdot 10^{-80}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
                        7. Add Preprocessing

                        Alternative 10: 61.2% accurate, 2.5× speedup?

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

                          1. Initial program 27.4%

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

                              \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
                            3. 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)}} \]
                          4. Applied rewrites63.0%

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

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

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

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

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

                          if -7.79999999999999948e-33 < A

                          1. Initial program 59.6%

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

                              \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
                            3. 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)}} \]
                          4. Applied rewrites82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 11: 61.2% accurate, 2.5× speedup?

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

                          1. Initial program 27.4%

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

                              \[\leadsto 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)}{\color{blue}{\mathsf{PI}\left(\right)}} \]
                            3. 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)}} \]
                          4. Applied rewrites63.0%

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

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

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

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

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

                          if -7.79999999999999948e-33 < A

                          1. Initial program 59.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}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}}{\pi} \]
                          4. Step-by-step derivation
                            1. associate--l+N/A

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

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

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

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

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

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

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

                        Alternative 12: 45.1% accurate, 2.8× speedup?

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

                          1. Initial program 49.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}{1}}{\pi} \]
                          4. Step-by-step derivation
                            1. Applied rewrites46.7%

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

                            if -1.4999999999999999e-129 < B < 4.5999999999999996e-80

                            1. Initial program 52.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)}}{\pi} \]
                            4. Step-by-step derivation
                              1. mul-1-negN/A

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{A + -1 \cdot A}{B}\right)}{\pi} \]
                              3. lower-/.f64N/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{A + -1 \cdot A}{B}\right)}{\pi} \]
                              4. distribute-rgt1-inN/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{\left(-1 + 1\right) \cdot A}{B}\right)}{\pi} \]
                              5. metadata-evalN/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-\frac{0 \cdot A}{B}\right)}{\pi} \]
                              6. lower-*.f6435.6

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

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} 0}{\pi} \]
                            7. Step-by-step derivation
                              1. Applied rewrites35.6%

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

                              if 4.5999999999999996e-80 < B

                              1. Initial program 53.9%

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
                              4. Step-by-step derivation
                                1. Applied rewrites56.2%

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1.5 \cdot 10^{-129}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 4.6 \cdot 10^{-80}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 13: 40.5% accurate, 2.9× speedup?

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

                                1. Initial program 50.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}{1}}{\pi} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites35.8%

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

                                  if -3.999999999999988e-310 < B

                                  1. Initial program 53.0%

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

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites38.4%

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -4 \cdot 10^{-310}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
                                  7. Add Preprocessing

                                  Alternative 14: 21.0% 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 51.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}{-1}}{\pi} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites19.7%

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\pi} \]
                                    2. Final simplification19.7%

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

                                    Reproduce

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