Average Error: 28.9 → 7.6
Time: 21.1s
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 -0.0002:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A - C}\right)\\ \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 -0.0002)
     t_0
     (if (<= t_1 0.0) (* (/ 180.0 PI) (atan (/ (* B 0.5) (- A C)))) 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 <= -0.0002) {
		tmp = t_0;
	} else if (t_1 <= 0.0) {
		tmp = (180.0 / ((double) M_PI)) * atan(((B * 0.5) / (A - C)));
	} 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 <= -0.0002) {
		tmp = t_0;
	} else if (t_1 <= 0.0) {
		tmp = (180.0 / Math.PI) * Math.atan(((B * 0.5) / (A - C)));
	} 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 <= -0.0002:
		tmp = t_0
	elif t_1 <= 0.0:
		tmp = (180.0 / math.pi) * math.atan(((B * 0.5) / (A - C)))
	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 <= -0.0002)
		tmp = t_0;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(180.0 / pi) * atan(Float64(Float64(B * 0.5) / Float64(A - C))));
	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 <= -0.0002)
		tmp = t_0;
	elseif (t_1 <= 0.0)
		tmp = (180.0 / pi) * atan(((B * 0.5) / (A - C)));
	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, -0.0002], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(N[(B * 0.5), $MachinePrecision] / N[(A - C), $MachinePrecision]), $MachinePrecision]], $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 -0.0002:\\
\;\;\;\;t_0\\

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

\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))))) < -2.0000000000000001e-4 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.6

      \[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.4

      \[\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))): 78 points increase in error, 16 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 -2.0000000000000001e-4 < (*.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. Simplified49.8

      \[\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))): 78 points increase in error, 16 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 23.5

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{-0.5 \cdot \frac{B}{\frac{C - A}{B}}}}{B}\right)}{\pi} \]
      Proof
      (*.f64 -1/2 (/.f64 B (/.f64 (-.f64 C A) B))): 0 points increase in error, 0 points decrease in error
      (*.f64 -1/2 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 B B) (-.f64 C A)))): 43 points increase in error, 25 points decrease in error
      (*.f64 -1/2 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 B 2)) (-.f64 C A))): 0 points increase in error, 1 points decrease in error
    5. Taylor expanded in C around -inf 1.7

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

      \[\leadsto \color{blue}{\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A - C}\right)} \]
      Proof
      (*.f64 (/.f64 180 (PI.f64)) (atan.f64 (/.f64 (*.f64 B 1/2) (-.f64 A C)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 180 (PI.f64)) (atan.f64 (/.f64 (*.f64 B 1/2) (Rewrite<= unsub-neg_binary64 (+.f64 A (neg.f64 C)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 180 (PI.f64)) (atan.f64 (/.f64 (*.f64 B 1/2) (+.f64 A (Rewrite<= mul-1-neg_binary64 (*.f64 -1 C)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 180 (PI.f64)) (atan.f64 (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 B (+.f64 A (*.f64 -1 C))) 1/2)))): 1 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 180 (PI.f64)) (atan.f64 (Rewrite<= *-commutative_binary64 (*.f64 1/2 (/.f64 B (+.f64 A (*.f64 -1 C))))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 180 (/.f64 (PI.f64) (atan.f64 (*.f64 1/2 (/.f64 B (+.f64 A (*.f64 -1 C)))))))): 18 points increase in error, 14 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 180 (atan.f64 (*.f64 1/2 (/.f64 B (+.f64 A (*.f64 -1 C)))))) (PI.f64))): 17 points increase in error, 26 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 180 (/.f64 (atan.f64 (*.f64 1/2 (/.f64 B (+.f64 A (*.f64 -1 C))))) (PI.f64)))): 28 points increase in error, 14 points decrease in error
  3. Recombined 2 regimes into one program.
  4. Final simplification7.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.0002:\\ \;\;\;\;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 0:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A - C}\right)\\ \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
