ABCF->ab-angle angle

Percentage Accurate: 54.0% → 80.7%
Time: 22.7s
Alternatives: 17
Speedup: 2.4×

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 17 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.0% 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: 80.7% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 2: 77.8% accurate, 1.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 3: 77.8% accurate, 1.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 4: 75.3% accurate, 1.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 5: 48.1% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\ t_2 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{if}\;A \leq -1.46 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;A \leq -2.4:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq -1.66 \cdot 10^{-50}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;A \leq -2 \cdot 10^{-115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -6 \cdot 10^{-158}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -2.6 \cdot 10^{-210}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -3.05 \cdot 10^{-239}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq 8 \cdot 10^{-171}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;A \leq 4.8 \cdot 10^{-80}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan -1.0) PI)))
        (t_1 (* 180.0 (/ (atan (/ (* B -0.5) C)) PI)))
        (t_2 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
   (if (<= A -1.46e+32)
     t_2
     (if (<= A -2.4)
       t_1
       (if (<= A -1.66e-50)
         t_2
         (if (<= A -2e-115)
           t_0
           (if (<= A -6e-158)
             (* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
             (if (<= A -2.6e-210)
               t_0
               (if (<= A -3.05e-239)
                 (* 180.0 (/ (atan (/ C B)) PI))
                 (if (<= A 8e-171)
                   (* 180.0 (/ (atan 1.0) PI))
                   (if (<= A 4.8e-80)
                     t_1
                     (* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))))))))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
	double t_1 = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
	double t_2 = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
	double tmp;
	if (A <= -1.46e+32) {
		tmp = t_2;
	} else if (A <= -2.4) {
		tmp = t_1;
	} else if (A <= -1.66e-50) {
		tmp = t_2;
	} else if (A <= -2e-115) {
		tmp = t_0;
	} else if (A <= -6e-158) {
		tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
	} else if (A <= -2.6e-210) {
		tmp = t_0;
	} else if (A <= -3.05e-239) {
		tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
	} else if (A <= 8e-171) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (A <= 4.8e-80) {
		tmp = t_1;
	} else {
		tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
	double t_1 = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
	double t_2 = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
	double tmp;
	if (A <= -1.46e+32) {
		tmp = t_2;
	} else if (A <= -2.4) {
		tmp = t_1;
	} else if (A <= -1.66e-50) {
		tmp = t_2;
	} else if (A <= -2e-115) {
		tmp = t_0;
	} else if (A <= -6e-158) {
		tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
	} else if (A <= -2.6e-210) {
		tmp = t_0;
	} else if (A <= -3.05e-239) {
		tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
	} else if (A <= 8e-171) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (A <= 4.8e-80) {
		tmp = t_1;
	} else {
		tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 * (math.atan(-1.0) / math.pi)
	t_1 = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi)
	t_2 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	tmp = 0
	if A <= -1.46e+32:
		tmp = t_2
	elif A <= -2.4:
		tmp = t_1
	elif A <= -1.66e-50:
		tmp = t_2
	elif A <= -2e-115:
		tmp = t_0
	elif A <= -6e-158:
		tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi)
	elif A <= -2.6e-210:
		tmp = t_0
	elif A <= -3.05e-239:
		tmp = 180.0 * (math.atan((C / B)) / math.pi)
	elif A <= 8e-171:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif A <= 4.8e-80:
		tmp = t_1
	else:
		tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi)
	return tmp
function code(A, B, C)
	t_0 = Float64(180.0 * Float64(atan(-1.0) / pi))
	t_1 = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi))
	t_2 = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi))
	tmp = 0.0
	if (A <= -1.46e+32)
		tmp = t_2;
	elseif (A <= -2.4)
		tmp = t_1;
	elseif (A <= -1.66e-50)
		tmp = t_2;
	elseif (A <= -2e-115)
		tmp = t_0;
	elseif (A <= -6e-158)
		tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi));
	elseif (A <= -2.6e-210)
		tmp = t_0;
	elseif (A <= -3.05e-239)
		tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi));
	elseif (A <= 8e-171)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (A <= 4.8e-80)
		tmp = t_1;
	else
		tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = 180.0 * (atan(-1.0) / pi);
	t_1 = 180.0 * (atan(((B * -0.5) / C)) / pi);
	t_2 = 180.0 * (atan((0.5 * (B / A))) / pi);
	tmp = 0.0;
	if (A <= -1.46e+32)
		tmp = t_2;
	elseif (A <= -2.4)
		tmp = t_1;
	elseif (A <= -1.66e-50)
		tmp = t_2;
	elseif (A <= -2e-115)
		tmp = t_0;
	elseif (A <= -6e-158)
		tmp = 180.0 * (atan((2.0 * (C / B))) / pi);
	elseif (A <= -2.6e-210)
		tmp = t_0;
	elseif (A <= -3.05e-239)
		tmp = 180.0 * (atan((C / B)) / pi);
	elseif (A <= 8e-171)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (A <= 4.8e-80)
		tmp = t_1;
	else
		tmp = 180.0 * (atan((-2.0 * (A / B))) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.46e+32], t$95$2, If[LessEqual[A, -2.4], t$95$1, If[LessEqual[A, -1.66e-50], t$95$2, If[LessEqual[A, -2e-115], t$95$0, If[LessEqual[A, -6e-158], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.6e-210], t$95$0, If[LessEqual[A, -3.05e-239], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 8e-171], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.8e-80], t$95$1, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
t_2 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.46 \cdot 10^{+32}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;A \leq -2.4:\\
\;\;\;\;t_1\\

\mathbf{elif}\;A \leq -1.66 \cdot 10^{-50}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;A \leq -2 \cdot 10^{-115}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;A \leq -2.6 \cdot 10^{-210}:\\
\;\;\;\;t_0\\

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

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

\mathbf{elif}\;A \leq 4.8 \cdot 10^{-80}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 6: 48.2% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{if}\;A \leq -1.2 \cdot 10^{-52}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -2.2 \cdot 10^{-115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -1.9 \cdot 10^{-153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq -1.4 \cdot 10^{-210}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -4.6 \cdot 10^{-239}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 1.8 \cdot 10^{-192}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;A \leq 7.6 \cdot 10^{-67}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan -1.0) PI)))
        (t_1 (* 180.0 (/ (atan (/ C B)) PI))))
   (if (<= A -1.2e-52)
     (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
     (if (<= A -2.2e-115)
       t_0
       (if (<= A -1.9e-153)
         t_1
         (if (<= A -1.4e-210)
           t_0
           (if (<= A -4.6e-239)
             t_1
             (if (<= A 1.8e-192)
               (* 180.0 (/ (atan 1.0) PI))
               (if (<= A 7.6e-67)
                 t_0
                 (* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))))))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
	double t_1 = 180.0 * (atan((C / B)) / ((double) M_PI));
	double tmp;
	if (A <= -1.2e-52) {
		tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
	} else if (A <= -2.2e-115) {
		tmp = t_0;
	} else if (A <= -1.9e-153) {
		tmp = t_1;
	} else if (A <= -1.4e-210) {
		tmp = t_0;
	} else if (A <= -4.6e-239) {
		tmp = t_1;
	} else if (A <= 1.8e-192) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (A <= 7.6e-67) {
		tmp = t_0;
	} else {
		tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
	double t_1 = 180.0 * (Math.atan((C / B)) / Math.PI);
	double tmp;
	if (A <= -1.2e-52) {
		tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
	} else if (A <= -2.2e-115) {
		tmp = t_0;
	} else if (A <= -1.9e-153) {
		tmp = t_1;
	} else if (A <= -1.4e-210) {
		tmp = t_0;
	} else if (A <= -4.6e-239) {
		tmp = t_1;
	} else if (A <= 1.8e-192) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (A <= 7.6e-67) {
		tmp = t_0;
	} else {
		tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 * (math.atan(-1.0) / math.pi)
	t_1 = 180.0 * (math.atan((C / B)) / math.pi)
	tmp = 0
	if A <= -1.2e-52:
		tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	elif A <= -2.2e-115:
		tmp = t_0
	elif A <= -1.9e-153:
		tmp = t_1
	elif A <= -1.4e-210:
		tmp = t_0
	elif A <= -4.6e-239:
		tmp = t_1
	elif A <= 1.8e-192:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif A <= 7.6e-67:
		tmp = t_0
	else:
		tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi)
	return tmp
function code(A, B, C)
	t_0 = Float64(180.0 * Float64(atan(-1.0) / pi))
	t_1 = Float64(180.0 * Float64(atan(Float64(C / B)) / pi))
	tmp = 0.0
	if (A <= -1.2e-52)
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi));
	elseif (A <= -2.2e-115)
		tmp = t_0;
	elseif (A <= -1.9e-153)
		tmp = t_1;
	elseif (A <= -1.4e-210)
		tmp = t_0;
	elseif (A <= -4.6e-239)
		tmp = t_1;
	elseif (A <= 1.8e-192)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (A <= 7.6e-67)
		tmp = t_0;
	else
		tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = 180.0 * (atan(-1.0) / pi);
	t_1 = 180.0 * (atan((C / B)) / pi);
	tmp = 0.0;
	if (A <= -1.2e-52)
		tmp = 180.0 * (atan((0.5 * (B / A))) / pi);
	elseif (A <= -2.2e-115)
		tmp = t_0;
	elseif (A <= -1.9e-153)
		tmp = t_1;
	elseif (A <= -1.4e-210)
		tmp = t_0;
	elseif (A <= -4.6e-239)
		tmp = t_1;
	elseif (A <= 1.8e-192)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (A <= 7.6e-67)
		tmp = t_0;
	else
		tmp = 180.0 * (atan((-2.0 * (A / B))) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.2e-52], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.2e-115], t$95$0, If[LessEqual[A, -1.9e-153], t$95$1, If[LessEqual[A, -1.4e-210], t$95$0, If[LessEqual[A, -4.6e-239], t$95$1, If[LessEqual[A, 1.8e-192], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7.6e-67], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\
\mathbf{if}\;A \leq -1.2 \cdot 10^{-52}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\

\mathbf{elif}\;A \leq -2.2 \cdot 10^{-115}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq -1.9 \cdot 10^{-153}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;A \leq -1.4 \cdot 10^{-210}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq -4.6 \cdot 10^{-239}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;A \leq 7.6 \cdot 10^{-67}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 7: 48.2% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{if}\;A \leq -4.2 \cdot 10^{-60}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -2.6 \cdot 10^{-115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -8.8 \cdot 10^{-156}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(2 \cdot \frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -3.2 \cdot 10^{-211}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -1.95 \cdot 10^{-233}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq 1.5 \cdot 10^{-191}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;A \leq 2.05 \cdot 10^{-66}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan -1.0) PI))))
   (if (<= A -4.2e-60)
     (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
     (if (<= A -2.6e-115)
       t_0
       (if (<= A -8.8e-156)
         (* 180.0 (/ (atan (* 2.0 (/ C B))) PI))
         (if (<= A -3.2e-211)
           t_0
           (if (<= A -1.95e-233)
             (* 180.0 (/ (atan (/ C B)) PI))
             (if (<= A 1.5e-191)
               (* 180.0 (/ (atan 1.0) PI))
               (if (<= A 2.05e-66)
                 t_0
                 (* 180.0 (/ (atan (* -2.0 (/ A B))) PI)))))))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan(-1.0) / ((double) M_PI));
	double tmp;
	if (A <= -4.2e-60) {
		tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
	} else if (A <= -2.6e-115) {
		tmp = t_0;
	} else if (A <= -8.8e-156) {
		tmp = 180.0 * (atan((2.0 * (C / B))) / ((double) M_PI));
	} else if (A <= -3.2e-211) {
		tmp = t_0;
	} else if (A <= -1.95e-233) {
		tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
	} else if (A <= 1.5e-191) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (A <= 2.05e-66) {
		tmp = t_0;
	} else {
		tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = 180.0 * (Math.atan(-1.0) / Math.PI);
	double tmp;
	if (A <= -4.2e-60) {
		tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
	} else if (A <= -2.6e-115) {
		tmp = t_0;
	} else if (A <= -8.8e-156) {
		tmp = 180.0 * (Math.atan((2.0 * (C / B))) / Math.PI);
	} else if (A <= -3.2e-211) {
		tmp = t_0;
	} else if (A <= -1.95e-233) {
		tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
	} else if (A <= 1.5e-191) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (A <= 2.05e-66) {
		tmp = t_0;
	} else {
		tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 * (math.atan(-1.0) / math.pi)
	tmp = 0
	if A <= -4.2e-60:
		tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	elif A <= -2.6e-115:
		tmp = t_0
	elif A <= -8.8e-156:
		tmp = 180.0 * (math.atan((2.0 * (C / B))) / math.pi)
	elif A <= -3.2e-211:
		tmp = t_0
	elif A <= -1.95e-233:
		tmp = 180.0 * (math.atan((C / B)) / math.pi)
	elif A <= 1.5e-191:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif A <= 2.05e-66:
		tmp = t_0
	else:
		tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi)
	return tmp
function code(A, B, C)
	t_0 = Float64(180.0 * Float64(atan(-1.0) / pi))
	tmp = 0.0
	if (A <= -4.2e-60)
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi));
	elseif (A <= -2.6e-115)
		tmp = t_0;
	elseif (A <= -8.8e-156)
		tmp = Float64(180.0 * Float64(atan(Float64(2.0 * Float64(C / B))) / pi));
	elseif (A <= -3.2e-211)
		tmp = t_0;
	elseif (A <= -1.95e-233)
		tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi));
	elseif (A <= 1.5e-191)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (A <= 2.05e-66)
		tmp = t_0;
	else
		tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = 180.0 * (atan(-1.0) / pi);
	tmp = 0.0;
	if (A <= -4.2e-60)
		tmp = 180.0 * (atan((0.5 * (B / A))) / pi);
	elseif (A <= -2.6e-115)
		tmp = t_0;
	elseif (A <= -8.8e-156)
		tmp = 180.0 * (atan((2.0 * (C / B))) / pi);
	elseif (A <= -3.2e-211)
		tmp = t_0;
	elseif (A <= -1.95e-233)
		tmp = 180.0 * (atan((C / B)) / pi);
	elseif (A <= 1.5e-191)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (A <= 2.05e-66)
		tmp = t_0;
	else
		tmp = 180.0 * (atan((-2.0 * (A / B))) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -4.2e-60], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -2.6e-115], t$95$0, If[LessEqual[A, -8.8e-156], N[(180.0 * N[(N[ArcTan[N[(2.0 * N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -3.2e-211], t$95$0, If[LessEqual[A, -1.95e-233], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.5e-191], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.05e-66], t$95$0, N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;A \leq -2.6 \cdot 10^{-115}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;A \leq -3.2 \cdot 10^{-211}:\\
\;\;\;\;t_0\\

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

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

\mathbf{elif}\;A \leq 2.05 \cdot 10^{-66}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 8: 61.0% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{if}\;A \leq -1.46 \cdot 10^{+32}:\\ \;\;\;\;\frac{180}{\frac{\pi}{t_0}}\\ \mathbf{elif}\;A \leq -23.5:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;A \leq -1.4 \cdot 10^{-57}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{elif}\;A \leq -5 \cdot 10^{-209} \lor \neg \left(A \leq 5.2 \cdot 10^{-203}\right):\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (atan (* 0.5 (/ B A)))))
   (if (<= A -1.46e+32)
     (/ 180.0 (/ PI t_0))
     (if (<= A -23.5)
       (/ (* 180.0 (atan (* -0.5 (/ B C)))) PI)
       (if (<= A -1.4e-57)
         (* 180.0 (/ t_0 PI))
         (if (or (<= A -5e-209) (not (<= A 5.2e-203)))
           (* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))
           (* 180.0 (/ (atan (/ (+ B C) B)) PI))))))))
double code(double A, double B, double C) {
	double t_0 = atan((0.5 * (B / A)));
	double tmp;
	if (A <= -1.46e+32) {
		tmp = 180.0 / (((double) M_PI) / t_0);
	} else if (A <= -23.5) {
		tmp = (180.0 * atan((-0.5 * (B / C)))) / ((double) M_PI);
	} else if (A <= -1.4e-57) {
		tmp = 180.0 * (t_0 / ((double) M_PI));
	} else if ((A <= -5e-209) || !(A <= 5.2e-203)) {
		tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = Math.atan((0.5 * (B / A)));
	double tmp;
	if (A <= -1.46e+32) {
		tmp = 180.0 / (Math.PI / t_0);
	} else if (A <= -23.5) {
		tmp = (180.0 * Math.atan((-0.5 * (B / C)))) / Math.PI;
	} else if (A <= -1.4e-57) {
		tmp = 180.0 * (t_0 / Math.PI);
	} else if ((A <= -5e-209) || !(A <= 5.2e-203)) {
		tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = math.atan((0.5 * (B / A)))
	tmp = 0
	if A <= -1.46e+32:
		tmp = 180.0 / (math.pi / t_0)
	elif A <= -23.5:
		tmp = (180.0 * math.atan((-0.5 * (B / C)))) / math.pi
	elif A <= -1.4e-57:
		tmp = 180.0 * (t_0 / math.pi)
	elif (A <= -5e-209) or not (A <= 5.2e-203):
		tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi)
	else:
		tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi)
	return tmp
function code(A, B, C)
	t_0 = atan(Float64(0.5 * Float64(B / A)))
	tmp = 0.0
	if (A <= -1.46e+32)
		tmp = Float64(180.0 / Float64(pi / t_0));
	elseif (A <= -23.5)
		tmp = Float64(Float64(180.0 * atan(Float64(-0.5 * Float64(B / C)))) / pi);
	elseif (A <= -1.4e-57)
		tmp = Float64(180.0 * Float64(t_0 / pi));
	elseif ((A <= -5e-209) || !(A <= 5.2e-203))
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = atan((0.5 * (B / A)));
	tmp = 0.0;
	if (A <= -1.46e+32)
		tmp = 180.0 / (pi / t_0);
	elseif (A <= -23.5)
		tmp = (180.0 * atan((-0.5 * (B / C)))) / pi;
	elseif (A <= -1.4e-57)
		tmp = 180.0 * (t_0 / pi);
	elseif ((A <= -5e-209) || ~((A <= 5.2e-203)))
		tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi);
	else
		tmp = 180.0 * (atan(((B + C) / B)) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[A, -1.46e+32], N[(180.0 / N[(Pi / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -23.5], N[(N[(180.0 * N[ArcTan[N[(-0.5 * N[(B / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, -1.4e-57], N[(180.0 * N[(t$95$0 / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[A, -5e-209], N[Not[LessEqual[A, 5.2e-203]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;A \leq -1.4 \cdot 10^{-57}:\\
\;\;\;\;180 \cdot \frac{t_0}{\pi}\\

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 9: 55.0% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;A \leq -170:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq -4.6 \cdot 10^{-61}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;A \leq 5.7 \cdot 10^{-80}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 10: 58.4% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;A \leq -220:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq -5.5 \cdot 10^{-61}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;A \leq 3.3 \cdot 10^{-87}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 11: 58.4% accurate, 2.4× speedup?

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

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

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

\mathbf{elif}\;A \leq -4 \cdot 10^{-61}:\\
\;\;\;\;t_0\\

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 12: 58.2% accurate, 2.4× speedup?

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

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

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

\mathbf{elif}\;A \leq -5.4 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{t_0}{\pi}\\

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

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

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 13: 58.2% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;A \leq -210:\\
\;\;\;\;\frac{180 \cdot t_0}{\pi}\\

\mathbf{elif}\;A \leq -4.6 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{t_1}{\pi}\\

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

\mathbf{elif}\;A \leq 5.8 \cdot 10^{-88}:\\
\;\;\;\;\frac{180}{\frac{\pi}{t_0}}\\

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


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 14: 46.9% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.3 \cdot 10^{-128}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

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

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 15: 44.6% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.45 \cdot 10^{-135}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{elif}\;B \leq 9.5 \cdot 10^{-158}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} 0}}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 16: 39.6% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\


\end{array}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Alternative 17: 20.5% accurate, 2.5× speedup?

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

\\
180 \cdot \frac{\tan^{-1} -1}{\pi}
\end{array}
Derivation
    &prev;&pcontext;&pcontext2;&ctx;
  1. Add Preprocessing

Reproduce

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