ABCF->ab-angle angle

Percentage Accurate: 53.1% → 80.9%
Time: 5.5s
Alternatives: 17
Speedup: 2.6×

Specification

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 53.1% 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: 80.9% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 2.10000000000000001e80

    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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.10000000000000001e80 < C

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

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

        \[\leadsto 180 \cdot \frac{\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 180 \cdot \frac{\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 180 \cdot \frac{\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 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}{\pi} \]
      5. mul-1-negN/A

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

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

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

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

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

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

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

Alternative 2: 72.4% 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{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, -\frac{0 \cdot A}{B}\right)\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 (/ (- (fma -1.0 B C) A) B)) PI))
     (if (<= t_0 0.0)
       (/ (* 180.0 (atan (fma (/ B C) -0.5 (- (/ (* 0.0 A) B))))) PI)
       (* 180.0 (/ (atan (/ (- (+ C B) 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(((fma(-1.0, B, C) - A) / B)) / ((double) M_PI));
	} else if (t_0 <= 0.0) {
		tmp = (180.0 * atan(fma((B / C), -0.5, -((0.0 * A) / B)))) / ((double) M_PI);
	} else {
		tmp = 180.0 * (atan((((C + B) - 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(fma(-1.0, B, C) - A) / B)) / pi));
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64(180.0 * atan(fma(Float64(B / C), -0.5, Float64(-Float64(Float64(0.0 * A) / B))))) / pi);
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - 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[(N[(-1.0 * B + C), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5 + (-N[(N[(0.0 * A), $MachinePrecision] / B), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $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{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi}\\

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

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 59.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
      10. lift--.f6486.5

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\frac{C}{B} - 1\right) - \frac{A}{B}\right) \cdot B}{B}\right)}{\pi} \]
      8. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\mathsf{neg}\left(B\right)\right) + C\right) - A}{B}\right)}{\pi} \]
      4. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-1 \cdot B + C\right) - A}{B}\right)}{\pi} \]
      5. lower-fma.f6475.6

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi} \]
    10. Applied rewrites75.6%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\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.0

    1. Initial program 18.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{B}{C} \cdot \frac{-1}{2} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}{\pi} \]
      5. lower-fma.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} \]
      6. 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} \]
      7. mul-1-negN/A

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \mathsf{neg}\left(\frac{A + -1 \cdot A}{B}\right)\right)\right)}{\pi} \]
      8. lower-neg.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} \]
      9. 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} \]
      10. 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} \]
      11. 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} \]
      12. lower-*.f6451.5

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

      \[\leadsto \frac{180 \cdot \tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, -\frac{0 \cdot A}{B}\right)\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 58.3%

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

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

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

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

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

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

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

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

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

Alternative 3: 72.4% 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{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, -\frac{0 \cdot A}{B}\right)\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 (/ (- (fma -1.0 B C) A) B)) PI))
     (if (<= t_0 0.0)
       (* 180.0 (/ (atan (fma (/ B C) -0.5 (- (/ (* 0.0 A) B)))) PI))
       (* 180.0 (/ (atan (/ (- (+ C B) 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(((fma(-1.0, B, C) - A) / B)) / ((double) M_PI));
	} else if (t_0 <= 0.0) {
		tmp = 180.0 * (atan(fma((B / C), -0.5, -((0.0 * A) / B))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((((C + B) - 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(fma(-1.0, B, C) - A) / B)) / pi));
	elseif (t_0 <= 0.0)
		tmp = Float64(180.0 * Float64(atan(fma(Float64(B / C), -0.5, Float64(-Float64(Float64(0.0 * A) / B)))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - 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[(N[(-1.0 * B + C), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(180.0 * N[(N[ArcTan[N[(N[(B / C), $MachinePrecision] * -0.5 + (-N[(N[(0.0 * A), $MachinePrecision] / B), $MachinePrecision])), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $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{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi}\\

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

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 59.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
      10. lift--.f6486.5

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\frac{C}{B} - 1\right) - \frac{A}{B}\right) \cdot B}{B}\right)}{\pi} \]
      8. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\mathsf{neg}\left(B\right)\right) + C\right) - A}{B}\right)}{\pi} \]
      4. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-1 \cdot B + C\right) - A}{B}\right)}{\pi} \]
      5. lower-fma.f6475.6

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi} \]
    10. Applied rewrites75.6%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\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.0

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

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

        \[\leadsto 180 \cdot \frac{\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 180 \cdot \frac{\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 180 \cdot \frac{\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 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}{\pi} \]
      5. mul-1-negN/A

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

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

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

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, -0.5, -\frac{0 \cdot A}{B}\right)\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 58.3%

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

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

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

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

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

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

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

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

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

Alternative 4: 61.1% accurate, 0.4× speedup?

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

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

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

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

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


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

    1. Initial program 59.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
      10. lift--.f6486.5

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\frac{C}{B} - 1\right) - \frac{A}{B}\right) \cdot B}{B}\right)}{\pi} \]
      8. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\mathsf{neg}\left(B\right)\right) + C\right) - A}{B}\right)}{\pi} \]
      4. mul-1-negN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-1 \cdot B + C\right) - A}{B}\right)}{\pi} \]
      5. lower-fma.f6475.6

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi} \]
    10. Applied rewrites75.6%

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

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

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

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

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

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

    1. Initial program 18.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 95.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. 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} \]
    3. 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--.f6493.6

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

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

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

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

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

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

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

    1. Initial program 43.5%

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

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

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

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

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

    Alternative 5: 61.1% accurate, 0.4× speedup?

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

      1. Initial program 59.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
        10. lift--.f6486.5

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

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

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\frac{C}{B} - 1\right) - \frac{A}{B}\right) \cdot B}{B}\right)}{\pi} \]
        8. lift-/.f64N/A

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\mathsf{neg}\left(B\right)\right) + C\right) - A}{B}\right)}{\pi} \]
        4. mul-1-negN/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-1 \cdot B + C\right) - A}{B}\right)}{\pi} \]
        5. lower-fma.f6475.6

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi} \]
      10. Applied rewrites75.6%

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

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

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

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

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

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

      1. Initial program 18.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. Taylor expanded in A around -inf

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}}{\pi} \]
      3. 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-/.f6449.9

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

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

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

      1. Initial program 95.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. 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} \]
      3. 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--.f6493.6

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

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

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

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

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

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

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

      1. Initial program 43.5%

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

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

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

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

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

      Alternative 6: 72.2% 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{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 (/ (- (fma -1.0 B C) A) B)) PI))
           (if (<= t_0 0.0)
             (/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
             (* 180.0 (/ (atan (/ (- (+ C B) 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(((fma(-1.0, B, C) - A) / B)) / ((double) M_PI));
      	} else if (t_0 <= 0.0) {
      		tmp = (180.0 * atan(((B / A) * 0.5))) / ((double) M_PI);
      	} else {
      		tmp = 180.0 * (atan((((C + B) - 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(fma(-1.0, B, C) - A) / B)) / pi));
      	elseif (t_0 <= 0.0)
      		tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / pi);
      	else
      		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - 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[(N[(-1.0 * B + C), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $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{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi}\\
      
      \mathbf{elif}\;t\_0 \leq 0:\\
      \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
      
      \mathbf{else}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 59.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
          10. lift--.f6486.5

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

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

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\frac{C}{B} - 1\right) - \frac{A}{B}\right) \cdot B}{B}\right)}{\pi} \]
          8. lift-/.f64N/A

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\mathsf{neg}\left(B\right)\right) + C\right) - A}{B}\right)}{\pi} \]
          4. mul-1-negN/A

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-1 \cdot B + C\right) - A}{B}\right)}{\pi} \]
          5. lower-fma.f6475.6

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi} \]
        10. Applied rewrites75.6%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\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.0

        1. Initial program 18.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\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 58.3%

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

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

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

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

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

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

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

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

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

      Alternative 7: 72.2% 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:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - B}{B}\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 (/ (- (- C A) B) B))) PI)
           (if (<= t_0 0.0)
             (/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
             (* 180.0 (/ (atan (/ (- (+ C B) 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((((C - A) - B) / B))) / ((double) M_PI);
      	} else if (t_0 <= 0.0) {
      		tmp = (180.0 * atan(((B / A) * 0.5))) / ((double) M_PI);
      	} else {
      		tmp = 180.0 * (atan((((C + B) - 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 <= -40.0) {
      		tmp = (180.0 * Math.atan((((C - A) - B) / B))) / Math.PI;
      	} else if (t_0 <= 0.0) {
      		tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
      	} else {
      		tmp = 180.0 * (Math.atan((((C + B) - 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 <= -40.0:
      		tmp = (180.0 * math.atan((((C - A) - B) / B))) / math.pi
      	elif t_0 <= 0.0:
      		tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi
      	else:
      		tmp = 180.0 * (math.atan((((C + B) - 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 <= -40.0)
      		tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(C - A) - B) / B))) / pi);
      	elseif (t_0 <= 0.0)
      		tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / pi);
      	else
      		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - 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 <= -40.0)
      		tmp = (180.0 * atan((((C - A) - B) / B))) / pi;
      	elseif (t_0 <= 0.0)
      		tmp = (180.0 * atan(((B / A) * 0.5))) / pi;
      	else
      		tmp = 180.0 * (atan((((C + B) - 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, -40.0], N[(N[(180.0 * N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $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:\\
      \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - B}{B}\right)}{\pi}\\
      
      \mathbf{elif}\;t\_0 \leq 0:\\
      \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
      
      \mathbf{else}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 59.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
          10. lift--.f6486.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(C - A\right) - B}{B}\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.0

          1. Initial program 18.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\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 58.3%

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

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

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

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

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

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

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

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

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

        Alternative 8: 66.8% 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{\left(-B\right) - A}{B}\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 (/ (- (- B) A) B)) PI))
             (if (<= t_0 0.0)
               (/ (* 180.0 (atan (* (/ B A) 0.5))) PI)
               (* 180.0 (/ (atan (/ (- (+ C B) 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(((-B - A) / B)) / ((double) M_PI));
        	} else if (t_0 <= 0.0) {
        		tmp = (180.0 * atan(((B / A) * 0.5))) / ((double) M_PI);
        	} else {
        		tmp = 180.0 * (atan((((C + B) - 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 <= -40.0) {
        		tmp = 180.0 * (Math.atan(((-B - A) / B)) / Math.PI);
        	} else if (t_0 <= 0.0) {
        		tmp = (180.0 * Math.atan(((B / A) * 0.5))) / Math.PI;
        	} else {
        		tmp = 180.0 * (Math.atan((((C + B) - 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 <= -40.0:
        		tmp = 180.0 * (math.atan(((-B - A) / B)) / math.pi)
        	elif t_0 <= 0.0:
        		tmp = (180.0 * math.atan(((B / A) * 0.5))) / math.pi
        	else:
        		tmp = 180.0 * (math.atan((((C + B) - 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 <= -40.0)
        		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-B) - A) / B)) / pi));
        	elseif (t_0 <= 0.0)
        		tmp = Float64(Float64(180.0 * atan(Float64(Float64(B / A) * 0.5))) / pi);
        	else
        		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C + B) - 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 <= -40.0)
        		tmp = 180.0 * (atan(((-B - A) / B)) / pi);
        	elseif (t_0 <= 0.0)
        		tmp = (180.0 * atan(((B / A) * 0.5))) / pi;
        	else
        		tmp = 180.0 * (atan((((C + B) - 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, -40.0], N[(180.0 * N[(N[ArcTan[N[(N[((-B) - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(180.0 * N[ArcTan[N[(N[(B / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C + B), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $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{\left(-B\right) - A}{B}\right)}{\pi}\\
        
        \mathbf{elif}\;t\_0 \leq 0:\\
        \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
        
        \mathbf{else}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - 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 59.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
            10. lift--.f6486.5

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

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

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

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

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

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\frac{C}{B} - 1\right) - \frac{A}{B}\right) \cdot B}{B}\right)}{\pi} \]
            8. lift-/.f64N/A

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

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

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\mathsf{neg}\left(B\right)\right) + C\right) - A}{B}\right)}{\pi} \]
            4. mul-1-negN/A

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-1 \cdot B + C\right) - A}{B}\right)}{\pi} \]
            5. lower-fma.f6475.6

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi} \]
          10. Applied rewrites75.6%

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-B\right) - A}{B}\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.0

          1. Initial program 18.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{B}{A} \cdot 0.5\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 58.3%

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

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

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

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

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

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

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

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

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

        Alternative 9: 77.7% accurate, 1.5× speedup?

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

          1. Initial program 74.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. 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} \]
          3. 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.f6486.2

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

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

          if -8.50000000000000012e-50 < C < 1.94999999999999999e80

          1. Initial program 54.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. 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} \]
          3. 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.f6474.6

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

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

          if 1.94999999999999999e80 < C

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

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

              \[\leadsto 180 \cdot \frac{\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 180 \cdot \frac{\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 180 \cdot \frac{\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 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, -1 \cdot \frac{A + -1 \cdot A}{B}\right)\right)}{\pi} \]
            5. mul-1-negN/A

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

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

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

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

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

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

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

        Alternative 10: 74.2% accurate, 1.5× speedup?

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

          1. Initial program 24.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
            10. lift--.f6456.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{180 \cdot \tan^{-1} \left(-\frac{\frac{-1}{2} \cdot \left(B + B \cdot \frac{C}{A}\right)}{A}\right)}{\pi} \]
            11. lower-/.f6465.9

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

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

            \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \frac{B \cdot C}{A} - \frac{-1}{2} \cdot B}{A}\right)}{\pi} \]
          11. Step-by-step derivation
            1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

          if -9.6e8 < A < 0.00209999999999999987

          1. Initial program 56.4%

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

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

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

          if 0.00209999999999999987 < A

          1. Initial program 75.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. 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} \]
          3. 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--.f6477.2

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

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

        Alternative 11: 79.2% accurate, 1.5× speedup?

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

          1. Initial program 24.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
            10. lift--.f6456.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{180 \cdot \tan^{-1} \left(-\frac{\frac{-1}{2} \cdot \left(B + B \cdot \frac{C}{A}\right)}{A}\right)}{\pi} \]
            11. lower-/.f6465.9

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

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

            \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\frac{1}{2} \cdot \frac{B \cdot C}{A} - \frac{-1}{2} \cdot B}{A}\right)}{\pi} \]
          11. Step-by-step derivation
            1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

          if -9.6e8 < A

          1. Initial program 62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 12: 50.7% accurate, 2.5× speedup?

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

          1. Initial program 51.2%

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

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

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

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

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

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

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

          if -4.5000000000000001e-214 < B < 1e20

          1. Initial program 59.2%

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{\color{blue}{B}}\right)}{\pi} \]
          6. Step-by-step derivation
            1. lift-/.f6433.0

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi} \]
          7. Applied rewrites33.0%

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

          if 1e20 < B

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

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

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

          Alternative 13: 46.5% accurate, 2.5× speedup?

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

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

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

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

              if -1.90000000000000019e-68 < B < 1e20

              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. 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} \]
              3. 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--.f6448.6

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{\color{blue}{B}}\right)}{\pi} \]
              6. Step-by-step derivation
                1. lift-/.f6432.5

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

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

              if 1e20 < B

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

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

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

              Alternative 14: 55.3% accurate, 2.6× speedup?

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

                1. Initial program 52.8%

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

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

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

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

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

                  if -1.15e-300 < B

                  1. Initial program 53.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(A - C, B\right)}{B}\right)}{\pi} \]
                    10. lift--.f6477.8

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

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

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

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

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\frac{C}{B} - 1\right) - \frac{A}{B}\right) \cdot B}{B}\right)}{\pi} \]
                    8. lift-/.f64N/A

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

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(\left(\mathsf{neg}\left(B\right)\right) + C\right) - A}{B}\right)}{\pi} \]
                    4. mul-1-negN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\left(-1 \cdot B + C\right) - A}{B}\right)}{\pi} \]
                    5. lower-fma.f6465.6

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(-1, B, C\right) - A}{B}\right)}{\pi} \]
                  10. Applied rewrites65.6%

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

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

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

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

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

                Alternative 15: 50.9% accurate, 2.6× speedup?

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

                  1. Initial program 54.0%

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

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

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

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

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

                    if 6.49999999999999991e-132 < B

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

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

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

                    Alternative 16: 39.7% accurate, 2.9× speedup?

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

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

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

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

                        if -4.999999999999985e-310 < B

                        1. Initial program 53.4%

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

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

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

                        Alternative 17: 20.9% accurate, 3.1× speedup?

                        \[\begin{array}{l} \\ 180 \cdot \frac{\tan^{-1} -1}{\pi} \end{array} \]
                        (FPCore (A B C) :precision binary64 (* 180.0 (/ (atan -1.0) PI)))
                        double code(double A, double B, double C) {
                        	return 180.0 * (atan(-1.0) / ((double) M_PI));
                        }
                        
                        public static double code(double A, double B, double C) {
                        	return 180.0 * (Math.atan(-1.0) / Math.PI);
                        }
                        
                        def code(A, B, C):
                        	return 180.0 * (math.atan(-1.0) / math.pi)
                        
                        function code(A, B, C)
                        	return Float64(180.0 * Float64(atan(-1.0) / pi))
                        end
                        
                        function tmp = code(A, B, C)
                        	tmp = 180.0 * (atan(-1.0) / pi);
                        end
                        
                        code[A_, B_, C_] := N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        180 \cdot \frac{\tan^{-1} -1}{\pi}
                        \end{array}
                        
                        Derivation
                        1. Initial program 53.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. Taylor expanded in B around inf

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

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

                          Reproduce

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