Error11.2
Cost20164
\[\begin{array}{l} \mathbf{if}\;A \leq -1.3376608561692848 \cdot 10^{+61}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A - C}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \left(A + \mathsf{hypot}\left(B, C - A\right)\right)}{B}\right)\\ \end{array} \]
Alternative 2
Error13.8
Cost20104
\[\begin{array}{l} \mathbf{if}\;C \leq -6.942305116475016 \cdot 10^{+47}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\ \mathbf{elif}\;C \leq 4.0785699396512036 \cdot 10^{+45}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{\left(-A\right) - \mathsf{hypot}\left(B, A\right)}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \end{array} \]
Alternative 3
Error14.7
Cost20040
\[\begin{array}{l} \mathbf{if}\;A \leq -1.3376608561692848 \cdot 10^{+61}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A - C}\right)\\ \mathbf{elif}\;A \leq 8.024026920823831 \cdot 10^{+79}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - \mathsf{hypot}\left(B, C\right)}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\ \end{array} \]
Alternative 4
Error29.1
Cost14496
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{A \cdot -2}{B}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} 1\\ t_2 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A - C}\right)\\ \mathbf{if}\;B \leq -2.2279396436020537 \cdot 10^{+20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -4894.362170564843:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{elif}\;B \leq -3.581995160051717 \cdot 10^{-61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -1.8456384602286509 \cdot 10^{-256}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 4.782806538390296 \cdot 10^{-294}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 8.890718880344477 \cdot 10^{-48}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 15.689816812795312:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 6.804832779821373 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \end{array} \]
Alternative 5
Error34.2
Cost14104
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} 1\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\ \mathbf{if}\;B \leq -2.2279396436020537 \cdot 10^{+20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -4894.362170564843:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{elif}\;B \leq -3.581995160051717 \cdot 10^{-61}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.3256707400077488 \cdot 10^{-136}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 6.352149717888542 \cdot 10^{-202}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 0\\ \mathbf{elif}\;B \leq 2.0630042587541568 \cdot 10^{+40}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 6
Error34.2
Cost14104
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{if}\;B \leq -2.2279396436020537 \cdot 10^{+20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -4894.362170564843:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{elif}\;B \leq -3.581995160051717 \cdot 10^{-61}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.3256707400077488 \cdot 10^{-136}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\ \mathbf{elif}\;B \leq 6.352149717888542 \cdot 10^{-202}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 0\\ \mathbf{elif}\;B \leq 2.0630042587541568 \cdot 10^{+40}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 7
Error25.4
Cost14100
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot 0.5}{A - C}\right)\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C - B\right) - A}{B}\right)}{\pi}\\ \mathbf{if}\;A \leq -1.214813217904932 \cdot 10^{-62}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -8.24331434000067 \cdot 10^{-114}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{elif}\;A \leq -4.1764699592859263 \cdot 10^{-203}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 4.945228213945751 \cdot 10^{-154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 9.829583909532496 \cdot 10^{-102}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error30.5
Cost13972
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{if}\;C \leq -3.195229103614077 \cdot 10^{-140}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;C \leq 1.401254198033994 \cdot 10^{-303}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{elif}\;C \leq 1.9626429064414232 \cdot 10^{-159}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 5.9660603652220276 \cdot 10^{-105}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{A \cdot -2}{B}\right)\\ \mathbf{elif}\;C \leq 3.264828499949277 \cdot 10^{-101}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right)}{\pi}\\ \end{array} \]
Alternative 9
Error34.2
Cost13840
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\ \mathbf{if}\;B \leq -3.581995160051717 \cdot 10^{-61}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{elif}\;B \leq -1.3256707400077488 \cdot 10^{-136}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 6.352149717888542 \cdot 10^{-202}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 0\\ \mathbf{elif}\;B \leq 2.0630042587541568 \cdot 10^{+40}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 10
Error30.4
Cost13708
\[\begin{array}{l} \mathbf{if}\;C \leq -3.195229103614077 \cdot 10^{-140}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;C \leq 1.401254198033994 \cdot 10^{-303}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{elif}\;C \leq 3.264828499949277 \cdot 10^{-101}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{B}{\frac{C}{-0.5}}\right)}{\pi}\\ \end{array} \]
Alternative 11
Error34.9
Cost13320
\[\begin{array}{l} \mathbf{if}\;B \leq -1.3764136298351405 \cdot 10^{-150}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{elif}\;B \leq 1.8907835611334857 \cdot 10^{-109}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 12
Error44.8
Cost13188
\[\begin{array}{l} \mathbf{if}\;B \leq -1.3764136298351405 \cdot 10^{-150}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 1\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} 0\\ \end{array} \]
Alternative 13
Error55.6
Cost13056
\[\frac{180}{\pi} \cdot \tan^{-1} 0 \]

Error

Reproduce

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