ABCF->ab-angle angle

Percentage Accurate: 53.3% → 79.2%
Time: 24.2s
Alternatives: 21
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 21 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 53.3% accurate, 1.0× speedup?

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

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

Alternative 1: 79.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -2.4 \cdot 10^{+148}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -7.4 \cdot 10^{+53}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -7.2 \cdot 10^{-46}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(0.5 \cdot \left(\frac{B}{A} + \frac{B}{\frac{{A}^{2}}{C}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\sqrt[3]{{\left(\frac{\pi}{\tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(A - C, B\right)\right)}{B}\right)}\right)}^{3}}}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (if (<= A -2.4e+148)
   (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
   (if (<= A -7.4e+53)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
     (if (<= A -7.2e-46)
       (/ 180.0 (/ PI (atan (* 0.5 (+ (/ B A) (/ B (/ (pow A 2.0) C)))))))
       (/
        180.0
        (cbrt (pow (/ PI (atan (/ (- C (+ A (hypot (- A C) B))) B))) 3.0)))))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -2.4e+148) {
		tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
	} else if (A <= -7.4e+53) {
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
	} else if (A <= -7.2e-46) {
		tmp = 180.0 / (((double) M_PI) / atan((0.5 * ((B / A) + (B / (pow(A, 2.0) / C))))));
	} else {
		tmp = 180.0 / cbrt(pow((((double) M_PI) / atan(((C - (A + hypot((A - C), B))) / B))), 3.0));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double tmp;
	if (A <= -2.4e+148) {
		tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
	} else if (A <= -7.4e+53) {
		tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
	} else if (A <= -7.2e-46) {
		tmp = 180.0 / (Math.PI / Math.atan((0.5 * ((B / A) + (B / (Math.pow(A, 2.0) / C))))));
	} else {
		tmp = 180.0 / Math.cbrt(Math.pow((Math.PI / Math.atan(((C - (A + Math.hypot((A - C), B))) / B))), 3.0));
	}
	return tmp;
}
function code(A, B, C)
	tmp = 0.0
	if (A <= -2.4e+148)
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi));
	elseif (A <= -7.4e+53)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi));
	elseif (A <= -7.2e-46)
		tmp = Float64(180.0 / Float64(pi / atan(Float64(0.5 * Float64(Float64(B / A) + Float64(B / Float64((A ^ 2.0) / C)))))));
	else
		tmp = Float64(180.0 / cbrt((Float64(pi / atan(Float64(Float64(C - Float64(A + hypot(Float64(A - C), B))) / B))) ^ 3.0)));
	end
	return tmp
