ABCF->ab-angle b

Percentage Accurate: 19.2% → 47.8%
Time: 22.8s
Alternatives: 13
Speedup: 5.1×

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 13 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: 19.2% 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: 47.8% accurate, 1.2× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 10^{-124}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C - A}\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+105}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* A (* C -4.0)))))
   (if (<= (pow B 2.0) 1e-124)
     (/
      (- (sqrt (* 2.0 (* t_0 (* F (+ A (+ A (* -0.5 (/ (* B B) (- C A))))))))))
      t_0)
     (if (<= (pow B 2.0) 2e+105)
       (/
        (- (sqrt (* 2.0 (* t_0 (* F (+ A (- C (hypot B (- A C)))))))))
        (- (* B B) (* 4.0 (* A C))))
       (* (sqrt (* F (- A (hypot A B)))) (/ (- (sqrt 2.0)) B))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 1e-124) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + (A + (-0.5 * ((B * B) / (C - A))))))))) / t_0;
	} else if (pow(B, 2.0) <= 2e+105) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + (C - hypot(B, (A - C)))))))) / ((B * B) - (4.0 * (A * C)));
	} else {
		tmp = sqrt((F * (A - hypot(A, B)))) * (-sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 1e-124)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(B * B) / Float64(C - A)))))))))) / t_0);
	elseif ((B ^ 2.0) <= 2e+105)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C))))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - hypot(A, B)))) * Float64(Float64(-sqrt(2.0)) / B));
	end
	return tmp
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e-124], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(A + N[(A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+105], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 10^{-124}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B}{C - A}\right)\right)\right)\right)}}{t_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B 2) < 9.99999999999999933e-125

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

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

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

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

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

    if 9.99999999999999933e-125 < (pow.f64 B 2) < 1.9999999999999999e105

    1. Initial program 45.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. Simplified45.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e105 < (pow.f64 B 2)

    1. Initial program 11.9%

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

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in10.8%

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

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

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

        \[\leadsto \sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    5. Simplified22.5%

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

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

Alternative 2: 47.4% accurate, 1.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 2.6 \cdot 10^{-62}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.7 \cdot 10^{+56}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 2.6e-62)
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A A)))))) t_0)
     (if (<= B 1.7e+56)
       (/
        (-
         (sqrt
          (*
           2.0
           (*
            (fma B B (* A (* C -4.0)))
            (* F (+ A (- C (hypot B (- A C)))))))))
        (- (* B B) (* 4.0 (* A C))))
       (* (sqrt (* F (- A (hypot A B)))) (/ (- (sqrt 2.0)) B))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 2.6e-62) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else if (B <= 1.7e+56) {
		tmp = -sqrt((2.0 * (fma(B, B, (A * (C * -4.0))) * (F * (A + (C - hypot(B, (A - C)))))))) / ((B * B) - (4.0 * (A * C)));
	} else {
		tmp = sqrt((F * (A - hypot(A, B)))) * (-sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 2.6e-62)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + A)))))) / t_0);
	elseif (B <= 1.7e+56)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(fma(B, B, Float64(A * Float64(C * -4.0))) * Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C))))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - hypot(A, B)))) * Float64(Float64(-sqrt(2.0)) / B));
	end
	return tmp
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 2.6e-62], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.7e+56], N[((-N[Sqrt[N[(2.0 * N[(N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 2.6 \cdot 10^{-62}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\

\mathbf{elif}\;B \leq 1.7 \cdot 10^{+56}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\

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


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

    1. Initial program 24.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. Simplified24.5%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.6%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.6%

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv14.6%

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv14.6%

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

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

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

    if 2.5999999999999999e-62 < B < 1.7e56

    1. Initial program 26.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7e56 < B

    1. Initial program 12.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. Simplified12.3%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in19.5%

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

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

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

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

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

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

Alternative 3: 47.4% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := A - \mathsf{hypot}\left(A, B\right)\\ t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_2 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 3.7 \cdot 10^{-62}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_2}\\ \mathbf{elif}\;B \leq 5.8 \cdot 10^{+47}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot t_1\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot t_0} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- A (hypot A B)))
        (t_1 (- (* B B) (* 4.0 (* A C))))
        (t_2 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 3.7e-62)
     (/ (- (sqrt (* 2.0 (* t_2 (* F (+ A A)))))) t_2)
     (if (<= B 5.8e+47)
       (/ (- (sqrt (* 2.0 (* t_0 (* F t_1))))) t_1)
       (* (sqrt (* F t_0)) (/ (- (sqrt 2.0)) B))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = A - hypot(A, B);
	double t_1 = (B * B) - (4.0 * (A * C));
	double t_2 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 3.7e-62) {
		tmp = -sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	} else if (B <= 5.8e+47) {
		tmp = -sqrt((2.0 * (t_0 * (F * t_1)))) / t_1;
	} else {
		tmp = sqrt((F * t_0)) * (-sqrt(2.0) / B);
	}
	return tmp;
}
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = A - Math.hypot(A, B);
	double t_1 = (B * B) - (4.0 * (A * C));
	double t_2 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 3.7e-62) {
		tmp = -Math.sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	} else if (B <= 5.8e+47) {
		tmp = -Math.sqrt((2.0 * (t_0 * (F * t_1)))) / t_1;
	} else {
		tmp = Math.sqrt((F * t_0)) * (-Math.sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = A - math.hypot(A, B)
	t_1 = (B * B) - (4.0 * (A * C))
	t_2 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 3.7e-62:
		tmp = -math.sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2
	elif B <= 5.8e+47:
		tmp = -math.sqrt((2.0 * (t_0 * (F * t_1)))) / t_1
	else:
		tmp = math.sqrt((F * t_0)) * (-math.sqrt(2.0) / B)
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(A - hypot(A, B))
	t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	t_2 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 3.7e-62)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(F * Float64(A + A)))))) / t_2);
	elseif (B <= 5.8e+47)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * t_1))))) / t_1);
	else
		tmp = Float64(sqrt(Float64(F * t_0)) * Float64(Float64(-sqrt(2.0)) / B));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = A - hypot(A, B);
	t_1 = (B * B) - (4.0 * (A * C));
	t_2 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 3.7e-62)
		tmp = -sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	elseif (B <= 5.8e+47)
		tmp = -sqrt((2.0 * (t_0 * (F * t_1)))) / t_1;
	else
		tmp = sqrt((F * t_0)) * (-sqrt(2.0) / B);
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.7e-62], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[B, 5.8e+47], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[Sqrt[N[(F * t$95$0), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := A - \mathsf{hypot}\left(A, B\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_2 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 3.7 \cdot 10^{-62}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_2}\\

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

\mathbf{else}:\\
\;\;\;\;\sqrt{F \cdot t_0} \cdot \frac{-\sqrt{2}}{B}\\


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

    1. Initial program 24.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. Simplified24.5%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.6%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.6%

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv14.6%

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv14.6%

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

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

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

    if 3.6999999999999998e-62 < B < 5.79999999999999961e47

    1. Initial program 26.7%

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

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

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

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

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

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

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

    if 5.79999999999999961e47 < B

    1. Initial program 12.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. Simplified12.3%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in19.5%

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

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

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

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

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

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

Alternative 4: 44.8% accurate, 2.7× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 4.6 \cdot 10^{-62}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_1}\\ \mathbf{elif}\;B \leq 1.95 \cdot 10^{+49}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - B\right)}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (* B B) (* 4.0 (* A C)))) (t_1 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 4.6e-62)
     (/ (- (sqrt (* 2.0 (* t_1 (* F (+ A A)))))) t_1)
     (if (<= B 1.95e+49)
       (/ (- (sqrt (* 2.0 (* (- A (hypot A B)) (* F t_0))))) t_0)
       (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A B)))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) - (4.0 * (A * C));
	double t_1 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 4.6e-62) {
		tmp = -sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	} else if (B <= 1.95e+49) {
		tmp = -sqrt((2.0 * ((A - hypot(A, B)) * (F * t_0)))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - B)));
	}
	return tmp;
}
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) - (4.0 * (A * C));
	double t_1 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 4.6e-62) {
		tmp = -Math.sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	} else if (B <= 1.95e+49) {
		tmp = -Math.sqrt((2.0 * ((A - Math.hypot(A, B)) * (F * t_0)))) / t_0;
	} else {
		tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A - B)));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) - (4.0 * (A * C))
	t_1 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 4.6e-62:
		tmp = -math.sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1
	elif B <= 1.95e+49:
		tmp = -math.sqrt((2.0 * ((A - math.hypot(A, B)) * (F * t_0)))) / t_0
	else:
		tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A - B)))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	t_1 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 4.6e-62)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(A + A)))))) / t_1);
	elseif (B <= 1.95e+49)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A - hypot(A, B)) * Float64(F * t_0))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - B)))));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) - (4.0 * (A * C));
	t_1 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 4.6e-62)
		tmp = -sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	elseif (B <= 1.95e+49)
		tmp = -sqrt((2.0 * ((A - hypot(A, B)) * (F * t_0)))) / t_0;
	else
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - B)));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 4.6e-62], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 1.95e+49], N[((-N[Sqrt[N[(2.0 * N[(N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 4.6 \cdot 10^{-62}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_1}\\

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

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


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

    1. Initial program 24.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. Simplified24.5%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.6%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.6%

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv14.6%

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv14.6%

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

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

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

    if 4.60000000000000001e-62 < B < 1.95e49

    1. Initial program 26.7%

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

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

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

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

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

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

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

    if 1.95e49 < B

    1. Initial program 12.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. Simplified12.7%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - B\right)}\right)} \]
    7. Step-by-step derivation
      1. associate-*r*39.7%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(A - B\right)}} \]
      2. neg-mul-139.7%

        \[\leadsto \color{blue}{\left(-\frac{\sqrt{2}}{B}\right)} \cdot \sqrt{F \cdot \left(A - B\right)} \]
      3. distribute-neg-frac39.7%

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

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

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

