ABCF->ab-angle angle

Percentage Accurate: 54.1% → 75.4%
Time: 5.5s
Alternatives: 10
Speedup: 2.3×

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 10 alternatives:

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

Initial Program: 54.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: 75.4% accurate, 2.1× speedup?

\[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;C \leq 1.75 \cdot 10^{+72}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(C - A\right) - B\_m\right)\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\ \end{array} \end{array} \]
B\_m = (fabs.f64 B)
B\_s = (copysign.f64 #s(literal 1 binary64) B)
(FPCore (B_s A B_m C)
 :precision binary64
 (*
  B_s
  (if (<= C 1.75e+72)
    (/ (* 180.0 (atan (* (/ 1.0 B_m) (- (- C A) B_m)))) PI)
    (* 180.0 (/ (atan (* (/ B_m C) -0.5)) PI)))))
B\_m = fabs(B);
B\_s = copysign(1.0, B);
double code(double B_s, double A, double B_m, double C) {
	double tmp;
	if (C <= 1.75e+72) {
		tmp = (180.0 * atan(((1.0 / B_m) * ((C - A) - B_m)))) / ((double) M_PI);
	} else {
		tmp = 180.0 * (atan(((B_m / C) * -0.5)) / ((double) M_PI));
	}
	return B_s * tmp;
}
B\_m = Math.abs(B);
B\_s = Math.copySign(1.0, B);
public static double code(double B_s, double A, double B_m, double C) {
	double tmp;
	if (C <= 1.75e+72) {
		tmp = (180.0 * Math.atan(((1.0 / B_m) * ((C - A) - B_m)))) / Math.PI;
	} else {
		tmp = 180.0 * (Math.atan(((B_m / C) * -0.5)) / Math.PI);
	}
	return B_s * tmp;
}
B\_m = math.fabs(B)
B\_s = math.copysign(1.0, B)
def code(B_s, A, B_m, C):
	tmp = 0
	if C <= 1.75e+72:
		tmp = (180.0 * math.atan(((1.0 / B_m) * ((C - A) - B_m)))) / math.pi
	else:
		tmp = 180.0 * (math.atan(((B_m / C) * -0.5)) / math.pi)
	return B_s * tmp
B\_m = abs(B)
B\_s = copysign(1.0, B)
function code(B_s, A, B_m, C)
	tmp = 0.0
	if (C <= 1.75e+72)
		tmp = Float64(Float64(180.0 * atan(Float64(Float64(1.0 / B_m) * Float64(Float64(C - A) - B_m)))) / pi);
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B_m / C) * -0.5)) / pi));
	end
	return Float64(B_s * tmp)
end
B\_m = abs(B);
B\_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, A, B_m, C)
	tmp = 0.0;
	if (C <= 1.75e+72)
		tmp = (180.0 * atan(((1.0 / B_m) * ((C - A) - B_m)))) / pi;
	else
		tmp = 180.0 * (atan(((B_m / C) * -0.5)) / pi);
	end
	tmp_2 = B_s * tmp;
