ABCF->ab-angle angle

Percentage Accurate: 53.1% → 88.0%
Time: 16.7s
Alternatives: 19
Speedup: 3.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 19 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 88.0% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot 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)))))) < -1e-58

    1. Initial program 61.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified89.2%

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

    if -1e-58 < (*.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 21.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified21.4%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{B \cdot \frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\frac{-1}{2}}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \left(C - A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      14. --lowering--.f6499.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \mathsf{\_.f64}\left(C, A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified99.4%

      \[\leadsto \tan^{-1} \color{blue}{\left(B \cdot \frac{-0.5}{C - A}\right)} \cdot \frac{180}{\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 52.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified87.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \left(C - A\right) \cdot \left(C - A\right)}}{B}\right) \cdot 180\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    6. Applied egg-rr87.0%

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

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

Alternative 2: 76.1% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 19.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified51.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{B \cdot \frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\frac{-1}{2}}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \left(C - A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      14. --lowering--.f6486.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \mathsf{\_.f64}\left(C, A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified86.3%

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

    if -7.00000000000000033e118 < A < 3.8000000000000003e32

    1. Initial program 48.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified77.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \left(C - A\right) \cdot \left(C - A\right)}}{B}\right) \cdot 180\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    6. Applied egg-rr77.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{{B}^{2} + {C}^{2}}\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{C}^{2} + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      7. hypot-lowering-hypot.f6475.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    9. Simplified75.3%

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

    if 3.8000000000000003e32 < A

    1. Initial program 78.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 \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C}{B} - \left(\frac{A}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C - A}{B} - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\left(\frac{C - A}{B}\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(C - A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. --lowering--.f6482.8%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified82.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 simplification78.7%

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

Alternative 3: 76.2% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 19.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified51.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{B \cdot \frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\frac{-1}{2}}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \left(C - A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      14. --lowering--.f6486.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \mathsf{\_.f64}\left(C, A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified86.3%

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

    if -7.8e118 < A < 1.5000000000000001e38

    1. Initial program 48.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified77.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \left(C - A\right) \cdot \left(C - A\right)}}{B}\right) \cdot 180\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    6. Applied egg-rr77.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{{B}^{2} + {C}^{2}}\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{C}^{2} + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      7. hypot-lowering-hypot.f6475.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    9. Simplified75.3%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\tan^{-1} \left(\frac{C - \sqrt{C \cdot C + B \cdot B}}{B}\right), \mathsf{PI}\left(\right)\right), 180\right) \]
      5. atan-lowering-atan.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C - \sqrt{C \cdot C + B \cdot B}}{B}\right)\right), \mathsf{PI}\left(\right)\right), 180\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{C \cdot C + B \cdot B}\right), B\right)\right), \mathsf{PI}\left(\right)\right), 180\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right), \mathsf{PI}\left(\right)\right), 180\right) \]
      8. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right), \mathsf{PI}\left(\right)\right), 180\right) \]
      9. hypot-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right), \mathsf{PI}\left(\right)\right), 180\right) \]
      10. PI-lowering-PI.f6475.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right), 180\right) \]
    11. Applied egg-rr75.3%

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

    if 1.5000000000000001e38 < A

    1. Initial program 78.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 \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C}{B} - \left(\frac{A}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C - A}{B} - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\left(\frac{C - A}{B}\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(C - A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. --lowering--.f6482.8%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified82.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 simplification78.7%

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

Alternative 4: 76.2% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 19.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified51.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{B \cdot \frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\frac{-1}{2}}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \left(C - A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      14. --lowering--.f6486.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \mathsf{\_.f64}\left(C, A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified86.3%

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

    if -9.20000000000000063e118 < A < 4.3e43

    1. Initial program 48.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified77.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{{B}^{2} + {C}^{2}}\right), B\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right), B\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{C}^{2} + {B}^{2}}\right)\right), B\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + {B}^{2}}\right)\right), B\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. hypot-lowering-hypot.f6475.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified75.2%

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

    if 4.3e43 < A

    1. Initial program 78.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 \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C}{B} - \left(\frac{A}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C - A}{B} - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\left(\frac{C - A}{B}\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(C - A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. --lowering--.f6482.8%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified82.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 simplification78.7%

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

Alternative 5: 81.5% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 6.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified44.9%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{B \cdot \frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\frac{-1}{2}}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \left(C - A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      14. --lowering--.f6486.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \mathsf{\_.f64}\left(C, A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified86.8%

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

    if -2.4000000000000002e146 < A

    1. Initial program 57.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified83.1%

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

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

Alternative 6: 65.7% accurate, 3.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < -2.1000000000000002e-186

    1. Initial program 46.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. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified77.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 + -1 \cdot \frac{-1 \cdot \left(C - A\right) + \frac{-1}{2} \cdot \frac{{\left(C - A\right)}^{2}}{B}}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\mathsf{neg}\left(\frac{-1 \cdot \left(C - A\right) + \frac{-1}{2} \cdot \frac{{\left(C - A\right)}^{2}}{B}}{B}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 - \frac{-1 \cdot \left(C - A\right) + \frac{-1}{2} \cdot \frac{{\left(C - A\right)}^{2}}{B}}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{-1 \cdot \left(C - A\right) + \frac{-1}{2} \cdot \frac{{\left(C - A\right)}^{2}}{B}}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(-1 \cdot \left(C - A\right) + \frac{-1}{2} \cdot \frac{{\left(C - A\right)}^{2}}{B}\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified74.4%

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

    if -2.1000000000000002e-186 < B < 7.4999999999999999e-280

    1. Initial program 48.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified74.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{B \cdot \frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\frac{-1}{2}}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \left(C - A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      14. --lowering--.f6464.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \mathsf{\_.f64}\left(C, A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified64.3%

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

    if 7.4999999999999999e-280 < B

    1. Initial program 59.0%

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

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

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C}{B} - \left(\frac{A}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C - A}{B} - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\left(\frac{C - A}{B}\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(C - A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. --lowering--.f6477.0%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified77.0%

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

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

Alternative 7: 60.1% accurate, 3.4× speedup?

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

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

\mathbf{elif}\;A \leq 3.45 \cdot 10^{-125}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\

\mathbf{elif}\;A \leq 6.2 \cdot 10^{-69}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B} + -1\right)}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -6.40000000000000046e-16

    1. Initial program 24.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified56.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{1}{2} \cdot B}{A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot B\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(B \cdot \frac{1}{2}\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. *-lowering-*.f6469.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \frac{1}{2}\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified69.6%

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

    if -6.40000000000000046e-16 < A < 3.44999999999999986e-125

    1. Initial program 46.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified75.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \left(C - A\right) \cdot \left(C - A\right)}}{B}\right) \cdot 180\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    6. Applied egg-rr75.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{{B}^{2} + {C}^{2}}\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{C}^{2} + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      7. hypot-lowering-hypot.f6475.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    9. Simplified75.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(1 + \frac{C}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    11. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(\frac{C}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(\left(\frac{C}{B}\right), 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. /-lowering-/.f6449.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(C, B\right), 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    12. Simplified49.5%

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

    if 3.44999999999999986e-125 < A < 6.1999999999999999e-69

    1. Initial program 79.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified94.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \left(C - A\right) \cdot \left(C - A\right)}}{B}\right) \cdot 180\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    6. Applied egg-rr94.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{{B}^{2} + {C}^{2}}\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{C}^{2} + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      7. hypot-lowering-hypot.f6494.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    9. Simplified94.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C}{B} - 1\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    11. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(\frac{C}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(\frac{C}{B} + -1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(-1 + \frac{C}{B}\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(-1, \left(\frac{C}{B}\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. /-lowering-/.f6477.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(C, B\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    12. Simplified77.0%

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

    if 6.1999999999999999e-69 < A

    1. Initial program 73.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified96.3%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6477.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified77.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f6476.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(A, B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Simplified76.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -6.4 \cdot 10^{-16}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)\\ \mathbf{elif}\;A \leq 3.45 \cdot 10^{-125}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(1 + \frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq 6.2 \cdot 10^{-69}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B} + -1\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 60.1% accurate, 3.4× speedup?

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

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

\mathbf{elif}\;A \leq 5 \cdot 10^{-127}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(1 + \frac{C}{B}\right)\\

\mathbf{elif}\;A \leq 1.65 \cdot 10^{-69}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C}{B} + -1\right)}{\pi}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -2.39999999999999995e-15

    1. Initial program 24.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified56.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{1}{2} \cdot B}{A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot B\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(B \cdot \frac{1}{2}\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. *-lowering-*.f6469.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \frac{1}{2}\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified69.6%

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

    if -2.39999999999999995e-15 < A < 4.9999999999999997e-127

    1. Initial program 46.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified75.6%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6449.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified49.3%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 + \frac{C}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f6449.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(C, B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Simplified49.4%

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

    if 4.9999999999999997e-127 < A < 1.65e-69

    1. Initial program 79.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified94.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \left(C - A\right) \cdot \left(C - A\right)}}{B}\right) \cdot 180\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    6. Applied egg-rr94.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{{B}^{2} + {C}^{2}}\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{C}^{2} + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      7. hypot-lowering-hypot.f6494.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    9. Simplified94.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C}{B} - 1\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    11. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(\frac{C}{B} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(\frac{C}{B} + -1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(-1 + \frac{C}{B}\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(-1, \left(\frac{C}{B}\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. /-lowering-/.f6477.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(C, B\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    12. Simplified77.0%

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

    if 1.65e-69 < A

    1. Initial program 73.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified96.3%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6477.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified77.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f6476.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(A, B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Simplified76.1%

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

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

Alternative 9: 65.2% accurate, 3.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < -9.50000000000000042e-185

    1. Initial program 46.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. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified77.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6473.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified73.1%

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

    if -9.50000000000000042e-185 < B < 8.499999999999999e-282

    1. Initial program 48.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified74.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{B \cdot \frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\frac{-1}{2}}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \left(C - A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      14. --lowering--.f6464.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \mathsf{\_.f64}\left(C, A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified64.3%

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

    if 8.499999999999999e-282 < B

    1. Initial program 59.0%

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

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

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C}{B} - \left(\frac{A}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C - A}{B} - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\left(\frac{C - A}{B}\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(C - A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. --lowering--.f6477.0%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified77.0%

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

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

Alternative 10: 61.3% accurate, 3.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < -2.1999999999999999e-140

    1. Initial program 45.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified77.4%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \left(C - A\right) \cdot \left(C - A\right)}}{B}\right) \cdot 180\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    6. Applied egg-rr77.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{{B}^{2} + {C}^{2}}\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{C}^{2} + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      7. hypot-lowering-hypot.f6471.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    9. Simplified71.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(1 + \frac{C}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    11. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(\frac{C}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(\left(\frac{C}{B}\right), 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. /-lowering-/.f6469.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(C, B\right), 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    12. Simplified69.5%

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

    if -2.1999999999999999e-140 < B < 7.20000000000000013e-281

    1. Initial program 48.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified75.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{B}{C - A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{-1}{2} \cdot B}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{B \cdot \frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\frac{-1}{2}}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(B \cdot \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{C - A}\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \left(\frac{\frac{-1}{2}}{C - A}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \left(C - A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      14. --lowering--.f6460.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{*.f64}\left(B, \mathsf{/.f64}\left(\frac{-1}{2}, \mathsf{\_.f64}\left(C, A\right)\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified60.6%

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

    if 7.20000000000000013e-281 < B

    1. Initial program 59.0%

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

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

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C}{B} - \left(\frac{A}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C - A}{B} - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\left(\frac{C - A}{B}\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(C - A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. --lowering--.f6477.0%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified77.0%

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

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

Alternative 11: 59.3% accurate, 3.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < -1.4999999999999999e-239

    1. Initial program 45.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified77.7%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{B \cdot B + \left(C - A\right) \cdot \left(C - A\right)}}{B}\right) \cdot 180\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    6. Applied egg-rr77.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(\frac{C - \sqrt{{B}^{2} + {C}^{2}}}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(C - \sqrt{{B}^{2} + {C}^{2}}\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{{C}^{2} + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + {B}^{2}}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\sqrt{C \cdot C + B \cdot B}\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      6. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(C, B\right)\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      7. hypot-lowering-hypot.f6468.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(C, B\right)\right), B\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    9. Simplified68.8%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\color{blue}{\left(1 + \frac{C}{B}\right)}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    11. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\left(\frac{C}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(\left(\frac{C}{B}\right), 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
      3. /-lowering-/.f6463.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(180, \mathsf{atan.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(C, B\right), 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    12. Simplified63.2%

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

    if -1.4999999999999999e-239 < B < -6.40000000000000025e-296

    1. Initial program 49.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified65.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{1}{2} \cdot B}{A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot B\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(B \cdot \frac{1}{2}\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. *-lowering-*.f6460.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \frac{1}{2}\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified60.1%

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

    if -6.40000000000000025e-296 < B

    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 \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{C}{B} - \left(1 + \frac{A}{B}\right)\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C}{B} - \left(\frac{A}{B} + 1\right)\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. associate--r+N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\left(\frac{C}{B} - \frac{A}{B}\right) - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{C - A}{B} - 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\left(\frac{C - A}{B}\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(C - A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. --lowering--.f6473.1%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right), 1\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified73.1%

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

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

Alternative 12: 60.2% accurate, 3.5× speedup?

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

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

\mathbf{elif}\;A \leq 1.18 \cdot 10^{-85}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(1 + \frac{C}{B}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -1.94999999999999995e-17

    1. Initial program 24.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified56.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{1}{2} \cdot B}{A}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot B\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(B \cdot \frac{1}{2}\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. *-lowering-*.f6469.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \frac{1}{2}\right), A\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified69.6%

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

    if -1.94999999999999995e-17 < A < 1.18e-85

    1. Initial program 50.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified78.0%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6449.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified49.0%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 + \frac{C}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f6449.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(C, B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Simplified49.2%

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

    if 1.18e-85 < A

    1. Initial program 74.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified96.3%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6476.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified76.4%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f6475.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(A, B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Simplified75.4%

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

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

Alternative 13: 60.1% accurate, 3.5× speedup?

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

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

\mathbf{elif}\;A \leq 4.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(1 + \frac{C}{B}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -1.1e-17

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

      \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{1}{2} \cdot B}{A}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot B\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(B \cdot \frac{1}{2}\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. *-lowering-*.f6469.4%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \frac{1}{2}\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified69.4%

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

    if -1.1e-17 < A < 4.79999999999999999e-78

    1. Initial program 50.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified78.0%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6449.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified49.0%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 + \frac{C}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f6449.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(C, B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Simplified49.2%

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

    if 4.79999999999999999e-78 < A

    1. Initial program 74.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified96.3%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6476.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified76.4%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f6475.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(A, B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Simplified75.4%

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

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

Alternative 14: 57.7% accurate, 3.5× speedup?

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

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

\mathbf{elif}\;A \leq 7.6 \cdot 10^{+22}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(1 + \frac{C}{B}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -1.04999999999999996e-17

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

      \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{1}{2} \cdot B}{A}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot B\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(B \cdot \frac{1}{2}\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. *-lowering-*.f6469.4%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \frac{1}{2}\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified69.4%

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

    if -1.04999999999999996e-17 < A < 7.6000000000000008e22

    1. Initial program 52.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified80.3%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\left(1 + \frac{C}{B}\right) - \frac{A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \left(\frac{C}{B} - \frac{A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(1 + \frac{C - A}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C - A}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(C - A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. --lowering--.f6451.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(C, A\right), B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    7. Simplified51.5%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(1 + \frac{C}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{C}{B}\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f6449.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(C, B\right)\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Simplified49.6%

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

    if 7.6000000000000008e22 < A

    1. Initial program 77.4%

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

      \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(-2 \cdot \frac{A}{B}\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{-2 \cdot A}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\left(\mathsf{neg}\left(2\right)\right) \cdot A}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\mathsf{neg}\left(2 \cdot A\right)}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(2 \cdot A\right)\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(2\right)\right) \cdot A\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(-2 \cdot A\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(A \cdot -2\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      8. *-lowering-*.f6469.7%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(A, -2\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified69.7%

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

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

Alternative 15: 48.8% accurate, 3.5× speedup?

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

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

\mathbf{elif}\;A \leq 7.5 \cdot 10^{-95}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -1.05e-133

    1. Initial program 32.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 \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{B}{A}\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\frac{1}{2} \cdot B}{A}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot B\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(B \cdot \frac{1}{2}\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. *-lowering-*.f6463.1%

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \frac{1}{2}\right), A\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    5. Simplified63.1%

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

    if -1.05e-133 < A < 7.5000000000000003e-95

    1. Initial program 47.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
    3. Simplified79.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{1}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
    6. Step-by-step derivation
      1. Simplified35.6%

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

      if 7.5000000000000003e-95 < 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. Taylor expanded in A around inf

        \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(-2 \cdot \frac{A}{B}\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      4. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{-2 \cdot A}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\left(\mathsf{neg}\left(2\right)\right) \cdot A}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        3. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\mathsf{neg}\left(2 \cdot A\right)}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(2 \cdot A\right)\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        5. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(2\right)\right) \cdot A\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        6. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(-2 \cdot A\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(A \cdot -2\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        8. *-lowering-*.f6463.6%

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(A, -2\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. Simplified63.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -1.05 \cdot 10^{-133}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot 0.5}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 7.5 \cdot 10^{-95}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 16: 45.2% accurate, 3.5× speedup?

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

      1. Initial program 45.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. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
      3. Simplified77.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{1}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
      6. Step-by-step derivation
        1. Simplified57.4%

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

        if -3.25000000000000005e-136 < B < 3.89999999999999994e-91

        1. Initial program 56.4%

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

          \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(-2 \cdot \frac{A}{B}\right)}\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        4. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{-2 \cdot A}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
          2. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\left(\mathsf{neg}\left(2\right)\right) \cdot A}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
          3. distribute-lft-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\left(\frac{\mathsf{neg}\left(2 \cdot A\right)}{B}\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(2 \cdot A\right)\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
          5. distribute-lft-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(2\right)\right) \cdot A\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(-2 \cdot A\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(A \cdot -2\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
          8. *-lowering-*.f6437.7%

            \[\leadsto \mathsf{*.f64}\left(180, \mathsf{/.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(A, -2\right), B\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
        5. Simplified37.7%

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

        if 3.89999999999999994e-91 < B

        1. Initial program 54.0%

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
        3. Simplified79.5%

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{-1}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
        6. Step-by-step derivation
          1. Simplified59.7%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -3.25 \cdot 10^{-136}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{elif}\;B \leq 3.9 \cdot 10^{-91}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{A \cdot -2}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} -1\\ \end{array} \]
        9. Add Preprocessing

        Alternative 17: 42.6% accurate, 3.6× speedup?

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

          1. Initial program 46.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. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
          3. Simplified77.6%

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{1}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
          6. Step-by-step derivation
            1. Simplified56.6%

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

            if -1.34999999999999997e-146 < B < 6.9999999999999995e-261

            1. Initial program 48.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. Step-by-step derivation
              1. *-commutativeN/A

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
            3. Simplified76.2%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{\left(-1 \cdot \frac{A + -1 \cdot A}{B}\right)}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
            6. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{-1 \cdot \left(A + -1 \cdot A\right)}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
              2. distribute-rgt1-inN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{-1 \cdot \left(\left(-1 + 1\right) \cdot A\right)}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
              3. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{-1 \cdot \left(0 \cdot A\right)}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
              4. mul0-lftN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{-1 \cdot 0}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
              5. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\left(\frac{0}{B}\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
              6. /-lowering-/.f6437.2%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\mathsf{/.f64}\left(0, B\right)\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
            7. Simplified37.2%

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

            if 6.9999999999999995e-261 < B

            1. Initial program 59.2%

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
            3. Simplified80.5%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{-1}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
            6. Step-by-step derivation
              1. Simplified51.4%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1.35 \cdot 10^{-146}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{elif}\;B \leq 7 \cdot 10^{-261}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} -1\\ \end{array} \]
            9. Add Preprocessing

            Alternative 18: 38.8% accurate, 3.8× speedup?

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

              1. Initial program 47.1%

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
              3. Simplified76.2%

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{1}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
              6. Step-by-step derivation
                1. Simplified42.6%

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

                if -2.15e-306 < B

                1. Initial program 57.3%

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
                3. Simplified81.3%

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{-1}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
                6. Step-by-step derivation
                  1. Simplified45.9%

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

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

                Alternative 19: 20.2% accurate, 4.0× speedup?

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right), \color{blue}{\left(\frac{180}{\mathsf{PI}\left(\right)}\right)}\right) \]
                3. Simplified78.3%

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{atan.f64}\left(\color{blue}{-1}\right), \mathsf{/.f64}\left(180, \mathsf{PI.f64}\left(\right)\right)\right) \]
                6. Step-by-step derivation
                  1. Simplified20.3%

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

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

                  Reproduce

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