ABCF->ab-angle b

Percentage Accurate: 18.8% → 42.2%
Time: 32.8s
Alternatives: 14
Speedup: 3.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F):
	t_0 = math.pow(B, 2.0) - ((4.0 * A) * C)
	return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F)
	t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0)
end
function tmp = code(A, B, C, F)
	t_0 = (B ^ 2.0) - ((4.0 * A) * C);
	tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0;
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 18.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F):
	t_0 = math.pow(B, 2.0) - ((4.0 * A) * C)
	return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F)
	t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0)
end
function tmp = code(A, B, C, F)
	t_0 = (B ^ 2.0) - ((4.0 * A) * C);
	tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0;
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}

Alternative 1: 42.2% accurate, 0.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)\\ t_1 := \mathsf{hypot}\left(B_m, A - C\right)\\ t_2 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\ \mathbf{if}\;t_3 \leq 0:\\ \;\;\;\;\frac{\sqrt{t_0} \cdot \left(-\sqrt{\left(2 \cdot F\right) \cdot \left(A + \left(C - t_1\right)\right)}\right)}{t_0}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(C + \left(A - t_1\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma A (* C -4.0) (pow B_m 2.0)))
        (t_1 (hypot B_m (- A C)))
        (t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
        (t_3
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_2 F))
             (- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0)))))))
          t_2)))
   (if (<= t_3 0.0)
     (/ (* (sqrt t_0) (- (sqrt (* (* 2.0 F) (+ A (- C t_1)))))) t_0)
     (if (<= t_3 INFINITY)
       (/ (- (sqrt (* 2.0 (* t_0 (* F (+ C (- A t_1))))))) t_0)
       (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(A, (C * -4.0), pow(B_m, 2.0));
	double t_1 = hypot(B_m, (A - C));
	double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_3 = -sqrt(((2.0 * (t_2 * F)) * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= 0.0) {
		tmp = (sqrt(t_0) * -sqrt(((2.0 * F) * (A + (C - t_1))))) / t_0;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = -sqrt((2.0 * (t_0 * (F * (C + (A - t_1)))))) / t_0;
	} else {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(A, Float64(C * -4.0), (B_m ^ 2.0))
	t_1 = hypot(B_m, Float64(A - C))
	t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2)
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(Float64(sqrt(t_0) * Float64(-sqrt(Float64(Float64(2.0 * F) * Float64(A + Float64(C - t_1)))))) / t_0);
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(C + Float64(A - t_1))))))) / t_0);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[(N[Sqrt[t$95$0], $MachinePrecision] * (-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[(C - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(C + N[(A - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)\\
t_1 := \mathsf{hypot}\left(B_m, A - C\right)\\
t_2 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
\mathbf{if}\;t_3 \leq 0:\\
\;\;\;\;\frac{\sqrt{t_0} \cdot \left(-\sqrt{\left(2 \cdot F\right) \cdot \left(A + \left(C - t_1\right)\right)}\right)}{t_0}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 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))) < -0.0

    1. Initial program 37.2%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}} \]
    3. Step-by-step derivation
      1. *-commutative41.8%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right) \cdot 2}}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      2. associate-*l*41.8%

        \[\leadsto \frac{-\sqrt{\color{blue}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(\left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right) \cdot 2\right)}}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      3. associate-*r*41.8%

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

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

        \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \left(\left(\color{blue}{\left(A + C\right)} - \mathsf{hypot}\left(B, A - C\right)\right) \cdot 2\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      6. associate-+r-41.6%

        \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \left(\color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot 2\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      7. *-commutative41.6%

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

        \[\leadsto \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \cdot \sqrt{F \cdot \left(2 \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      9. associate-+r-50.0%

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

        \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \cdot \sqrt{F \cdot \left(2 \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      11. associate-+r-51.0%

        \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \cdot \sqrt{F \cdot \left(2 \cdot \color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    4. Applied egg-rr51.0%

      \[\leadsto \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \cdot \sqrt{F \cdot \left(2 \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.0%

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

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

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

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

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

    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 36.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. Simplified63.9%

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\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 0.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. Simplified1.5%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*2.0%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/2.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg2.0%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 14.2%

      \[\leadsto \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \color{blue}{B}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification35.7%

    \[\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 0:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \cdot \left(-\sqrt{\left(2 \cdot F\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\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 \infty:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - B\right)}\\ \end{array} \]

Alternative 2: 41.6% accurate, 0.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)\\ t_1 := \mathsf{hypot}\left(B_m, A - C\right)\\ t_2 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\ \mathbf{if}\;t_3 \leq 0:\\ \;\;\;\;\frac{\sqrt{2 \cdot t_0} \cdot \left(-\sqrt{F \cdot \left(\left(A + C\right) - t_1\right)}\right)}{{B_m}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(C + \left(A - t_1\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma A (* C -4.0) (pow B_m 2.0)))
        (t_1 (hypot B_m (- A C)))
        (t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
        (t_3
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_2 F))
             (- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0)))))))
          t_2)))
   (if (<= t_3 0.0)
     (/
      (* (sqrt (* 2.0 t_0)) (- (sqrt (* F (- (+ A C) t_1)))))
      (- (pow B_m 2.0) (* 4.0 (* A C))))
     (if (<= t_3 INFINITY)
       (/ (- (sqrt (* 2.0 (* t_0 (* F (+ C (- A t_1))))))) t_0)
       (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(A, (C * -4.0), pow(B_m, 2.0));
	double t_1 = hypot(B_m, (A - C));
	double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_3 = -sqrt(((2.0 * (t_2 * F)) * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= 0.0) {
		tmp = (sqrt((2.0 * t_0)) * -sqrt((F * ((A + C) - t_1)))) / (pow(B_m, 2.0) - (4.0 * (A * C)));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = -sqrt((2.0 * (t_0 * (F * (C + (A - t_1)))))) / t_0;
	} else {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(A, Float64(C * -4.0), (B_m ^ 2.0))
	t_1 = hypot(B_m, Float64(A - C))
	t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2)
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(Float64(sqrt(Float64(2.0 * t_0)) * Float64(-sqrt(Float64(F * Float64(Float64(A + C) - t_1))))) / Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C))));
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(C + Float64(A - t_1))))))) / t_0);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[(N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(F * N[(N[(A + C), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(C + N[(A - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)\\
t_1 := \mathsf{hypot}\left(B_m, A - C\right)\\
t_2 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
\mathbf{if}\;t_3 \leq 0:\\
\;\;\;\;\frac{\sqrt{2 \cdot t_0} \cdot \left(-\sqrt{F \cdot \left(\left(A + C\right) - t_1\right)}\right)}{{B_m}^{2} - 4 \cdot \left(A \cdot C\right)}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 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))) < -0.0

    1. Initial program 37.2%

      \[\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. Simplified37.2%

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

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

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

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

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-+r-40.8%

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      6. +-commutative40.8%

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr40.8%

      \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    5. Step-by-step derivation
      1. associate-*l*41.8%

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

        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      3. sub-neg51.0%

        \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left({B}^{2} + \left(-4 \cdot \left(A \cdot C\right)\right)\right)}} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      4. distribute-rgt-in51.0%

        \[\leadsto \frac{-\sqrt{\color{blue}{{B}^{2} \cdot 2 + \left(-4 \cdot \left(A \cdot C\right)\right) \cdot 2}} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      5. distribute-lft-neg-in51.0%

        \[\leadsto \frac{-\sqrt{{B}^{2} \cdot 2 + \color{blue}{\left(\left(-4\right) \cdot \left(A \cdot C\right)\right)} \cdot 2} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      6. metadata-eval51.0%

        \[\leadsto \frac{-\sqrt{{B}^{2} \cdot 2 + \left(\color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot 2} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      7. *-commutative51.0%

        \[\leadsto \frac{-\sqrt{{B}^{2} \cdot 2 + \color{blue}{\left(\left(A \cdot C\right) \cdot -4\right)} \cdot 2} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      8. associate-*r*51.0%

        \[\leadsto \frac{-\sqrt{{B}^{2} \cdot 2 + \color{blue}{\left(A \cdot \left(C \cdot -4\right)\right)} \cdot 2} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      9. distribute-rgt-in51.0%

        \[\leadsto \frac{-\sqrt{\color{blue}{2 \cdot \left({B}^{2} + A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      10. +-commutative51.0%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}} \cdot \sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      12. *-commutative51.0%

        \[\leadsto \frac{-\sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \cdot \sqrt{\color{blue}{\left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right) \cdot F}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    6. Applied egg-rr51.0%

      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \cdot \sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot F}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    7. Step-by-step derivation
      1. associate-+r-49.9%

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

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

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

    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 36.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. Simplified63.9%

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\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 0.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. Simplified1.5%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*2.0%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/2.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg2.0%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 14.2%

      \[\leadsto \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \color{blue}{B}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification35.2%

    \[\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 0:\\ \;\;\;\;\frac{\sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \cdot \left(-\sqrt{F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{{B}^{2} - 4 \cdot \left(A \cdot C\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 \infty:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - B\right)}\\ \end{array} \]

Alternative 3: 37.3% accurate, 0.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)\\ \mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+264}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B_m, A - C\right)\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma A (* C -4.0) (pow B_m 2.0))))
   (if (<= (pow B_m 2.0) 2e+264)
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ C (- A (hypot B_m (- A C))))))))) t_0)
     (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(A, (C * -4.0), pow(B_m, 2.0));
	double tmp;
	if (pow(B_m, 2.0) <= 2e+264) {
		tmp = -sqrt((2.0 * (t_0 * (F * (C + (A - hypot(B_m, (A - C)))))))) / t_0;
	} else {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(A, Float64(C * -4.0), (B_m ^ 2.0))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e+264)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(C + Float64(A - hypot(B_m, Float64(A - C))))))))) / t_0);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+264], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(C + N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)\\
\mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+264}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(C + \left(A - \mathsf{hypot}\left(B_m, A - C\right)\right)\right)\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 2.00000000000000009e264

    1. Initial program 28.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. Simplified36.5%

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

    if 2.00000000000000009e264 < (pow.f64 B 2)

    1. Initial program 0.2%

      \[\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. Simplified0.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*3.1%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/3.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg3.1%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 23.6%

      \[\leadsto \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \color{blue}{B}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.8%

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

Alternative 4: 37.2% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+264}:\\ \;\;\;\;\frac{-\sqrt{\left(C + \left(A - \mathsf{hypot}\left(B_m, A - C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot t_0\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* 4.0 (* A C)))))
   (if (<= (pow B_m 2.0) 2e+264)
     (/ (- (sqrt (* (+ C (- A (hypot B_m (- A C)))) (* F (* 2.0 t_0))))) t_0)
     (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (4.0 * (A * C));
	double tmp;
	if (pow(B_m, 2.0) <= 2e+264) {
		tmp = -sqrt(((C + (A - hypot(B_m, (A - C)))) * (F * (2.0 * t_0)))) / t_0;
	} else {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.pow(B_m, 2.0) - (4.0 * (A * C));
	double tmp;
	if (Math.pow(B_m, 2.0) <= 2e+264) {
		tmp = -Math.sqrt(((C + (A - Math.hypot(B_m, (A - C)))) * (F * (2.0 * t_0)))) / t_0;
	} else {
		tmp = (-Math.sqrt(2.0) / B_m) * Math.sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.pow(B_m, 2.0) - (4.0 * (A * C))
	tmp = 0
	if math.pow(B_m, 2.0) <= 2e+264:
		tmp = -math.sqrt(((C + (A - math.hypot(B_m, (A - C)))) * (F * (2.0 * t_0)))) / t_0
	else:
		tmp = (-math.sqrt(2.0) / B_m) * math.sqrt((F * (C - B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e+264)
		tmp = Float64(Float64(-sqrt(Float64(Float64(C + Float64(A - hypot(B_m, Float64(A - C)))) * Float64(F * Float64(2.0 * t_0))))) / t_0);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (B_m ^ 2.0) - (4.0 * (A * C));
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 2e+264)
		tmp = -sqrt(((C + (A - hypot(B_m, (A - C)))) * (F * (2.0 * t_0)))) / t_0;
	else
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+264], N[((-N[Sqrt[N[(N[(C + N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+264}:\\
\;\;\;\;\frac{-\sqrt{\left(C + \left(A - \mathsf{hypot}\left(B_m, A - C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot t_0\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 2.00000000000000009e264

    1. Initial program 28.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. Simplified28.1%

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

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

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

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

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-+r-35.8%

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      6. +-commutative35.8%

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr35.8%

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

    if 2.00000000000000009e264 < (pow.f64 B 2)

    1. Initial program 0.2%

      \[\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. Simplified0.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*3.1%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/3.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg3.1%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 23.6%

      \[\leadsto \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \color{blue}{B}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.3%

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

Alternative 5: 37.2% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+264}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C - \mathsf{hypot}\left(B_m, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 2e+264)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (- C (hypot B_m (- A C)))))))) t_0)
     (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 2e+264) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + (C - hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e+264)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C - hypot(B_m, Float64(A - C)))))))) / t_0);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+264], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+264}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C - \mathsf{hypot}\left(B_m, A - C\right)\right)\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 2.00000000000000009e264

    1. Initial program 28.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. Simplified35.6%

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

    if 2.00000000000000009e264 < (pow.f64 B 2)

    1. Initial program 0.2%

      \[\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. Simplified0.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*3.1%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/3.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg3.1%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 23.6%

      \[\leadsto \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \color{blue}{B}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.2%

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

Alternative 6: 32.9% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B_m \leq 9.5 \cdot 10^{-191}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(2 \cdot A\right)\right) \cdot \left({B_m}^{2} + A \cdot \left(C \cdot -4\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)}\\ \mathbf{elif}\;B_m \leq 1.05 \cdot 10^{-12}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot t_0\right)\right) \cdot \left(C + C\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* 4.0 (* A C)))))
   (if (<= B_m 9.5e-191)
     (/
      (- (sqrt (* 2.0 (* (* F (* 2.0 A)) (+ (pow B_m 2.0) (* A (* C -4.0)))))))
      (fma A (* C -4.0) (pow B_m 2.0)))
     (if (<= B_m 1.05e-12)
       (/ (- (sqrt (* (* F (* 2.0 t_0)) (+ C C)))) t_0)
       (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (4.0 * (A * C));
	double tmp;
	if (B_m <= 9.5e-191) {
		tmp = -sqrt((2.0 * ((F * (2.0 * A)) * (pow(B_m, 2.0) + (A * (C * -4.0)))))) / fma(A, (C * -4.0), pow(B_m, 2.0));
	} else if (B_m <= 1.05e-12) {
		tmp = -sqrt(((F * (2.0 * t_0)) * (C + C))) / t_0;
	} else {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if (B_m <= 9.5e-191)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * Float64(2.0 * A)) * Float64((B_m ^ 2.0) + Float64(A * Float64(C * -4.0))))))) / fma(A, Float64(C * -4.0), (B_m ^ 2.0)));
	elseif (B_m <= 1.05e-12)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * Float64(2.0 * t_0)) * Float64(C + C)))) / t_0);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 9.5e-191], N[((-N[Sqrt[N[(2.0 * N[(N[(F * N[(2.0 * A), $MachinePrecision]), $MachinePrecision] * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.05e-12], N[((-N[Sqrt[N[(N[(F * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(C + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B_m \leq 9.5 \cdot 10^{-191}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(2 \cdot A\right)\right) \cdot \left({B_m}^{2} + A \cdot \left(C \cdot -4\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)}\\

\mathbf{elif}\;B_m \leq 1.05 \cdot 10^{-12}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot t_0\right)\right) \cdot \left(C + C\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 9.4999999999999996e-191

    1. Initial program 20.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. Simplified26.5%

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

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

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(A - \left(-A\right)\right)}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    6. Step-by-step derivation
      1. *-commutative16.8%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(A - \left(-A\right)\right)\right) \cdot \color{blue}{\left(A \cdot \left(C \cdot -4\right) + {B}^{2}\right)}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      3. distribute-lft-in16.5%

        \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(\left(F \cdot \left(A - \left(-A\right)\right)\right) \cdot \left(A \cdot \left(C \cdot -4\right)\right) + \left(F \cdot \left(A - \left(-A\right)\right)\right) \cdot {B}^{2}\right)}}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      4. *-un-lft-identity16.5%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(\color{blue}{\frac{2}{2}} \cdot A - \left(-A\right)\right)\right) \cdot \left(A \cdot \left(C \cdot -4\right)\right) + \left(F \cdot \left(A - \left(-A\right)\right)\right) \cdot {B}^{2}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      6. neg-mul-116.5%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(\frac{2}{2} \cdot A - \color{blue}{-1 \cdot A}\right)\right) \cdot \left(A \cdot \left(C \cdot -4\right)\right) + \left(F \cdot \left(A - \left(-A\right)\right)\right) \cdot {B}^{2}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      7. distribute-rgt-out--16.5%

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(A \cdot \color{blue}{2}\right)\right) \cdot \left(A \cdot \left(C \cdot -4\right)\right) + \left(F \cdot \left(A - \left(-A\right)\right)\right) \cdot {B}^{2}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      10. *-un-lft-identity16.5%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(A \cdot 2\right)\right) \cdot \left(A \cdot \left(C \cdot -4\right)\right) + \left(F \cdot \left(\color{blue}{\frac{2}{2}} \cdot A - \left(-A\right)\right)\right) \cdot {B}^{2}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      12. neg-mul-116.5%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(A \cdot 2\right)\right) \cdot \left(A \cdot \left(C \cdot -4\right)\right) + \left(F \cdot \left(\frac{2}{2} \cdot A - \color{blue}{-1 \cdot A}\right)\right) \cdot {B}^{2}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      13. distribute-rgt-out--16.5%

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(A \cdot 2\right)\right) \cdot \left(A \cdot \left(C \cdot -4\right)\right) + \left(F \cdot \left(A \cdot \color{blue}{2}\right)\right) \cdot {B}^{2}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    7. Applied egg-rr16.5%

      \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(\left(F \cdot \left(A \cdot 2\right)\right) \cdot \left(A \cdot \left(C \cdot -4\right)\right) + \left(F \cdot \left(A \cdot 2\right)\right) \cdot {B}^{2}\right)}}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-out16.8%

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

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

    if 9.4999999999999996e-191 < B < 1.04999999999999997e-12

    1. Initial program 30.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. Simplified30.0%

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

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

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

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

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-+r-42.4%

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

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr42.4%

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

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

    if 1.04999999999999997e-12 < B

    1. Initial program 14.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. Simplified15.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*16.0%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/16.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg16.0%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 35.2%

      \[\leadsto \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \color{blue}{B}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification24.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 9.5 \cdot 10^{-191}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(2 \cdot A\right)\right) \cdot \left({B}^{2} + A \cdot \left(C \cdot -4\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}\\ \mathbf{elif}\;B \leq 1.05 \cdot 10^{-12}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(C + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - B\right)}\\ \end{array} \]

Alternative 7: 30.6% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B_m \leq 5 \cdot 10^{-152}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot t_0\right)\right) \cdot \left(2 \cdot A\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* 4.0 (* A C)))))
   (if (<= B_m 5e-152)
     (/ (- (sqrt (* (* F (* 2.0 t_0)) (* 2.0 A)))) t_0)
     (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (4.0 * (A * C));
	double tmp;
	if (B_m <= 5e-152) {
		tmp = -sqrt(((F * (2.0 * t_0)) * (2.0 * A))) / t_0;
	} else {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (b_m ** 2.0d0) - (4.0d0 * (a * c))
    if (b_m <= 5d-152) then
        tmp = -sqrt(((f * (2.0d0 * t_0)) * (2.0d0 * a))) / t_0
    else
        tmp = (-sqrt(2.0d0) / b_m) * sqrt((f * (c - b_m)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.pow(B_m, 2.0) - (4.0 * (A * C));
	double tmp;
	if (B_m <= 5e-152) {
		tmp = -Math.sqrt(((F * (2.0 * t_0)) * (2.0 * A))) / t_0;
	} else {
		tmp = (-Math.sqrt(2.0) / B_m) * Math.sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.pow(B_m, 2.0) - (4.0 * (A * C))
	tmp = 0
	if B_m <= 5e-152:
		tmp = -math.sqrt(((F * (2.0 * t_0)) * (2.0 * A))) / t_0
	else:
		tmp = (-math.sqrt(2.0) / B_m) * math.sqrt((F * (C - B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if (B_m <= 5e-152)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * Float64(2.0 * t_0)) * Float64(2.0 * A)))) / t_0);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (B_m ^ 2.0) - (4.0 * (A * C));
	tmp = 0.0;
	if (B_m <= 5e-152)
		tmp = -sqrt(((F * (2.0 * t_0)) * (2.0 * A))) / t_0;
	else
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 5e-152], N[((-N[Sqrt[N[(N[(F * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B_m \leq 5 \cdot 10^{-152}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot t_0\right)\right) \cdot \left(2 \cdot A\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 4.9999999999999997e-152

    1. Initial program 20.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. Simplified20.6%

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

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

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

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

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-+r-26.0%

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      6. +-commutative26.0%

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr26.0%

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

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

    if 4.9999999999999997e-152 < B

    1. Initial program 19.1%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*16.6%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/16.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg16.6%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 28.9%

      \[\leadsto \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \color{blue}{B}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification20.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 5 \cdot 10^{-152}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(2 \cdot A\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - B\right)}\\ \end{array} \]

Alternative 8: 32.8% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B_m \leq 6.6 \cdot 10^{-13}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot t_0\right)\right) \cdot \left(C + C\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* 4.0 (* A C)))))
   (if (<= B_m 6.6e-13)
     (/ (- (sqrt (* (* F (* 2.0 t_0)) (+ C C)))) t_0)
     (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (4.0 * (A * C));
	double tmp;
	if (B_m <= 6.6e-13) {
		tmp = -sqrt(((F * (2.0 * t_0)) * (C + C))) / t_0;
	} else {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (b_m ** 2.0d0) - (4.0d0 * (a * c))
    if (b_m <= 6.6d-13) then
        tmp = -sqrt(((f * (2.0d0 * t_0)) * (c + c))) / t_0
    else
        tmp = (-sqrt(2.0d0) / b_m) * sqrt((f * (c - b_m)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.pow(B_m, 2.0) - (4.0 * (A * C));
	double tmp;
	if (B_m <= 6.6e-13) {
		tmp = -Math.sqrt(((F * (2.0 * t_0)) * (C + C))) / t_0;
	} else {
		tmp = (-Math.sqrt(2.0) / B_m) * Math.sqrt((F * (C - B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.pow(B_m, 2.0) - (4.0 * (A * C))
	tmp = 0
	if B_m <= 6.6e-13:
		tmp = -math.sqrt(((F * (2.0 * t_0)) * (C + C))) / t_0
	else:
		tmp = (-math.sqrt(2.0) / B_m) * math.sqrt((F * (C - B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if (B_m <= 6.6e-13)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * Float64(2.0 * t_0)) * Float64(C + C)))) / t_0);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (B_m ^ 2.0) - (4.0 * (A * C));
	tmp = 0.0;
	if (B_m <= 6.6e-13)
		tmp = -sqrt(((F * (2.0 * t_0)) * (C + C))) / t_0;
	else
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 6.6e-13], N[((-N[Sqrt[N[(N[(F * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(C + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B_m \leq 6.6 \cdot 10^{-13}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot t_0\right)\right) \cdot \left(C + C\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 6.6000000000000001e-13

    1. Initial program 22.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. Simplified22.4%

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

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

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

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

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-+r-29.5%

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

        \[\leadsto \frac{-\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \color{blue}{\left(\left(A - \mathsf{hypot}\left(B, A - C\right)\right) + C\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr29.5%

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

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

    if 6.6000000000000001e-13 < B

    1. Initial program 14.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. Simplified15.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*16.0%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/16.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg16.0%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 35.2%

      \[\leadsto \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \color{blue}{B}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification24.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6.6 \cdot 10^{-13}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot \left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(C + C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - B\right)}\\ \end{array} \]

Alternative 9: 25.9% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-302}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(A \cdot -4\right) \cdot \left(C \cdot F\right)\right) \cdot \left(2 \cdot \left(A + \left(B_m + C\right)\right)\right)}}{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -9.5e-302)
   (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m))))
   (/
    (- (sqrt (* (* (* A -4.0) (* C F)) (* 2.0 (+ A (+ B_m C))))))
    (fma B_m B_m (* A (* C -4.0))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -9.5e-302) {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	} else {
		tmp = -sqrt((((A * -4.0) * (C * F)) * (2.0 * (A + (B_m + C))))) / fma(B_m, B_m, (A * (C * -4.0)));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -9.5e-302)
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	else
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(A * -4.0) * Float64(C * F)) * Float64(2.0 * Float64(A + Float64(B_m + C)))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.0))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -9.5e-302], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(N[(A * -4.0), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(A + N[(B$95$m + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-302}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(A \cdot -4\right) \cdot \left(C \cdot F\right)\right) \cdot \left(2 \cdot \left(A + \left(B_m + C\right)\right)\right)}}{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -9.49999999999999991e-302

    1. Initial program 18.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. Simplified21.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*9.3%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/9.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg9.3%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 14.4%

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

    if -9.49999999999999991e-302 < F

    1. Initial program 27.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. Simplified47.0%

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

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

      \[\leadsto \frac{-\sqrt{\color{blue}{\left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)} \cdot \left(2 \cdot \left(A + \left(B + C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*10.2%

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

      \[\leadsto \frac{-\sqrt{\color{blue}{\left(\left(-4 \cdot A\right) \cdot \left(C \cdot F\right)\right)} \cdot \left(2 \cdot \left(A + \left(B + C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification13.7%

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

Alternative 10: 26.3% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right)}}{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -5e-310)
   (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m))))
   (/
    (- (sqrt (* -8.0 (* A (* C (* F (+ A C)))))))
    (fma B_m B_m (* A (* C -4.0))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -5e-310) {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
	} else {
		tmp = -sqrt((-8.0 * (A * (C * (F * (A + C)))))) / fma(B_m, B_m, (A * (C * -4.0)));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))));
	else
		tmp = Float64(Float64(-sqrt(Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A + C))))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.0))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-310], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(-8.0 * N[(A * N[(C * N[(F * N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right)}}{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -4.999999999999985e-310

    1. Initial program 18.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. Simplified21.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*9.3%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/9.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
      3. mul-1-neg9.3%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in B around inf 14.4%

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

    if -4.999999999999985e-310 < F

    1. Initial program 28.1%

      \[\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. Simplified48.9%

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

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

      \[\leadsto \frac{-\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative9.9%

        \[\leadsto \frac{-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \color{blue}{\left(C + A\right)}\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    6. Simplified9.9%

      \[\leadsto \frac{-\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(C + A\right)\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification13.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - B\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \end{array} \]

Alternative 11: 7.6% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-196}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(2 \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \sqrt{A \cdot \left(F \cdot {B_m}^{-2}\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -4.6e-196)
   (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (* 2.0 C))))
   (* -2.0 (sqrt (* A (* F (pow B_m -2.0)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -4.6e-196) {
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (2.0 * C)));
	} else {
		tmp = -2.0 * sqrt((A * (F * pow(B_m, -2.0))));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= (-4.6d-196)) then
        tmp = (-sqrt(2.0d0) / b_m) * sqrt((f * (2.0d0 * c)))
    else
        tmp = (-2.0d0) * sqrt((a * (f * (b_m ** (-2.0d0)))))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -4.6e-196) {
		tmp = (-Math.sqrt(2.0) / B_m) * Math.sqrt((F * (2.0 * C)));
	} else {
		tmp = -2.0 * Math.sqrt((A * (F * Math.pow(B_m, -2.0))));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if C <= -4.6e-196:
		tmp = (-math.sqrt(2.0) / B_m) * math.sqrt((F * (2.0 * C)))
	else:
		tmp = -2.0 * math.sqrt((A * (F * math.pow(B_m, -2.0))))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -4.6e-196)
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(2.0 * C))));
	else
		tmp = Float64(-2.0 * sqrt(Float64(A * Float64(F * (B_m ^ -2.0)))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -4.6e-196)
		tmp = (-sqrt(2.0) / B_m) * sqrt((F * (2.0 * C)));
	else
		tmp = -2.0 * sqrt((A * (F * (B_m ^ -2.0))));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -4.6e-196], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[Sqrt[N[(A * N[(F * N[Power[B$95$m, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.6 \cdot 10^{-196}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(2 \cdot C\right)}\\

\mathbf{else}:\\
\;\;\;\;-2 \cdot \sqrt{A \cdot \left(F \cdot {B_m}^{-2}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -4.6000000000000004e-196

    1. Initial program 27.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*9.4%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. associate-*r/9.4%

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

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    6. Taylor expanded in C around -inf 4.9%

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

    if -4.6000000000000004e-196 < C

    1. Initial program 14.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. Simplified18.2%

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

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

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(A - \left(-A\right)\right)}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    6. Taylor expanded in C around 0 1.6%

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
    7. Applied egg-rr4.4%

      \[\leadsto -2 \cdot \color{blue}{\sqrt{\left(A \cdot F\right) \cdot {B}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*4.7%

        \[\leadsto -2 \cdot \sqrt{\color{blue}{A \cdot \left(F \cdot {B}^{-2}\right)}} \]
    9. Simplified4.7%

      \[\leadsto -2 \cdot \color{blue}{\sqrt{A \cdot \left(F \cdot {B}^{-2}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification4.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-196}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(2 \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \sqrt{A \cdot \left(F \cdot {B}^{-2}\right)}\\ \end{array} \]

Alternative 12: 25.2% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (* (/ (- (sqrt 2.0)) B_m) (sqrt (* F (- C B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = (-sqrt(2.0d0) / b_m) * sqrt((f * (c - b_m)))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return (-Math.sqrt(2.0) / B_m) * Math.sqrt((F * (C - B_m)));
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return (-math.sqrt(2.0) / B_m) * math.sqrt((F * (C - B_m)))
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(F * Float64(C - B_m))))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = (-sqrt(2.0) / B_m) * sqrt((F * (C - B_m)));
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\frac{-\sqrt{2}}{B_m} \cdot \sqrt{F \cdot \left(C - B_m\right)}
\end{array}
Derivation
  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. Simplified26.0%

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

    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
  4. Step-by-step derivation
    1. associate-*r*7.8%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    2. associate-*r/7.8%

      \[\leadsto \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)} \]
    3. mul-1-neg7.8%

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

    \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
  6. Taylor expanded in B around inf 12.1%

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

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

Alternative 13: 5.1% accurate, 5.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ -2 \cdot \left({\left(A \cdot F\right)}^{0.5} \cdot \frac{1}{B_m}\right) \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (* -2.0 (* (pow (* A F) 0.5) (/ 1.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return -2.0 * (pow((A * F), 0.5) * (1.0 / B_m));
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = (-2.0d0) * (((a * f) ** 0.5d0) * (1.0d0 / b_m))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return -2.0 * (Math.pow((A * F), 0.5) * (1.0 / B_m));
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return -2.0 * (math.pow((A * F), 0.5) * (1.0 / B_m))
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) * Float64(1.0 / B_m)))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = -2.0 * (((A * F) ^ 0.5) * (1.0 / B_m));
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
-2 \cdot \left({\left(A \cdot F\right)}^{0.5} \cdot \frac{1}{B_m}\right)
\end{array}
Derivation
  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. Simplified26.0%

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

    \[\leadsto \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
  4. Step-by-step derivation
    1. mul-1-neg12.3%

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

    \[\leadsto \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(A - \left(-A\right)\right)}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
  6. Taylor expanded in C around 0 1.7%

    \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
  7. Applied egg-rr2.0%

    \[\leadsto -2 \cdot \left(\color{blue}{{\left(A \cdot F\right)}^{0.5}} \cdot \frac{1}{B}\right) \]
  8. Final simplification2.0%

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

Alternative 14: 4.9% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \frac{-2 \cdot \sqrt{A \cdot F}}{B_m} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (/ (* -2.0 (sqrt (* A F))) B_m))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return (-2.0 * sqrt((A * F))) / B_m;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = ((-2.0d0) * sqrt((a * f))) / b_m
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return (-2.0 * Math.sqrt((A * F))) / B_m;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return (-2.0 * math.sqrt((A * F))) / B_m
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(Float64(-2.0 * sqrt(Float64(A * F))) / B_m)
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = (-2.0 * sqrt((A * F))) / B_m;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[(-2.0 * N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\frac{-2 \cdot \sqrt{A \cdot F}}{B_m}
\end{array}
Derivation
  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. Simplified26.0%

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

    \[\leadsto \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
  4. Step-by-step derivation
    1. mul-1-neg12.3%

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

    \[\leadsto \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(A - \left(-A\right)\right)}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
  6. Taylor expanded in C around 0 1.7%

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

    \[\leadsto \color{blue}{\frac{\sqrt{A \cdot F} \cdot -2}{B}} \]
  8. Final simplification1.7%

    \[\leadsto \frac{-2 \cdot \sqrt{A \cdot F}}{B} \]

Reproduce

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