end
code[A_, B_, C_] := If[LessEqual[A, -2.4e+148], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -7.4e+53], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -7.2e-46], N[(180.0 / N[(Pi / N[ArcTan[N[(0.5 * N[(N[(B / A), $MachinePrecision] + N[(B / N[(N[Power[A, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(180.0 / N[Power[N[Power[N[(Pi / N[ArcTan[N[(N[(C - N[(A + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

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

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


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

Alternative 2: 79.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -1.65 \cdot 10^{+149}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -4.4 \cdot 10^{+53}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -6.3 \cdot 10^{-46}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \left(\frac{B}{A} + \frac{B}{\frac{{A}^{2}}{C}}\right)\right)}{\pi}\\ \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 -1.65e+149)
   (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
   (if (<= A -4.4e+53)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
     (if (<= A -6.3e-46)
       (* 180.0 (/ (atan (* 0.5 (+ (/ B A) (/ B (/ (pow A 2.0) C))))) PI))
       (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -1.65e+149) {
		tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
	} else if (A <= -4.4e+53) {
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
	} else if (A <= -6.3e-46) {
		tmp = 180.0 * (atan((0.5 * ((B / A) + (B / (pow(A, 2.0) / C))))) / ((double) M_PI));
	} 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 <= -1.65e+149) {
		tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
	} else if (A <= -4.4e+53) {
		tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
	} else if (A <= -6.3e-46) {
		tmp = 180.0 * (Math.atan((0.5 * ((B / A) + (B / (Math.pow(A, 2.0) / C))))) / Math.PI);
	} 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 <= -1.65e+149:
		tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	elif A <= -4.4e+53:
		tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi)
	elif A <= -6.3e-46:
		tmp = 180.0 * (math.atan((0.5 * ((B / A) + (B / (math.pow(A, 2.0) / C))))) / math.pi)
	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 <= -1.65e+149)
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi));
	elseif (A <= -4.4e+53)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi));
	elseif (A <= -6.3e-46)
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(B / A) + Float64(B / Float64((A ^ 2.0) / C))))) / pi));
	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 <= -1.65e+149)
		tmp = 180.0 * (atan((0.5 * (B / A))) / pi);
	elseif (A <= -4.4e+53)
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi);
	elseif (A <= -6.3e-46)
		tmp = 180.0 * (atan((0.5 * ((B / A) + (B / ((A ^ 2.0) / C))))) / pi);
	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, -1.65e+149], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -4.4e+53], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -6.3e-46], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(B / A), $MachinePrecision] + N[(B / N[(N[Power[A, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $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 -1.65 \cdot 10^{+149}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\

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

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

\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 3: 79.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -4 \cdot 10^{+148}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -6.2 \cdot 10^{+53}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -7.4 \cdot 10^{-46}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(0.5 \cdot \left(\frac{B}{A} + \frac{B}{\frac{{A}^{2}}{C}}\right)\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 -4e+148)
   (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
   (if (<= A -6.2e+53)
     (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
     (if (<= A -7.4e-46)
       (/ 180.0 (/ PI (atan (* 0.5 (+ (/ B A) (/ B (/ (pow A 2.0) C)))))))
       (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI))))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -4e+148) {
		tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
	} else if (A <= -6.2e+53) {
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
	} else if (A <= -7.4e-46) {
		tmp = 180.0 / (((double) M_PI) / atan((0.5 * ((B / A) + (B / (pow(A, 2.0) / C))))));
	} 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 <= -4e+148) {
		tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
	} else if (A <= -6.2e+53) {
		tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
	} else if (A <= -7.4e-46) {
		tmp = 180.0 / (Math.PI / Math.atan((0.5 * ((B / A) + (B / (Math.pow(A, 2.0) / C))))));
	} 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 <= -4e+148:
		tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	elif A <= -6.2e+53:
		tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi)
	elif A <= -7.4e-46:
		tmp = 180.0 / (math.pi / math.atan((0.5 * ((B / A) + (B / (math.pow(A, 2.0) / C))))))
	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 <= -4e+148)
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi));
	elseif (A <= -6.2e+53)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi));
	elseif (A <= -7.4e-46)
		tmp = Float64(180.0 / Float64(pi / atan(Float64(0.5 * Float64(Float64(B / A) + Float64(B / Float64((A ^ 2.0) / C)))))));
	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 <= -4e+148)
		tmp = 180.0 * (atan((0.5 * (B / A))) / pi);
	elseif (A <= -6.2e+53)
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi);
	elseif (A <= -7.4e-46)
		tmp = 180.0 / (pi / atan((0.5 * ((B / A) + (B / ((A ^ 2.0) / C))))));
	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, -4e+148], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -6.2e+53], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -7.4e-46], N[(180.0 / N[(Pi / N[ArcTan[N[(0.5 * N[(N[(B / A), $MachinePrecision] + N[(B / N[(N[Power[A, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $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 -4 \cdot 10^{+148}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\

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

\mathbf{elif}\;A \leq -7.4 \cdot 10^{-46}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(0.5 \cdot \left(\frac{B}{A} + \frac{B}{\frac{{A}^{2}}{C}}\right)\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 4: 78.9% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{if}\;A \leq -2.5 \cdot 10^{+148}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{elif}\;A \leq -5 \cdot 10^{+53}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -4.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{180 \cdot t_0}{\pi}\\ \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
 (let* ((t_0 (atan (* 0.5 (/ B A)))))
   (if (<= A -2.5e+148)
     (* 180.0 (/ t_0 PI))
     (if (<= A -5e+53)
       (* 180.0 (/ (atan (/ (- C (hypot B C)) B)) PI))
       (if (<= A -4.1e-47)
         (/ (* 180.0 t_0) PI)
         (* 180.0 (/ (atan (/ (- C (+ A (hypot B (- A C)))) B)) PI)))))))
double code(double A, double B, double C) {
	double t_0 = atan((0.5 * (B / A)));
	double tmp;
	if (A <= -2.5e+148) {
		tmp = 180.0 * (t_0 / ((double) M_PI));
	} else if (A <= -5e+53) {
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / ((double) M_PI));
	} else if (A <= -4.1e-47) {
		tmp = (180.0 * t_0) / ((double) M_PI);
	} 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 t_0 = Math.atan((0.5 * (B / A)));
	double tmp;
	if (A <= -2.5e+148) {
		tmp = 180.0 * (t_0 / Math.PI);
	} else if (A <= -5e+53) {
		tmp = 180.0 * (Math.atan(((C - Math.hypot(B, C)) / B)) / Math.PI);
	} else if (A <= -4.1e-47) {
		tmp = (180.0 * t_0) / Math.PI;
	} else {
		tmp = 180.0 * (Math.atan(((C - (A + Math.hypot(B, (A - C)))) / B)) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = math.atan((0.5 * (B / A)))
	tmp = 0
	if A <= -2.5e+148:
		tmp = 180.0 * (t_0 / math.pi)
	elif A <= -5e+53:
		tmp = 180.0 * (math.atan(((C - math.hypot(B, C)) / B)) / math.pi)
	elif A <= -4.1e-47:
		tmp = (180.0 * t_0) / math.pi
	else:
		tmp = 180.0 * (math.atan(((C - (A + math.hypot(B, (A - 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 <= -2.5e+148)
		tmp = Float64(180.0 * Float64(t_0 / pi));
	elseif (A <= -5e+53)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - hypot(B, C)) / B)) / pi));
	elseif (A <= -4.1e-47)
		tmp = Float64(Float64(180.0 * t_0) / pi);
	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)
	t_0 = atan((0.5 * (B / A)));
	tmp = 0.0;
	if (A <= -2.5e+148)
		tmp = 180.0 * (t_0 / pi);
	elseif (A <= -5e+53)
		tmp = 180.0 * (atan(((C - hypot(B, C)) / B)) / pi);
	elseif (A <= -4.1e-47)
		tmp = (180.0 * t_0) / pi;
	else
		tmp = 180.0 * (atan(((C - (A + hypot(B, (A - 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, -2.5e+148], N[(180.0 * N[(t$95$0 / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -5e+53], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, -4.1e-47], N[(N[(180.0 * t$95$0), $MachinePrecision] / Pi), $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}
t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\
\mathbf{if}\;A \leq -2.5 \cdot 10^{+148}:\\
\;\;\;\;180 \cdot \frac{t_0}{\pi}\\

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

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

\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 5: 73.1% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;A \leq -4.4 \cdot 10^{+53}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;A \leq 1.55 \cdot 10^{+128}:\\
\;\;\;\;t_0\\

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


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

Alternative 6: 45.7% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{-A}{B}\right)}}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{if}\;B \leq -5.2 \cdot 10^{-72}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -4.5 \cdot 10^{-136}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.75 \cdot 10^{-212}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -7.6 \cdot 10^{-273}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 4.9 \cdot 10^{-262}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 9.8 \cdot 10^{-239}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.02 \cdot 10^{-185}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 6 \cdot 10^{+29}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (/ 180.0 (/ PI (atan (/ (- A) B)))))
        (t_1 (* 180.0 (/ (atan (/ 0.0 B)) PI))))
   (if (<= B -5.2e-72)
     (* 180.0 (/ (atan 1.0) PI))
     (if (<= B -4.5e-136)
       t_0
       (if (<= B -1.75e-212)
         t_1
         (if (<= B -7.6e-273)
           (* 180.0 (/ (atan (/ C B)) PI))
           (if (<= B 4.9e-262)
             t_1
             (if (<= B 9.8e-239)
               t_0
               (if (<= B 1.02e-185)
                 t_1
                 (if (<= B 6e+29)
                   (* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
                   (* 180.0 (/ (atan -1.0) PI))))))))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 / (((double) M_PI) / atan((-A / B)));
	double t_1 = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
	double tmp;
	if (B <= -5.2e-72) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (B <= -4.5e-136) {
		tmp = t_0;
	} else if (B <= -1.75e-212) {
		tmp = t_1;
	} else if (B <= -7.6e-273) {
		tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
	} else if (B <= 4.9e-262) {
		tmp = t_1;
	} else if (B <= 9.8e-239) {
		tmp = t_0;
	} else if (B <= 1.02e-185) {
		tmp = t_1;
	} else if (B <= 6e+29) {
		tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double A, double B, double C) {
	double t_0 = 180.0 / (Math.PI / Math.atan((-A / B)));
	double t_1 = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
	double tmp;
	if (B <= -5.2e-72) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (B <= -4.5e-136) {
		tmp = t_0;
	} else if (B <= -1.75e-212) {
		tmp = t_1;
	} else if (B <= -7.6e-273) {
		tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
	} else if (B <= 4.9e-262) {
		tmp = t_1;
	} else if (B <= 9.8e-239) {
		tmp = t_0;
	} else if (B <= 1.02e-185) {
		tmp = t_1;
	} else if (B <= 6e+29) {
		tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 / (math.pi / math.atan((-A / B)))
	t_1 = 180.0 * (math.atan((0.0 / B)) / math.pi)
	tmp = 0
	if B <= -5.2e-72:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif B <= -4.5e-136:
		tmp = t_0
	elif B <= -1.75e-212:
		tmp = t_1
	elif B <= -7.6e-273:
		tmp = 180.0 * (math.atan((C / B)) / math.pi)
	elif B <= 4.9e-262:
		tmp = t_1
	elif B <= 9.8e-239:
		tmp = t_0
	elif B <= 1.02e-185:
		tmp = t_1
	elif B <= 6e+29:
		tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi)
	else:
		tmp = 180.0 * (math.atan(-1.0) / math.pi)
	return tmp
function code(A, B, C)
	t_0 = Float64(180.0 / Float64(pi / atan(Float64(Float64(-A) / B))))
	t_1 = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi))
	tmp = 0.0
	if (B <= -5.2e-72)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (B <= -4.5e-136)
		tmp = t_0;
	elseif (B <= -1.75e-212)
		tmp = t_1;
	elseif (B <= -7.6e-273)
		tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi));
	elseif (B <= 4.9e-262)
		tmp = t_1;
	elseif (B <= 9.8e-239)
		tmp = t_0;
	elseif (B <= 1.02e-185)
		tmp = t_1;
	elseif (B <= 6e+29)
		tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = 180.0 / (pi / atan((-A / B)));
	t_1 = 180.0 * (atan((0.0 / B)) / pi);
	tmp = 0.0;
	if (B <= -5.2e-72)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (B <= -4.5e-136)
		tmp = t_0;
	elseif (B <= -1.75e-212)
		tmp = t_1;
	elseif (B <= -7.6e-273)
		tmp = 180.0 * (atan((C / B)) / pi);
	elseif (B <= 4.9e-262)
		tmp = t_1;
	elseif (B <= 9.8e-239)
		tmp = t_0;
	elseif (B <= 1.02e-185)
		tmp = t_1;
	elseif (B <= 6e+29)
		tmp = 180.0 * (atan((-2.0 * (A / B))) / pi);
	else
		tmp = 180.0 * (atan(-1.0) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(180.0 / N[(Pi / N[ArcTan[N[((-A) / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -5.2e-72], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -4.5e-136], t$95$0, If[LessEqual[B, -1.75e-212], t$95$1, If[LessEqual[B, -7.6e-273], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.9e-262], t$95$1, If[LessEqual[B, 9.8e-239], t$95$0, If[LessEqual[B, 1.02e-185], t$95$1, If[LessEqual[B, 6e+29], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;B \leq -4.5 \cdot 10^{-136}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;B \leq -1.75 \cdot 10^{-212}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;B \leq 4.9 \cdot 10^{-262}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;B \leq 9.8 \cdot 10^{-239}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;B \leq 1.02 \cdot 10^{-185}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;B \leq 6 \cdot 10^{+29}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{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 7: 55.3% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\ \mathbf{if}\;A \leq -9.5 \cdot 10^{-47}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 8.8 \cdot 10^{-231}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 2.2 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 2.06 \cdot 10^{-73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 1.6 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 480000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{elif}\;A \leq 7 \cdot 10^{+72}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq 1.45 \cdot 10^{+81}:\\ \;\;\;\;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 (/ (- C B) B)) PI)))
        (t_1 (* 180.0 (/ (atan (/ (* B -0.5) C)) PI))))
   (if (<= A -9.5e-47)
     (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
     (if (<= A 8.8e-231)
       t_0
       (if (<= A 2.2e-213)
         t_1
         (if (<= A 2.06e-73)
           t_0
           (if (<= A 1.6e-25)
             t_1
             (if (<= A 480000000000.0)
               (* 180.0 (/ (atan -1.0) PI))
               (if (<= A 7e+72)
                 (* 180.0 (/ (atan (/ (+ B C) B)) PI))
                 (if (<= A 1.45e+81)
                   t_1
                   (* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))))))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
	double t_1 = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
	double tmp;
	if (A <= -9.5e-47) {
		tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
	} else if (A <= 8.8e-231) {
		tmp = t_0;
	} else if (A <= 2.2e-213) {
		tmp = t_1;
	} else if (A <= 2.06e-73) {
		tmp = t_0;
	} else if (A <= 1.6e-25) {
		tmp = t_1;
	} else if (A <= 480000000000.0) {
		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
	} else if (A <= 7e+72) {
		tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
	} else if (A <= 1.45e+81) {
		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(((C - B) / B)) / Math.PI);
	double t_1 = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
	double tmp;
	if (A <= -9.5e-47) {
		tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
	} else if (A <= 8.8e-231) {
		tmp = t_0;
	} else if (A <= 2.2e-213) {
		tmp = t_1;
	} else if (A <= 2.06e-73) {
		tmp = t_0;
	} else if (A <= 1.6e-25) {
		tmp = t_1;
	} else if (A <= 480000000000.0) {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	} else if (A <= 7e+72) {
		tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
	} else if (A <= 1.45e+81) {
		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(((C - B) / B)) / math.pi)
	t_1 = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi)
	tmp = 0
	if A <= -9.5e-47:
		tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	elif A <= 8.8e-231:
		tmp = t_0
	elif A <= 2.2e-213:
		tmp = t_1
	elif A <= 2.06e-73:
		tmp = t_0
	elif A <= 1.6e-25:
		tmp = t_1
	elif A <= 480000000000.0:
		tmp = 180.0 * (math.atan(-1.0) / math.pi)
	elif A <= 7e+72:
		tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi)
	elif A <= 1.45e+81:
		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(Float64(Float64(C - B) / B)) / pi))
	t_1 = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi))
	tmp = 0.0
	if (A <= -9.5e-47)
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi));
	elseif (A <= 8.8e-231)
		tmp = t_0;
	elseif (A <= 2.2e-213)
		tmp = t_1;
	elseif (A <= 2.06e-73)
		tmp = t_0;
	elseif (A <= 1.6e-25)
		tmp = t_1;
	elseif (A <= 480000000000.0)
		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
	elseif (A <= 7e+72)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi));
	elseif (A <= 1.45e+81)
		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(((C - B) / B)) / pi);
	t_1 = 180.0 * (atan(((B * -0.5) / C)) / pi);
	tmp = 0.0;
	if (A <= -9.5e-47)
		tmp = 180.0 * (atan((0.5 * (B / A))) / pi);
	elseif (A <= 8.8e-231)
		tmp = t_0;
	elseif (A <= 2.2e-213)
		tmp = t_1;
	elseif (A <= 2.06e-73)
		tmp = t_0;
	elseif (A <= 1.6e-25)
		tmp = t_1;
	elseif (A <= 480000000000.0)
		tmp = 180.0 * (atan(-1.0) / pi);
	elseif (A <= 7e+72)
		tmp = 180.0 * (atan(((B + C) / B)) / pi);
	elseif (A <= 1.45e+81)
		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[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $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]}, If[LessEqual[A, -9.5e-47], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 8.8e-231], t$95$0, If[LessEqual[A, 2.2e-213], t$95$1, If[LessEqual[A, 2.06e-73], t$95$0, If[LessEqual[A, 1.6e-25], t$95$1, If[LessEqual[A, 480000000000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7e+72], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.45e+81], 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} \left(\frac{C - B}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\mathbf{if}\;A \leq -9.5 \cdot 10^{-47}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\

\mathbf{elif}\;A \leq 8.8 \cdot 10^{-231}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq 2.2 \cdot 10^{-213}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;A \leq 2.06 \cdot 10^{-73}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq 1.6 \cdot 10^{-25}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;A \leq 1.45 \cdot 10^{+81}:\\
\;\;\;\;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 8: 55.3% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\ \mathbf{if}\;A \leq -3.25 \cdot 10^{-49}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 8.8 \cdot 10^{-231}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 1.3 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 9 \cdot 10^{-73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 7.8 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 340000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{elif}\;A \leq 4.2 \cdot 10^{+73}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq 1.5 \cdot 10^{+81}:\\ \;\;\;\;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 (/ (- C B) B)) PI)))
        (t_1 (* 180.0 (/ (atan (/ (* B -0.5) C)) PI))))
   (if (<= A -3.25e-49)
     (/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
     (if (<= A 8.8e-231)
       t_0
       (if (<= A 1.3e-213)
         t_1
         (if (<= A 9e-73)
           t_0
           (if (<= A 7.8e-27)
             t_1
             (if (<= A 340000000000.0)
               (* 180.0 (/ (atan -1.0) PI))
               (if (<= A 4.2e+73)
                 (* 180.0 (/ (atan (/ (+ B C) B)) PI))
                 (if (<= A 1.5e+81)
                   t_1
                   (* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))))))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
	double t_1 = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
	double tmp;
	if (A <= -3.25e-49) {
		tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
	} else if (A <= 8.8e-231) {
		tmp = t_0;
	} else if (A <= 1.3e-213) {
		tmp = t_1;
	} else if (A <= 9e-73) {
		tmp = t_0;
	} else if (A <= 7.8e-27) {
		tmp = t_1;
	} else if (A <= 340000000000.0) {
		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
	} else if (A <= 4.2e+73) {
		tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
	} else if (A <= 1.5e+81) {
		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(((C - B) / B)) / Math.PI);
	double t_1 = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
	double tmp;
	if (A <= -3.25e-49) {
		tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
	} else if (A <= 8.8e-231) {
		tmp = t_0;
	} else if (A <= 1.3e-213) {
		tmp = t_1;
	} else if (A <= 9e-73) {
		tmp = t_0;
	} else if (A <= 7.8e-27) {
		tmp = t_1;
	} else if (A <= 340000000000.0) {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	} else if (A <= 4.2e+73) {
		tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
	} else if (A <= 1.5e+81) {
		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(((C - B) / B)) / math.pi)
	t_1 = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi)
	tmp = 0
	if A <= -3.25e-49:
		tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi
	elif A <= 8.8e-231:
		tmp = t_0
	elif A <= 1.3e-213:
		tmp = t_1
	elif A <= 9e-73:
		tmp = t_0
	elif A <= 7.8e-27:
		tmp = t_1
	elif A <= 340000000000.0:
		tmp = 180.0 * (math.atan(-1.0) / math.pi)
	elif A <= 4.2e+73:
		tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi)
	elif A <= 1.5e+81:
		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(Float64(Float64(C - B) / B)) / pi))
	t_1 = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi))
	tmp = 0.0
	if (A <= -3.25e-49)
		tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi);
	elseif (A <= 8.8e-231)
		tmp = t_0;
	elseif (A <= 1.3e-213)
		tmp = t_1;
	elseif (A <= 9e-73)
		tmp = t_0;
	elseif (A <= 7.8e-27)
		tmp = t_1;
	elseif (A <= 340000000000.0)
		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
	elseif (A <= 4.2e+73)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi));
	elseif (A <= 1.5e+81)
		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(((C - B) / B)) / pi);
	t_1 = 180.0 * (atan(((B * -0.5) / C)) / pi);
	tmp = 0.0;
	if (A <= -3.25e-49)
		tmp = (180.0 * atan((0.5 * (B / A)))) / pi;
	elseif (A <= 8.8e-231)
		tmp = t_0;
	elseif (A <= 1.3e-213)
		tmp = t_1;
	elseif (A <= 9e-73)
		tmp = t_0;
	elseif (A <= 7.8e-27)
		tmp = t_1;
	elseif (A <= 340000000000.0)
		tmp = 180.0 * (atan(-1.0) / pi);
	elseif (A <= 4.2e+73)
		tmp = 180.0 * (atan(((B + C) / B)) / pi);
	elseif (A <= 1.5e+81)
		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[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $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]}, If[LessEqual[A, -3.25e-49], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 8.8e-231], t$95$0, If[LessEqual[A, 1.3e-213], t$95$1, If[LessEqual[A, 9e-73], t$95$0, If[LessEqual[A, 7.8e-27], t$95$1, If[LessEqual[A, 340000000000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.2e+73], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.5e+81], 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} \left(\frac{C - B}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\mathbf{if}\;A \leq -3.25 \cdot 10^{-49}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\

\mathbf{elif}\;A \leq 8.8 \cdot 10^{-231}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq 1.3 \cdot 10^{-213}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;A \leq 9 \cdot 10^{-73}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq 7.8 \cdot 10^{-27}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;A \leq 1.5 \cdot 10^{+81}:\\
\;\;\;\;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 9: 55.2% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\ \mathbf{if}\;A \leq -6.8 \cdot 10^{-50}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 8.8 \cdot 10^{-231}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 1.3 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 8.8 \cdot 10^{-73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 5.8 \cdot 10^{-25}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-0.5}{\frac{C}{B}}\right)}{\pi}\\ \mathbf{elif}\;A \leq 480000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{elif}\;A \leq 4.5 \cdot 10^{+73}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq 3.8 \cdot 10^{+81}:\\ \;\;\;\;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 (/ (- C B) B)) PI)))
        (t_1 (* 180.0 (/ (atan (/ (* B -0.5) C)) PI))))
   (if (<= A -6.8e-50)
     (/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
     (if (<= A 8.8e-231)
       t_0
       (if (<= A 1.3e-213)
         t_1
         (if (<= A 8.8e-73)
           t_0
           (if (<= A 5.8e-25)
             (/ (* 180.0 (atan (/ -0.5 (/ C B)))) PI)
             (if (<= A 480000000000.0)
               (* 180.0 (/ (atan -1.0) PI))
               (if (<= A 4.5e+73)
                 (* 180.0 (/ (atan (/ (+ B C) B)) PI))
                 (if (<= A 3.8e+81)
                   t_1
                   (* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))))))))))
double code(double A, double B, double C) {
	double t_0 = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
	double t_1 = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
	double tmp;
	if (A <= -6.8e-50) {
		tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
	} else if (A <= 8.8e-231) {
		tmp = t_0;
	} else if (A <= 1.3e-213) {
		tmp = t_1;
	} else if (A <= 8.8e-73) {
		tmp = t_0;
	} else if (A <= 5.8e-25) {
		tmp = (180.0 * atan((-0.5 / (C / B)))) / ((double) M_PI);
	} else if (A <= 480000000000.0) {
		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
	} else if (A <= 4.5e+73) {
		tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
	} else if (A <= 3.8e+81) {
		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(((C - B) / B)) / Math.PI);
	double t_1 = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
	double tmp;
	if (A <= -6.8e-50) {
		tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
	} else if (A <= 8.8e-231) {
		tmp = t_0;
	} else if (A <= 1.3e-213) {
		tmp = t_1;
	} else if (A <= 8.8e-73) {
		tmp = t_0;
	} else if (A <= 5.8e-25) {
		tmp = (180.0 * Math.atan((-0.5 / (C / B)))) / Math.PI;
	} else if (A <= 480000000000.0) {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	} else if (A <= 4.5e+73) {
		tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
	} else if (A <= 3.8e+81) {
		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(((C - B) / B)) / math.pi)
	t_1 = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi)
	tmp = 0
	if A <= -6.8e-50:
		tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi
	elif A <= 8.8e-231:
		tmp = t_0
	elif A <= 1.3e-213:
		tmp = t_1
	elif A <= 8.8e-73:
		tmp = t_0
	elif A <= 5.8e-25:
		tmp = (180.0 * math.atan((-0.5 / (C / B)))) / math.pi
	elif A <= 480000000000.0:
		tmp = 180.0 * (math.atan(-1.0) / math.pi)
	elif A <= 4.5e+73:
		tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi)
	elif A <= 3.8e+81:
		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(Float64(Float64(C - B) / B)) / pi))
	t_1 = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi))
	tmp = 0.0
	if (A <= -6.8e-50)
		tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi);
	elseif (A <= 8.8e-231)
		tmp = t_0;
	elseif (A <= 1.3e-213)
		tmp = t_1;
	elseif (A <= 8.8e-73)
		tmp = t_0;
	elseif (A <= 5.8e-25)
		tmp = Float64(Float64(180.0 * atan(Float64(-0.5 / Float64(C / B)))) / pi);
	elseif (A <= 480000000000.0)
		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
	elseif (A <= 4.5e+73)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi));
	elseif (A <= 3.8e+81)
		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(((C - B) / B)) / pi);
	t_1 = 180.0 * (atan(((B * -0.5) / C)) / pi);
	tmp = 0.0;
	if (A <= -6.8e-50)
		tmp = (180.0 * atan((0.5 * (B / A)))) / pi;
	elseif (A <= 8.8e-231)
		tmp = t_0;
	elseif (A <= 1.3e-213)
		tmp = t_1;
	elseif (A <= 8.8e-73)
		tmp = t_0;
	elseif (A <= 5.8e-25)
		tmp = (180.0 * atan((-0.5 / (C / B)))) / pi;
	elseif (A <= 480000000000.0)
		tmp = 180.0 * (atan(-1.0) / pi);
	elseif (A <= 4.5e+73)
		tmp = 180.0 * (atan(((B + C) / B)) / pi);
	elseif (A <= 3.8e+81)
		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[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $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]}, If[LessEqual[A, -6.8e-50], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 8.8e-231], t$95$0, If[LessEqual[A, 1.3e-213], t$95$1, If[LessEqual[A, 8.8e-73], t$95$0, If[LessEqual[A, 5.8e-25], N[(N[(180.0 * N[ArcTan[N[(-0.5 / N[(C / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 480000000000.0], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.5e+73], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.8e+81], 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} \left(\frac{C - B}{B}\right)}{\pi}\\
t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\
\mathbf{if}\;A \leq -6.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\

\mathbf{elif}\;A \leq 8.8 \cdot 10^{-231}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;A \leq 1.3 \cdot 10^{-213}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;A \leq 8.8 \cdot 10^{-73}:\\
\;\;\;\;t_0\\

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

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

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

\mathbf{elif}\;A \leq 3.8 \cdot 10^{+81}:\\
\;\;\;\;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 10: 45.8% accurate, 2.3× speedup?

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

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

\mathbf{elif}\;B \leq -3.1 \cdot 10^{-138}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;B \leq -4.8 \cdot 10^{-212}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;B \leq 8.2 \cdot 10^{-275}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;B \leq 10^{-237}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;B \leq 1.26 \cdot 10^{-185}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;B \leq 6 \cdot 10^{+29}:\\
\;\;\;\;t_0\\

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


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

Alternative 11: 63.3% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\ \mathbf{if}\;B \leq -2.15 \cdot 10^{-122}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -7.4 \cdot 10^{-190}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -3.2 \cdot 10^{-276}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 4.2 \cdot 10^{-286}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 2.75 \cdot 10^{-235} \lor \neg \left(B \leq 3.3 \cdot 10^{-202}\right):\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (/ (* 180.0 (atan (* 0.5 (/ B A)))) PI))
        (t_1 (* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI))))
   (if (<= B -2.15e-122)
     t_1
     (if (<= B -7.4e-190)
       t_0
       (if (<= B -3.2e-276)
         t_1
         (if (<= B 4.2e-286)
           (* 180.0 (/ (atan (/ 0.0 B)) PI))
           (if (or (<= B 2.75e-235) (not (<= B 3.3e-202)))
             (* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))
             t_0)))))))
double code(double A, double B, double C) {
	double t_0 = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
	double t_1 = 180.0 * (atan(((C + (B - A)) / B)) / ((double) M_PI));
	double tmp;
	if (B <= -2.15e-122) {
		tmp = t_1;
	} else if (B <= -7.4e-190) {
		tmp = t_0;
	} else if (B <= -3.2e-276) {
		tmp = t_1;
	} else if (B <= 4.2e-286) {
		tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
	} else if ((B <= 2.75e-235) || !(B <= 3.3e-202)) {
		tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
	} else {
		tmp = t_0;
	}
	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 t_1 = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
	double tmp;
	if (B <= -2.15e-122) {
		tmp = t_1;
	} else if (B <= -7.4e-190) {
		tmp = t_0;
	} else if (B <= -3.2e-276) {
		tmp = t_1;
	} else if (B <= 4.2e-286) {
		tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
	} else if ((B <= 2.75e-235) || !(B <= 3.3e-202)) {
		tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(A, B, C):
	t_0 = (180.0 * math.atan((0.5 * (B / A)))) / math.pi
	t_1 = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi)
	tmp = 0
	if B <= -2.15e-122:
		tmp = t_1
	elif B <= -7.4e-190:
		tmp = t_0
	elif B <= -3.2e-276:
		tmp = t_1
	elif B <= 4.2e-286:
		tmp = 180.0 * (math.atan((0.0 / B)) / math.pi)
	elif (B <= 2.75e-235) or not (B <= 3.3e-202):
		tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi)
	else:
		tmp = t_0
	return tmp
function code(A, B, C)
	t_0 = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi)
	t_1 = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi))
	tmp = 0.0
	if (B <= -2.15e-122)
		tmp = t_1;
	elseif (B <= -7.4e-190)
		tmp = t_0;
	elseif (B <= -3.2e-276)
		tmp = t_1;
	elseif (B <= 4.2e-286)
		tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi));
	elseif ((B <= 2.75e-235) || !(B <= 3.3e-202))
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(A, B, C)
	t_0 = (180.0 * atan((0.5 * (B / A)))) / pi;
	t_1 = 180.0 * (atan(((C + (B - A)) / B)) / pi);
	tmp = 0.0;
	if (B <= -2.15e-122)
		tmp = t_1;
	elseif (B <= -7.4e-190)
		tmp = t_0;
	elseif (B <= -3.2e-276)
		tmp = t_1;
	elseif (B <= 4.2e-286)
		tmp = 180.0 * (atan((0.0 / B)) / pi);
	elseif ((B <= 2.75e-235) || ~((B <= 3.3e-202)))
		tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, Block[{t$95$1 = N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -2.15e-122], t$95$1, If[LessEqual[B, -7.4e-190], t$95$0, If[LessEqual[B, -3.2e-276], t$95$1, If[LessEqual[B, 4.2e-286], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[B, 2.75e-235], N[Not[LessEqual[B, 3.3e-202]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;B \leq -7.4 \cdot 10^{-190}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;B \leq -3.2 \cdot 10^{-276}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;B \leq 4.2 \cdot 10^{-286}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\

\mathbf{elif}\;B \leq 2.75 \cdot 10^{-235} \lor \neg \left(B \leq 3.3 \cdot 10^{-202}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

Alternative 12: 63.1% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{if}\;B \leq -7.3 \cdot 10^{-121}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq -7.6 \cdot 10^{-191}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -2.6 \cdot 10^{-275}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)}}\\ \mathbf{elif}\;B \leq 5.9 \cdot 10^{-292}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 1.4 \cdot 10^{-237} \lor \neg \left(B \leq 7.8 \cdot 10^{-202}\right):\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)))
   (if (<= B -7.3e-121)
     (* 180.0 (/ (atan (/ (+ C (- B A)) B)) PI))
     (if (<= B -7.6e-191)
       t_0
       (if (<= B -2.6e-275)
         (/ 180.0 (/ PI (atan (/ (- (+ B C) A) B))))
         (if (<= B 5.9e-292)
           (* 180.0 (/ (atan (/ 0.0 B)) PI))
           (if (or (<= B 1.4e-237) (not (<= B 7.8e-202)))
             (* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))
             t_0)))))))
