ABCF->ab-angle b

?

Percentage Accurate: 19.1% → 46.3%
Time: 50.7s
Precision: binary64
Cost: 27720

?

\[ \begin{array}{c}[A, C] = \mathsf{sort}([A, C])\\ \end{array} \]
\[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
\[\begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -2.2 \cdot 10^{+80}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq -3.6 \cdot 10^{-60}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 3 \cdot 10^{-10}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(F \cdot 2\right) \cdot \left(A + A\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\\ \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (/
  (-
   (sqrt
    (*
     (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F))
     (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
  (- (pow B 2.0) (* (* 4.0 A) C))))
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* C (* A -4.0)))) (t_1 (fma B B (* A (* C -4.0)))))
   (if (<= B -2.2e+80)
     (* (sqrt (/ F B)) (- (sqrt 2.0)))
     (if (<= B -3.6e-60)
       (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (- C (hypot B (- A C)))))))) t_0)
       (if (<= B 3e-10)
         (/ (- (sqrt (* t_1 (* (* F 2.0) (+ A A))))) t_1)
         (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A (hypot B A)))))))))))
double code(double A, double B, double C, double F) {
	return -sqrt(((2.0 * ((pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / (pow(B, 2.0) - ((4.0 * A) * C));
}
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (C * (A * -4.0)));
	double t_1 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (B <= -2.2e+80) {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	} else if (B <= -3.6e-60) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C - hypot(B, (A - C))))))) / t_0;
	} else if (B <= 3e-10) {
		tmp = -sqrt((t_1 * ((F * 2.0) * (A + A)))) / t_1;
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(B, A))));
	}
	return tmp;
}
function code(A, B, C, F)
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)))
end
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(C * Float64(A * -4.0)))
	t_1 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (B <= -2.2e+80)
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	elseif (B <= -3.6e-60)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C - hypot(B, Float64(A - C)))))))) / t_0);
	elseif (B <= 3e-10)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(Float64(F * 2.0) * Float64(A + A))))) / t_1);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - hypot(B, A))))));
	end
	return tmp
