Average Error: 29.2 → 6.9
Time: 21.8s
Precision: binary64
Cost: 60488
\[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 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}\\ t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{-23}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{-5}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \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 (* 180.0 (/ (atan (/ (- (- C A) (hypot B (- C A))) B)) PI)))
        (t_1
         (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
   (if (<= t_1 -2e-23)
     t_0
     (if (<= t_1 4e-5) (* 180.0 (/ (atan (* -0.5 (/ B (- C A)))) PI)) t_0))))
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 = 180.0 * (atan((((C - A) - hypot(B, (C - A))) / B)) / ((double) M_PI));
	double t_1 = (1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0))));
	double tmp;
	if (t_1 <= -2e-23) {
		tmp = t_0;
	} else if (t_1 <= 4e-5) {
		tmp = 180.0 * (atan((-0.5 * (B / (C - A)))) / ((double) M_PI));
	} else {
		tmp = t_0;
	}
	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 = 180.0 * (Math.atan((((C - A) - Math.hypot(B, (C - A))) / B)) / Math.PI);
	double t_1 = (1.0 / B) * ((C - A) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0))));
	double tmp;
	if (t_1 <= -2e-23) {
		tmp = t_0;
	} else if (t_1 <= 4e-5) {
		tmp = 180.0 * (Math.atan((-0.5 * (B / (C - A)))) / Math.PI);
	} else {
		tmp = t_0;
	}
	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 = 180.0 * (math.atan((((C - A) - math.hypot(B, (C - A))) / B)) / math.pi)
	t_1 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0))))
	tmp = 0
	if t_1 <= -2e-23:
		tmp = t_0
	elif t_1 <= 4e-5:
		tmp = 180.0 * (math.atan((-0.5 * (B / (C - A)))) / math.pi)
	else:
		tmp = t_0
	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(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(C - A))) / B)) / pi))
	t_1 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
	tmp = 0.0
	if (t_1 <= -2e-23)
		tmp = t_0;
	elseif (t_1 <= 4e-5)
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(B / Float64(C - A)))) / pi));
	else
		tmp = t_0;
	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 = 180.0 * (atan((((C - A) - hypot(B, (C - A))) / B)) / pi);
	t_1 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0))));
	tmp = 0.0;
	if (t_1 <= -2e-23)
		tmp = t_0;
	elseif (t_1 <= 4e-5)
		tmp = 180.0 * (atan((-0.5 * (B / (C - A)))) / pi);
	else
		tmp = t_0;
	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[(180.0 * N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(C - A), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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[LessEqual[t$95$1, -2e-23], t$95$0, If[LessEqual[t$95$1, 4e-5], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(B / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$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}
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}\\
t_1 := \frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-23}:\\
\;\;\;\;t_0\\

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

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


\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))))) < -1.99999999999999992e-23 or 4.00000000000000033e-5 < (*.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.3

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

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}} \]
      Proof
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (hypot.f64 B (-.f64 C A))) 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 C A) (-.f64 C A)))))) B)) (PI.f64))): 84 points increase in error, 13 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 C A) (-.f64 C A))))) 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 (pow.f64 B 2) (Rewrite<= sqr-neg_binary64 (*.f64 (neg.f64 (-.f64 C A)) (neg.f64 (-.f64 C A))))))) 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 (pow.f64 B 2) (*.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 C A))) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 C) A)) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 C)) A) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 A (neg.f64 C))) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (Rewrite<= sub-neg_binary64 (-.f64 A C)) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 C A))))))) 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 C) A)))))) 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 C)) A))))) 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (Rewrite<= +-commutative_binary64 (+.f64 A (neg.f64 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (Rewrite<= sub-neg_binary64 (-.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 (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, 0 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 -1.99999999999999992e-23 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < 4.00000000000000033e-5

    1. Initial program 52.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. Simplified51.6

      \[\leadsto \color{blue}{180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}} \]
      Proof
      (*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (hypot.f64 B (-.f64 C A))) 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 C A) (-.f64 C A)))))) B)) (PI.f64))): 84 points increase in error, 13 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 C A) (-.f64 C A))))) 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 (pow.f64 B 2) (Rewrite<= sqr-neg_binary64 (*.f64 (neg.f64 (-.f64 C A)) (neg.f64 (-.f64 C A))))))) 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 (pow.f64 B 2) (*.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 C A))) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 C) A)) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 C)) A) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 A (neg.f64 C))) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (Rewrite<= sub-neg_binary64 (-.f64 A C)) (neg.f64 (-.f64 C A)))))) 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 C A))))))) 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 C) A)))))) 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 C)) A))))) 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (Rewrite<= +-commutative_binary64 (+.f64 A (neg.f64 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 (pow.f64 B 2) (*.f64 (-.f64 A C) (Rewrite<= sub-neg_binary64 (-.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 (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, 0 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 B around 0 1.8

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

    \[\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 -2 \cdot 10^{-23}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}\\ \mathbf{elif}\;\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq 4 \cdot 10^{-5}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right)}{\pi}\\ \end{array} \]

Alternatives

Alternative 1
Error13.9
Cost20168
\[\begin{array}{l} \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 1.4911153120280181 \cdot 10^{+41}:\\ \;\;\;\;180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(B, A\right)}{B}\right)}{\pi}\\ \end{array} \]
Alternative 2
Error12.0
Cost20164
\[\begin{array}{l} \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(C - A, B\right)\right)}{B}\right)}{\pi}\\ \end{array} \]
Alternative 3
Error14.0
Cost20104
\[\begin{array}{l} \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 1.4911153120280181 \cdot 10^{+41}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(B, A\right)}{B}\right)}{\pi}\\ \end{array} \]
Alternative 4
Error15.1
Cost20040
\[\begin{array}{l} \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 1.91230820700148 \cdot 10^{+38}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}}\\ \end{array} \]
Alternative 5
Error26.4
Cost14104
\[\begin{array}{l} t_0 := \frac{180 \cdot \tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\ t_1 := \frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - B}{B}\right)}}\\ \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -3.0423177045574224 \cdot 10^{-114}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -3.085356391204654 \cdot 10^{-128}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq -5.668035615918552 \cdot 10^{-282}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 5.470756008450195 \cdot 10^{-207}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 1.4911153120280181 \cdot 10^{+41}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \]
Alternative 6
Error25.1
Cost14100
\[\begin{array}{l} \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -3.0423177045574224 \cdot 10^{-114}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -3.085356391204654 \cdot 10^{-128}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq -5.668035615918552 \cdot 10^{-282}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - B}{B}\right)}}\\ \mathbf{elif}\;A \leq 5.470756008450195 \cdot 10^{-207}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}}\\ \end{array} \]
Alternative 7
Error24.3
Cost14100
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -2.802111587241079 \cdot 10^{-50}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)}{\pi}\\ \mathbf{elif}\;A \leq -3.085356391204654 \cdot 10^{-128}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -5.668035615918552 \cdot 10^{-282}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - B}{B}\right)}}\\ \mathbf{elif}\;A \leq 5.470756008450195 \cdot 10^{-207}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B + C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - \left(B + A\right)}{B}\right)}}\\ \end{array} \]
Alternative 8
Error25.3
Cost13968
\[\begin{array}{l} t_0 := \frac{180 \cdot \tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)}{\pi}\\ \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -3.0423177045574224 \cdot 10^{-114}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -3.085356391204654 \cdot 10^{-128}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq -5.668035615918552 \cdot 10^{-282}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - B}{B}\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error31.6
Cost13840
\[\begin{array}{l} t_0 := \frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{A}{-B}\right)}}\\ t_1 := \frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - B}{B}\right)}}\\ \mathbf{if}\;B \leq -7.117581946634193 \cdot 10^{-38}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -5.8679820950077195 \cdot 10^{-301}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 5.942867024706843 \cdot 10^{-260}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.8603233926907724 \cdot 10^{-86}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error33.9
Cost13712
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{if}\;B \leq -7.117581946634193 \cdot 10^{-38}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -1.4256481532323107 \cdot 10^{-169}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -6.534613657116692 \cdot 10^{-302}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 1.4071361082232872 \cdot 10^{-136}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 11
Error30.4
Cost13708
\[\begin{array}{l} \mathbf{if}\;C \leq -7.20813284353332 \cdot 10^{-196}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - B}{B}\right)}}\\ \mathbf{elif}\;C \leq 1.4166947398161405 \cdot 10^{-121}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{A}{-B}\right)}}\\ \mathbf{elif}\;C \leq 3.725895032990451 \cdot 10^{-10}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right) \cdot \frac{180}{\pi}\\ \end{array} \]
Alternative 12
Error26.4
Cost13576
\[\begin{array}{l} \mathbf{if}\;C \leq -6.001312926112942 \cdot 10^{-52}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - B}{B}\right)}}\\ \mathbf{elif}\;C \leq 6.546057785353591 \cdot 10^{+112}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right) \cdot \frac{180}{\pi}\\ \end{array} \]
Alternative 13
Error26.2
Cost13576
\[\begin{array}{l} \mathbf{if}\;A \leq -5875283.082812134:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{elif}\;A \leq 1.4911153120280181 \cdot 10^{+41}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{C - B}{B}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)}{\pi}\\ \end{array} \]
Alternative 14
Error34.1
Cost13512
\[\begin{array}{l} \mathbf{if}\;B \leq -7.117581946634193 \cdot 10^{-38}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 1.8818337462930214 \cdot 10^{+29}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{A}{-B}\right)}}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 15
Error33.6
Cost13448
\[\begin{array}{l} \mathbf{if}\;B \leq -7.117581946634193 \cdot 10^{-38}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 1.4071361082232872 \cdot 10^{-136}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 16
Error38.3
Cost13188
\[\begin{array}{l} \mathbf{if}\;B \leq -5.8679820950077195 \cdot 10^{-301}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} 1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 17
Error50.4
Cost13056
\[180 \cdot \frac{\tan^{-1} -1}{\pi} \]

Error

Reproduce

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