double code(double A, double B, double C) {
	double t_0 = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
	double tmp;
	if (B <= -7.3e-121) {
		tmp = 180.0 * (atan(((C + (B - A)) / B)) / ((double) M_PI));
	} else if (B <= -7.6e-191) {
		tmp = t_0;
	} else if (B <= -2.6e-275) {
		tmp = 180.0 / (((double) M_PI) / atan((((B + C) - A) / B)));
	} else if (B <= 5.9e-292) {
		tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
	} else if ((B <= 1.4e-237) || !(B <= 7.8e-202)) {
		tmp = 180.0 * (atan(((C - (A + B)) / B)) / ((double) M_PI));
	} else {
		tmp = t_0;
	}
	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 (B <= -7.3e-121) {
		tmp = 180.0 * (Math.atan(((C + (B - A)) / B)) / Math.PI);
	} else if (B <= -7.6e-191) {
		tmp = t_0;
	} else if (B <= -2.6e-275) {
		tmp = 180.0 / (Math.PI / Math.atan((((B + C) - A) / B)));
	} else if (B <= 5.9e-292) {
		tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
	} else if ((B <= 1.4e-237) || !(B <= 7.8e-202)) {
		tmp = 180.0 * (Math.atan(((C - (A + B)) / B)) / Math.PI);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(A, B, C):
	t_0 = (180.0 * math.atan((0.5 * (B / A)))) / math.pi
	tmp = 0
	if B <= -7.3e-121:
		tmp = 180.0 * (math.atan(((C + (B - A)) / B)) / math.pi)
	elif B <= -7.6e-191:
		tmp = t_0
	elif B <= -2.6e-275:
		tmp = 180.0 / (math.pi / math.atan((((B + C) - A) / B)))
	elif B <= 5.9e-292:
		tmp = 180.0 * (math.atan((0.0 / B)) / math.pi)
	elif (B <= 1.4e-237) or not (B <= 7.8e-202):
		tmp = 180.0 * (math.atan(((C - (A + B)) / B)) / math.pi)
	else:
		tmp = t_0
	return tmp
function code(A, B, C)
	t_0 = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi)
	tmp = 0.0
	if (B <= -7.3e-121)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C + Float64(B - A)) / B)) / pi));
	elseif (B <= -7.6e-191)
		tmp = t_0;
	elseif (B <= -2.6e-275)
		tmp = Float64(180.0 / Float64(pi / atan(Float64(Float64(Float64(B + C) - A) / B))));
	elseif (B <= 5.9e-292)
		tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi));
	elseif ((B <= 1.4e-237) || !(B <= 7.8e-202))
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - Float64(A + B)) / B)) / pi));
	else
		tmp = t_0;
	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 (B <= -7.3e-121)
		tmp = 180.0 * (atan(((C + (B - A)) / B)) / pi);
	elseif (B <= -7.6e-191)
		tmp = t_0;
	elseif (B <= -2.6e-275)
		tmp = 180.0 / (pi / atan((((B + C) - A) / B)));
	elseif (B <= 5.9e-292)
		tmp = 180.0 * (atan((0.0 / B)) / pi);
	elseif ((B <= 1.4e-237) || ~((B <= 7.8e-202)))
		tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]}, If[LessEqual[B, -7.3e-121], N[(180.0 * N[(N[ArcTan[N[(N[(C + N[(B - A), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -7.6e-191], t$95$0, If[LessEqual[B, -2.6e-275], N[(180.0 / N[(Pi / N[ArcTan[N[(N[(N[(B + C), $MachinePrecision] - A), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.9e-292], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[B, 1.4e-237], N[Not[LessEqual[B, 7.8e-202]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(C - N[(A + B), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;B \leq -7.6 \cdot 10^{-191}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;B \leq 5.9 \cdot 10^{-292}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\

\mathbf{elif}\;B \leq 1.4 \cdot 10^{-237} \lor \neg \left(B \leq 7.8 \cdot 10^{-202}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(A + B\right)}{B}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

Alternative 13: 46.7% 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}\;B \leq -10800000000000:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -8 \cdot 10^{-211}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -3.2 \cdot 10^{-283}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 8.5 \cdot 10^{-173}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.95 \cdot 10^{-113}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-2 \cdot \frac{A}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 3000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
   (if (<= B -10800000000000.0)
     (* 180.0 (/ (atan 1.0) PI))
     (if (<= B -8e-211)
       t_0
       (if (<= B -3.2e-283)
         (* 180.0 (/ (atan (/ C B)) PI))
         (if (<= B 8.5e-173)
           t_0
           (if (<= B 1.95e-113)
             (* 180.0 (/ (atan (* -2.0 (/ A B))) PI))
             (if (<= B 3000.0) t_0 (* 180.0 (/ (atan -1.0) 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 (B <= -10800000000000.0) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (B <= -8e-211) {
		tmp = t_0;
	} else if (B <= -3.2e-283) {
		tmp = 180.0 * (atan((C / B)) / ((double) M_PI));
	} else if (B <= 8.5e-173) {
		tmp = t_0;
	} else if (B <= 1.95e-113) {
		tmp = 180.0 * (atan((-2.0 * (A / B))) / ((double) M_PI));
	} else if (B <= 3000.0) {
		tmp = t_0;
	} else {
		tmp = 180.0 * (atan(-1.0) / ((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 (B <= -10800000000000.0) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (B <= -8e-211) {
		tmp = t_0;
	} else if (B <= -3.2e-283) {
		tmp = 180.0 * (Math.atan((C / B)) / Math.PI);
	} else if (B <= 8.5e-173) {
		tmp = t_0;
	} else if (B <= 1.95e-113) {
		tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
	} else if (B <= 3000.0) {
		tmp = t_0;
	} else {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	tmp = 0
	if B <= -10800000000000.0:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif B <= -8e-211:
		tmp = t_0
	elif B <= -3.2e-283:
		tmp = 180.0 * (math.atan((C / B)) / math.pi)
	elif B <= 8.5e-173:
		tmp = t_0
	elif B <= 1.95e-113:
		tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi)
	elif B <= 3000.0:
		tmp = t_0
	else:
		tmp = 180.0 * (math.atan(-1.0) / 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 (B <= -10800000000000.0)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (B <= -8e-211)
		tmp = t_0;
	elseif (B <= -3.2e-283)
		tmp = Float64(180.0 * Float64(atan(Float64(C / B)) / pi));
	elseif (B <= 8.5e-173)
		tmp = t_0;
	elseif (B <= 1.95e-113)
		tmp = Float64(180.0 * Float64(atan(Float64(-2.0 * Float64(A / B))) / pi));
	elseif (B <= 3000.0)
		tmp = t_0;
	else
		tmp = Float64(180.0 * Float64(atan(-1.0) / 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 (B <= -10800000000000.0)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (B <= -8e-211)
		tmp = t_0;
	elseif (B <= -3.2e-283)
		tmp = 180.0 * (atan((C / B)) / pi);
	elseif (B <= 8.5e-173)
		tmp = t_0;
	elseif (B <= 1.95e-113)
		tmp = 180.0 * (atan((-2.0 * (A / B))) / pi);
	elseif (B <= 3000.0)
		tmp = t_0;
	else
		tmp = 180.0 * (atan(-1.0) / 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[B, -10800000000000.0], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -8e-211], t$95$0, If[LessEqual[B, -3.2e-283], N[(180.0 * N[(N[ArcTan[N[(C / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8.5e-173], t$95$0, If[LessEqual[B, 1.95e-113], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3000.0], t$95$0, N[(180.0 * N[(N[ArcTan[-1.0], $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}\;B \leq -10800000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{elif}\;B \leq -8 \cdot 10^{-211}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;B \leq 8.5 \cdot 10^{-173}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;B \leq 3000:\\
\;\;\;\;t_0\\

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


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

Alternative 14: 56.3% accurate, 2.4× speedup?

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

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

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

\mathbf{elif}\;C \leq 7.7 \cdot 10^{-240}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;C \leq 2.4 \cdot 10^{-172}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{elif}\;C \leq 5.8 \cdot 10^{+30}:\\
\;\;\;\;t_0\\

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


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

Alternative 15: 52.7% 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}\;C \leq -3.8 \cdot 10^{-131}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq -1.5 \cdot 10^{-200}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 8.8 \cdot 10^{-249}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{elif}\;C \leq 5.1 \cdot 10^{-84}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\ \end{array} \end{array} \]
(FPCore (A B C)
 :precision binary64
 (let* ((t_0 (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))))
   (if (<= C -3.8e-131)
     (* 180.0 (/ (atan (/ (+ B C) B)) PI))
     (if (<= C -1.5e-200)
       t_0
       (if (<= C 8.8e-249)
         (* 180.0 (/ (atan -1.0) PI))
         (if (<= C 5.1e-84) t_0 (* 180.0 (/ (atan (/ (* B -0.5) C)) 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 (C <= -3.8e-131) {
		tmp = 180.0 * (atan(((B + C) / B)) / ((double) M_PI));
	} else if (C <= -1.5e-200) {
		tmp = t_0;
	} else if (C <= 8.8e-249) {
		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
	} else if (C <= 5.1e-84) {
		tmp = t_0;
	} else {
		tmp = 180.0 * (atan(((B * -0.5) / C)) / ((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 (C <= -3.8e-131) {
		tmp = 180.0 * (Math.atan(((B + C) / B)) / Math.PI);
	} else if (C <= -1.5e-200) {
		tmp = t_0;
	} else if (C <= 8.8e-249) {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	} else if (C <= 5.1e-84) {
		tmp = t_0;
	} else {
		tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	t_0 = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	tmp = 0
	if C <= -3.8e-131:
		tmp = 180.0 * (math.atan(((B + C) / B)) / math.pi)
	elif C <= -1.5e-200:
		tmp = t_0
	elif C <= 8.8e-249:
		tmp = 180.0 * (math.atan(-1.0) / math.pi)
	elif C <= 5.1e-84:
		tmp = t_0
	else:
		tmp = 180.0 * (math.atan(((B * -0.5) / C)) / 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 (C <= -3.8e-131)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B + C) / B)) / pi));
	elseif (C <= -1.5e-200)
		tmp = t_0;
	elseif (C <= 8.8e-249)
		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
	elseif (C <= 5.1e-84)
		tmp = t_0;
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / 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 (C <= -3.8e-131)
		tmp = 180.0 * (atan(((B + C) / B)) / pi);
	elseif (C <= -1.5e-200)
		tmp = t_0;
	elseif (C <= 8.8e-249)
		tmp = 180.0 * (atan(-1.0) / pi);
	elseif (C <= 5.1e-84)
		tmp = t_0;
	else
		tmp = 180.0 * (atan(((B * -0.5) / C)) / 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[C, -3.8e-131], N[(180.0 * N[(N[ArcTan[N[(N[(B + C), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, -1.5e-200], t$95$0, If[LessEqual[C, 8.8e-249], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 5.1e-84], t$95$0, N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $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}\;C \leq -3.8 \cdot 10^{-131}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\

\mathbf{elif}\;C \leq -1.5 \cdot 10^{-200}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;C \leq 8.8 \cdot 10^{-249}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\

\mathbf{elif}\;C \leq 5.1 \cdot 10^{-84}:\\
\;\;\;\;t_0\\

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


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

Alternative 16: 60.3% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -4.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 6.2 \cdot 10^{-231}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - B}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq 1.3 \cdot 10^{-213}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\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 -4.2e-50)
   (/ (* 180.0 (atan (* 0.5 (/ B A)))) PI)
   (if (<= A 6.2e-231)
     (* 180.0 (/ (atan (/ (- C B) B)) PI))
     (if (<= A 1.3e-213)
       (* 180.0 (/ (atan (/ (* B -0.5) C)) PI))
       (* 180.0 (/ (atan (/ (- C (+ A B)) B)) PI))))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -4.2e-50) {
		tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
	} else if (A <= 6.2e-231) {
		tmp = 180.0 * (atan(((C - B) / B)) / ((double) M_PI));
	} else if (A <= 1.3e-213) {
		tmp = 180.0 * (atan(((B * -0.5) / C)) / ((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 <= -4.2e-50) {
		tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
	} else if (A <= 6.2e-231) {
		tmp = 180.0 * (Math.atan(((C - B) / B)) / Math.PI);
	} else if (A <= 1.3e-213) {
		tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / 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 <= -4.2e-50:
		tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi
	elif A <= 6.2e-231:
		tmp = 180.0 * (math.atan(((C - B) / B)) / math.pi)
	elif A <= 1.3e-213:
		tmp = 180.0 * (math.atan(((B * -0.5) / C)) / 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 <= -4.2e-50)
		tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi);
	elseif (A <= 6.2e-231)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(C - B) / B)) / pi));
	elseif (A <= 1.3e-213)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / 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 <= -4.2e-50)
		tmp = (180.0 * atan((0.5 * (B / A)))) / pi;
	elseif (A <= 6.2e-231)
		tmp = 180.0 * (atan(((C - B) / B)) / pi);
	elseif (A <= 1.3e-213)
		tmp = 180.0 * (atan(((B * -0.5) / C)) / pi);
	else
		tmp = 180.0 * (atan(((C - (A + B)) / B)) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := If[LessEqual[A, -4.2e-50], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[A, 6.2e-231], N[(180.0 * N[(N[ArcTan[N[(N[(C - B), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.3e-213], N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $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 -4.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\

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

\mathbf{elif}\;A \leq 1.3 \cdot 10^{-213}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\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 17: 47.4% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;A \leq -4.2 \cdot 10^{-300}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 8 \cdot 10^{-126}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{elif}\;A \leq 1.45 \cdot 10^{+81}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)}{\pi}\\ \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
 (if (<= A -4.2e-300)
   (* 180.0 (/ (atan (* 0.5 (/ B A))) PI))
   (if (<= A 8e-126)
     (* 180.0 (/ (atan -1.0) PI))
     (if (<= A 1.45e+81)
       (* 180.0 (/ (atan (/ (* B -0.5) C)) PI))
       (* 180.0 (/ (atan (* -2.0 (/ A B))) PI))))))
double code(double A, double B, double C) {
	double tmp;
	if (A <= -4.2e-300) {
		tmp = 180.0 * (atan((0.5 * (B / A))) / ((double) M_PI));
	} else if (A <= 8e-126) {
		tmp = 180.0 * (atan(-1.0) / ((double) M_PI));
	} else if (A <= 1.45e+81) {
		tmp = 180.0 * (atan(((B * -0.5) / C)) / ((double) M_PI));
	} 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 tmp;
	if (A <= -4.2e-300) {
		tmp = 180.0 * (Math.atan((0.5 * (B / A))) / Math.PI);
	} else if (A <= 8e-126) {
		tmp = 180.0 * (Math.atan(-1.0) / Math.PI);
	} else if (A <= 1.45e+81) {
		tmp = 180.0 * (Math.atan(((B * -0.5) / C)) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan((-2.0 * (A / B))) / Math.PI);
	}
	return tmp;
}
def code(A, B, C):
	tmp = 0
	if A <= -4.2e-300:
		tmp = 180.0 * (math.atan((0.5 * (B / A))) / math.pi)
	elif A <= 8e-126:
		tmp = 180.0 * (math.atan(-1.0) / math.pi)
	elif A <= 1.45e+81:
		tmp = 180.0 * (math.atan(((B * -0.5) / C)) / math.pi)
	else:
		tmp = 180.0 * (math.atan((-2.0 * (A / B))) / math.pi)
	return tmp
function code(A, B, C)
	tmp = 0.0
	if (A <= -4.2e-300)
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(B / A))) / pi));
	elseif (A <= 8e-126)
		tmp = Float64(180.0 * Float64(atan(-1.0) / pi));
	elseif (A <= 1.45e+81)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(B * -0.5) / C)) / pi));
	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)
	tmp = 0.0;
	if (A <= -4.2e-300)
		tmp = 180.0 * (atan((0.5 * (B / A))) / pi);
	elseif (A <= 8e-126)
		tmp = 180.0 * (atan(-1.0) / pi);
	elseif (A <= 1.45e+81)
		tmp = 180.0 * (atan(((B * -0.5) / C)) / pi);
	else
		tmp = 180.0 * (atan((-2.0 * (A / B))) / pi);
	end
	tmp_2 = tmp;
end
code[A_, B_, C_] := If[LessEqual[A, -4.2e-300], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 8e-126], N[(180.0 * N[(N[ArcTan[-1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.45e+81], N[(180.0 * N[(N[ArcTan[N[(N[(B * -0.5), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-2.0 * N[(A / B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

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

\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 18: 45.4% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -3.9 \cdot 10^{-137}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 4.2 \cdot 10^{-188}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 0.102:\\ \;\;\;\;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 -3.9e-137)
   (* 180.0 (/ (atan 1.0) PI))
   (if (<= B 4.2e-188)
     (* 180.0 (/ (atan (/ 0.0 B)) PI))
     (if (<= B 0.102)
       (* 180.0 (/ (atan (/ C B)) PI))
       (* 180.0 (/ (atan -1.0) PI))))))
double code(double A, double B, double C) {
	double tmp;
	if (B <= -3.9e-137) {
		tmp = 180.0 * (atan(1.0) / ((double) M_PI));
	} else if (B <= 4.2e-188) {
		tmp = 180.0 * (atan((0.0 / B)) / ((double) M_PI));
	} else if (B <= 0.102) {
		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 <= -3.9e-137) {
		tmp = 180.0 * (Math.atan(1.0) / Math.PI);
	} else if (B <= 4.2e-188) {
		tmp = 180.0 * (Math.atan((0.0 / B)) / Math.PI);
	} else if (B <= 0.102) {
		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 <= -3.9e-137:
		tmp = 180.0 * (math.atan(1.0) / math.pi)
	elif B <= 4.2e-188:
		tmp = 180.0 * (math.atan((0.0 / B)) / math.pi)
	elif B <= 0.102:
		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 <= -3.9e-137)
		tmp = Float64(180.0 * Float64(atan(1.0) / pi));
	elseif (B <= 4.2e-188)
		tmp = Float64(180.0 * Float64(atan(Float64(0.0 / B)) / pi));
	elseif (B <= 0.102)
		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 <= -3.9e-137)
		tmp = 180.0 * (atan(1.0) / pi);
	elseif (B <= 4.2e-188)
		tmp = 180.0 * (atan((0.0 / B)) / pi);
	elseif (B <= 0.102)
		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, -3.9e-137], N[(180.0 * N[(N[ArcTan[1.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.2e-188], N[(180.0 * N[(N[ArcTan[N[(0.0 / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 0.102], 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 -3.9 \cdot 10^{-137}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\

\mathbf{elif}\;B \leq 4.2 \cdot 10^{-188}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\

\mathbf{elif}\;B \leq 0.102:\\
\;\;\;\;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 19: 44.4% accurate, 2.5× speedup?

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

\mathbf{elif}\;B \leq 6.5 \cdot 10^{-186}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{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 20: 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 21: 20.3% 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 2023364 
(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)))