Alternative 5: 42.0% accurate, 2.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 2.1 \cdot 10^{-54} \lor \neg \left(B \leq 2.4 \cdot 10^{-25}\right) \land B \leq 175000:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-B\right)}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (or (<= B 2.1e-54) (and (not (<= B 2.4e-25)) (<= B 175000.0)))
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A A)))))) t_0)
     (* (/ (sqrt 2.0) B) (- (sqrt (* F (- B))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if ((B <= 2.1e-54) || (!(B <= 2.4e-25) && (B <= 175000.0))) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * -B));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    real(8) :: tmp
    t_0 = (b * b) + ((-4.0d0) * (a * c))
    if ((b <= 2.1d-54) .or. (.not. (b <= 2.4d-25)) .and. (b <= 175000.0d0)) then
        tmp = -sqrt((2.0d0 * (t_0 * (f * (a + a))))) / t_0
    else
        tmp = (sqrt(2.0d0) / b) * -sqrt((f * -b))
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if ((B <= 2.1e-54) || (!(B <= 2.4e-25) && (B <= 175000.0))) {
		tmp = -Math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * -B));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if (B <= 2.1e-54) or (not (B <= 2.4e-25) and (B <= 175000.0)):
		tmp = -math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0
	else:
		tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * -B))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if ((B <= 2.1e-54) || (!(B <= 2.4e-25) && (B <= 175000.0)))
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + A)))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(-B)))));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if ((B <= 2.1e-54) || (~((B <= 2.4e-25)) && (B <= 175000.0)))
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	else
		tmp = (sqrt(2.0) / B) * -sqrt((F * -B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[B, 2.1e-54], And[N[Not[LessEqual[B, 2.4e-25]], $MachinePrecision], LessEqual[B, 175000.0]]], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * (-B)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 2.1 \cdot 10^{-54} \lor \neg \left(B \leq 2.4 \cdot 10^{-25}\right) \land B \leq 175000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 2.1e-54 or 2.40000000000000009e-25 < B < 175000

    1. Initial program 24.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. Simplified24.0%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv14.6%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity14.6%

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv15.6%

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv15.6%

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

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

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

    if 2.1e-54 < B < 2.40000000000000009e-25 or 175000 < B

    1. Initial program 17.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. Simplified17.4%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in23.0%

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

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

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

        \[\leadsto \sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    5. Simplified39.3%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(-B\right)} \cdot F} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    8. Simplified39.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.1 \cdot 10^{-54} \lor \neg \left(B \leq 2.4 \cdot 10^{-25}\right) \land B \leq 175000:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-B\right)}\right)\\ \end{array} \]

