Average Error: 52.4 → 31.4
Time: 1.0min
Precision: binary64
\[[A, C]=\mathsf{sort}([A, C])\]
\[\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 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_1 := \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_0}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;-\frac{{\left(-F\right)}^{0.5}}{\sqrt{C}}\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_2 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\ \mathbf{if}\;t_1 \leq -3.6630033190351204 \cdot 10^{-209}:\\ \;\;\;\;\begin{array}{l} t_3 := \sqrt{\mathsf{hypot}\left(B, A - C\right)}\\ \frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) \cdot t_2 + t_2 \cdot \left(\left(F \cdot \left(t_3 \cdot t_3\right)\right) \cdot -2\right)}}{t_2} \end{array}\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\sqrt{-F} \cdot \frac{-1}{\sqrt{C}}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;\frac{A \cdot \left(\sqrt{2} \cdot \sqrt{-8 \cdot \left(C \cdot F\right)}\right)}{t_2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{F \cdot -0.5}}{\frac{\sqrt{C}}{\sqrt{2}}}\\ \end{array}\\ \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 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_1 := \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_0}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;-\frac{{\left(-F\right)}^{0.5}}{\sqrt{C}}\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)\\
\mathbf{if}\;t_1 \leq -3.6630033190351204 \cdot 10^{-209}:\\
\;\;\;\;\begin{array}{l}
t_3 := \sqrt{\mathsf{hypot}\left(B, A - C\right)}\\
\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) \cdot t_2 + t_2 \cdot \left(\left(F \cdot \left(t_3 \cdot t_3\right)\right) \cdot -2\right)}}{t_2}
\end{array}\\

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\sqrt{-F} \cdot \frac{-1}{\sqrt{C}}\\

\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\frac{A \cdot \left(\sqrt{2} \cdot \sqrt{-8 \cdot \left(C \cdot F\right)}\right)}{t_2}\\

\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{F \cdot -0.5}}{\frac{\sqrt{C}}{\sqrt{2}}}\\


\end{array}\\


\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 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_1
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_0 F))
             (- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_0)))
   (if (<= t_1 (- INFINITY))
     (- (/ (pow (- F) 0.5) (sqrt C)))
     (let* ((t_2 (fma A (* C -4.0) (* B B))))
       (if (<= t_1 -3.6630033190351204e-209)
         (let* ((t_3 (sqrt (hypot B (- A C)))))
           (/
            (-
             (sqrt
              (+
               (* (* 2.0 (* F (+ A C))) t_2)
               (* t_2 (* (* F (* t_3 t_3)) -2.0)))))
            t_2))
         (if (<= t_1 0.0)
           (* (sqrt (- F)) (/ -1.0 (sqrt C)))
           (if (<= t_1 INFINITY)
             (/ (* A (* (sqrt 2.0) (sqrt (* -8.0 (* C F))))) t_2)
             (- (/ (sqrt (* F -0.5)) (/ (sqrt C) (sqrt 2.0)))))))))))
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 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_1 = -sqrt((2.0 * (t_0 * F)) * ((A + C) - sqrt(pow(B, 2.0) + pow((A - C), 2.0)))) / t_0;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = -(pow(-F, 0.5) / sqrt(C));
	} else {
		double t_2 = fma(A, (C * -4.0), (B * B));
		double tmp_1;
		if (t_1 <= -3.6630033190351204e-209) {
			double t_3_2 = sqrt(hypot(B, (A - C)));
			tmp_1 = -sqrt(((2.0 * (F * (A + C))) * t_2) + (t_2 * ((F * (t_3_2 * t_3_2)) * -2.0))) / t_2;
		} else if (t_1 <= 0.0) {
			tmp_1 = sqrt(-F) * (-1.0 / sqrt(C));
		} else if (t_1 <= ((double) INFINITY)) {
			tmp_1 = (A * (sqrt(2.0) * sqrt(-8.0 * (C * F)))) / t_2;
		} else {
			tmp_1 = -(sqrt(F * -0.5) / (sqrt(C) / sqrt(2.0)));
		}
		tmp = tmp_1;
	}
	return tmp;
}

Error

Bits error versus A

Bits error versus B

Bits error versus C

Bits error versus F

