ABCF->ab-angle angle

Percentage Accurate: 53.7% → 79.2%
Time: 10.6s
Alternatives: 15
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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: 79.2% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (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))))))) < -0.5

    1. Initial program 61.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
    2. Add Preprocessing
    3. Applied rewrites61.3%

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

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

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

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

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

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

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

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

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

    if -0.5 < (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))))))) < -0.0

    1. Initial program 14.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. Applied rewrites14.2%

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

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

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

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

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

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

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

    if -0.0 < (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)))))))

    1. Initial program 58.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. Applied rewrites58.5%

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

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

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

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

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

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

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
      6. lower--.f6479.8

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

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

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

Alternative 2: 72.6% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (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))))))) < -0.5

    1. Initial program 61.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
    2. Add Preprocessing
    3. Applied rewrites61.3%

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

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

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

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

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

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

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

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

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

    if -0.5 < (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))))))) < -0.0

    1. Initial program 14.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 A around -inf

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

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

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

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

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

    if -0.0 < (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)))))))

    1. Initial program 58.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. Applied rewrites58.5%

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

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

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

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

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

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

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
      6. lower--.f6479.8

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

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

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

Alternative 3: 72.6% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (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))))))) < -0.5

    1. Initial program 61.3%

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

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

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

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

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

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

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

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

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

    if -0.5 < (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))))))) < -0.0

    1. Initial program 14.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 A around -inf

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

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

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

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

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

    if -0.0 < (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)))))))

    1. Initial program 58.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. Applied rewrites58.5%

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

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

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

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

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

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

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
      6. lower--.f6479.8

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

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

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

Alternative 4: 72.6% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (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))))))) < -0.5

    1. Initial program 61.3%

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

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

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

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

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

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

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

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

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

    if -0.5 < (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))))))) < -0.0

    1. Initial program 14.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 A around -inf

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

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

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

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

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

    if -0.0 < (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)))))))

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right)}{\mathsf{PI}\left(\right)} \]
      6. lower--.f6479.8

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

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

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

