ABCF->ab-angle angle

?

Percentage Accurate: 54.2% → 89.3%
Time: 27.1s
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 -2 \cdot 10^{-68} \lor \neg \left(t_0 \leq 0\right):\\ \;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{\left(C - A\right) \cdot -2}\right)}{\pi \cdot 0.005555555555555556}\\ \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 -2e-68) (not (<= t_0 0.0)))
     (* (atan (/ (- (- C A) (hypot B (- C A))) B)) (/ 180.0 PI))
     (/ (atan (/ B (* (- C A) -2.0))) (* PI 0.005555555555555556)))))
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 <= -2e-68) || !(t_0 <= 0.0)) {
		tmp = atan((((C - A) - hypot(B, (C - A))) / B)) * (180.0 / ((double) M_PI));
	} else {
		tmp = atan((B / ((C - A) * -2.0))) / (((double) M_PI) * 0.005555555555555556);
	}
	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 <= -2e-68) || !(t_0 <= 0.0)) {
		tmp = Math.atan((((C - A) - Math.hypot(B, (C - A))) / B)) * (180.0 / Math.PI);
	} else {
		tmp = Math.atan((B / ((C - A) * -2.0))) / (Math.PI * 0.005555555555555556);
	}
	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 <= -2e-68) or not (t_0 <= 0.0):
		tmp = math.atan((((C - A) - math.hypot(B, (C - A))) / B)) * (180.0 / math.pi)
	else:
		tmp = math.atan((B / ((C - A) * -2.0))) / (math.pi * 0.005555555555555556)
	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 <= -2e-68) || !(t_0 <= 0.0))
		tmp = Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(C - A))) / B)) * Float64(180.0 / pi));
	else
		tmp = Float64(atan(Float64(B / Float64(Float64(C - A) * -2.0))) / Float64(pi * 0.005555555555555556));
	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 <= -2e-68) || ~((t_0 <= 0.0)))
		tmp = atan((((C - A) - hypot(B, (C - A))) / B)) * (180.0 / pi);
	else
		tmp = atan((B / ((C - A) * -2.0))) / (pi * 0.005555555555555556);
	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, -2e-68], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], N[(N[ArcTan[N[(N[(N[(C - A), $MachinePrecision] - N[Sqrt[B ^ 2 + N[(C - A), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[N[(B / N[(N[(C - A), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(Pi * 0.005555555555555556), $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 -2 \cdot 10^{-68} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right) \cdot \frac{180}{\pi}\\

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


\end{array}

Local Percentage Accuracy?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 22 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each of Herbie's proposed alternatives. Up and to the right is better. Each dot represents an alternative program; the red square represents the initial program.

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.00000000000000013e-68 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 61.5%

      \[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. Simplified86.1%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right) \cdot \frac{180}{\pi}} \]
      Step-by-step derivation

      [Start]61.5

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

      associate-*r/ [=>]61.5

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

      associate-*l/ [<=]61.5

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

      *-commutative [=>]61.5

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

    if -2.00000000000000013e-68 < (*.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 23.8%

      \[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. Simplified23.8%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right) \cdot \frac{180}{\pi}} \]
      Step-by-step derivation

      [Start]23.8

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

      associate-*r/ [=>]23.8

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

      associate-*l/ [<=]23.8

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

      *-commutative [=>]23.8

      \[ \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}} \]
    3. Taylor expanded in B around 0 99.6%

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

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

      [Start]99.6

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

      *-commutative [=>]99.6

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

      associate-*l/ [=>]99.6

      \[ \tan^{-1} \color{blue}{\left(\frac{B \cdot -0.5}{C - A}\right)} \cdot \frac{180}{\pi} \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\tan^{-1} \left(\frac{B}{\left(C - A\right) \cdot -2}\right)}{\pi \cdot 0.005555555555555556}} \]
      Step-by-step derivation

      [Start]99.6

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

      clear-num [=>]99.6

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

      un-div-inv [=>]99.7

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

      associate-/l* [=>]99.7

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

      div-inv [=>]99.7

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

      metadata-eval [=>]99.7

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

      div-inv [=>]99.7

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

      metadata-eval [=>]99.7

      \[ \frac{\tan^{-1} \left(\frac{B}{\left(C - A\right) \cdot -2}\right)}{\pi \cdot \color{blue}{0.005555555555555556}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.0%

    \[\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^{-68} \lor \neg \left(\frac{1}{B} \cdot \left(\left(C - A\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right) \leq 0\right):\\ \;\;\;\;\tan^{-1} \left(\frac{\left(C - A\right) - \mathsf{hypot}\left(B, C - A\right)}{B}\right) \cdot \frac{180}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{\left(C - A\right) \cdot -2}\right)}{\pi \cdot 0.005555555555555556}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy75.1%
Cost20104
\[\begin{array}{l} \mathbf{if}\;C \leq -1.85 \cdot 10^{+177}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;C \leq 1.16 \cdot 10^{+44}:\\ \;\;\;\;\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(\frac{B}{\left(C - A\right) \cdot -2}\right)}{\pi \cdot 0.005555555555555556}\\ \end{array} \]
Alternative 2
Accuracy47.2%
Cost14764
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ t_2 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{if}\;B \leq -3.3 \cdot 10^{+32}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -1.18 \cdot 10^{-122}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.55 \cdot 10^{-168}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq -1.8 \cdot 10^{-172}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -9.8 \cdot 10^{-260}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 7 \cdot 10^{-273}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 4.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.75 \cdot 10^{-164}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 5.8 \cdot 10^{-96}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 2.1 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 9000000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 3
Accuracy47.2%
Cost14764
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ t_2 := 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)}{\pi}\\ \mathbf{if}\;B \leq -6.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -3.8 \cdot 10^{-122}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.1 \cdot 10^{-168}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq -2.6 \cdot 10^{-170}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -7.2 \cdot 10^{-260}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.75 \cdot 10^{-272}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 4.3 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 3.7 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 3.9 \cdot 10^{-96}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\ \mathbf{elif}\;B \leq 1.15 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 7000000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 4
Accuracy47.3%
Cost14632
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ t_2 := \frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{if}\;B \leq -4.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -8.6 \cdot 10^{-123}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.26 \cdot 10^{-195}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq -1.28 \cdot 10^{-259}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 2.2 \cdot 10^{-273}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{-171}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.9 \cdot 10^{-95}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 53000000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 5
Accuracy47.2%
Cost14632
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ t_2 := \frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{if}\;B \leq -2.6 \cdot 10^{+32}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -3.9 \cdot 10^{-123}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -5.5 \cdot 10^{-196}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq -6.5 \cdot 10^{-260}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.82 \cdot 10^{-273}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 2.9 \cdot 10^{-217}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{-0.5}{\frac{C}{B}}\right)\\ \mathbf{elif}\;B \leq 3.8 \cdot 10^{-177}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 7.2 \cdot 10^{-96}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C}\right)\\ \mathbf{elif}\;B \leq 2.9 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.02 \cdot 10^{+14}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 6
Accuracy47.2%
Cost14632
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ t_2 := \frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{if}\;B \leq -9.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -5.4 \cdot 10^{-122}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.25 \cdot 10^{-195}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq -8.2 \cdot 10^{-260}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 4.5 \cdot 10^{-273}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 1.85 \cdot 10^{-217}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{-0.5}{\frac{C}{B}}\right)\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{-174}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 3.05 \cdot 10^{-96}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)\\ \mathbf{elif}\;B \leq 1.25 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 21000000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 7
Accuracy47.3%
Cost14632
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{if}\;B \leq -7.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -1.04 \cdot 10^{-122}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.4 \cdot 10^{-195}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{elif}\;B \leq -7.2 \cdot 10^{-260}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 3.7 \cdot 10^{-273}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{elif}\;B \leq 6.4 \cdot 10^{-218}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{-0.5}{\frac{C}{B}}\right)\\ \mathbf{elif}\;B \leq 4.2 \cdot 10^{-171}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 2.1 \cdot 10^{-95}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)\\ \mathbf{elif}\;B \leq 1.7 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 9000000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 8
Accuracy56.9%
Cost14497
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\ \mathbf{if}\;B \leq -1.4 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -1.4 \cdot 10^{-106}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -7.2 \cdot 10^{-153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -4.1 \cdot 10^{-174}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -8.5 \cdot 10^{-260}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{elif}\;B \leq 1.6 \cdot 10^{-229} \lor \neg \left(B \leq 6.2 \cdot 10^{+27}\right) \land B \leq 1.1 \cdot 10^{+60}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \end{array} \]
Alternative 9
Accuracy56.9%
Cost14497
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C - A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\ \mathbf{if}\;B \leq -5 \cdot 10^{-16}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -4.4 \cdot 10^{-113}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -2.2 \cdot 10^{-153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -3.8 \cdot 10^{-174}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{elif}\;B \leq -1.6 \cdot 10^{-259}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{elif}\;B \leq 5.8 \cdot 10^{-226} \lor \neg \left(B \leq 7.2 \cdot 10^{+27}\right) \land B \leq 1.1 \cdot 10^{+60}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \end{array} \]
Alternative 10
Accuracy56.9%
Cost14497
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C - A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\ \mathbf{if}\;B \leq -4.6 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -3.9 \cdot 10^{-111}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -5.5 \cdot 10^{-153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -2.4 \cdot 10^{-173}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C - A}\right)\\ \mathbf{elif}\;B \leq -1.2 \cdot 10^{-259}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{elif}\;B \leq 1.65 \cdot 10^{-227} \lor \neg \left(B \leq 4.1 \cdot 10^{+27}\right) \land B \leq 1.1 \cdot 10^{+60}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \end{array} \]
Alternative 11
Accuracy59.8%
Cost14497
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)\\ \mathbf{if}\;A \leq -1.15 \cdot 10^{+142}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C - A}\right)}{\pi}\\ \mathbf{elif}\;A \leq -5.6 \cdot 10^{+72}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -1.7 \cdot 10^{-71}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C - A}\right)\\ \mathbf{elif}\;A \leq -2.3 \cdot 10^{-103}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -2.9 \cdot 10^{-193}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{-0.5}{C - A}\right)\\ \mathbf{elif}\;A \leq 4.4 \cdot 10^{-292}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;A \leq 5.2 \cdot 10^{-191} \lor \neg \left(A \leq 6.5 \cdot 10^{-102}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \end{array} \]
Alternative 12
Accuracy59.8%
Cost14497
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)\\ t_1 := \frac{\tan^{-1} \left(\frac{B}{\left(C - A\right) \cdot -2}\right)}{\pi \cdot 0.005555555555555556}\\ \mathbf{if}\;A \leq -1.15 \cdot 10^{+142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq -6 \cdot 10^{+72}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -8.5 \cdot 10^{-73}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C - A}\right)\\ \mathbf{elif}\;A \leq -1.3 \cdot 10^{-103}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -2.8 \cdot 10^{-193}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;A \leq 2.25 \cdot 10^{-292}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;A \leq 1.9 \cdot 10^{-192} \lor \neg \left(A \leq 1.22 \cdot 10^{-100}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \end{array} \]
Alternative 13
Accuracy47.5%
Cost14368
\[\begin{array}{l} t_0 := 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{if}\;B \leq -3.3 \cdot 10^{+32}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -1.4 \cdot 10^{-110}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -8.5 \cdot 10^{-308}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.1 \cdot 10^{-233}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 2.05 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.4 \cdot 10^{-95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.4 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 6800000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 14
Accuracy51.2%
Cost14236
\[\begin{array}{l} t_0 := \tan^{-1} \left(0.5 \cdot \frac{B}{A}\right)\\ \mathbf{if}\;B \leq -2.8 \cdot 10^{+32}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -7.6 \cdot 10^{-123}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;B \leq -4.1 \cdot 10^{-196}:\\ \;\;\;\;\frac{180}{\pi} \cdot t_0\\ \mathbf{elif}\;B \leq -8 \cdot 10^{-260}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{elif}\;B \leq 1.26 \cdot 10^{-272}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(B \cdot \frac{0.5}{A}\right)\\ \mathbf{elif}\;B \leq 3.6 \cdot 10^{-238}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{-0.5}{\frac{C}{B}}\right)\\ \mathbf{elif}\;B \leq 1.52 \cdot 10^{-223}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \end{array} \]
Alternative 15
Accuracy65.7%
Cost14233
\[\begin{array}{l} t_0 := \tan^{-1} \left(B \cdot \frac{-0.5}{C - A}\right)\\ t_1 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{\left(B + C\right) - A}{B}\right)\\ \mathbf{if}\;B \leq -6.6 \cdot 10^{-47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq -2.4 \cdot 10^{-107}:\\ \;\;\;\;\frac{180}{\pi} \cdot t_0\\ \mathbf{elif}\;B \leq -1.18 \cdot 10^{-297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.22 \cdot 10^{-233}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{B}{\left(C - A\right) \cdot -2}\right)}{\pi \cdot 0.005555555555555556}\\ \mathbf{elif}\;B \leq 8.7 \cdot 10^{+27} \lor \neg \left(B \leq 1.1 \cdot 10^{+60}\right):\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{C - A}{B} + -1\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{t_0}{\pi}\\ \end{array} \]
Alternative 16
Accuracy55.0%
Cost13972
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\ \mathbf{if}\;B \leq -3.6 \cdot 10^{-17}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.5 \cdot 10^{-106}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{B}{C}\right)}{\pi}\\ \mathbf{elif}\;B \leq -2.4 \cdot 10^{-195}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.45 \cdot 10^{-307}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{elif}\;B \leq 1.22 \cdot 10^{-225}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \end{array} \]
Alternative 17
Accuracy58.9%
Cost13840
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(1 - \frac{A}{B}\right)\\ \mathbf{if}\;C \leq -1 \cdot 10^{-65}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C - B}{B}\right)\\ \mathbf{elif}\;C \leq -1.3 \cdot 10^{-185}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 9.5 \cdot 10^{-132}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(-1 - \frac{A}{B}\right)\\ \mathbf{elif}\;C \leq 3.1 \cdot 10^{+42}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{B \cdot -0.5}{C}\right)\\ \end{array} \]
Alternative 18
Accuracy47.4%
Cost13712
\[\begin{array}{l} t_0 := \frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{if}\;B \leq -2.1 \cdot 10^{-37}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq -9 \cdot 10^{-309}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq 1.3 \cdot 10^{-233}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{0}{B}\right)}{\pi}\\ \mathbf{elif}\;B \leq 2.55 \cdot 10^{-42}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 19
Accuracy47.6%
Cost13448
\[\begin{array}{l} \mathbf{if}\;B \leq -3.3 \cdot 10^{-37}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{elif}\;B \leq 1.4 \cdot 10^{-42}:\\ \;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(\frac{C}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 20
Accuracy40.5%
Cost13188
\[\begin{array}{l} \mathbf{if}\;B \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} 1}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} -1}{\pi}\\ \end{array} \]
Alternative 21
Accuracy20.7%
Cost13056
\[\frac{180 \cdot \tan^{-1} -1}{\pi} \]

Reproduce?

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