end
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -2.2e+80], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], If[LessEqual[B, -3.6e-60], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 3e-10], N[((-N[Sqrt[N[(t$95$1 * N[(N[(F * 2.0), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]
\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq -2.2 \cdot 10^{+80}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\

\mathbf{elif}\;B \leq -3.6 \cdot 10^{-60}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

\mathbf{elif}\;B \leq 3 \cdot 10^{-10}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(F \cdot 2\right) \cdot \left(A + A\right)\right)}}{t_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\\


\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 14 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.

Bogosity?

Bogosity

Derivation?

  1. Split input into 4 regimes
  2. if B < -2.20000000000000003e80

    1. Initial program 8.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified8.4%

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
      Step-by-step derivation

      [Start]8.4

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Taylor expanded in A around 0 8.4%

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Simplified8.5%

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(C - \mathsf{hypot}\left(C, B\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      Step-by-step derivation

      [Start]8.4

      \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

      +-commutative [=>]8.4

      \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(C - \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

      unpow2 [=>]8.4

      \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(C - \sqrt{\color{blue}{C \cdot C} + {B}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

      unpow2 [=>]8.4

      \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(C - \sqrt{C \cdot C + \color{blue}{B \cdot B}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

      hypot-def [=>]8.5

      \[ \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(C - \color{blue}{\mathsf{hypot}\left(C, B\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Taylor expanded in B around -inf 8.1%

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(C + \left(-0.125 \cdot \frac{{C}^{4}}{{B}^{3}} + \left(0.5 \cdot \frac{{C}^{2}}{B} + B\right)\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in C around 0 51.1%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)} \]
    7. Simplified51.1%

      \[\leadsto \color{blue}{\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)} \]
      Step-by-step derivation

      [Start]51.1

      \[ -1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right) \]

      mul-1-neg [=>]51.1

      \[ \color{blue}{-\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]

      *-commutative [=>]51.1

      \[ -\color{blue}{\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]

      distribute-rgt-neg-in [=>]51.1

      \[ \color{blue}{\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)} \]

    if -2.20000000000000003e80 < B < -3.6e-60

    1. Initial program 53.3%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified61.2%

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}} \]
      Step-by-step derivation

      [Start]53.3

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if -3.6e-60 < B < 3e-10

    1. Initial program 20.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified34.4%

      \[\leadsto \color{blue}{\frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}} \]
      Step-by-step derivation

      [Start]20.0

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Taylor expanded in C around inf 25.5%

      \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]
    4. Simplified25.5%

      \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \color{blue}{\left(A + A\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]
      Step-by-step derivation

      [Start]25.5

      \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]

      cancel-sign-sub-inv [=>]25.5

      \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \color{blue}{\left(A + \left(--1\right) \cdot A\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]

      metadata-eval [=>]25.5

      \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]

      *-lft-identity [=>]25.5

      \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \left(A + \color{blue}{A}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]

    if 3e-10 < B

    1. Initial program 12.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified10.6%

      \[\leadsto \color{blue}{\frac{-\sqrt{F \cdot \left(\left(A - \left(\mathsf{hypot}\left(B, A - C\right) - C\right)\right) \cdot \mathsf{fma}\left(C, A \cdot -8, 2 \cdot \left(B \cdot B\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      Step-by-step derivation

      [Start]12.9

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Taylor expanded in C around 0 18.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)} \]
    4. Simplified50.2%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)} \]
      Step-by-step derivation

      [Start]18.9

      \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right) \]

      mul-1-neg [=>]18.9

      \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}} \]

      distribute-rgt-neg-in [=>]18.9

      \[ \color{blue}{\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)} \]

      *-commutative [=>]18.9

      \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\color{blue}{F \cdot \left(A - \sqrt{{B}^{2} + {A}^{2}}\right)}}\right) \]

      unpow2 [=>]18.9

      \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]

      unpow2 [=>]18.9

      \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}\right) \]

      hypot-def [=>]50.2

      \[ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification40.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -2.2 \cdot 10^{+80}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq -3.6 \cdot 10^{-60}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 3 \cdot 10^{-10}:\\ \;\;\;\;\frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(F \cdot 2\right) \cdot \left(A + A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy46.2%
Cost21132
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B \leq -1.15 \cdot 10^{+80}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq -1.6 \cdot 10^{-61}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 5.8 \cdot 10^{-6}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(F \cdot 2\right) \cdot \left(A + A\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\\ \end{array} \]
Alternative 2
Accuracy46.2%
Cost20300
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;B \leq -1.1 \cdot 10^{+81}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq -2.55 \cdot 10^{-60}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.9 \cdot 10^{-14}:\\ \;\;\;\;\frac{-{\left(\mathsf{fma}\left(B, B, -4 \cdot \left(C \cdot A\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}^{0.5}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\\ \end{array} \]
Alternative 3
Accuracy44.0%
Cost14924
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;B \leq -4.6 \cdot 10^{+82}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq -2.2 \cdot 10^{-61}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 5.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{-{\left(\mathsf{fma}\left(B, B, -4 \cdot \left(C \cdot A\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}^{0.5}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \left(\frac{C \cdot -0.5}{\frac{B}{C}} - B\right)\right)}\right)\\ \end{array} \]
Alternative 4
Accuracy43.3%
Cost14792
\[\begin{array}{l} \mathbf{if}\;B \leq -170:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq 6.2 \cdot 10^{+77}:\\ \;\;\;\;\frac{-{\left(\mathsf{fma}\left(B, B, -4 \cdot \left(C \cdot A\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}^{0.5}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \left(\frac{C \cdot -0.5}{\frac{B}{C}} - B\right)\right)}\right)\\ \end{array} \]
Alternative 5
Accuracy43.0%
Cost14664
\[\begin{array}{l} \mathbf{if}\;B \leq -0.29:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq 5.5 \cdot 10^{+77}:\\ \;\;\;\;\frac{-{\left(A \cdot \left(4 \cdot \left(F \cdot \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\right)\right)\right)}^{0.5}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \left(\frac{C \cdot -0.5}{\frac{B}{C}} - B\right)\right)}\right)\\ \end{array} \]
Alternative 6
Accuracy43.0%
Cost14216
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;B \leq -2.4 \cdot 10^{-7}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq 5.5 \cdot 10^{+77}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \left(\frac{C \cdot -0.5}{\frac{B}{C}} - B\right)\right)}\right)\\ \end{array} \]
Alternative 7
Accuracy35.0%
Cost13316
\[\begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;B \leq -1.45 \cdot 10^{-13}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq 4.4 \cdot 10^{+22}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \end{array} \]
Alternative 8
Accuracy27.4%
Cost8460
\[\begin{array}{l} t_0 := \sqrt{\frac{-F}{C}}\\ t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;A \leq -1.65 \cdot 10^{+105}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -5.2 \cdot 10^{-196}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)\right)}}{t_1}\\ \mathbf{elif}\;A \leq -4.2 \cdot 10^{-308}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot t_1\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Accuracy31.0%
Cost8460
\[\begin{array}{l} t_0 := \sqrt{\frac{-F}{C}}\\ t_1 := B \cdot B - 4 \cdot \left(C \cdot A\right)\\ t_2 := F \cdot t_1\\ \mathbf{if}\;A \leq -4.2 \cdot 10^{+252}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;A \leq -2 \cdot 10^{-192}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot t_2\right)}}{t_1}\\ \mathbf{elif}\;A \leq -3.1 \cdot 10^{-306}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot t_2\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Accuracy26.0%
Cost8201
\[\begin{array}{l} \mathbf{if}\;A \leq -1.4 \cdot 10^{+105} \lor \neg \left(A \leq -9 \cdot 10^{-148}\right):\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\ \end{array} \]
Alternative 11
Accuracy26.0%
Cost8009
\[\begin{array}{l} \mathbf{if}\;A \leq -4 \cdot 10^{+104} \lor \neg \left(A \leq -7.5 \cdot 10^{-148}\right):\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-{\left(-16 \cdot \left(A \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)\right)}^{0.5}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\ \end{array} \]
Alternative 12
Accuracy26.0%
Cost8009
\[\begin{array}{l} \mathbf{if}\;A \leq -1.75 \cdot 10^{+104} \lor \neg \left(A \leq -9.2 \cdot 10^{-148}\right):\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-{\left(-16 \cdot \left(\left(F \cdot C\right) \cdot \left(A \cdot A\right)\right)\right)}^{0.5}}{B \cdot B - 4 \cdot \left(C \cdot A\right)}\\ \end{array} \]
Alternative 13
Accuracy20.8%
Cost6656
\[\sqrt{\frac{-F}{C}} \]

Reproduce?

herbie shell --seed 2023160 
(FPCore (A B C F)
  :name "ABCF->ab-angle b"
  :precision binary64
  (/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))