ABCF->ab-angle angle

Percentage Accurate: 53.7% → 74.5%
Time: 5.3s
Alternatives: 11
Speedup: 1.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 11 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: 74.5% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -2.1000000000000001e99

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

      if -2.1000000000000001e99 < C < 8.5e6

      1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

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

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

      if 8.5e6 < C

      1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-\frac{\mathsf{hypot}\left(A, B\right) + A}{B}\right)}}{\pi} \]
      6. 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} \]
      7. 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. distribute-rgt1-inN/A

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, \frac{-1 \cdot 0}{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}{B}\right)\right)}{\pi} \]
        10. mul0-lftN/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} \]
        11. lift-/.f64N/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} \]
        12. mul0-lft67.7

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

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

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

    Alternative 2: 72.3% 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 5 \cdot 10^{-109}:\\ \;\;\;\;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 5e-109)
           (* 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 <= 5e-109) {
    		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 <= 5e-109) {
    		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 <= 5e-109:
    		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 <= 5e-109)
    		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 <= 5e-109)
    		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, 5e-109], 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 5 \cdot 10^{-109}:\\
    \;\;\;\;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 59.2%

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

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

          \[\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))) < 5.0000000000000002e-109

        1. Initial program 25.4%

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

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

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

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

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

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

        if 5.0000000000000002e-109 < (*.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 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. Add Preprocessing
        3. Taylor expanded in B around -inf

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

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

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

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

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

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

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

      Alternative 3: 66.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{C}{B} - 1\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-109}:\\ \;\;\;\;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 (- (/ C B) 1.0)) PI))
           (if (<= t_0 5e-109)
             (* 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(((C / B) - 1.0)) / ((double) M_PI));
      	} else if (t_0 <= 5e-109) {
      		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(((C / B) - 1.0)) / Math.PI);
      	} else if (t_0 <= 5e-109) {
      		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(((C / B) - 1.0)) / math.pi)
      	elif t_0 <= 5e-109:
      		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(C / B) - 1.0)) / pi));
      	elseif (t_0 <= 5e-109)
      		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(((C / B) - 1.0)) / pi);
      	elseif (t_0 <= 5e-109)
      		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[(C / B), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-109], 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{C}{B} - 1\right)}{\pi}\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-109}:\\
      \;\;\;\;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 59.2%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \color{blue}{1}\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))) < 5.0000000000000002e-109

        1. Initial program 25.4%

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

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

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

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

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

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

        if 5.0000000000000002e-109 < (*.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 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. Add Preprocessing
        3. Taylor expanded in B around -inf

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

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

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

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

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

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

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

      Alternative 4: 61.6% 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} - 1\right)}{\pi}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-111}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
      (FPCore (A B C)
       :precision binary64
       (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) 1.0)) PI))
           (if (<= t_0 5e-111)
             (* 180.0 (/ (atan (* (/ B A) 0.5)) PI))
             (* 180.0 (/ (atan (- 1.0 (/ A 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) - 1.0)) / ((double) M_PI));
      	} else if (t_0 <= 5e-111) {
      		tmp = 180.0 * (atan(((B / A) * 0.5)) / ((double) M_PI));
      	} else {
      		tmp = 180.0 * (atan((1.0 - (A / B))) / ((double) M_PI));
      	}
      	return tmp;
      }
      
      public static double code(double A, double B, double C) {
      	double 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) - 1.0)) / Math.PI);
      	} else if (t_0 <= 5e-111) {
      		tmp = 180.0 * (Math.atan(((B / A) * 0.5)) / Math.PI);
      	} else {
      		tmp = 180.0 * (Math.atan((1.0 - (A / 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) - 1.0)) / math.pi)
      	elif t_0 <= 5e-111:
      		tmp = 180.0 * (math.atan(((B / A) * 0.5)) / math.pi)
      	else:
      		tmp = 180.0 * (math.atan((1.0 - (A / 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) - 1.0)) / pi));
      	elseif (t_0 <= 5e-111)
      		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B / A) * 0.5)) / pi));
      	else
      		tmp = Float64(180.0 * Float64(atan(Float64(1.0 - Float64(A / 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) - 1.0)) / pi);
      	elseif (t_0 <= 5e-111)
      		tmp = 180.0 * (atan(((B / A) * 0.5)) / pi);
      	else
      		tmp = 180.0 * (atan((1.0 - (A / 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] - 1.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-111], 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[(A / 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} - 1\right)}{\pi}\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-111}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B}{A} \cdot 0.5\right)}{\pi}\\
      
      \mathbf{else}:\\
      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(1 - \frac{A}{B}\right)}{\pi}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (/.f64 #s(literal 1 binary64) B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))) < -0.5

        1. Initial program 59.2%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \color{blue}{1}\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)))))) < 5.0000000000000003e-111

        1. Initial program 25.4%

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

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

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

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

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

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

        if 5.0000000000000003e-111 < (*.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 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. Add Preprocessing
        3. Taylor expanded in B around -inf

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 59.2%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B} - \color{blue}{1}\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)))))) < 5.0000000000000003e-111

        1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

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

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

          if 5.0000000000000003e-111 < (*.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 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. Add Preprocessing
          3. Taylor expanded in B around -inf

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

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

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

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

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

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

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

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

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

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

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

        Alternative 6: 46.5% accurate, 2.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3200:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -1.9 \cdot 10^{-160}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-116}:\\ \;\;\;\;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 -3200.0)
           (* 180.0 (/ (atan 1.0) PI))
           (if (<= B -1.9e-160)
             (* 180.0 (/ (atan (/ (- A) B)) PI))
             (if (<= B 2.6e-116)
               (* 180.0 (/ (atan (/ C B)) PI))
               (* 180.0 (/ (atan -1.0) PI))))))
        double code(double A, double B, double C) {
        	double tmp;
        	if (B <= -3200.0) {
        		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
        	} else if (B <= -1.9e-160) {
        		tmp = 180.0 * (atan((-A / B)) / ((double) M_PI));
        	} else if (B <= 2.6e-116) {
        		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 <= -3200.0) {
        		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
        	} else if (B <= -1.9e-160) {
        		tmp = 180.0 * (Math.atan((-A / B)) / Math.PI);
        	} else if (B <= 2.6e-116) {
        		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 <= -3200.0:
        		tmp = 180.0 * (math.atan(1.0) / math.pi)
        	elif B <= -1.9e-160:
        		tmp = 180.0 * (math.atan((-A / B)) / math.pi)
        	elif B <= 2.6e-116:
        		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 <= -3200.0)
        		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
        	elseif (B <= -1.9e-160)
        		tmp = Float64(180.0 * Float64(atan(Float64(Float64(-A) / B)) / pi));
        	elseif (B <= 2.6e-116)
        		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 <= -3200.0)
        		tmp = 180.0 * (atan(1.0) / pi);
        	elseif (B <= -1.9e-160)
        		tmp = 180.0 * (atan((-A / B)) / pi);
        	elseif (B <= 2.6e-116)
        		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, -3200.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -1.9e-160], N[(180.0 * N[(N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.6e-116], 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 -3200:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
        
        \mathbf{elif}\;B \leq -1.9 \cdot 10^{-160}:\\
        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-A}{B}\right)}{\pi}\\
        
        \mathbf{elif}\;B \leq 2.6 \cdot 10^{-116}:\\
        \;\;\;\;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 4 regimes
        2. if B < -3200

          1. Initial program 48.5%

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

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

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

            if -3200 < B < -1.8999999999999999e-160

            1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

            if -1.8999999999999999e-160 < B < 2.6e-116

            1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

            if 2.6e-116 < B

            1. Initial program 49.9%

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

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

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

            Alternative 7: 50.7% accurate, 2.5× speedup?

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

              1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

              if -5.50000000000000027e-164 < B < 2.6e-116

              1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

              if 2.6e-116 < B

              1. Initial program 49.9%

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

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

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

              Alternative 8: 46.4% accurate, 2.5× speedup?

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

                1. Initial program 52.4%

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

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

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

                  if -1.18e-55 < B < 2.6e-116

                  1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

                  if 2.6e-116 < B

                  1. Initial program 49.9%

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

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

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

                  Alternative 9: 44.2% accurate, 2.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -4.6 \cdot 10^{-178}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{-153}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
                  (FPCore (A B C)
                   :precision binary64
                   (if (<= B -4.6e-178)
                     (* 180.0 (/ (atan 1.0) PI))
                     (if (<= B 1.8e-153)
                       (* 180.0 (/ (atan 0.0) PI))
                       (* 180.0 (/ (atan -1.0) PI)))))
                  double code(double A, double B, double C) {
                  	double tmp;
                  	if (B <= -4.6e-178) {
                  		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
                  	} else if (B <= 1.8e-153) {
                  		tmp = 180.0 * (atan(0.0) / ((double) M_PI));
                  	} else {
                  		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
                  	}
                  	return tmp;
                  }
                  
                  public static double code(double A, double B, double C) {
                  	double tmp;
                  	if (B <= -4.6e-178) {
                  		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
                  	} else if (B <= 1.8e-153) {
                  		tmp = 180.0 * (Math.atan(0.0) / Math.PI);
                  	} else {
                  		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
                  	}
                  	return tmp;
                  }
                  
                  def code(A, B, C):
                  	tmp = 0
                  	if B <= -4.6e-178:
                  		tmp = 180.0 * (math.atan(1.0) / math.pi)
                  	elif B <= 1.8e-153:
                  		tmp = 180.0 * (math.atan(0.0) / math.pi)
                  	else:
                  		tmp = 180.0 * (math.atan(-1.0) / math.pi)
                  	return tmp
                  
                  function code(A, B, C)
                  	tmp = 0.0
                  	if (B <= -4.6e-178)
                  		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
                  	elseif (B <= 1.8e-153)
                  		tmp = Float64(180.0 * Float64(atan(0.0) / pi));
                  	else
                  		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(A, B, C)
                  	tmp = 0.0;
                  	if (B <= -4.6e-178)
                  		tmp = 180.0 * (atan(1.0) / pi);
                  	elseif (B <= 1.8e-153)
                  		tmp = 180.0 * (atan(0.0) / pi);
                  	else
                  		tmp = 180.0 * (atan(-1.0) / pi);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[A_, B_, C_] := If[LessEqual[B, -4.6e-178], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.8e-153], N[(180.0 * N[(N[ArcTan[0.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;B \leq -4.6 \cdot 10^{-178}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\
                  
                  \mathbf{elif}\;B \leq 1.8 \cdot 10^{-153}:\\
                  \;\;\;\;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 < -4.59999999999999989e-178

                    1. Initial program 56.1%

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

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

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

                      if -4.59999999999999989e-178 < B < 1.7999999999999999e-153

                      1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

                        if 1.7999999999999999e-153 < B

                        1. Initial program 51.0%

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

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

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

                        Alternative 10: 39.4% accurate, 2.9× speedup?

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

                          1. Initial program 56.8%

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

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

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

                            if -4.999999999999985e-310 < B

                            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. Add Preprocessing
                            3. Taylor expanded in B around inf

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

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

                            Alternative 11: 20.8% 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 55.2%

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

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

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

                              Reproduce

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