Derivation

  1. Split input into 5 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -inf.0

    1. Initial program 64.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. Simplified53.8

      \[\leadsto \color{blue}{\frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \]
    3. Taylor expanded in A around -inf 34.0

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2}\right)} \]
    4. Simplified34.0

      \[\leadsto \color{blue}{-\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2}} \]
    5. Applied associate-*r/_binary6434.0

      \[\leadsto -\sqrt{\color{blue}{\frac{-0.5 \cdot F}{C}}} \cdot \sqrt{2} \]
    6. Applied sqrt-div_binary6423.5

      \[\leadsto -\color{blue}{\frac{\sqrt{-0.5 \cdot F}}{\sqrt{C}}} \cdot \sqrt{2} \]
    7. Applied associate-*l/_binary6423.5

      \[\leadsto -\color{blue}{\frac{\sqrt{-0.5 \cdot F} \cdot \sqrt{2}}{\sqrt{C}}} \]
    8. Applied pow1/2_binary6423.5

      \[\leadsto -\frac{\sqrt{-0.5 \cdot F} \cdot \color{blue}{{2}^{0.5}}}{\sqrt{C}} \]
    9. Applied pow1/2_binary6423.5

      \[\leadsto -\frac{\color{blue}{{\left(-0.5 \cdot F\right)}^{0.5}} \cdot {2}^{0.5}}{\sqrt{C}} \]
    10. Applied pow-prod-down_binary6423.4

      \[\leadsto -\frac{\color{blue}{{\left(\left(-0.5 \cdot F\right) \cdot 2\right)}^{0.5}}}{\sqrt{C}} \]
    11. Simplified23.4

      \[\leadsto -\frac{{\color{blue}{\left(-F\right)}}^{0.5}}{\sqrt{C}} \]

    if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -3.6630033190351204e-209

    1. Initial program 1.5

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \]
    3. Applied add-sqr-sqrt_binary642.5

      \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(2 \cdot \left(F \cdot \left(\left(A + C\right) - \color{blue}{\sqrt{\mathsf{hypot}\left(B, A - C\right)} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right)}}\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)} \]
    4. Applied cancel-sign-sub-inv_binary642.5

      \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(2 \cdot \left(F \cdot \color{blue}{\left(\left(A + C\right) + \left(-\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right) \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)} \]
    5. Applied distribute-rgt-in_binary642.5

      \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(2 \cdot \color{blue}{\left(\left(A + C\right) \cdot F + \left(\left(-\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right) \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right)}\right) \cdot F\right)}\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)} \]
    6. Applied distribute-rgt-in_binary642.5

      \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \color{blue}{\left(\left(\left(A + C\right) \cdot F\right) \cdot 2 + \left(\left(\left(-\sqrt{\mathsf{hypot}\left(B, A - C\right)}\right) \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right)}\right) \cdot F\right) \cdot 2\right)}}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)} \]
    7. Applied distribute-rgt-in_binary642.5

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

    if -3.6630033190351204e-209 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -0.0

    1. Initial program 61.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. Simplified59.1

      \[\leadsto \color{blue}{\frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \]
    3. Taylor expanded in A around -inf 32.3

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2}\right)} \]
    4. Simplified32.3

      \[\leadsto \color{blue}{-\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2}} \]
    5. Applied associate-*r/_binary6432.3

      \[\leadsto -\sqrt{\color{blue}{\frac{-0.5 \cdot F}{C}}} \cdot \sqrt{2} \]
    6. Applied sqrt-div_binary6429.1

      \[\leadsto -\color{blue}{\frac{\sqrt{-0.5 \cdot F}}{\sqrt{C}}} \cdot \sqrt{2} \]
    7. Applied associate-*l/_binary6429.1

      \[\leadsto -\color{blue}{\frac{\sqrt{-0.5 \cdot F} \cdot \sqrt{2}}{\sqrt{C}}} \]
    8. Applied sqrt-unprod_binary6429.0

      \[\leadsto -\frac{\color{blue}{\sqrt{\left(-0.5 \cdot F\right) \cdot 2}}}{\sqrt{C}} \]
    9. Simplified29.0

      \[\leadsto -\frac{\sqrt{\color{blue}{-F}}}{\sqrt{C}} \]
    10. Applied div-inv_binary6429.0

      \[\leadsto -\color{blue}{\sqrt{-F} \cdot \frac{1}{\sqrt{C}}} \]

    if -0.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0

    1. Initial program 38.6

      \[\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. Simplified26.0

      \[\leadsto \color{blue}{\frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \]
    3. Taylor expanded in A around -inf 14.8

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

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

    if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)))

    1. Initial program 64.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. Simplified63.6

      \[\leadsto \color{blue}{\frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}} \]
    3. Taylor expanded in A around -inf 53.6

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2}\right)} \]
    4. Simplified53.6

      \[\leadsto \color{blue}{-\sqrt{-0.5 \cdot \frac{F}{C}} \cdot \sqrt{2}} \]
    5. Applied associate-*r/_binary6453.6

      \[\leadsto -\sqrt{\color{blue}{\frac{-0.5 \cdot F}{C}}} \cdot \sqrt{2} \]
    6. Applied sqrt-div_binary6449.2

      \[\leadsto -\color{blue}{\frac{\sqrt{-0.5 \cdot F}}{\sqrt{C}}} \cdot \sqrt{2} \]
    7. Applied associate-*l/_binary6449.2

      \[\leadsto -\color{blue}{\frac{\sqrt{-0.5 \cdot F} \cdot \sqrt{2}}{\sqrt{C}}} \]
    8. Applied associate-/l*_binary6449.2

      \[\leadsto -\color{blue}{\frac{\sqrt{-0.5 \cdot F}}{\frac{\sqrt{C}}{\sqrt{2}}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification31.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq -\infty:\\ \;\;\;\;-\frac{{\left(-F\right)}^{0.5}}{\sqrt{C}}\\ \mathbf{elif}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq -3.6630033190351204 \cdot 10^{-209}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(A + C\right)\right)\right) \cdot \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) + \mathsf{fma}\left(A, C \cdot -4, B \cdot B\right) \cdot \left(\left(F \cdot \left(\sqrt{\mathsf{hypot}\left(B, A - C\right)} \cdot \sqrt{\mathsf{hypot}\left(B, A - C\right)}\right)\right) \cdot -2\right)}}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}\\ \mathbf{elif}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq 0:\\ \;\;\;\;\sqrt{-F} \cdot \frac{-1}{\sqrt{C}}\\ \mathbf{elif}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq \infty:\\ \;\;\;\;\frac{A \cdot \left(\sqrt{2} \cdot \sqrt{-8 \cdot \left(C \cdot F\right)}\right)}{\mathsf{fma}\left(A, C \cdot -4, B \cdot B\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{F \cdot -0.5}}{\frac{\sqrt{C}}{\sqrt{2}}}\\ \end{array} \]

Reproduce

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