Alternative 6: 42.0% accurate, 2.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ t_1 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ t_2 := \frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_1}\\ \mathbf{if}\;B \leq 5.5 \cdot 10^{-55}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{-25}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(A - B\right)}\right)\\ \mathbf{elif}\;B \leq 160000:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(-B\right)}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (/ (sqrt 2.0) B))
        (t_1 (+ (* B B) (* -4.0 (* A C))))
        (t_2 (/ (- (sqrt (* 2.0 (* t_1 (* F (+ A A)))))) t_1)))
   (if (<= B 5.5e-55)
     t_2
     (if (<= B 2.3e-25)
       (* t_0 (- (sqrt (* F (- A B)))))
       (if (<= B 160000.0) t_2 (* t_0 (- (sqrt (* F (- B))))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = sqrt(2.0) / B;
	double t_1 = (B * B) + (-4.0 * (A * C));
	double t_2 = -sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	double tmp;
	if (B <= 5.5e-55) {
		tmp = t_2;
	} else if (B <= 2.3e-25) {
		tmp = t_0 * -sqrt((F * (A - B)));
	} else if (B <= 160000.0) {
		tmp = t_2;
	} else {
		tmp = t_0 * -sqrt((F * -B));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = sqrt(2.0d0) / b
    t_1 = (b * b) + ((-4.0d0) * (a * c))
    t_2 = -sqrt((2.0d0 * (t_1 * (f * (a + a))))) / t_1
    if (b <= 5.5d-55) then
        tmp = t_2
    else if (b <= 2.3d-25) then
        tmp = t_0 * -sqrt((f * (a - b)))
    else if (b <= 160000.0d0) then
        tmp = t_2
    else
        tmp = t_0 * -sqrt((f * -b))
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.sqrt(2.0) / B;
	double t_1 = (B * B) + (-4.0 * (A * C));
	double t_2 = -Math.sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	double tmp;
	if (B <= 5.5e-55) {
		tmp = t_2;
	} else if (B <= 2.3e-25) {
		tmp = t_0 * -Math.sqrt((F * (A - B)));
	} else if (B <= 160000.0) {
		tmp = t_2;
	} else {
		tmp = t_0 * -Math.sqrt((F * -B));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = math.sqrt(2.0) / B
	t_1 = (B * B) + (-4.0 * (A * C))
	t_2 = -math.sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1
	tmp = 0
	if B <= 5.5e-55:
		tmp = t_2
	elif B <= 2.3e-25:
		tmp = t_0 * -math.sqrt((F * (A - B)))
	elif B <= 160000.0:
		tmp = t_2
	else:
		tmp = t_0 * -math.sqrt((F * -B))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(sqrt(2.0) / B)
	t_1 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	t_2 = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(A + A)))))) / t_1)
	tmp = 0.0
	if (B <= 5.5e-55)
		tmp = t_2;
	elseif (B <= 2.3e-25)
		tmp = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(A - B)))));
	elseif (B <= 160000.0)
		tmp = t_2;
	else
		tmp = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(-B)))));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = sqrt(2.0) / B;
	t_1 = (B * B) + (-4.0 * (A * C));
	t_2 = -sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	tmp = 0.0;
	if (B <= 5.5e-55)
		tmp = t_2;
	elseif (B <= 2.3e-25)
		tmp = t_0 * -sqrt((F * (A - B)));
	elseif (B <= 160000.0)
		tmp = t_2;
	else
		tmp = t_0 * -sqrt((F * -B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, If[LessEqual[B, 5.5e-55], t$95$2, If[LessEqual[B, 2.3e-25], N[(t$95$0 * (-N[Sqrt[N[(F * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B, 160000.0], t$95$2, N[(t$95$0 * (-N[Sqrt[N[(F * (-B)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B}\\
t_1 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_2 := \frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_1}\\
\mathbf{if}\;B \leq 5.5 \cdot 10^{-55}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;B \leq 2.3 \cdot 10^{-25}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(A - B\right)}\right)\\

\mathbf{elif}\;B \leq 160000:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(-B\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 5.4999999999999999e-55 or 2.2999999999999999e-25 < B < 1.6e5

    1. Initial program 24.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. Simplified24.0%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv14.6%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity14.6%

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv15.6%

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv15.6%

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

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

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

    if 5.4999999999999999e-55 < B < 2.2999999999999999e-25

    1. Initial program 26.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - B\right)}\right)} \]
    7. Step-by-step derivation
      1. associate-*r*25.9%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(A - B\right)}} \]
      2. neg-mul-125.9%

        \[\leadsto \color{blue}{\left(-\frac{\sqrt{2}}{B}\right)} \cdot \sqrt{F \cdot \left(A - B\right)} \]
      3. distribute-neg-frac25.9%

        \[\leadsto \color{blue}{\frac{-\sqrt{2}}{B}} \cdot \sqrt{F \cdot \left(A - B\right)} \]
    8. Simplified25.9%

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

    if 1.6e5 < B

    1. Initial program 16.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. Simplified16.8%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in22.7%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(-B\right)} \cdot F} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    8. Simplified40.6%

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

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

Alternative 7: 27.1% accurate, 4.7× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 2.1 \cdot 10^{-54} \lor \neg \left(B \leq 2.2 \cdot 10^{-25}\right) \land B \leq 160000:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(\left(A + C\right) - B\right)\right)}}{t_1}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (- (* B B) (* 4.0 (* A C)))))
   (if (or (<= B 2.1e-54) (and (not (<= B 2.2e-25)) (<= B 160000.0)))
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A A)))))) t_0)
     (/ (- (sqrt (* 2.0 (* (* F t_1) (- (+ A C) B))))) t_1))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double t_1 = (B * B) - (4.0 * (A * C));
	double tmp;
	if ((B <= 2.1e-54) || (!(B <= 2.2e-25) && (B <= 160000.0))) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = -sqrt((2.0 * ((F * t_1) * ((A + C) - B)))) / t_1;
	}
	return tmp;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (b * b) + ((-4.0d0) * (a * c))
    t_1 = (b * b) - (4.0d0 * (a * c))
    if ((b <= 2.1d-54) .or. (.not. (b <= 2.2d-25)) .and. (b <= 160000.0d0)) then
        tmp = -sqrt((2.0d0 * (t_0 * (f * (a + a))))) / t_0
    else
        tmp = -sqrt((2.0d0 * ((f * t_1) * ((a + c) - b)))) / t_1
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double t_1 = (B * B) - (4.0 * (A * C));
	double tmp;
	if ((B <= 2.1e-54) || (!(B <= 2.2e-25) && (B <= 160000.0))) {
		tmp = -Math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = -Math.sqrt((2.0 * ((F * t_1) * ((A + C) - B)))) / t_1;
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	t_1 = (B * B) - (4.0 * (A * C))
	tmp = 0
	if (B <= 2.1e-54) or (not (B <= 2.2e-25) and (B <= 160000.0)):
		tmp = -math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0
	else:
		tmp = -math.sqrt((2.0 * ((F * t_1) * ((A + C) - B)))) / t_1
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if ((B <= 2.1e-54) || (!(B <= 2.2e-25) && (B <= 160000.0)))
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + A)))))) / t_0);
	else
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(Float64(A + C) - B))))) / t_1);
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	t_1 = (B * B) - (4.0 * (A * C));
	tmp = 0.0;
	if ((B <= 2.1e-54) || (~((B <= 2.2e-25)) && (B <= 160000.0)))
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	else
		tmp = -sqrt((2.0 * ((F * t_1) * ((A + C) - B)))) / t_1;
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[B, 2.1e-54], And[N[Not[LessEqual[B, 2.2e-25]], $MachinePrecision], LessEqual[B, 160000.0]]], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 2.1 \cdot 10^{-54} \lor \neg \left(B \leq 2.2 \cdot 10^{-25}\right) \land B \leq 160000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(\left(A + C\right) - B\right)\right)}}{t_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 2.1e-54 or 2.2000000000000002e-25 < B < 1.6e5

    1. Initial program 24.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. Simplified24.0%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv14.6%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity14.6%

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv15.6%

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv15.6%

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

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

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

    if 2.1e-54 < B < 2.2000000000000002e-25 or 1.6e5 < B

    1. Initial program 17.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. Simplified17.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.1 \cdot 10^{-54} \lor \neg \left(B \leq 2.2 \cdot 10^{-25}\right) \land B \leq 160000:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(\left(A + C\right) - B\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \end{array} \]

Alternative 8: 26.6% accurate, 4.7× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ t_1 := 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 7.2 \cdot 10^{-62} \lor \neg \left(B \leq 5.6 \cdot 10^{-25}\right) \land B \leq 175000:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_1 - B \cdot B\right)\right)\right)}}{B \cdot B - t_1}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))) (t_1 (* 4.0 (* A C))))
   (if (or (<= B 7.2e-62) (and (not (<= B 5.6e-25)) (<= B 175000.0)))
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A A)))))) t_0)
     (/ (- (sqrt (* 2.0 (* B (* F (- t_1 (* B B))))))) (- (* B B) t_1)))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double t_1 = 4.0 * (A * C);
	double tmp;
	if ((B <= 7.2e-62) || (!(B <= 5.6e-25) && (B <= 175000.0))) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = -sqrt((2.0 * (B * (F * (t_1 - (B * B)))))) / ((B * B) - t_1);
	}
	return tmp;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (b * b) + ((-4.0d0) * (a * c))
    t_1 = 4.0d0 * (a * c)
    if ((b <= 7.2d-62) .or. (.not. (b <= 5.6d-25)) .and. (b <= 175000.0d0)) then
        tmp = -sqrt((2.0d0 * (t_0 * (f * (a + a))))) / t_0
    else
        tmp = -sqrt((2.0d0 * (b * (f * (t_1 - (b * b)))))) / ((b * b) - t_1)
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double t_1 = 4.0 * (A * C);
	double tmp;
	if ((B <= 7.2e-62) || (!(B <= 5.6e-25) && (B <= 175000.0))) {
		tmp = -Math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = -Math.sqrt((2.0 * (B * (F * (t_1 - (B * B)))))) / ((B * B) - t_1);
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	t_1 = 4.0 * (A * C)
	tmp = 0
	if (B <= 7.2e-62) or (not (B <= 5.6e-25) and (B <= 175000.0)):
		tmp = -math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0
	else:
		tmp = -math.sqrt((2.0 * (B * (F * (t_1 - (B * B)))))) / ((B * B) - t_1)
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	t_1 = Float64(4.0 * Float64(A * C))
	tmp = 0.0
	if ((B <= 7.2e-62) || (!(B <= 5.6e-25) && (B <= 175000.0)))
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + A)))))) / t_0);
	else
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * Float64(F * Float64(t_1 - Float64(B * B))))))) / Float64(Float64(B * B) - t_1));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	t_1 = 4.0 * (A * C);
	tmp = 0.0;
	if ((B <= 7.2e-62) || (~((B <= 5.6e-25)) && (B <= 175000.0)))
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	else
		tmp = -sqrt((2.0 * (B * (F * (t_1 - (B * B)))))) / ((B * B) - t_1);
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[B, 7.2e-62], And[N[Not[LessEqual[B, 5.6e-25]], $MachinePrecision], LessEqual[B, 175000.0]]], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(B * N[(F * N[(t$95$1 - N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_1 := 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 7.2 \cdot 10^{-62} \lor \neg \left(B \leq 5.6 \cdot 10^{-25}\right) \land B \leq 175000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 7.1999999999999999e-62 or 5.59999999999999976e-25 < B < 175000

    1. Initial program 24.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. Simplified24.1%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv14.7%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity14.7%

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv15.7%

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv15.7%

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

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

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

    if 7.1999999999999999e-62 < B < 5.59999999999999976e-25 or 175000 < B

    1. Initial program 17.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. Simplified17.2%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 7.2 \cdot 10^{-62} \lor \neg \left(B \leq 5.6 \cdot 10^{-25}\right) \land B \leq 175000:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(4 \cdot \left(A \cdot C\right) - B \cdot B\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \end{array} \]

Alternative 9: 27.0% accurate, 4.7× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B - t_0\\ t_2 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ t_3 := \frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_2}\\ \mathbf{if}\;B \leq 1.1 \cdot 10^{-48}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;B \leq 2.55 \cdot 10^{-25}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(C - B\right)\right)}}{t_1}\\ \mathbf{elif}\;B \leq 175000:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{t_1}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C)))
        (t_1 (- (* B B) t_0))
        (t_2 (+ (* B B) (* -4.0 (* A C))))
        (t_3 (/ (- (sqrt (* 2.0 (* t_2 (* F (+ A A)))))) t_2)))
   (if (<= B 1.1e-48)
     t_3
     (if (<= B 2.55e-25)
       (/ (- (sqrt (* 2.0 (* (* F t_1) (- C B))))) t_1)
       (if (<= B 175000.0)
         t_3
         (/ (- (sqrt (* 2.0 (* B (* F (- t_0 (* B B))))))) t_1))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double t_1 = (B * B) - t_0;
	double t_2 = (B * B) + (-4.0 * (A * C));
	double t_3 = -sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	double tmp;
	if (B <= 1.1e-48) {
		tmp = t_3;
	} else if (B <= 2.55e-25) {
		tmp = -sqrt((2.0 * ((F * t_1) * (C - B)))) / t_1;
	} else if (B <= 175000.0) {
		tmp = t_3;
	} else {
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	}
	return tmp;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = 4.0d0 * (a * c)
    t_1 = (b * b) - t_0
    t_2 = (b * b) + ((-4.0d0) * (a * c))
    t_3 = -sqrt((2.0d0 * (t_2 * (f * (a + a))))) / t_2
    if (b <= 1.1d-48) then
        tmp = t_3
    else if (b <= 2.55d-25) then
        tmp = -sqrt((2.0d0 * ((f * t_1) * (c - b)))) / t_1
    else if (b <= 175000.0d0) then
        tmp = t_3
    else
        tmp = -sqrt((2.0d0 * (b * (f * (t_0 - (b * b)))))) / t_1
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double t_1 = (B * B) - t_0;
	double t_2 = (B * B) + (-4.0 * (A * C));
	double t_3 = -Math.sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	double tmp;
	if (B <= 1.1e-48) {
		tmp = t_3;
	} else if (B <= 2.55e-25) {
		tmp = -Math.sqrt((2.0 * ((F * t_1) * (C - B)))) / t_1;
	} else if (B <= 175000.0) {
		tmp = t_3;
	} else {
		tmp = -Math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = 4.0 * (A * C)
	t_1 = (B * B) - t_0
	t_2 = (B * B) + (-4.0 * (A * C))
	t_3 = -math.sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2
	tmp = 0
	if B <= 1.1e-48:
		tmp = t_3
	elif B <= 2.55e-25:
		tmp = -math.sqrt((2.0 * ((F * t_1) * (C - B)))) / t_1
	elif B <= 175000.0:
		tmp = t_3
	else:
		tmp = -math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	t_1 = Float64(Float64(B * B) - t_0)
	t_2 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	t_3 = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(F * Float64(A + A)))))) / t_2)
	tmp = 0.0
	if (B <= 1.1e-48)
		tmp = t_3;
	elseif (B <= 2.55e-25)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(C - B))))) / t_1);
	elseif (B <= 175000.0)
		tmp = t_3;
	else
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * Float64(F * Float64(t_0 - Float64(B * B))))))) / t_1);
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = 4.0 * (A * C);
	t_1 = (B * B) - t_0;
	t_2 = (B * B) + (-4.0 * (A * C));
	t_3 = -sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	tmp = 0.0;
	if (B <= 1.1e-48)
		tmp = t_3;
	elseif (B <= 2.55e-25)
		tmp = -sqrt((2.0 * ((F * t_1) * (C - B)))) / t_1;
	elseif (B <= 175000.0)
		tmp = t_3;
	else
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[B, 1.1e-48], t$95$3, If[LessEqual[B, 2.55e-25], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(C - B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 175000.0], t$95$3, N[((-N[Sqrt[N[(2.0 * N[(B * N[(F * N[(t$95$0 - N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
t_1 := B \cdot B - t_0\\
t_2 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
t_3 := \frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_2}\\
\mathbf{if}\;B \leq 1.1 \cdot 10^{-48}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;B \leq 2.55 \cdot 10^{-25}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(C - B\right)\right)}}{t_1}\\

\mathbf{elif}\;B \leq 175000:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{t_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 1.10000000000000006e-48 or 2.5500000000000001e-25 < B < 175000

    1. Initial program 23.9%

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

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv14.5%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity14.5%

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv15.5%

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

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

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

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

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

    if 1.10000000000000006e-48 < B < 2.5500000000000001e-25

    1. Initial program 34.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. Simplified34.2%

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

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

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

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

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

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

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

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

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

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

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

    if 175000 < B

    1. Initial program 16.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. Simplified16.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 22.6% accurate, 5.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := B \cdot B - t_0\\ \mathbf{if}\;B \leq 9.8 \cdot 10^{-64}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{t_1}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))) (t_1 (- (* B B) t_0)))
   (if (<= B 9.8e-64)
     (- (/ (sqrt (* 2.0 (* (+ A A) (* -4.0 (* A (* C F)))))) t_1))
     (/ (- (sqrt (* 2.0 (* B (* F (- t_0 (* B B))))))) t_1))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double t_1 = (B * B) - t_0;
	double tmp;
	if (B <= 9.8e-64) {
		tmp = -(sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / t_1);
	} else {
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	}
	return tmp;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 4.0d0 * (a * c)
    t_1 = (b * b) - t_0
    if (b <= 9.8d-64) then
        tmp = -(sqrt((2.0d0 * ((a + a) * ((-4.0d0) * (a * (c * f)))))) / t_1)
    else
        tmp = -sqrt((2.0d0 * (b * (f * (t_0 - (b * b)))))) / t_1
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double t_1 = (B * B) - t_0;
	double tmp;
	if (B <= 9.8e-64) {
		tmp = -(Math.sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / t_1);
	} else {
		tmp = -Math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = 4.0 * (A * C)
	t_1 = (B * B) - t_0
	tmp = 0
	if B <= 9.8e-64:
		tmp = -(math.sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / t_1)
	else:
		tmp = -math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	t_1 = Float64(Float64(B * B) - t_0)
	tmp = 0.0
	if (B <= 9.8e-64)
		tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(-4.0 * Float64(A * Float64(C * F)))))) / t_1));
	else
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * Float64(F * Float64(t_0 - Float64(B * B))))))) / t_1);
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = 4.0 * (A * C);
	t_1 = (B * B) - t_0;
	tmp = 0.0;
	if (B <= 9.8e-64)
		tmp = -(sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / t_1);
	else
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[B, 9.8e-64], (-N[(N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), N[((-N[Sqrt[N[(2.0 * N[(B * N[(F * N[(t$95$0 - N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
t_1 := B \cdot B - t_0\\
\mathbf{if}\;B \leq 9.8 \cdot 10^{-64}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{t_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{t_1}\\


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

    1. Initial program 24.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. Simplified24.8%

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

      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.7%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.7%

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

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

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

    if 9.8000000000000003e-64 < B

    1. Initial program 16.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. Simplified16.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 19.6% accurate, 5.1× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ -\frac{\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (-
  (/
   (sqrt (* 2.0 (* (+ A A) (* -4.0 (* A (* C F))))))
   (- (* B B) (* 4.0 (* A C))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return -(sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / ((B * B) - (4.0 * (A * C))));
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    code = -(sqrt((2.0d0 * ((a + a) * ((-4.0d0) * (a * (c * f)))))) / ((b * b) - (4.0d0 * (a * c))))
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return -(Math.sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / ((B * B) - (4.0 * (A * C))));
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -(math.sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / ((B * B) - (4.0 * (A * C))))
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(-4.0 * Float64(A * Float64(C * F)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -(sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / ((B * B) - (4.0 * (A * C))));
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := (-N[(N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
-\frac{\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\end{array}
Derivation
  1. Initial program 22.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. Simplified22.3%

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

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

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

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

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

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

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

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

Alternative 12: 15.6% accurate, 5.2× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ -\frac{\sqrt{2 \cdot \left(-8 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (-
  (/ (sqrt (* 2.0 (* -8.0 (* (* C F) (* A A))))) (- (* B B) (* 4.0 (* A C))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return -(sqrt((2.0 * (-8.0 * ((C * F) * (A * A))))) / ((B * B) - (4.0 * (A * C))));
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    code = -(sqrt((2.0d0 * ((-8.0d0) * ((c * f) * (a * a))))) / ((b * b) - (4.0d0 * (a * c))))
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return -(Math.sqrt((2.0 * (-8.0 * ((C * F) * (A * A))))) / ((B * B) - (4.0 * (A * C))));
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -(math.sqrt((2.0 * (-8.0 * ((C * F) * (A * A))))) / ((B * B) - (4.0 * (A * C))))
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(-Float64(sqrt(Float64(2.0 * Float64(-8.0 * Float64(Float64(C * F) * Float64(A * A))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -(sqrt((2.0 * (-8.0 * ((C * F) * (A * A))))) / ((B * B) - (4.0 * (A * C))));
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := (-N[(N[Sqrt[N[(2.0 * N[(-8.0 * N[(N[(C * F), $MachinePrecision] * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
-\frac{\sqrt{2 \cdot \left(-8 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\end{array}
Derivation
  1. Initial program 22.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. Simplified22.3%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(-8 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  9. Final simplification9.1%

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

Alternative 13: 8.9% accurate, 5.8× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ -2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right) \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F) :precision binary64 (* -2.0 (* (sqrt (* A F)) (/ 1.0 B))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return -2.0 * (sqrt((A * F)) * (1.0 / B));
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    code = (-2.0d0) * (sqrt((a * f)) * (1.0d0 / b))
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return -2.0 * (Math.sqrt((A * F)) * (1.0 / B));
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -2.0 * (math.sqrt((A * F)) * (1.0 / B))
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(-2.0 * Float64(sqrt(Float64(A * F)) * Float64(1.0 / B)))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)
\end{array}
Derivation
  1. Initial program 22.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. Simplified22.3%

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

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

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

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

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

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

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

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

Reproduce

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