end
B\_m = N[Abs[B], $MachinePrecision]
B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, 1.75e+72], N[(N[(180.0 * N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B$95$m / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B\_m = \left|B\right|
\\
B\_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;C \leq 1.75 \cdot 10^{+72}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(C - A\right) - B\_m\right)\right)}{\pi}\\

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


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

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

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

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

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

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

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

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

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

      if 1.75000000000000005e72 < C

      1. Initial program 20.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-*.f6471.6

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

        \[\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} \]
      5. Taylor expanded in A around 0

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

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

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

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

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

    Alternative 2: 74.1% accurate, 2.0× speedup?

    \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;C \leq -3.3 \cdot 10^{-111}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(C - B\_m\right)\right)}{\pi}\\ \mathbf{elif}\;C \leq 1.75 \cdot 10^{+72}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(-A\right) - B\_m\right)\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\ \end{array} \end{array} \]
    B\_m = (fabs.f64 B)
    B\_s = (copysign.f64 #s(literal 1 binary64) B)
    (FPCore (B_s A B_m C)
     :precision binary64
     (*
      B_s
      (if (<= C -3.3e-111)
        (/ (* 180.0 (atan (* (/ 1.0 B_m) (- C B_m)))) PI)
        (if (<= C 1.75e+72)
          (/ (* 180.0 (atan (* (/ 1.0 B_m) (- (- A) B_m)))) PI)
          (* 180.0 (/ (atan (* (/ B_m C) -0.5)) PI))))))
    B\_m = fabs(B);
    B\_s = copysign(1.0, B);
    double code(double B_s, double A, double B_m, double C) {
    	double tmp;
    	if (C <= -3.3e-111) {
    		tmp = (180.0 * atan(((1.0 / B_m) * (C - B_m)))) / ((double) M_PI);
    	} else if (C <= 1.75e+72) {
    		tmp = (180.0 * atan(((1.0 / B_m) * (-A - B_m)))) / ((double) M_PI);
    	} else {
    		tmp = 180.0 * (atan(((B_m / C) * -0.5)) / ((double) M_PI));
    	}
    	return B_s * tmp;
    }
    
    B\_m = Math.abs(B);
    B\_s = Math.copySign(1.0, B);
    public static double code(double B_s, double A, double B_m, double C) {
    	double tmp;
    	if (C <= -3.3e-111) {
    		tmp = (180.0 * Math.atan(((1.0 / B_m) * (C - B_m)))) / Math.PI;
    	} else if (C <= 1.75e+72) {
    		tmp = (180.0 * Math.atan(((1.0 / B_m) * (-A - B_m)))) / Math.PI;
    	} else {
    		tmp = 180.0 * (Math.atan(((B_m / C) * -0.5)) / Math.PI);
    	}
    	return B_s * tmp;
    }
    
    B\_m = math.fabs(B)
    B\_s = math.copysign(1.0, B)
    def code(B_s, A, B_m, C):
    	tmp = 0
    	if C <= -3.3e-111:
    		tmp = (180.0 * math.atan(((1.0 / B_m) * (C - B_m)))) / math.pi
    	elif C <= 1.75e+72:
    		tmp = (180.0 * math.atan(((1.0 / B_m) * (-A - B_m)))) / math.pi
    	else:
    		tmp = 180.0 * (math.atan(((B_m / C) * -0.5)) / math.pi)
    	return B_s * tmp
    
    B\_m = abs(B)
    B\_s = copysign(1.0, B)
    function code(B_s, A, B_m, C)
    	tmp = 0.0
    	if (C <= -3.3e-111)
    		tmp = Float64(Float64(180.0 * atan(Float64(Float64(1.0 / B_m) * Float64(C - B_m)))) / pi);
    	elseif (C <= 1.75e+72)
    		tmp = Float64(Float64(180.0 * atan(Float64(Float64(1.0 / B_m) * Float64(Float64(-A) - B_m)))) / pi);
    	else
    		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B_m / C) * -0.5)) / pi));
    	end
    	return Float64(B_s * tmp)
    end
    
    B\_m = abs(B);
    B\_s = sign(B) * abs(1.0);
    function tmp_2 = code(B_s, A, B_m, C)
    	tmp = 0.0;
    	if (C <= -3.3e-111)
    		tmp = (180.0 * atan(((1.0 / B_m) * (C - B_m)))) / pi;
    	elseif (C <= 1.75e+72)
    		tmp = (180.0 * atan(((1.0 / B_m) * (-A - B_m)))) / pi;
    	else
    		tmp = 180.0 * (atan(((B_m / C) * -0.5)) / pi);
    	end
    	tmp_2 = B_s * tmp;
    end
    
    B\_m = N[Abs[B], $MachinePrecision]
    B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, -3.3e-111], N[(N[(180.0 * N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 1.75e+72], N[(N[(180.0 * N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[((-A) - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B$95$m / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
    
    \begin{array}{l}
    B\_m = \left|B\right|
    \\
    B\_s = \mathsf{copysign}\left(1, B\right)
    
    \\
    B\_s \cdot \begin{array}{l}
    \mathbf{if}\;C \leq -3.3 \cdot 10^{-111}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(C - B\_m\right)\right)}{\pi}\\
    
    \mathbf{elif}\;C \leq 1.75 \cdot 10^{+72}:\\
    \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(\left(-A\right) - B\_m\right)\right)}{\pi}\\
    
    \mathbf{else}:\\
    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if C < -3.3e-111

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

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

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

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

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

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

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

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

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

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

          if -3.3e-111 < C < 1.75000000000000005e72

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

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

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

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

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

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

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

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

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

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

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

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

            if 1.75000000000000005e72 < C

            1. Initial program 20.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-*.f6471.6

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

              \[\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} \]
            5. Taylor expanded in A around 0

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

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

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

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

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

          Alternative 3: 66.3% accurate, 2.3× speedup?

          \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;C \leq 6 \cdot 10^{+38}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(C - B\_m\right)\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\ \end{array} \end{array} \]
          B\_m = (fabs.f64 B)
          B\_s = (copysign.f64 #s(literal 1 binary64) B)
          (FPCore (B_s A B_m C)
           :precision binary64
           (*
            B_s
            (if (<= C 6e+38)
              (/ (* 180.0 (atan (* (/ 1.0 B_m) (- C B_m)))) PI)
              (* 180.0 (/ (atan (* (/ B_m C) -0.5)) PI)))))
          B\_m = fabs(B);
          B\_s = copysign(1.0, B);
          double code(double B_s, double A, double B_m, double C) {
          	double tmp;
          	if (C <= 6e+38) {
          		tmp = (180.0 * atan(((1.0 / B_m) * (C - B_m)))) / ((double) M_PI);
          	} else {
          		tmp = 180.0 * (atan(((B_m / C) * -0.5)) / ((double) M_PI));
          	}
          	return B_s * tmp;
          }
          
          B\_m = Math.abs(B);
          B\_s = Math.copySign(1.0, B);
          public static double code(double B_s, double A, double B_m, double C) {
          	double tmp;
          	if (C <= 6e+38) {
          		tmp = (180.0 * Math.atan(((1.0 / B_m) * (C - B_m)))) / Math.PI;
          	} else {
          		tmp = 180.0 * (Math.atan(((B_m / C) * -0.5)) / Math.PI);
          	}
          	return B_s * tmp;
          }
          
          B\_m = math.fabs(B)
          B\_s = math.copysign(1.0, B)
          def code(B_s, A, B_m, C):
          	tmp = 0
          	if C <= 6e+38:
          		tmp = (180.0 * math.atan(((1.0 / B_m) * (C - B_m)))) / math.pi
          	else:
          		tmp = 180.0 * (math.atan(((B_m / C) * -0.5)) / math.pi)
          	return B_s * tmp
          
          B\_m = abs(B)
          B\_s = copysign(1.0, B)
          function code(B_s, A, B_m, C)
          	tmp = 0.0
          	if (C <= 6e+38)
          		tmp = Float64(Float64(180.0 * atan(Float64(Float64(1.0 / B_m) * Float64(C - B_m)))) / pi);
          	else
          		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B_m / C) * -0.5)) / pi));
          	end
          	return Float64(B_s * tmp)
          end
          
          B\_m = abs(B);
          B\_s = sign(B) * abs(1.0);
          function tmp_2 = code(B_s, A, B_m, C)
          	tmp = 0.0;
          	if (C <= 6e+38)
          		tmp = (180.0 * atan(((1.0 / B_m) * (C - B_m)))) / pi;
          	else
          		tmp = 180.0 * (atan(((B_m / C) * -0.5)) / pi);
          	end
          	tmp_2 = B_s * tmp;
          end
          
          B\_m = N[Abs[B], $MachinePrecision]
          B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, 6e+38], N[(N[(180.0 * N[ArcTan[N[(N[(1.0 / B$95$m), $MachinePrecision] * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B$95$m / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
          
          \begin{array}{l}
          B\_m = \left|B\right|
          \\
          B\_s = \mathsf{copysign}\left(1, B\right)
          
          \\
          B\_s \cdot \begin{array}{l}
          \mathbf{if}\;C \leq 6 \cdot 10^{+38}:\\
          \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{1}{B\_m} \cdot \left(C - B\_m\right)\right)}{\pi}\\
          
          \mathbf{else}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if C < 6.0000000000000002e38

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

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

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

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

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

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

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

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

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

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

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

                if 6.0000000000000002e38 < C

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

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

                  \[\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} \]
                5. Taylor expanded in A around 0

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

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

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

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

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

              Alternative 4: 59.2% accurate, 2.2× speedup?

              \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;C \leq -37000000000000:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C + C}{B\_m}\right)}{\pi}\\ \mathbf{elif}\;C \leq 7 \cdot 10^{+39}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\ \end{array} \end{array} \]
              B\_m = (fabs.f64 B)
              B\_s = (copysign.f64 #s(literal 1 binary64) B)
              (FPCore (B_s A B_m C)
               :precision binary64
               (*
                B_s
                (if (<= C -37000000000000.0)
                  (/ (* 180.0 (atan (/ (+ C C) B_m))) PI)
                  (if (<= C 7e+39)
                    (* 180.0 (/ (atan -1.0) PI))
                    (* 180.0 (/ (atan (* (/ B_m C) -0.5)) PI))))))
              B\_m = fabs(B);
              B\_s = copysign(1.0, B);
              double code(double B_s, double A, double B_m, double C) {
              	double tmp;
              	if (C <= -37000000000000.0) {
              		tmp = (180.0 * atan(((C + C) / B_m))) / ((double) M_PI);
              	} else if (C <= 7e+39) {
              		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
              	} else {
              		tmp = 180.0 * (atan(((B_m / C) * -0.5)) / ((double) M_PI));
              	}
              	return B_s * tmp;
              }
              
              B\_m = Math.abs(B);
              B\_s = Math.copySign(1.0, B);
              public static double code(double B_s, double A, double B_m, double C) {
              	double tmp;
              	if (C <= -37000000000000.0) {
              		tmp = (180.0 * Math.atan(((C + C) / B_m))) / Math.PI;
              	} else if (C <= 7e+39) {
              		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
              	} else {
              		tmp = 180.0 * (Math.atan(((B_m / C) * -0.5)) / Math.PI);
              	}
              	return B_s * tmp;
              }
              
              B\_m = math.fabs(B)
              B\_s = math.copysign(1.0, B)
              def code(B_s, A, B_m, C):
              	tmp = 0
              	if C <= -37000000000000.0:
              		tmp = (180.0 * math.atan(((C + C) / B_m))) / math.pi
              	elif C <= 7e+39:
              		tmp = 180.0 * (math.atan(-1.0) / math.pi)
              	else:
              		tmp = 180.0 * (math.atan(((B_m / C) * -0.5)) / math.pi)
              	return B_s * tmp
              
              B\_m = abs(B)
              B\_s = copysign(1.0, B)
              function code(B_s, A, B_m, C)
              	tmp = 0.0
              	if (C <= -37000000000000.0)
              		tmp = Float64(Float64(180.0 * atan(Float64(Float64(C + C) / B_m))) / pi);
              	elseif (C <= 7e+39)
              		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
              	else
              		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B_m / C) * -0.5)) / pi));
              	end
              	return Float64(B_s * tmp)
              end
              
              B\_m = abs(B);
              B\_s = sign(B) * abs(1.0);
              function tmp_2 = code(B_s, A, B_m, C)
              	tmp = 0.0;
              	if (C <= -37000000000000.0)
              		tmp = (180.0 * atan(((C + C) / B_m))) / pi;
              	elseif (C <= 7e+39)
              		tmp = 180.0 * (atan(-1.0) / pi);
              	else
              		tmp = 180.0 * (atan(((B_m / C) * -0.5)) / pi);
              	end
              	tmp_2 = B_s * tmp;
              end
              
              B\_m = N[Abs[B], $MachinePrecision]
              B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
              code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, -37000000000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(C + C), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[C, 7e+39], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B$95$m / C), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
              
              \begin{array}{l}
              B\_m = \left|B\right|
              \\
              B\_s = \mathsf{copysign}\left(1, B\right)
              
              \\
              B\_s \cdot \begin{array}{l}
              \mathbf{if}\;C \leq -37000000000000:\\
              \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C + C}{B\_m}\right)}{\pi}\\
              
              \mathbf{elif}\;C \leq 7 \cdot 10^{+39}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
              
              \mathbf{else}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B\_m}{C} \cdot -0.5\right)}{\pi}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if C < -3.7e13

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -3.7e13 < C < 7.0000000000000003e39

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

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

                    if 7.0000000000000003e39 < C

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

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

                      \[\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} \]
                    5. Taylor expanded in A around 0

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

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

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

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

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

                  Alternative 5: 58.9% accurate, 2.2× speedup?

                  \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;A \leq -8.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right)}{\pi}\\ \mathbf{elif}\;A \leq 460000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                  B\_m = (fabs.f64 B)
                  B\_s = (copysign.f64 #s(literal 1 binary64) B)
                  (FPCore (B_s A B_m C)
                   :precision binary64
                   (*
                    B_s
                    (if (<= A -8.5e-54)
                      (/ (* 180.0 (atan (* (/ B_m A) 0.5))) PI)
                      (if (<= A 460000.0)
                        (* 180.0 (/ (atan -1.0) PI))
                        (* (/ (atan (* (/ A B_m) -2.0)) PI) 180.0)))))
                  B\_m = fabs(B);
                  B\_s = copysign(1.0, B);
                  double code(double B_s, double A, double B_m, double C) {
                  	double tmp;
                  	if (A <= -8.5e-54) {
                  		tmp = (180.0 * atan(((B_m / A) * 0.5))) / ((double) M_PI);
                  	} else if (A <= 460000.0) {
                  		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
                  	} else {
                  		tmp = (atan(((A / B_m) * -2.0)) / ((double) M_PI)) * 180.0;
                  	}
                  	return B_s * tmp;
                  }
                  
                  B\_m = Math.abs(B);
                  B\_s = Math.copySign(1.0, B);
                  public static double code(double B_s, double A, double B_m, double C) {
                  	double tmp;
                  	if (A <= -8.5e-54) {
                  		tmp = (180.0 * Math.atan(((B_m / A) * 0.5))) / Math.PI;
                  	} else if (A <= 460000.0) {
                  		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
                  	} else {
                  		tmp = (Math.atan(((A / B_m) * -2.0)) / Math.PI) * 180.0;
                  	}
                  	return B_s * tmp;
                  }
                  
                  B\_m = math.fabs(B)
                  B\_s = math.copysign(1.0, B)
                  def code(B_s, A, B_m, C):
                  	tmp = 0
                  	if A <= -8.5e-54:
                  		tmp = (180.0 * math.atan(((B_m / A) * 0.5))) / math.pi
                  	elif A <= 460000.0:
                  		tmp = 180.0 * (math.atan(-1.0) / math.pi)
                  	else:
                  		tmp = (math.atan(((A / B_m) * -2.0)) / math.pi) * 180.0
                  	return B_s * tmp
                  
                  B\_m = abs(B)
                  B\_s = copysign(1.0, B)
                  function code(B_s, A, B_m, C)
                  	tmp = 0.0
                  	if (A <= -8.5e-54)
                  		tmp = Float64(Float64(180.0 * atan(Float64(Float64(B_m / A) * 0.5))) / pi);
                  	elseif (A <= 460000.0)
                  		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
                  	else
                  		tmp = Float64(Float64(atan(Float64(Float64(A / B_m) * -2.0)) / pi) * 180.0);
                  	end
                  	return Float64(B_s * tmp)
                  end
                  
                  B\_m = abs(B);
                  B\_s = sign(B) * abs(1.0);
                  function tmp_2 = code(B_s, A, B_m, C)
                  	tmp = 0.0;
                  	if (A <= -8.5e-54)
                  		tmp = (180.0 * atan(((B_m / A) * 0.5))) / pi;
                  	elseif (A <= 460000.0)
                  		tmp = 180.0 * (atan(-1.0) / pi);
                  	else
                  		tmp = (atan(((A / B_m) * -2.0)) / pi) * 180.0;
                  	end
                  	tmp_2 = B_s * tmp;
                  end
                  
                  B\_m = N[Abs[B], $MachinePrecision]
                  B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                  code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[A, -8.5e-54], N[(N[(180.0 * N[ArcTan[N[(N[(B$95$m / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 460000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(A / B$95$m), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]), $MachinePrecision]
                  
                  \begin{array}{l}
                  B\_m = \left|B\right|
                  \\
                  B\_s = \mathsf{copysign}\left(1, B\right)
                  
                  \\
                  B\_s \cdot \begin{array}{l}
                  \mathbf{if}\;A \leq -8.5 \cdot 10^{-54}:\\
                  \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right)}{\pi}\\
                  
                  \mathbf{elif}\;A \leq 460000:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if A < -8.5e-54

                    1. Initial program 28.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 -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-/.f6461.5

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

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

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

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

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

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

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

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

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

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

                    if -8.5e-54 < A < 4.6e5

                    1. Initial program 59.4%

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

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

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

                      if 4.6e5 < A

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

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

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

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

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

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

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

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

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

                    Alternative 6: 58.9% accurate, 2.2× speedup?

                    \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;A \leq -8.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right)}{\pi} \cdot 180\\ \mathbf{elif}\;A \leq 460000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                    B\_m = (fabs.f64 B)
                    B\_s = (copysign.f64 #s(literal 1 binary64) B)
                    (FPCore (B_s A B_m C)
                     :precision binary64
                     (*
                      B_s
                      (if (<= A -8.5e-54)
                        (* (/ (atan (* (/ B_m A) 0.5)) PI) 180.0)
                        (if (<= A 460000.0)
                          (* 180.0 (/ (atan -1.0) PI))
                          (* (/ (atan (* (/ A B_m) -2.0)) PI) 180.0)))))
                    B\_m = fabs(B);
                    B\_s = copysign(1.0, B);
                    double code(double B_s, double A, double B_m, double C) {
                    	double tmp;
                    	if (A <= -8.5e-54) {
                    		tmp = (atan(((B_m / A) * 0.5)) / ((double) M_PI)) * 180.0;
                    	} else if (A <= 460000.0) {
                    		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
                    	} else {
                    		tmp = (atan(((A / B_m) * -2.0)) / ((double) M_PI)) * 180.0;
                    	}
                    	return B_s * tmp;
                    }
                    
                    B\_m = Math.abs(B);
                    B\_s = Math.copySign(1.0, B);
                    public static double code(double B_s, double A, double B_m, double C) {
                    	double tmp;
                    	if (A <= -8.5e-54) {
                    		tmp = (Math.atan(((B_m / A) * 0.5)) / Math.PI) * 180.0;
                    	} else if (A <= 460000.0) {
                    		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
                    	} else {
                    		tmp = (Math.atan(((A / B_m) * -2.0)) / Math.PI) * 180.0;
                    	}
                    	return B_s * tmp;
                    }
                    
                    B\_m = math.fabs(B)
                    B\_s = math.copysign(1.0, B)
                    def code(B_s, A, B_m, C):
                    	tmp = 0
                    	if A <= -8.5e-54:
                    		tmp = (math.atan(((B_m / A) * 0.5)) / math.pi) * 180.0
                    	elif A <= 460000.0:
                    		tmp = 180.0 * (math.atan(-1.0) / math.pi)
                    	else:
                    		tmp = (math.atan(((A / B_m) * -2.0)) / math.pi) * 180.0
                    	return B_s * tmp
                    
                    B\_m = abs(B)
                    B\_s = copysign(1.0, B)
                    function code(B_s, A, B_m, C)
                    	tmp = 0.0
                    	if (A <= -8.5e-54)
                    		tmp = Float64(Float64(atan(Float64(Float64(B_m / A) * 0.5)) / pi) * 180.0);
                    	elseif (A <= 460000.0)
                    		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
                    	else
                    		tmp = Float64(Float64(atan(Float64(Float64(A / B_m) * -2.0)) / pi) * 180.0);
                    	end
                    	return Float64(B_s * tmp)
                    end
                    
                    B\_m = abs(B);
                    B\_s = sign(B) * abs(1.0);
                    function tmp_2 = code(B_s, A, B_m, C)
                    	tmp = 0.0;
                    	if (A <= -8.5e-54)
                    		tmp = (atan(((B_m / A) * 0.5)) / pi) * 180.0;
                    	elseif (A <= 460000.0)
                    		tmp = 180.0 * (atan(-1.0) / pi);
                    	else
                    		tmp = (atan(((A / B_m) * -2.0)) / pi) * 180.0;
                    	end
                    	tmp_2 = B_s * tmp;
                    end
                    
                    B\_m = N[Abs[B], $MachinePrecision]
                    B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                    code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[A, -8.5e-54], N[(N[(N[ArcTan[N[(N[(B$95$m / A), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[A, 460000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(A / B$95$m), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]), $MachinePrecision]
                    
                    \begin{array}{l}
                    B\_m = \left|B\right|
                    \\
                    B\_s = \mathsf{copysign}\left(1, B\right)
                    
                    \\
                    B\_s \cdot \begin{array}{l}
                    \mathbf{if}\;A \leq -8.5 \cdot 10^{-54}:\\
                    \;\;\;\;\frac{\tan^{-1} \left(\frac{B\_m}{A} \cdot 0.5\right)}{\pi} \cdot 180\\
                    
                    \mathbf{elif}\;A \leq 460000:\\
                    \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if A < -8.5e-54

                      1. Initial program 28.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 -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-/.f6461.5

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

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

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

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

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

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

                      if -8.5e-54 < A < 4.6e5

                      1. Initial program 59.4%

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

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

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

                        if 4.6e5 < A

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

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

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

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

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

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

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

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

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

                      Alternative 7: 51.7% accurate, 2.2× speedup?

                      \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;A \leq -4.45 \cdot 10^{+173}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B\_m}\right)}{\pi}\\ \mathbf{elif}\;A \leq 460000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                      B\_m = (fabs.f64 B)
                      B\_s = (copysign.f64 #s(literal 1 binary64) B)
                      (FPCore (B_s A B_m C)
                       :precision binary64
                       (*
                        B_s
                        (if (<= A -4.45e+173)
                          (/ (* 180.0 (atan (/ 0.0 B_m))) PI)
                          (if (<= A 460000.0)
                            (* 180.0 (/ (atan -1.0) PI))
                            (* (/ (atan (* (/ A B_m) -2.0)) PI) 180.0)))))
                      B\_m = fabs(B);
                      B\_s = copysign(1.0, B);
                      double code(double B_s, double A, double B_m, double C) {
                      	double tmp;
                      	if (A <= -4.45e+173) {
                      		tmp = (180.0 * atan((0.0 / B_m))) / ((double) M_PI);
                      	} else if (A <= 460000.0) {
                      		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
                      	} else {
                      		tmp = (atan(((A / B_m) * -2.0)) / ((double) M_PI)) * 180.0;
                      	}
                      	return B_s * tmp;
                      }
                      
                      B\_m = Math.abs(B);
                      B\_s = Math.copySign(1.0, B);
                      public static double code(double B_s, double A, double B_m, double C) {
                      	double tmp;
                      	if (A <= -4.45e+173) {
                      		tmp = (180.0 * Math.atan((0.0 / B_m))) / Math.PI;
                      	} else if (A <= 460000.0) {
                      		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
                      	} else {
                      		tmp = (Math.atan(((A / B_m) * -2.0)) / Math.PI) * 180.0;
                      	}
                      	return B_s * tmp;
                      }
                      
                      B\_m = math.fabs(B)
                      B\_s = math.copysign(1.0, B)
                      def code(B_s, A, B_m, C):
                      	tmp = 0
                      	if A <= -4.45e+173:
                      		tmp = (180.0 * math.atan((0.0 / B_m))) / math.pi
                      	elif A <= 460000.0:
                      		tmp = 180.0 * (math.atan(-1.0) / math.pi)
                      	else:
                      		tmp = (math.atan(((A / B_m) * -2.0)) / math.pi) * 180.0
                      	return B_s * tmp
                      
                      B\_m = abs(B)
                      B\_s = copysign(1.0, B)
                      function code(B_s, A, B_m, C)
                      	tmp = 0.0
                      	if (A <= -4.45e+173)
                      		tmp = Float64(Float64(180.0 * atan(Float64(0.0 / B_m))) / pi);
                      	elseif (A <= 460000.0)
                      		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
                      	else
                      		tmp = Float64(Float64(atan(Float64(Float64(A / B_m) * -2.0)) / pi) * 180.0);
                      	end
                      	return Float64(B_s * tmp)
                      end
                      
                      B\_m = abs(B);
                      B\_s = sign(B) * abs(1.0);
                      function tmp_2 = code(B_s, A, B_m, C)
                      	tmp = 0.0;
                      	if (A <= -4.45e+173)
                      		tmp = (180.0 * atan((0.0 / B_m))) / pi;
                      	elseif (A <= 460000.0)
                      		tmp = 180.0 * (atan(-1.0) / pi);
                      	else
                      		tmp = (atan(((A / B_m) * -2.0)) / pi) * 180.0;
                      	end
                      	tmp_2 = B_s * tmp;
                      end
                      
                      B\_m = N[Abs[B], $MachinePrecision]
                      B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                      code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[A, -4.45e+173], N[(N[(180.0 * N[ArcTan[N[(0.0 / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 460000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(A / B$95$m), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]), $MachinePrecision]
                      
                      \begin{array}{l}
                      B\_m = \left|B\right|
                      \\
                      B\_s = \mathsf{copysign}\left(1, B\right)
                      
                      \\
                      B\_s \cdot \begin{array}{l}
                      \mathbf{if}\;A \leq -4.45 \cdot 10^{+173}:\\
                      \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B\_m}\right)}{\pi}\\
                      
                      \mathbf{elif}\;A \leq 460000:\\
                      \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{\tan^{-1} \left(\frac{A}{B\_m} \cdot -2\right)}{\pi} \cdot 180\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if A < -4.45000000000000008e173

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(0 \cdot A\right) \cdot -1}{B}\right)}{\pi} \]
                              5. mul0-lftN/A

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

                                \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{0}{B}\right)}{\pi} \]
                              7. mul0-lftN/A

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

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

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

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

                            if -4.45000000000000008e173 < A < 4.6e5

                            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 rewrites47.9%

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

                              if 4.6e5 < A

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

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

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

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

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

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

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

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

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

                            Alternative 8: 49.3% accurate, 2.5× speedup?

                            \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;C \leq -37000000000000:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C + C}{B\_m}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
                            B\_m = (fabs.f64 B)
                            B\_s = (copysign.f64 #s(literal 1 binary64) B)
                            (FPCore (B_s A B_m C)
                             :precision binary64
                             (*
                              B_s
                              (if (<= C -37000000000000.0)
                                (/ (* 180.0 (atan (/ (+ C C) B_m))) PI)
                                (* 180.0 (/ (atan -1.0) PI)))))
                            B\_m = fabs(B);
                            B\_s = copysign(1.0, B);
                            double code(double B_s, double A, double B_m, double C) {
                            	double tmp;
                            	if (C <= -37000000000000.0) {
                            		tmp = (180.0 * atan(((C + C) / B_m))) / ((double) M_PI);
                            	} else {
                            		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
                            	}
                            	return B_s * tmp;
                            }
                            
                            B\_m = Math.abs(B);
                            B\_s = Math.copySign(1.0, B);
                            public static double code(double B_s, double A, double B_m, double C) {
                            	double tmp;
                            	if (C <= -37000000000000.0) {
                            		tmp = (180.0 * Math.atan(((C + C) / B_m))) / Math.PI;
                            	} else {
                            		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
                            	}
                            	return B_s * tmp;
                            }
                            
                            B\_m = math.fabs(B)
                            B\_s = math.copysign(1.0, B)
                            def code(B_s, A, B_m, C):
                            	tmp = 0
                            	if C <= -37000000000000.0:
                            		tmp = (180.0 * math.atan(((C + C) / B_m))) / math.pi
                            	else:
                            		tmp = 180.0 * (math.atan(-1.0) / math.pi)
                            	return B_s * tmp
                            
                            B\_m = abs(B)
                            B\_s = copysign(1.0, B)
                            function code(B_s, A, B_m, C)
                            	tmp = 0.0
                            	if (C <= -37000000000000.0)
                            		tmp = Float64(Float64(180.0 * atan(Float64(Float64(C + C) / B_m))) / pi);
                            	else
                            		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
                            	end
                            	return Float64(B_s * tmp)
                            end
                            
                            B\_m = abs(B);
                            B\_s = sign(B) * abs(1.0);
                            function tmp_2 = code(B_s, A, B_m, C)
                            	tmp = 0.0;
                            	if (C <= -37000000000000.0)
                            		tmp = (180.0 * atan(((C + C) / B_m))) / pi;
                            	else
                            		tmp = 180.0 * (atan(-1.0) / pi);
                            	end
                            	tmp_2 = B_s * tmp;
                            end
                            
                            B\_m = N[Abs[B], $MachinePrecision]
                            B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                            code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[C, -37000000000000.0], N[(N[(180.0 * N[ArcTan[N[(N[(C + C), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                            
                            \begin{array}{l}
                            B\_m = \left|B\right|
                            \\
                            B\_s = \mathsf{copysign}\left(1, B\right)
                            
                            \\
                            B\_s \cdot \begin{array}{l}
                            \mathbf{if}\;C \leq -37000000000000:\\
                            \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C + C}{B\_m}\right)}{\pi}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if C < -3.7e13

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if -3.7e13 < C

                                1. Initial program 47.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 rewrites43.0%

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

                                Alternative 9: 45.9% accurate, 2.8× speedup?

                                \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;B\_m \leq 1.65 \cdot 10^{-96}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B\_m}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
                                B\_m = (fabs.f64 B)
                                B\_s = (copysign.f64 #s(literal 1 binary64) B)
                                (FPCore (B_s A B_m C)
                                 :precision binary64
                                 (*
                                  B_s
                                  (if (<= B_m 1.65e-96)
                                    (/ (* 180.0 (atan (/ 0.0 B_m))) PI)
                                    (* 180.0 (/ (atan -1.0) PI)))))
                                B\_m = fabs(B);
                                B\_s = copysign(1.0, B);
                                double code(double B_s, double A, double B_m, double C) {
                                	double tmp;
                                	if (B_m <= 1.65e-96) {
                                		tmp = (180.0 * atan((0.0 / B_m))) / ((double) M_PI);
                                	} else {
                                		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
                                	}
                                	return B_s * tmp;
                                }
                                
                                B\_m = Math.abs(B);
                                B\_s = Math.copySign(1.0, B);
                                public static double code(double B_s, double A, double B_m, double C) {
                                	double tmp;
                                	if (B_m <= 1.65e-96) {
                                		tmp = (180.0 * Math.atan((0.0 / B_m))) / Math.PI;
                                	} else {
                                		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
                                	}
                                	return B_s * tmp;
                                }
                                
                                B\_m = math.fabs(B)
                                B\_s = math.copysign(1.0, B)
                                def code(B_s, A, B_m, C):
                                	tmp = 0
                                	if B_m <= 1.65e-96:
                                		tmp = (180.0 * math.atan((0.0 / B_m))) / math.pi
                                	else:
                                		tmp = 180.0 * (math.atan(-1.0) / math.pi)
                                	return B_s * tmp
                                
                                B\_m = abs(B)
                                B\_s = copysign(1.0, B)
                                function code(B_s, A, B_m, C)
                                	tmp = 0.0
                                	if (B_m <= 1.65e-96)
                                		tmp = Float64(Float64(180.0 * atan(Float64(0.0 / B_m))) / pi);
                                	else
                                		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
                                	end
                                	return Float64(B_s * tmp)
                                end
                                
                                B\_m = abs(B);
                                B\_s = sign(B) * abs(1.0);
                                function tmp_2 = code(B_s, A, B_m, C)
                                	tmp = 0.0;
                                	if (B_m <= 1.65e-96)
                                		tmp = (180.0 * atan((0.0 / B_m))) / pi;
                                	else
                                		tmp = 180.0 * (atan(-1.0) / pi);
                                	end
                                	tmp_2 = B_s * tmp;
                                end
                                
                                B\_m = N[Abs[B], $MachinePrecision]
                                B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * If[LessEqual[B$95$m, 1.65e-96], N[(N[(180.0 * N[ArcTan[N[(0.0 / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                
                                \begin{array}{l}
                                B\_m = \left|B\right|
                                \\
                                B\_s = \mathsf{copysign}\left(1, B\right)
                                
                                \\
                                B\_s \cdot \begin{array}{l}
                                \mathbf{if}\;B\_m \leq 1.65 \cdot 10^{-96}:\\
                                \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B\_m}\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 < 1.64999999999999995e-96

                                  1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{\left(0 \cdot A\right) \cdot -1}{B}\right)}{\pi} \]
                                        5. mul0-lftN/A

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

                                          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{0}{B}\right)}{\pi} \]
                                        7. mul0-lftN/A

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

                                          \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{0 \cdot A}{\color{blue}{B}}\right)}{\pi} \]
                                        9. mul0-lft29.7

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

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

                                      if 1.64999999999999995e-96 < B

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

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

                                      Alternative 10: 40.6% accurate, 4.1× speedup?

                                      \[\begin{array}{l} B\_m = \left|B\right| \\ B\_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \left(180 \cdot \frac{\tan^{-1} -1}{\pi}\right) \end{array} \]
                                      B\_m = (fabs.f64 B)
                                      B\_s = (copysign.f64 #s(literal 1 binary64) B)
                                      (FPCore (B_s A B_m C) :precision binary64 (* B_s (* 180.0 (/ (atan -1.0) PI))))
                                      B\_m = fabs(B);
                                      B\_s = copysign(1.0, B);
                                      double code(double B_s, double A, double B_m, double C) {
                                      	return B_s * (180.0 * (atan(-1.0) / ((double) M_PI)));
                                      }
                                      
                                      B\_m = Math.abs(B);
                                      B\_s = Math.copySign(1.0, B);
                                      public static double code(double B_s, double A, double B_m, double C) {
                                      	return B_s * (180.0 * (Math.atan(-1.0) / Math.PI));
                                      }
                                      
                                      B\_m = math.fabs(B)
                                      B\_s = math.copysign(1.0, B)
                                      def code(B_s, A, B_m, C):
                                      	return B_s * (180.0 * (math.atan(-1.0) / math.pi))
                                      
                                      B\_m = abs(B)
                                      B\_s = copysign(1.0, B)
                                      function code(B_s, A, B_m, C)
                                      	return Float64(B_s * Float64(180.0 * Float64(atan(-1.0) / pi)))
                                      end
                                      
                                      B\_m = abs(B);
                                      B\_s = sign(B) * abs(1.0);
                                      function tmp = code(B_s, A, B_m, C)
                                      	tmp = B_s * (180.0 * (atan(-1.0) / pi));
                                      end
                                      
                                      B\_m = N[Abs[B], $MachinePrecision]
                                      B\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                      code[B$95$s_, A_, B$95$m_, C_] := N[(B$95$s * N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      B\_m = \left|B\right|
                                      \\
                                      B\_s = \mathsf{copysign}\left(1, B\right)
                                      
                                      \\
                                      B\_s \cdot \left(180 \cdot \frac{\tan^{-1} -1}{\pi}\right)
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 54.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 rewrites40.6%

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

                                        Reproduce

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