Alternative 5: 67.2% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (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))))))) < -0.5

    1. Initial program 61.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
    2. Add Preprocessing
    3. Applied rewrites61.3%

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

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

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

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

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

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

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{{A}^{2} + {B}^{2}}} + A\right)\right)}{B}\right) \]
      6. +-commutativeN/A

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

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

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\sqrt{\color{blue}{\mathsf{fma}\left(B, B, {A}^{2}\right)}} + A\right)\right)}{B}\right) \]
      9. unpow2N/A

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\sqrt{\mathsf{fma}\left(B, B, \color{blue}{A \cdot A}\right)} + A\right)\right)}{B}\right) \]
      10. lower-*.f6455.3

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

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

      \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(A + B\right)\right)}{B}\right) \]
    8. Step-by-step derivation
      1. Applied rewrites68.6%

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

      if -0.5 < (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))))))) < -0.0

      1. Initial program 14.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 A around -inf

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

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

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

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

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

      if -0.0 < (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)))))))

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right)}{\mathsf{PI}\left(\right)} \]
        6. lower--.f6479.8

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

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

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

    Alternative 6: 61.7% accurate, 0.6× speedup?

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

        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
      2. Add Preprocessing
      3. Applied rewrites61.3%

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

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

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

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

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

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

          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{{A}^{2} + {B}^{2}}} + A\right)\right)}{B}\right) \]
        6. +-commutativeN/A

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

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

          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\sqrt{\color{blue}{\mathsf{fma}\left(B, B, {A}^{2}\right)}} + A\right)\right)}{B}\right) \]
        9. unpow2N/A

          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(\sqrt{\mathsf{fma}\left(B, B, \color{blue}{A \cdot A}\right)} + A\right)\right)}{B}\right) \]
        10. lower-*.f6455.3

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

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

        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{\mathsf{neg}\left(\left(A + B\right)\right)}{B}\right) \]
      8. Step-by-step derivation
        1. Applied rewrites68.6%

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

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

        1. Initial program 14.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 A around -inf

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

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

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

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

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

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

        1. Initial program 58.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. Applied rewrites58.5%

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

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

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

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

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

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

            \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
          6. lower--.f6479.8

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

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

          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(-1 \cdot \frac{A}{B} + 1\right) \]
        8. Step-by-step derivation
          1. Applied rewrites70.4%

            \[\leadsto \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{-A}{B} + 1\right) \]
        9. Recombined 3 regimes into one program.
        10. Final simplification67.9%

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

        Alternative 7: 61.5% accurate, 0.6× speedup?

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

            \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
          2. Add Preprocessing
          3. Applied rewrites61.3%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{C}{B} - 1\right) \]
          8. Step-by-step derivation
            1. Applied rewrites57.8%

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

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

            1. Initial program 14.2%

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\frac{B}{C} \cdot \frac{-1}{2}} + -1 \cdot \frac{A + -1 \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
              3. distribute-rgt1-inN/A

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot \frac{-1}{2} + -1 \cdot \frac{\color{blue}{0} \cdot A}{B}\right)}{\mathsf{PI}\left(\right)} \]
              5. mul0-lftN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot \frac{-1}{2} + -1 \cdot \frac{\color{blue}{0}}{B}\right)}{\mathsf{PI}\left(\right)} \]
              6. div0N/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{B}{C} \cdot \frac{-1}{2} + -1 \cdot \color{blue}{0}\right)}{\mathsf{PI}\left(\right)} \]
              7. metadata-evalN/A

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, 0\right)\right)}}{\mathsf{PI}\left(\right)} \]
              9. lower-/.f6448.7

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{fma}\left(\frac{B}{C}, -0.5, 0\right)\right)}}{\pi} \]
            6. Step-by-step derivation
              1. Applied rewrites48.7%

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

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

              1. Initial program 58.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. Applied rewrites58.5%

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

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

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

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

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

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

                  \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
                6. lower--.f6479.8

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

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

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

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

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

              Alternative 8: 57.3% accurate, 2.5× speedup?

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

                1. Initial program 26.5%

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

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

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

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

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

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

                if -2.5999999999999999e-216 < A < 8.99999999999999957e-178

                1. Initial program 67.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. Applied rewrites67.9%

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

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

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

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

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

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

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

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

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

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

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

                  if 8.99999999999999957e-178 < A

                  1. Initial program 74.1%

                    \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
                  2. Add Preprocessing
                  3. Applied rewrites74.1%

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

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

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

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

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

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

                      \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
                    6. lower--.f6477.1

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

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

                    \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(-1 \cdot \frac{A}{B} + 1\right) \]
                  8. Step-by-step derivation
                    1. Applied rewrites74.1%

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

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

                  Alternative 9: 54.9% accurate, 2.5× speedup?

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

                    1. Initial program 26.5%

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

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

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

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

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

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

                    if -2.5999999999999999e-216 < A < 3e19

                    1. Initial program 65.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. Applied rewrites65.2%

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

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

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

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

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

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

                        \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right) \]
                      6. lower--.f6460.0

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

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

                      \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{C}{B} - 1\right) \]
                    8. Step-by-step derivation
                      1. Applied rewrites54.2%

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

                      if 3e19 < A

                      1. Initial program 80.3%

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

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

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

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

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -2.6 \cdot 10^{-216}:\\ \;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\ \mathbf{elif}\;A \leq 3 \cdot 10^{+19}:\\ \;\;\;\;\tan^{-1} \left(\frac{C}{B} - 1\right) \cdot \frac{180}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi} \cdot 180\\ \end{array} \]
                    11. Add Preprocessing

                    Alternative 10: 54.2% accurate, 2.5× speedup?

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

                      1. Initial program 50.5%

                        \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
                      2. Add Preprocessing
                      3. Applied rewrites50.5%

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

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

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

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

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

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

                          \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
                        6. lower--.f6482.5

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

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

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

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

                        if -2.3500000000000001e-79 < B < 9.19999999999999962e-147

                        1. Initial program 59.1%

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

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

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

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

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

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

                        if 9.19999999999999962e-147 < B

                        1. Initial program 55.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. Applied rewrites55.0%

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

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

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

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

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

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

                            \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} - 1\right) \]
                          6. lower--.f6470.3

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

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

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -2.35 \cdot 10^{-79}:\\ \;\;\;\;\tan^{-1} \left(\frac{C}{B} + 1\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq 9.2 \cdot 10^{-147}:\\ \;\;\;\;\frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{C}{B} - 1\right) \cdot \frac{180}{\pi}\\ \end{array} \]
                        11. Add Preprocessing

                        Alternative 11: 55.1% accurate, 2.5× speedup?

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

                          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. Applied rewrites56.1%

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

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

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

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

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

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

                              \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
                            6. lower--.f6475.1

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

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

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

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

                            if -2.6e-284 < B < 4.49999999999999996e-238

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                            4. Step-by-step derivation
                              1. distribute-rgt1-inN/A

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{0}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                              4. div0N/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \color{blue}{0}\right)}{\mathsf{PI}\left(\right)} \]
                              5. metadata-eval43.4

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\pi} \]
                            5. Applied rewrites43.4%

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

                            if 4.49999999999999996e-238 < B

                            1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\frac{C}{B} - 1\right) \]
                            8. Step-by-step derivation
                              1. Applied rewrites53.1%

                                \[\leadsto \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B} - 1\right) \]
                            9. Recombined 3 regimes into one program.
                            10. Final simplification56.0%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -2.6 \cdot 10^{-284}:\\ \;\;\;\;\tan^{-1} \left(\frac{C}{B} + 1\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq 4.5 \cdot 10^{-238}:\\ \;\;\;\;\frac{\tan^{-1} 0}{\pi} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{C}{B} - 1\right) \cdot \frac{180}{\pi}\\ \end{array} \]
                            11. Add Preprocessing

                            Alternative 12: 50.6% accurate, 2.6× speedup?

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

                              1. Initial program 55.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. Applied rewrites55.1%

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

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

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

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

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

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

                                  \[\leadsto \frac{180}{\mathsf{PI}\left(\right)} \cdot \tan^{-1} \left(\color{blue}{\frac{C - A}{B}} + 1\right) \]
                                6. lower--.f6468.6

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

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

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

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

                                if 9.5000000000000008e-134 < B

                                1. Initial program 54.6%

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

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{-1}}{\mathsf{PI}\left(\right)} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites50.4%

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

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

                                Alternative 13: 44.5% accurate, 2.8× speedup?

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

                                  1. Initial program 53.6%

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

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{1}}{\mathsf{PI}\left(\right)} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites58.5%

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

                                    if -4.3999999999999999e-103 < B < 4.6999999999999998e-141

                                    1. Initial program 56.2%

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

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                                    4. Step-by-step derivation
                                      1. distribute-rgt1-inN/A

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

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

                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{0}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                      4. div0N/A

                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \color{blue}{0}\right)}{\mathsf{PI}\left(\right)} \]
                                      5. metadata-eval32.9

                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\pi} \]
                                    5. Applied rewrites32.9%

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

                                    if 4.6999999999999998e-141 < B

                                    1. Initial program 55.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}}{\mathsf{PI}\left(\right)} \]
                                    4. Step-by-step derivation
                                      1. Applied rewrites50.0%

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

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

                                    Alternative 14: 28.6% accurate, 2.9× speedup?

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

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

                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B}\right)}}{\mathsf{PI}\left(\right)} \]
                                      4. Step-by-step derivation
                                        1. distribute-rgt1-inN/A

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

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

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \frac{\color{blue}{0}}{B}\right)}{\mathsf{PI}\left(\right)} \]
                                        4. div0N/A

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \color{blue}{0}\right)}{\mathsf{PI}\left(\right)} \]
                                        5. metadata-eval18.1

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{0}}{\pi} \]
                                      5. Applied rewrites18.1%

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

                                      if 4.6999999999999998e-141 < B

                                      1. Initial program 55.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}}{\mathsf{PI}\left(\right)} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites50.0%

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

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

                                      Alternative 15: 20.2% accurate, 3.1× speedup?

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

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

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

                                        Reproduce

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