ABCF->ab-angle angle

Percentage Accurate: 53.7% → 73.2%
Time: 5.8s
Alternatives: 12
Speedup: 2.5×

Specification

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

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

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

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

Initial Program: 53.7% accurate, 1.0× speedup?

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

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

Alternative 1: 73.2% accurate, 0.4× speedup?

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

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

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

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


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

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

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

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

      1. Initial program 18.3%

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

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

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

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

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

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

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

      1. Initial program 60.2%

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

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

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

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

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

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

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

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

    Alternative 2: 67.7% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

        1. Initial program 18.3%

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

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

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

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

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

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

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

        1. Initial program 60.2%

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

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

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

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

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

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

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

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

      Alternative 3: 62.9% accurate, 2.5× speedup?

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

        1. Initial program 55.7%

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

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

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

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

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

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

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

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

        if 3.39999999999999981e29 < B

        1. Initial program 47.2%

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

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}}{B}\right)}{\pi} \]
          8. lower-*.f6442.7

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

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

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

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

        Alternative 4: 62.7% accurate, 2.5× speedup?

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

          1. Initial program 26.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 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-/.f6462.5

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

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

          if -1.8999999999999999e-18 < A < 5.80000000000000038e-84

          1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

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

            if 5.80000000000000038e-84 < A

            1. Initial program 73.3%

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

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

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

          Alternative 5: 56.2% accurate, 0.6× speedup?

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

            1. Initial program 58.8%

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

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

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

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

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

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

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}}{B}\right)}{\pi} \]
              8. lower-*.f6449.6

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

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

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

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

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

              1. Initial program 18.3%

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

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

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

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

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

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

              1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

              Alternative 6: 55.7% accurate, 2.5× speedup?

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

                1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

                  if -1.18e-291 < B < 8.0000000000000003e-203

                  1. Initial program 61.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 C around inf

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

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

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

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

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

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

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

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

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

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

                    if 8.0000000000000003e-203 < B

                    1. Initial program 51.6%

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

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

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

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

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

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

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

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

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C - \sqrt{\mathsf{fma}\left(C, C, B \cdot B\right)}}{B}\right)}{\pi} \]
                      8. lower-*.f6444.0

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

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

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

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

                    Alternative 7: 51.5% accurate, 2.4× speedup?

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

                      1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

                        if -1.18e-291 < B < 9.19999999999999966e-203

                        1. Initial program 61.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 C around inf

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

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

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

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

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

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

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

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

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

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

                          if 9.19999999999999966e-203 < B < 3.39999999999999981e29

                          1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 3.39999999999999981e29 < B

                          1. Initial program 47.2%

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

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

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

                          Alternative 8: 47.5% accurate, 2.3× speedup?

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

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

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

                              if -9.0000000000000002e-39 < B < -1.18e-291

                              1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

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

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

                              if -1.18e-291 < B < 9.19999999999999966e-203

                              1. Initial program 61.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 C around inf

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

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

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

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

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

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

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

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

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

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

                                if 9.19999999999999966e-203 < B < 3.39999999999999981e29

                                1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if 3.39999999999999981e29 < B

                                1. Initial program 47.2%

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

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

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

                                Alternative 9: 46.7% accurate, 2.5× speedup?

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

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

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

                                    if -9.0000000000000002e-39 < B < 1.35000000000000001e-8

                                    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

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

                                    if 1.35000000000000001e-8 < B

                                    1. Initial program 49.0%

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

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

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

                                    Alternative 10: 45.4% accurate, 2.8× speedup?

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

                                      1. Initial program 52.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 rewrites49.8%

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

                                        if -3.14999999999999995e-149 < B < 6.2000000000000003e-126

                                        1. Initial program 57.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 C around inf

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

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

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

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

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

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

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

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

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

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

                                          if 6.2000000000000003e-126 < B

                                          1. Initial program 51.5%

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

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

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

                                          Alternative 11: 40.8% accurate, 2.9× speedup?

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

                                            1. Initial program 54.3%

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

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

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

                                              if -3.999999999999988e-310 < B

                                              1. Initial program 53.1%

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

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

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

                                              Alternative 12: 21.9% accurate, 3.1× speedup?

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

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

                                                Reproduce

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