Average Error: 29.2 → 11.6
Time: 22.9s
Precision: binary64
Cost: 60489
\[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} \]
\[\begin{array}{l} t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ \mathbf{if}\;t_0 \leq -0.5 \lor \neg \left(t_0 \leq 0\right):\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\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)))
(FPCore (A B C)
 :precision binary64
 (let* ((t_0
         (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
   (if (or (<= t_0 -0.5) (not (<= t_0 0.0)))
     (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))
     (/ (* 180.0 (atan (* 0.5 (/ B A)))) 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));
}
double code(double A, double B, double C) {
	double t_0 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
	double tmp;
	if ((t_0 <= -0.5) || !(t_0 <= 0.0)) {
		tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / ((double) M_PI));
	} else {
		tmp = (180.0 * atan((0.5 * (B / A)))) / ((double) M_PI);
	}
	return tmp;
}
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);
}
public static double code(double A, double B, double C) {
	double t_0 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
	double tmp;
	if ((t_0 <= -0.5) || !(t_0 <= 0.0)) {
		tmp = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (A - C))) / B)) / Math.PI);
	} else {
		tmp = (180.0 * Math.atan((0.5 * (B / A)))) / Math.PI;
	}
	return tmp;
}
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)
def code(A, B, C):
	t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0))))
	tmp = 0
	if (t_0 <= -0.5) or not (t_0 <= 0.0):
		tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi)
	else:
		tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi
	return tmp
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 code(A, B, C)
	t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
	tmp = 0.0
	if ((t_0 <= -0.5) || !(t_0 <= 0.0))
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi));
	else
		tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi);
	end
	return tmp
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
function tmp_2 = code(A, B, C)
	t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0))));
	tmp = 0.0;
	if ((t_0 <= -0.5) || ~((t_0 <= 0.0)))
		tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi);
	else
		tmp = (180.0 * atan((0.5 * (B / A)))) / pi;
	end
	tmp_2 = tmp;
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]
code[A_, B_, C_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] * N[(N[(C - A), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -0.5], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(0.5 * N[(B / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
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}
\begin{array}{l}
t_0 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t_0 \leq -0.5 \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -0.5 or 0.0 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2)))))

    1. Initial program 25.9

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

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, A - C\right)}{B}\right)}{\pi}} \]
      Proof
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (hypot.f64 B (-.f64 A C))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 B B) (*.f64 (-.f64 A C) (-.f64 A C)))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (Rewrite<= unpow2_binary64 (pow.f64 B 2)) (*.f64 (-.f64 A C) (-.f64 A C))))) B)) (PI.f64))): 6 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 B 2) (Rewrite<= unpow2_binary64 (pow.f64 (-.f64 A C) 2))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (Rewrite<= +-commutative_binary64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) B)) (PI.f64))): 0 points increase in error, 6 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2)))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (PI.f64))): 0 points increase in error, 0 points decrease in error

    if -0.5 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < 0.0

    1. Initial program 51.0

      \[180 \cdot \frac{\tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}{\pi} \]
    2. Simplified51.0

      \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + B \cdot B}\right)\right)}{\pi}} \]
      Proof
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (hypot.f64 B (-.f64 A C))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 B B) (*.f64 (-.f64 A C) (-.f64 A C)))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (Rewrite<= unpow2_binary64 (pow.f64 B 2)) (*.f64 (-.f64 A C) (-.f64 A C))))) B)) (PI.f64))): 6 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 B 2) (Rewrite<= unpow2_binary64 (pow.f64 (-.f64 A C) 2))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (Rewrite<= +-commutative_binary64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) B)) (PI.f64))): 0 points increase in error, 6 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2)))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (*.f64 180 (/.f64 (atan.f64 (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (PI.f64))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in A around -inf 32.0

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

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

Alternatives

Alternative 1
Error14.9
Cost20104
\[\begin{array}{l} \mathbf{if}\;C \leq -0.43:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\ \mathbf{elif}\;C \leq 2.7 \cdot 10^{+15}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(B, A\right)}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi \cdot 0.005555555555555556}\\ \end{array} \]
Alternative 2
Error15.9
Cost20040
\[\begin{array}{l} \mathbf{if}\;A \leq -1.25 \cdot 10^{+51}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq 8.5 \cdot 10^{+163}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B - A}{B}\right)}{\pi \cdot 0.005555555555555556}\\ \end{array} \]
Alternative 3
Error34.3
Cost14764
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(-\frac{A}{B}\right)}{\pi}\\ t_2 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ t_3 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{if}\;B \leq -9.5 \cdot 10^{+16}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -1.05 \cdot 10^{-133}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -7.2 \cdot 10^{-171}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq -6.2 \cdot 10^{-202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -4.2 \cdot 10^{-212}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0}{B}\right)\\ \mathbf{elif}\;B \leq -5.2 \cdot 10^{-251}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 5.5 \cdot 10^{-288}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 7.2 \cdot 10^{-283}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 3.1 \cdot 10^{-236}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 4.6 \cdot 10^{-204}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 1.65 \cdot 10^{+63}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 4
Error31.5
Cost14633
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_1 := t_0 \cdot \frac{180}{\pi}\\ t_2 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{if}\;B \leq -3.8 \cdot 10^{+15}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -5.8 \cdot 10^{-133}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -1.7 \cdot 10^{-251}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \mathbf{elif}\;B \leq 2.65 \cdot 10^{-288}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 1.5 \cdot 10^{-282}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.18 \cdot 10^{-237}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\frac{A}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 1.36 \cdot 10^{-204}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{-175} \lor \neg \left(B \leq 1.3 \cdot 10^{-144}\right) \land B \leq 1.3 \cdot 10^{-89}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \end{array} \]
Alternative 5
Error27.6
Cost14500
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ t_1 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_2 := \frac{\tan^{-1} \left(\frac{B - A}{B}\right)}{\pi \cdot 0.005555555555555556}\\ t_3 := \frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \mathbf{if}\;C \leq -5.3 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq -4.1 \cdot 10^{-105}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;C \leq -8.5 \cdot 10^{-143}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq -5.5 \cdot 10^{-195}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;C \leq 5.5 \cdot 10^{-236}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;C \leq 1.55 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{t_1}{\pi}\\ \mathbf{elif}\;C \leq 1.55 \cdot 10^{-97}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;C \leq 7.8 \cdot 10^{-20}:\\ \;\;\;\;t_1 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;C \leq 16000000000000:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi \cdot 0.005555555555555556}\\ \end{array} \]
Alternative 6
Error34.3
Cost14368
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{if}\;B \leq -2 \cdot 10^{+15}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -7.6 \cdot 10^{-134}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.5 \cdot 10^{-253}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \mathbf{elif}\;B \leq 1.08 \cdot 10^{-287}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.3 \cdot 10^{-282}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 7.8 \cdot 10^{-238}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\frac{A}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 5.6 \cdot 10^{-204}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 7 \cdot 10^{+62}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 7
Error34.3
Cost14368
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_1 := t_0 \cdot \frac{180}{\pi}\\ t_2 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{if}\;B \leq -1.85 \cdot 10^{+14}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -3.1 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -5.8 \cdot 10^{-248}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \mathbf{elif}\;B \leq 1.45 \cdot 10^{-288}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{-283}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 2 \cdot 10^{-237}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-\frac{A}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 2.25 \cdot 10^{-203}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{+63}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 8
Error28.2
Cost14236
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \mathbf{if}\;C \leq -5 \cdot 10^{-23}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;C \leq -5.5 \cdot 10^{-105}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;C \leq 1.15 \cdot 10^{-235}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 9.2 \cdot 10^{-190}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{elif}\;C \leq 1.3 \cdot 10^{-97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 2.3 \cdot 10^{-22}:\\ \;\;\;\;t_0 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;C \leq 7800000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \end{array} \]
Alternative 9
Error28.5
Cost14236
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \mathbf{if}\;C \leq -1.8 \cdot 10^{-15}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;C \leq -4.8 \cdot 10^{-105}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;C \leq 6.2 \cdot 10^{-236}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 1.5 \cdot 10^{-183}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{elif}\;C \leq 1.55 \cdot 10^{-97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 3.7 \cdot 10^{-22}:\\ \;\;\;\;t_0 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;C \leq 4.7 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)}{\pi \cdot 0.005555555555555556}\\ \end{array} \]
Alternative 10
Error25.2
Cost14232
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\ \mathbf{if}\;B \leq -1.55 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -3.8 \cdot 10^{-257}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \mathbf{elif}\;B \leq 7.5 \cdot 10^{-204}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 9.8 \cdot 10^{-175}:\\ \;\;\;\;\frac{180 \cdot t_0}{\pi}\\ \mathbf{elif}\;B \leq 1.15 \cdot 10^{-141}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;B \leq 5 \cdot 10^{-90}:\\ \;\;\;\;\frac{1}{\frac{\frac{\pi}{180}}{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(-B\right) - A}{B}\right)}{\pi}\\ \end{array} \]
Alternative 11
Error23.3
Cost14232
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\ \mathbf{if}\;B \leq -1.55 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -3.5 \cdot 10^{-256}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \mathbf{elif}\;B \leq 3.7 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.6 \cdot 10^{-173}:\\ \;\;\;\;\frac{180 \cdot t_0}{\pi}\\ \mathbf{elif}\;B \leq 1.3 \cdot 10^{-148}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;B \leq 1.25 \cdot 10^{-96}:\\ \;\;\;\;\frac{1}{\frac{\frac{\pi}{180}}{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\ \end{array} \]
Alternative 12
Error23.2
Cost14232
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\ \mathbf{if}\;B \leq -1.55 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -6.5 \cdot 10^{-248}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \mathbf{elif}\;B \leq 3 \cdot 10^{-205}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 3.8 \cdot 10^{-173}:\\ \;\;\;\;\frac{180 \cdot t_0}{\pi}\\ \mathbf{elif}\;B \leq 1.95 \cdot 10^{-147}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;B \leq 1.2 \cdot 10^{-96}:\\ \;\;\;\;\frac{1}{\frac{\frac{\pi}{180}}{t_0}}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}{\pi}\\ \end{array} \]
Alternative 13
Error25.3
Cost14168
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C + \left(B - A\right)}{B}\right)\\ \mathbf{if}\;B \leq -3.9 \cdot 10^{-202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -1.95 \cdot 10^{-258}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)\\ \mathbf{elif}\;B \leq 3.3 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 6.2 \cdot 10^{-174}:\\ \;\;\;\;\frac{180 \cdot t_0}{\pi}\\ \mathbf{elif}\;B \leq 1.75 \cdot 10^{-147}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;B \leq 9 \cdot 10^{-89}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(-B\right) - A}{B}\right)}{\pi}\\ \end{array} \]
Alternative 14
Error34.3
Cost13712
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{if}\;B \leq -1.95 \cdot 10^{+45}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -5.1 \cdot 10^{-201}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -9.5 \cdot 10^{-249}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0}{B}\right)\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-61}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 15
Error34.3
Cost13712
\[\begin{array}{l} t_0 := \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{if}\;B \leq -6.4 \cdot 10^{+44}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -8 \cdot 10^{-201}:\\ \;\;\;\;\frac{180}{\pi} \cdot t_0\\ \mathbf{elif}\;B \leq -1.8 \cdot 10^{-248}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{0}{B}\right)\\ \mathbf{elif}\;B \leq 8 \cdot 10^{-61}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 16
Error33.8
Cost13708
\[\begin{array}{l} \mathbf{if}\;C \leq -5.2 \cdot 10^{-21}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{elif}\;C \leq -6 \cdot 10^{-209}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;C \leq 8.2 \cdot 10^{-98}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \end{array} \]
Alternative 17
Error34.0
Cost13448
\[\begin{array}{l} \mathbf{if}\;B \leq -1.95 \cdot 10^{+45}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 10^{-60}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 18
Error38.3
Cost13188
\[\begin{array}{l} \mathbf{if}\;B \leq -1.45 \cdot 10^{-307}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 19
Error50.8
Cost13056
\[\frac{180 \cdot \tan^{-1} -1}{\pi} \]

Error

Reproduce

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