?

Average Error: 29.6 → 17.5
Time: 20.5s
Precision: binary64
Cost: 53896

?

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

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

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 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

    1. Initial program 26.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. Simplified26.6

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right) \cdot \frac{180}{\pi}} \]
      Proof

      [Start]26.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} \]

      rational_best-simplify-55 [=>]26.6

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

      rational_best-simplify-1 [=>]26.6

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

      rational_best-simplify-55 [=>]26.6

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

      rational_best-simplify-1 [=>]26.6

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

      rational_best-simplify-7 [=>]26.6

      \[ \tan^{-1} \color{blue}{\left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)} \cdot \frac{180}{\pi} \]
    3. Taylor expanded in B around inf 16.1

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

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\left(C - B\right) - A}}{B}\right) \cdot \frac{180}{\pi} \]
      Proof

      [Start]16.1

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

      rational_best-simplify-59 [=>]16.1

      \[ \tan^{-1} \left(\frac{\color{blue}{\left(-1 \cdot B - \left(-C\right)\right)} - A}{B}\right) \cdot \frac{180}{\pi} \]

      rational_best-simplify-14 [=>]16.1

      \[ \tan^{-1} \left(\frac{\left(-1 \cdot B - \color{blue}{\left(0 - C\right)}\right) - A}{B}\right) \cdot \frac{180}{\pi} \]

      rational_best-simplify-51 [=>]16.1

      \[ \tan^{-1} \left(\frac{\color{blue}{\left(C - \left(0 - -1 \cdot B\right)\right)} - A}{B}\right) \cdot \frac{180}{\pi} \]

      metadata-eval [<=]16.1

      \[ \tan^{-1} \left(\frac{\left(C - \left(\color{blue}{\frac{0}{-1}} - -1 \cdot B\right)\right) - A}{B}\right) \cdot \frac{180}{\pi} \]

      rational_best-simplify-37 [=>]16.1

      \[ \tan^{-1} \left(\frac{\left(C - \color{blue}{\frac{B}{\frac{-1}{-1}}}\right) - A}{B}\right) \cdot \frac{180}{\pi} \]

      metadata-eval [=>]16.1

      \[ \tan^{-1} \left(\frac{\left(C - \frac{B}{\color{blue}{1}}\right) - A}{B}\right) \cdot \frac{180}{\pi} \]

      rational_best-simplify-8 [=>]16.1

      \[ \tan^{-1} \left(\frac{\left(C - \color{blue}{B}\right) - A}{B}\right) \cdot \frac{180}{\pi} \]

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

    1. Initial program 51.4

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

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right) \cdot \frac{180}{\pi}} \]
      Proof

      [Start]51.4

      \[ 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} \]

      rational_best-simplify-55 [=>]51.4

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

      rational_best-simplify-1 [=>]51.4

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

      rational_best-simplify-55 [=>]51.4

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

      rational_best-simplify-1 [=>]51.4

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

      rational_best-simplify-7 [=>]51.4

      \[ \tan^{-1} \color{blue}{\left(\frac{\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}{B}\right)} \cdot \frac{180}{\pi} \]
    3. Taylor expanded in A around -inf 31.1

      \[\leadsto \tan^{-1} \color{blue}{\left(0.5 \cdot \frac{B}{A}\right)} \cdot \frac{180}{\pi} \]

    if 9.99999999999999955e-7 < (*.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. Simplified25.6

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{C - \left(A + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}{B}\right) \cdot \frac{180}{\pi}} \]
      Proof

      [Start]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} \]

      rational_best-simplify-55 [=>]25.6

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

      rational_best-simplify-1 [=>]25.6

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

      rational_best-simplify-55 [=>]25.6

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

      rational_best-simplify-1 [=>]25.6

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

      rational_best-simplify-7 [=>]25.6

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

      rational_best-simplify-52 [=>]25.6

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

      rational_best-simplify-3 [=>]25.6

      \[ \tan^{-1} \left(\frac{C - \color{blue}{\left(A + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{B}\right) \cdot \frac{180}{\pi} \]
    3. Taylor expanded in B around -inf 14.7

      \[\leadsto \tan^{-1} \left(\frac{\color{blue}{\left(C + B\right) - A}}{B}\right) \cdot \frac{180}{\pi} \]
    4. Taylor expanded in C around 0 14.7

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

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

Alternatives

Alternative 1
Error31.6
Cost14896
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ t_1 := \tan^{-1} \left(\frac{-A}{B}\right) \cdot \frac{180}{\pi}\\ t_2 := \tan^{-1} \left(\frac{C}{B}\right) \cdot \frac{180}{\pi}\\ t_3 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_4 := \tan^{-1} -1 \cdot \frac{180}{\pi}\\ \mathbf{if}\;B \leq -2 \cdot 10^{-84}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C + B}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq -7.2 \cdot 10^{-214}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq -1 \cdot 10^{-268}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -4.5 \cdot 10^{-298}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 2.9 \cdot 10^{-136}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 6.2 \cdot 10^{-90}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.2 \cdot 10^{-52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-27}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1050000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{+26}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 3.05 \cdot 10^{+80}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;B \leq 1.1 \cdot 10^{+90}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 2
Error31.5
Cost14896
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := \tan^{-1} -1 \cdot \frac{180}{\pi}\\ t_2 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ t_3 := 180 \cdot \frac{t_2}{\pi}\\ t_4 := \tan^{-1} \left(\frac{-A}{B}\right) \cdot \frac{180}{\pi}\\ t_5 := \tan^{-1} \left(\frac{C}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{if}\;B \leq -1.7 \cdot 10^{-83}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{C + B}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq -1.32 \cdot 10^{-212}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1 \cdot 10^{-267}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;B \leq -5 \cdot 10^{-298}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 7.4 \cdot 10^{-137}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;B \leq 6 \cdot 10^{-90}:\\ \;\;\;\;t_2 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-56}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;B \leq 2.9 \cdot 10^{-25}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 1400000000:\\ \;\;\;\;t_5\\ \mathbf{elif}\;B \leq 1.2 \cdot 10^{+27}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 3.4 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{+82}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error33.9
Cost14764
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ t_2 := \tan^{-1} \left(\frac{-A}{B}\right) \cdot \frac{180}{\pi}\\ t_3 := \tan^{-1} \left(\frac{C}{B}\right) \cdot \frac{180}{\pi}\\ t_4 := \tan^{-1} -1 \cdot \frac{180}{\pi}\\ \mathbf{if}\;B \leq -1.1 \cdot 10^{-71}:\\ \;\;\;\;\tan^{-1} 1 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq -2.6 \cdot 10^{-213}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.3 \cdot 10^{-268}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq -8.6 \cdot 10^{-298}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 2.15 \cdot 10^{-137}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 3 \cdot 10^{-90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 4 \cdot 10^{-54}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 2.2 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 9.5 \cdot 10^{+32}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 4.6 \cdot 10^{+80}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;B \leq 4.6 \cdot 10^{+82}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 4
Error27.8
Cost14236
\[\begin{array}{l} t_0 := \tan^{-1} \left(-1 - \frac{A}{B}\right) \cdot \frac{180}{\pi}\\ t_1 := 180 \cdot \frac{\tan^{-1} \left(\frac{C + B}{B}\right)}{\pi}\\ \mathbf{if}\;C \leq -1.04 \cdot 10^{-109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 1.05 \cdot 10^{-269}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 2.4 \cdot 10^{-251}:\\ \;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;C \leq 1.4 \cdot 10^{-113}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 3.3 \cdot 10^{-60}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 1.75 \cdot 10^{+25}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;C \leq 3.1 \cdot 10^{+69}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \end{array} \]
Alternative 5
Error27.9
Cost14236
\[\begin{array}{l} t_0 := \tan^{-1} \left(-1 - \frac{A}{B}\right) \cdot \frac{180}{\pi}\\ t_1 := \tan^{-1} \left(\frac{C + B}{B}\right)\\ \mathbf{if}\;C \leq -4.7 \cdot 10^{-110}:\\ \;\;\;\;180 \cdot \frac{t_1}{\pi}\\ \mathbf{elif}\;C \leq 7.5 \cdot 10^{-276}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 4.2 \cdot 10^{-251}:\\ \;\;\;\;\tan^{-1} \left(B \cdot \frac{0.5}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;C \leq 8.5 \cdot 10^{-114}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 2.25 \cdot 10^{-62}:\\ \;\;\;\;t_1 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;C \leq 1.75 \cdot 10^{+25}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;C \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \end{array} \]
Alternative 6
Error26.0
Cost14232
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{\left(C + B\right) - A}{B}\right)}{\pi}\\ t_1 := \tan^{-1} \left(-1 - \frac{A}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{if}\;A \leq -3.7 \cdot 10^{+22}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq 5.2 \cdot 10^{-216}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 7.9 \cdot 10^{-159}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 3.05 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 1.98 \cdot 10^{-19}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;A \leq 31000000000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error26.0
Cost14232
\[\begin{array}{l} t_0 := \tan^{-1} \left(-1 - \frac{A}{B}\right) \cdot \frac{180}{\pi}\\ t_1 := \tan^{-1} \left(\frac{\left(C + B\right) - A}{B}\right)\\ t_2 := 180 \cdot \frac{t_1}{\pi}\\ \mathbf{if}\;A \leq -1.45 \cdot 10^{+24}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq 4.5 \cdot 10^{-216}:\\ \;\;\;\;t_1 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq 2.3 \cdot 10^{-159}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq 9.5 \cdot 10^{-79}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;A \leq 1.4 \cdot 10^{-19}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;A \leq 31000000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error34.8
Cost14040
\[\begin{array}{l} t_0 := \tan^{-1} \left(\frac{0}{B}\right) \cdot \frac{180}{\pi}\\ t_1 := \tan^{-1} \left(\frac{-A}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{if}\;B \leq -3.8 \cdot 10^{-100}:\\ \;\;\;\;\tan^{-1} 1 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq -1.65 \cdot 10^{-205}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.45 \cdot 10^{-266}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 4.5 \cdot 10^{-272}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.95 \cdot 10^{-133}:\\ \;\;\;\;\tan^{-1} \left(\frac{C}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq 3.1 \cdot 10^{+26}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} -1 \cdot \frac{180}{\pi}\\ \end{array} \]
Alternative 9
Error34.1
Cost14040
\[\begin{array}{l} t_0 := \tan^{-1} \left(\frac{-A}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{if}\;B \leq -3.5 \cdot 10^{-71}:\\ \;\;\;\;\tan^{-1} 1 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq -2.15 \cdot 10^{-200}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;B \leq -1.52 \cdot 10^{-268}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 3.8 \cdot 10^{-272}:\\ \;\;\;\;\tan^{-1} \left(\frac{0}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq 4.5 \cdot 10^{-131}:\\ \;\;\;\;\tan^{-1} \left(\frac{C}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq 3.5 \cdot 10^{+27}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} -1 \cdot \frac{180}{\pi}\\ \end{array} \]
Alternative 10
Error34.9
Cost13844
\[\begin{array}{l} t_0 := \tan^{-1} \left(\frac{0}{B}\right) \cdot \frac{180}{\pi}\\ t_1 := \tan^{-1} \left(\frac{C}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{if}\;B \leq -9.2 \cdot 10^{-104}:\\ \;\;\;\;\tan^{-1} 1 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq -9 \cdot 10^{-213}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -6.5 \cdot 10^{-270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.05 \cdot 10^{-271}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 3.9 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} -1 \cdot \frac{180}{\pi}\\ \end{array} \]
Alternative 11
Error25.8
Cost13708
\[\begin{array}{l} \mathbf{if}\;A \leq -2.45 \cdot 10^{+23}:\\ \;\;\;\;\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq 1.7 \cdot 10^{-216}:\\ \;\;\;\;\tan^{-1} \left(\frac{C + B}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{elif}\;A \leq 34000000000000:\\ \;\;\;\;\tan^{-1} \left(-1 - \frac{A}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(\frac{B - A}{B}\right) \cdot \frac{180}{\pi}\\ \end{array} \]
Alternative 12
Error35.5
Cost13448
\[\begin{array}{l} \mathbf{if}\;B \leq -4.8 \cdot 10^{-99}:\\ \;\;\;\;\tan^{-1} 1 \cdot \frac{180}{\pi}\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{-178}:\\ \;\;\;\;\tan^{-1} \left(\frac{0}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} -1 \cdot \frac{180}{\pi}\\ \end{array} \]
Alternative 13
Error38.4
Cost13188
\[\begin{array}{l} \mathbf{if}\;B \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\tan^{-1} 1 \cdot \frac{180}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} -1 \cdot \frac{180}{\pi}\\ \end{array} \]
Alternative 14
Error50.8
Cost13056
\[\tan^{-1} -1 \cdot \frac{180}{\pi} \]

Error

Reproduce?

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