ABCF->ab-angle angle

Percentage Accurate: 53.3% → 81.7%
Time: 7.4s
Alternatives: 9
Speedup: 2.1×

Specification

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 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.3% 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: 81.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;A \leq -5.2 \cdot 10^{+109}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -5.1999999999999997e109

    1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.1999999999999997e109 < A

    1. Initial program 53.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. Step-by-step derivation
      1. lift-sqrt.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + \color{blue}{B \cdot B}}\right)\right)}{\pi} \]
      11. fp-cancel-sign-sub-invN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{{\left(A - C\right)}^{2} - \left(\mathsf{neg}\left(B\right)\right) \cdot B}}\right)\right)}{\pi} \]
      12. fp-cancel-sub-sign-invN/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{\left(A - C\right) \cdot \left(A - C\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(B\right)\right)\right)\right) \cdot B}\right)\right)}{\pi} \]
      15. sqr-neg-revN/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(A - C\right)}\right)\right) \cdot \left(\mathsf{neg}\left(\left(A - C\right)\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(B\right)\right)\right)\right) \cdot B}\right)\right)}{\pi} \]
      17. sub-negate-revN/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\left(C - A\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(A - C\right)}\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(B\right)\right)\right)\right) \cdot B}\right)\right)}{\pi} \]
      20. sub-negate-revN/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\left(C - A\right) \cdot \color{blue}{\left(C - A\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(B\right)\right)\right)\right) \cdot B}\right)\right)}{\pi} \]
      22. remove-double-negN/A

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

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

Alternative 2: 73.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;A \leq -9.2 \cdot 10^{+108}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi} \cdot 180\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -9.1999999999999996e108

    1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.1999999999999996e108 < A < 1.35e-157

    1. Initial program 53.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. Step-by-step derivation
      1. lift-sqrt.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + \color{blue}{B \cdot B}}\right)\right)}{\pi} \]
      11. fp-cancel-sign-sub-invN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{{\left(A - C\right)}^{2} - \left(\mathsf{neg}\left(B\right)\right) \cdot B}}\right)\right)}{\pi} \]
      12. fp-cancel-sub-sign-invN/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\color{blue}{\left(A - C\right) \cdot \left(A - C\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(B\right)\right)\right)\right) \cdot B}\right)\right)}{\pi} \]
      15. sqr-neg-revN/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(A - C\right)}\right)\right) \cdot \left(\mathsf{neg}\left(\left(A - C\right)\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(B\right)\right)\right)\right) \cdot B}\right)\right)}{\pi} \]
      17. sub-negate-revN/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\left(C - A\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\left(A - C\right)}\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(B\right)\right)\right)\right) \cdot B}\right)\right)}{\pi} \]
      20. sub-negate-revN/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{\left(C - A\right) \cdot \color{blue}{\left(C - A\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(B\right)\right)\right)\right) \cdot B}\right)\right)}{\pi} \]
      22. remove-double-negN/A

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

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

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

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

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

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

        if 1.35e-157 < A

        1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 60.4% accurate, 2.1× speedup?

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

        1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.04999999999999986e61 < C

        1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{B}{C} - \left(\mathsf{neg}\left(\left(A - A\right)\right)\right) \cdot \frac{\color{blue}{1}}{B}\right)}{\pi} \]
          16. sub-flip-reverseN/A

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{B}{C} - \frac{1}{B} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(A + -1 \cdot A\right)\right)\right)}\right)}{\pi} \]
          21. fp-cancel-sub-sign-invN/A

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

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

      Alternative 4: 47.5% accurate, 2.1× speedup?

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

        1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

        if -1.12e-130 < C < 2.04999999999999986e61

        1. Initial program 53.3%

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

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

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

          if 2.04999999999999986e61 < C

          1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{B}{C} - \left(\mathsf{neg}\left(\left(A - A\right)\right)\right) \cdot \frac{\color{blue}{1}}{B}\right)}{\pi} \]
            16. sub-flip-reverseN/A

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{B}{C} - \frac{1}{B} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(A + -1 \cdot A\right)\right)\right)}\right)}{\pi} \]
            21. fp-cancel-sub-sign-invN/A

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

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

        Alternative 5: 47.5% accurate, 2.2× speedup?

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

          1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

          if -1.12e-130 < C < 2.04999999999999986e61

          1. Initial program 53.3%

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

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

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

            if 2.04999999999999986e61 < C

            1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

              \[\leadsto 180 \cdot \color{blue}{\left(\frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, -0.5, 0\right)\right)}{\sqrt[3]{\pi}} \cdot \frac{1}{{\pi}^{0.6666666666666666}}\right)} \]
            6. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{180 \cdot \left(\frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, 0\right)\right)}{\sqrt[3]{\pi}} \cdot \frac{1}{{\pi}^{\frac{2}{3}}}\right)} \]
              2. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\frac{\tan^{-1} \left(\mathsf{fma}\left(\frac{B}{C}, \frac{-1}{2}, 0\right)\right)}{\sqrt[3]{\pi}} \cdot \frac{1}{{\pi}^{\frac{2}{3}}}\right) \cdot 180} \]
              3. lower-*.f6426.7

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

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

          Alternative 6: 47.5% accurate, 2.2× speedup?

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

            1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

            if -1.12e-130 < C < 2.04999999999999986e61

            1. Initial program 53.3%

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

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

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

              if 2.04999999999999986e61 < C

              1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \tan^{-1} \left(\frac{-1}{2} \cdot \color{blue}{\frac{B}{C}}\right) \cdot \mathsf{Rewrite=>}\left(lower-/.f64, \left(\frac{180}{\pi}\right)\right) \]
              7. Applied rewrites26.9%

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

            Alternative 7: 44.4% accurate, 2.5× speedup?

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

              1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

              if 2.20000000000000002e24 < B

              1. Initial program 53.3%

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

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

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

              Alternative 8: 34.5% accurate, 2.5× speedup?

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

                1. Initial program 53.3%

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

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

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

                  if 8.2e57 < A

                  1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

                Alternative 9: 21.2% accurate, 4.1× speedup?

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

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

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

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

                  Reproduce

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