ABCF->ab-angle angle

Percentage Accurate: 54.3% → 81.6%
Time: 9.7s
Alternatives: 7
Speedup: N/A×

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 7 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: 54.3% accurate, 1.0× speedup?

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

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

Alternative 1: 81.6% accurate, N/A× speedup?

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

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

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


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

    1. Initial program 11.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.49999999999999908e99 < A

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 81.6% accurate, N/A× speedup?

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

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

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


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

    1. Initial program 11.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.6000000000000005e99 < A

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 71.2% accurate, N/A× speedup?

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

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

\mathbf{elif}\;C \leq 5.9 \cdot 10^{+81}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\mathsf{fma}\left(\left(-0.5 \cdot \left(\left(1 - \frac{C \cdot C}{\mathsf{fma}\left(C, C, B \cdot B\right)}\right) \cdot A\right)\right) \cdot t\_0 - \mathsf{fma}\left(-C, t\_0, 1\right), A, C\right) - \mathsf{hypot}\left(C, B\right)\right)\right)}{\pi}\\

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


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

    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

    if -1.24999999999999992e145 < C < 5.9000000000000004e81

    1. Initial program 53.7%

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

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

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

    if 5.9000000000000004e81 < C

    1. Initial program 26.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 68.6% accurate, N/A× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(C, B\right)\right)}^{-1}\\
\mathbf{if}\;C \leq -1.26 \cdot 10^{+132}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-0.5 \cdot \left(B + B \cdot \frac{C}{A}\right)}{-A}\right)}{\pi}\\

\mathbf{elif}\;C \leq 5.9 \cdot 10^{+81}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\mathsf{fma}\left(\left(-0.5 \cdot \left(\left(1 - \frac{C \cdot C}{\mathsf{fma}\left(C, C, B \cdot B\right)}\right) \cdot A\right)\right) \cdot t\_0 - \mathsf{fma}\left(-C, t\_0, 1\right), A, C\right) - \mathsf{hypot}\left(C, B\right)\right)\right)}{\pi}\\

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


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

    1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25999999999999999e132 < C < 5.9000000000000004e81

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

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

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

    if 5.9000000000000004e81 < C

    1. Initial program 26.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 45.8% accurate, N/A× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 1.0500000000000001e51

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0500000000000001e51 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 44.3% accurate, N/A× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 1.0500000000000001e51

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0500000000000001e51 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 33.8% accurate, N/A× speedup?

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

\\
180 \cdot \frac{\tan^{-1} \left(\frac{-0.5 \cdot \left(B + B \cdot \frac{C}{A}\right)}{-A}\right)}{\pi}
\end{array}
Derivation
  1. Initial program 51.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-0.5 \cdot \left(B + B \cdot \frac{C}{A}\right)}{-A}\right)}{\pi} \]
  7. Add Preprocessing

Reproduce

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