ABCF->ab-angle b

Percentage Accurate: 18.8% → 51.4%
Time: 41.7s
Alternatives: 14
Speedup: 5.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 18.8% accurate, 1.0× speedup?

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

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

Alternative 1: 51.4% accurate, 1.5× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-34}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(-4 \cdot F\right)} \cdot \left(-\sqrt{2}\right)}{\frac{C}{\sqrt{0.125}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\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
 (if (<= (pow B 2.0) 2e-34)
   (/ (* (sqrt (* C (* -4.0 F))) (- (sqrt 2.0))) (/ C (sqrt 0.125)))
   (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A (hypot A B))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 2e-34) {
		tmp = (sqrt((C * (-4.0 * F))) * -sqrt(2.0)) / (C / sqrt(0.125));
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(A, B))));
	}
	return tmp;
}
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.pow(B, 2.0) <= 2e-34) {
		tmp = (Math.sqrt((C * (-4.0 * F))) * -Math.sqrt(2.0)) / (C / Math.sqrt(0.125));
	} else {
		tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A - Math.hypot(A, B))));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	tmp = 0
	if math.pow(B, 2.0) <= 2e-34:
		tmp = (math.sqrt((C * (-4.0 * F))) * -math.sqrt(2.0)) / (C / math.sqrt(0.125))
	else:
		tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A - math.hypot(A, B))))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 2e-34)
		tmp = Float64(Float64(sqrt(Float64(C * Float64(-4.0 * F))) * Float64(-sqrt(2.0))) / Float64(C / sqrt(0.125)));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - hypot(A, B))))));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if ((B ^ 2.0) <= 2e-34)
		tmp = (sqrt((C * (-4.0 * F))) * -sqrt(2.0)) / (C / sqrt(0.125));
	else
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(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_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-34], N[(N[(N[Sqrt[N[(C * N[(-4.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision] / N[(C / N[Sqrt[0.125], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-34}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(-4 \cdot F\right)} \cdot \left(-\sqrt{2}\right)}{\frac{C}{\sqrt{0.125}}}\\

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


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

    1. Initial program 22.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. Simplified22.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. Step-by-step derivation
      1. flip--6.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. add-sqr-sqrt6.7%

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\color{blue}{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr6.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Step-by-step derivation
      1. rem-square-sqrt6.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Simplified7.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    7. Taylor expanded in A around -inf 29.6%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{0.125}}{C} \cdot \sqrt{\left(-2 \cdot C - 2 \cdot C\right) \cdot F}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg29.6%

        \[\leadsto \color{blue}{-\frac{\sqrt{2} \cdot \sqrt{0.125}}{C} \cdot \sqrt{\left(-2 \cdot C - 2 \cdot C\right) \cdot F}} \]
      2. associate-/l*29.8%

        \[\leadsto -\color{blue}{\frac{\sqrt{2}}{\frac{C}{\sqrt{0.125}}}} \cdot \sqrt{\left(-2 \cdot C - 2 \cdot C\right) \cdot F} \]
      3. distribute-rgt-out--29.8%

        \[\leadsto -\frac{\sqrt{2}}{\frac{C}{\sqrt{0.125}}} \cdot \sqrt{\color{blue}{\left(C \cdot \left(-2 - 2\right)\right)} \cdot F} \]
      4. metadata-eval29.8%

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

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{\frac{C}{\sqrt{0.125}}} \cdot \sqrt{\left(C \cdot -4\right) \cdot F}} \]
    10. Step-by-step derivation
      1. associate-*l/29.8%

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

        \[\leadsto -\frac{\sqrt{2} \cdot \sqrt{\color{blue}{C \cdot \left(-4 \cdot F\right)}}}{\frac{C}{\sqrt{0.125}}} \]
    11. Applied egg-rr29.8%

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

    if 1.99999999999999986e-34 < (pow.f64 B 2)

    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 C around 0 11.0%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 51.4% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 2 \cdot 10^{-17}:\\ \;\;\;\;\left(\sqrt{0.125} \cdot \frac{\sqrt{2}}{C}\right) \cdot \left(-\sqrt{F \cdot \left(C \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\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
 (if (<= B 2e-17)
   (* (* (sqrt 0.125) (/ (sqrt 2.0) C)) (- (sqrt (* F (* C -4.0)))))
   (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A (hypot A B))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 2e-17) {
		tmp = (sqrt(0.125) * (sqrt(2.0) / C)) * -sqrt((F * (C * -4.0)));
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(A, B))));
	}
	return tmp;
}
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 2e-17) {
		tmp = (Math.sqrt(0.125) * (Math.sqrt(2.0) / C)) * -Math.sqrt((F * (C * -4.0)));
	} else {
		tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A - Math.hypot(A, B))));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	tmp = 0
	if B <= 2e-17:
		tmp = (math.sqrt(0.125) * (math.sqrt(2.0) / C)) * -math.sqrt((F * (C * -4.0)))
	else:
		tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A - math.hypot(A, B))))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 2e-17)
		tmp = Float64(Float64(sqrt(0.125) * Float64(sqrt(2.0) / C)) * Float64(-sqrt(Float64(F * Float64(C * -4.0)))));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - hypot(A, B))))));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (B <= 2e-17)
		tmp = (sqrt(0.125) * (sqrt(2.0) / C)) * -sqrt((F * (C * -4.0)));
	else
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(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_] := If[LessEqual[B, 2e-17], N[(N[(N[Sqrt[0.125], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[N[(F * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\left(\sqrt{0.125} \cdot \frac{\sqrt{2}}{C}\right) \cdot \left(-\sqrt{F \cdot \left(C \cdot -4\right)}\right)\\

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


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

    1. Initial program 22.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. Simplified22.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. Step-by-step derivation
      1. flip--9.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. add-sqr-sqrt9.7%

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\color{blue}{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr9.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Step-by-step derivation
      1. rem-square-sqrt9.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Simplified9.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    7. Taylor expanded in A around -inf 23.1%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2} \cdot \sqrt{0.125}}{C} \cdot \sqrt{\left(-2 \cdot C - 2 \cdot C\right) \cdot F}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg23.1%

        \[\leadsto \color{blue}{-\frac{\sqrt{2} \cdot \sqrt{0.125}}{C} \cdot \sqrt{\left(-2 \cdot C - 2 \cdot C\right) \cdot F}} \]
      2. associate-/l*23.3%

        \[\leadsto -\color{blue}{\frac{\sqrt{2}}{\frac{C}{\sqrt{0.125}}}} \cdot \sqrt{\left(-2 \cdot C - 2 \cdot C\right) \cdot F} \]
      3. distribute-rgt-out--23.3%

        \[\leadsto -\frac{\sqrt{2}}{\frac{C}{\sqrt{0.125}}} \cdot \sqrt{\color{blue}{\left(C \cdot \left(-2 - 2\right)\right)} \cdot F} \]
      4. metadata-eval23.3%

        \[\leadsto -\frac{\sqrt{2}}{\frac{C}{\sqrt{0.125}}} \cdot \sqrt{\left(C \cdot \color{blue}{-4}\right) \cdot F} \]
    9. Simplified23.3%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{\frac{C}{\sqrt{0.125}}} \cdot \sqrt{\left(C \cdot -4\right) \cdot F}} \]
    10. Step-by-step derivation
      1. associate-/r/23.2%

        \[\leadsto -\color{blue}{\left(\frac{\sqrt{2}}{C} \cdot \sqrt{0.125}\right)} \cdot \sqrt{\left(C \cdot -4\right) \cdot F} \]
    11. Applied egg-rr23.2%

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

    if 2.00000000000000014e-17 < B

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 47.0% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;B \leq 4.1 \cdot 10^{-16}:\\ \;\;\;\;\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(A - \mathsf{hypot}\left(A, B\right)\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 (* C A)))))
   (if (<= B 4.1e-16)
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A A)))))) t_0)
     (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A (hypot 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 * (C * A));
	double tmp;
	if (B <= 4.1e-16) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(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 * (C * A));
	double tmp;
	if (B <= 4.1e-16) {
		tmp = -Math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A - Math.hypot(A, B))));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (C * A))
	tmp = 0
	if B <= 4.1e-16:
		tmp = -math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0
	else:
		tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (A - math.hypot(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(C * A)))
	tmp = 0.0
	if (B <= 4.1e-16)
		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(A - hypot(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 * (C * A));
	tmp = 0.0;
	if (B <= 4.1e-16)
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	else
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 4.1e-16], 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 * N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $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(C \cdot A\right)\\
\mathbf{if}\;B \leq 4.1 \cdot 10^{-16}:\\
\;\;\;\;\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(A - \mathsf{hypot}\left(A, B\right)\right)}\right)\\


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

    1. Initial program 22.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. Simplified22.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 18.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-inv18.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-eval18.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-identity18.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. Simplified18.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-neg18.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*20.2%

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

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

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

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

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

      \[\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.10000000000000006e-16 < B

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 44.9% accurate, 2.7× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B - \left(C \cdot A\right) \cdot 4\\ t_1 := F \cdot t_0\\ \mathbf{if}\;B \leq 1.36 \cdot 10^{-45}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot t_1\right)}}{t_0}\\ \mathbf{elif}\;B \leq 7.8 \cdot 10^{+27}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot t_1\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - B\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) (* (* C A) 4.0))) (t_1 (* F t_0)))
   (if (<= B 1.36e-45)
     (/ (- (sqrt (* 2.0 (* (+ A A) t_1)))) t_0)
     (if (<= B 7.8e+27)
       (/ (- (sqrt (* 2.0 (* (- A (hypot A B)) t_1)))) t_0)
       (* (sqrt (* F (- 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) - ((C * A) * 4.0);
	double t_1 = F * t_0;
	double tmp;
	if (B <= 1.36e-45) {
		tmp = -sqrt((2.0 * ((A + A) * t_1))) / t_0;
	} else if (B <= 7.8e+27) {
		tmp = -sqrt((2.0 * ((A - hypot(A, B)) * t_1))) / t_0;
	} else {
		tmp = sqrt((F * (A - B))) * (-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 = (B * B) - ((C * A) * 4.0);
	double t_1 = F * t_0;
	double tmp;
	if (B <= 1.36e-45) {
		tmp = -Math.sqrt((2.0 * ((A + A) * t_1))) / t_0;
	} else if (B <= 7.8e+27) {
		tmp = -Math.sqrt((2.0 * ((A - Math.hypot(A, B)) * t_1))) / t_0;
	} else {
		tmp = Math.sqrt((F * (A - B))) * (-Math.sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) - ((C * A) * 4.0)
	t_1 = F * t_0
	tmp = 0
	if B <= 1.36e-45:
		tmp = -math.sqrt((2.0 * ((A + A) * t_1))) / t_0
	elif B <= 7.8e+27:
		tmp = -math.sqrt((2.0 * ((A - math.hypot(A, B)) * t_1))) / t_0
	else:
		tmp = math.sqrt((F * (A - B))) * (-math.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(Float64(C * A) * 4.0))
	t_1 = Float64(F * t_0)
	tmp = 0.0
	if (B <= 1.36e-45)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * t_1)))) / t_0);
	elseif (B <= 7.8e+27)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A - hypot(A, B)) * t_1)))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - B))) * 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 = (B * B) - ((C * A) * 4.0);
	t_1 = F * t_0;
	tmp = 0.0;
	if (B <= 1.36e-45)
		tmp = -sqrt((2.0 * ((A + A) * t_1))) / t_0;
	elseif (B <= 7.8e+27)
		tmp = -sqrt((2.0 * ((A - hypot(A, B)) * t_1))) / t_0;
	else
		tmp = sqrt((F * (A - B))) * (-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[(N[(B * B), $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * t$95$0), $MachinePrecision]}, If[LessEqual[B, 1.36e-45], N[((-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 7.8e+27], N[((-N[Sqrt[N[(2.0 * N[(N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - B), $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 - \left(C \cdot A\right) \cdot 4\\
t_1 := F \cdot t_0\\
\mathbf{if}\;B \leq 1.36 \cdot 10^{-45}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot t_1\right)}}{t_0}\\

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

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


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

    1. Initial program 21.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. Simplified21.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 18.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-inv18.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-eval18.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-identity18.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. Simplified18.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)} \]

    if 1.35999999999999998e-45 < B < 7.7999999999999997e27

    1. Initial program 55.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. Simplified55.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 0 47.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 - \sqrt{{B}^{2} + {A}^{2}}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. +-commutative47.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 - \sqrt{\color{blue}{{A}^{2} + {B}^{2}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. unpow247.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 - \sqrt{\color{blue}{A \cdot A} + {B}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unpow247.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 - \sqrt{A \cdot A + \color{blue}{B \cdot B}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. hypot-def47.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}{\mathsf{hypot}\left(A, B\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified47.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 - \mathsf{hypot}\left(A, B\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 7.7999999999999997e27 < B

    1. Initial program 8.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 43.6% 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(C \cdot A\right)\\ t_1 := \frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\ \mathbf{if}\;B \leq 1.35 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 1.7 \cdot 10^{+16}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\frac{B \cdot B}{C + \mathsf{hypot}\left(B, C\right)} \cdot \left(F \cdot \left(B \cdot \left(-B\right)\right)\right)\right)}}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\ \mathbf{elif}\;B \leq 7 \cdot 10^{+26}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - B\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 (* C A))))
        (t_1 (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A A)))))) t_0)))
   (if (<= B 1.35e-13)
     t_1
     (if (<= B 1.7e+16)
       (/
        (- (sqrt (* 2.0 (* (/ (* B B) (+ C (hypot B C))) (* F (* B (- B)))))))
        (- (* B B) (* (* C A) 4.0)))
       (if (<= B 7e+26) t_1 (* (sqrt (* F (- 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 * (C * A));
	double t_1 = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	double tmp;
	if (B <= 1.35e-13) {
		tmp = t_1;
	} else if (B <= 1.7e+16) {
		tmp = -sqrt((2.0 * (((B * B) / (C + hypot(B, C))) * (F * (B * -B))))) / ((B * B) - ((C * A) * 4.0));
	} else if (B <= 7e+26) {
		tmp = t_1;
	} else {
		tmp = sqrt((F * (A - B))) * (-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 = (B * B) + (-4.0 * (C * A));
	double t_1 = -Math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	double tmp;
	if (B <= 1.35e-13) {
		tmp = t_1;
	} else if (B <= 1.7e+16) {
		tmp = -Math.sqrt((2.0 * (((B * B) / (C + Math.hypot(B, C))) * (F * (B * -B))))) / ((B * B) - ((C * A) * 4.0));
	} else if (B <= 7e+26) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt((F * (A - B))) * (-Math.sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (C * A))
	t_1 = -math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0
	tmp = 0
	if B <= 1.35e-13:
		tmp = t_1
	elif B <= 1.7e+16:
		tmp = -math.sqrt((2.0 * (((B * B) / (C + math.hypot(B, C))) * (F * (B * -B))))) / ((B * B) - ((C * A) * 4.0))
	elif B <= 7e+26:
		tmp = t_1
	else:
		tmp = math.sqrt((F * (A - B))) * (-math.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(C * A)))
	t_1 = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + A)))))) / t_0)
	tmp = 0.0
	if (B <= 1.35e-13)
		tmp = t_1;
	elseif (B <= 1.7e+16)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) / Float64(C + hypot(B, C))) * Float64(F * Float64(B * Float64(-B))))))) / Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0)));
	elseif (B <= 7e+26)
		tmp = t_1;
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - B))) * 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 = (B * B) + (-4.0 * (C * A));
	t_1 = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	tmp = 0.0;
	if (B <= 1.35e-13)
		tmp = t_1;
	elseif (B <= 1.7e+16)
		tmp = -sqrt((2.0 * (((B * B) / (C + hypot(B, C))) * (F * (B * -B))))) / ((B * B) - ((C * A) * 4.0));
	elseif (B <= 7e+26)
		tmp = t_1;
	else
		tmp = sqrt((F * (A - B))) * (-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[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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.35e-13], t$95$1, If[LessEqual[B, 1.7e+16], N[((-N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] / N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(B * (-B)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7e+26], t$95$1, N[(N[Sqrt[N[(F * N[(A - B), $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(C \cdot A\right)\\
t_1 := \frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\
\mathbf{if}\;B \leq 1.35 \cdot 10^{-13}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;B \leq 7 \cdot 10^{+26}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 1.35000000000000005e-13 or 1.7e16 < B < 6.9999999999999998e26

    1. Initial program 23.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. Simplified23.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 18.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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv18.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 + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval18.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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity18.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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified18.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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Step-by-step derivation
      1. distribute-frac-neg18.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(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
      2. associate-*l*20.0%

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

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

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

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

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

      \[\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.35000000000000005e-13 < B < 1.7e16

    1. Initial program 67.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. Simplified67.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. Step-by-step derivation
      1. flip--67.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. add-sqr-sqrt67.3%

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\color{blue}{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr67.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Step-by-step derivation
      1. rem-square-sqrt67.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Simplified67.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    7. Taylor expanded in A around 0 68.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(-1 \cdot \frac{{B}^{2}}{C + \sqrt{{B}^{2} + {C}^{2}}}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    8. Step-by-step derivation
      1. associate-*r/68.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}{\frac{-1 \cdot {B}^{2}}{C + \sqrt{{B}^{2} + {C}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg68.9%

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

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{-B \cdot B}{C + \color{blue}{\mathsf{hypot}\left(B, C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    9. Simplified68.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}{\frac{-B \cdot B}{C + \mathsf{hypot}\left(B, C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    10. Taylor expanded in B around inf 68.4%

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

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

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

    if 6.9999999999999998e26 < B

    1. Initial program 8.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 43.4% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;B \leq 9.8 \cdot 10^{-17}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - B\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 (* C A)))))
   (if (<= B 9.8e-17)
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A A)))))) t_0)
     (* (sqrt (* F (- 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 * (C * A));
	double tmp;
	if (B <= 9.8e-17) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = sqrt((F * (A - B))) * (-sqrt(2.0) / 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) * (c * a))
    if (b <= 9.8d-17) then
        tmp = -sqrt((2.0d0 * (t_0 * (f * (a + a))))) / t_0
    else
        tmp = sqrt((f * (a - b))) * (-sqrt(2.0d0) / 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 * (C * A));
	double tmp;
	if (B <= 9.8e-17) {
		tmp = -Math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = Math.sqrt((F * (A - B))) * (-Math.sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (C * A))
	tmp = 0
	if B <= 9.8e-17:
		tmp = -math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0
	else:
		tmp = math.sqrt((F * (A - B))) * (-math.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(C * A)))
	tmp = 0.0
	if (B <= 9.8e-17)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + A)))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - B))) * 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 = (B * B) + (-4.0 * (C * A));
	tmp = 0.0;
	if (B <= 9.8e-17)
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	else
		tmp = sqrt((F * (A - B))) * (-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[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 9.8e-17], 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[(F * N[(A - B), $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(C \cdot A\right)\\
\mathbf{if}\;B \leq 9.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_0}\\

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


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

    1. Initial program 22.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. Simplified22.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 18.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-inv18.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-eval18.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-identity18.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. Simplified18.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-neg18.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*20.2%

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

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

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

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

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

      \[\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 9.80000000000000024e-17 < B

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 42.9% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;B \leq 7.2 \cdot 10^{-13}:\\ \;\;\;\;\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{B \cdot \left(-F\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 (* C A)))))
   (if (<= B 7.2e-13)
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A A)))))) t_0)
     (* (/ (sqrt 2.0) B) (- (sqrt (* B (- F))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (C * A));
	double tmp;
	if (B <= 7.2e-13) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((B * -F));
	}
	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) * (c * a))
    if (b <= 7.2d-13) then
        tmp = -sqrt((2.0d0 * (t_0 * (f * (a + a))))) / t_0
    else
        tmp = (sqrt(2.0d0) / b) * -sqrt((b * -f))
    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 * (C * A));
	double tmp;
	if (B <= 7.2e-13) {
		tmp = -Math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	} else {
		tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * -F));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (C * A))
	tmp = 0
	if B <= 7.2e-13:
		tmp = -math.sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0
	else:
		tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * -F))
	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(C * A)))
	tmp = 0.0
	if (B <= 7.2e-13)
		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(B * Float64(-F)))));
	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 * (C * A));
	tmp = 0.0;
	if (B <= 7.2e-13)
		tmp = -sqrt((2.0 * (t_0 * (F * (A + A))))) / t_0;
	else
		tmp = (sqrt(2.0) / B) * -sqrt((B * -F));
	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[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 7.2e-13], 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[(B * (-F)), $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(C \cdot A\right)\\
\mathbf{if}\;B \leq 7.2 \cdot 10^{-13}:\\
\;\;\;\;\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{B \cdot \left(-F\right)}\right)\\


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

    1. Initial program 22.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. Simplified22.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 18.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-inv18.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-eval18.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-identity18.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. Simplified18.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-neg18.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*20.2%

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

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

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

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

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

      \[\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.1999999999999996e-13 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 28.9% accurate, 4.7× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \left(C \cdot A\right) \cdot 4\\ t_1 := B \cdot B + -4 \cdot \left(C \cdot A\right)\\ t_2 := \sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(A + A\right)\right)\right)}\\ \mathbf{if}\;B \leq 4.35 \cdot 10^{-13}:\\ \;\;\;\;\frac{-t_2}{t_1}\\ \mathbf{elif}\;B \leq 1.45 \cdot 10^{+69}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{B \cdot B - t_0}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+138}:\\ \;\;\;\;t_2 \cdot \frac{-1}{t_1}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\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 (* (* C A) 4.0))
        (t_1 (+ (* B B) (* -4.0 (* C A))))
        (t_2 (sqrt (* 2.0 (* t_1 (* F (+ A A)))))))
   (if (<= B 4.35e-13)
     (/ (- t_2) t_1)
     (if (<= B 1.45e+69)
       (/ (- (sqrt (* 2.0 (* B (* F (- t_0 (* B B))))))) (- (* B B) t_0))
       (if (<= B 2.5e+138)
         (* t_2 (/ -1.0 t_1))
         (* -2.0 (* (pow (* F A) 0.5) (/ 1.0 B))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (C * A) * 4.0;
	double t_1 = (B * B) + (-4.0 * (C * A));
	double t_2 = sqrt((2.0 * (t_1 * (F * (A + A)))));
	double tmp;
	if (B <= 4.35e-13) {
		tmp = -t_2 / t_1;
	} else if (B <= 1.45e+69) {
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / ((B * B) - t_0);
	} else if (B <= 2.5e+138) {
		tmp = t_2 * (-1.0 / t_1);
	} else {
		tmp = -2.0 * (pow((F * A), 0.5) * (1.0 / 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 = (c * a) * 4.0d0
    t_1 = (b * b) + ((-4.0d0) * (c * a))
    t_2 = sqrt((2.0d0 * (t_1 * (f * (a + a)))))
    if (b <= 4.35d-13) then
        tmp = -t_2 / t_1
    else if (b <= 1.45d+69) then
        tmp = -sqrt((2.0d0 * (b * (f * (t_0 - (b * b)))))) / ((b * b) - t_0)
    else if (b <= 2.5d+138) then
        tmp = t_2 * ((-1.0d0) / t_1)
    else
        tmp = (-2.0d0) * (((f * a) ** 0.5d0) * (1.0d0 / 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 = (C * A) * 4.0;
	double t_1 = (B * B) + (-4.0 * (C * A));
	double t_2 = Math.sqrt((2.0 * (t_1 * (F * (A + A)))));
	double tmp;
	if (B <= 4.35e-13) {
		tmp = -t_2 / t_1;
	} else if (B <= 1.45e+69) {
		tmp = -Math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / ((B * B) - t_0);
	} else if (B <= 2.5e+138) {
		tmp = t_2 * (-1.0 / t_1);
	} else {
		tmp = -2.0 * (Math.pow((F * A), 0.5) * (1.0 / B));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (C * A) * 4.0
	t_1 = (B * B) + (-4.0 * (C * A))
	t_2 = math.sqrt((2.0 * (t_1 * (F * (A + A)))))
	tmp = 0
	if B <= 4.35e-13:
		tmp = -t_2 / t_1
	elif B <= 1.45e+69:
		tmp = -math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / ((B * B) - t_0)
	elif B <= 2.5e+138:
		tmp = t_2 * (-1.0 / t_1)
	else:
		tmp = -2.0 * (math.pow((F * A), 0.5) * (1.0 / B))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(C * A) * 4.0)
	t_1 = Float64(Float64(B * B) + Float64(-4.0 * Float64(C * A)))
	t_2 = sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(A + A)))))
	tmp = 0.0
	if (B <= 4.35e-13)
		tmp = Float64(Float64(-t_2) / t_1);
	elseif (B <= 1.45e+69)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * Float64(F * Float64(t_0 - Float64(B * B))))))) / Float64(Float64(B * B) - t_0));
	elseif (B <= 2.5e+138)
		tmp = Float64(t_2 * Float64(-1.0 / t_1));
	else
		tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) * Float64(1.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 = (C * A) * 4.0;
	t_1 = (B * B) + (-4.0 * (C * A));
	t_2 = sqrt((2.0 * (t_1 * (F * (A + A)))));
	tmp = 0.0;
	if (B <= 4.35e-13)
		tmp = -t_2 / t_1;
	elseif (B <= 1.45e+69)
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / ((B * B) - t_0);
	elseif (B <= 2.5e+138)
		tmp = t_2 * (-1.0 / t_1);
	else
		tmp = -2.0 * (((F * A) ^ 0.5) * (1.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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 4.35e-13], N[((-t$95$2) / t$95$1), $MachinePrecision], If[LessEqual[B, 1.45e+69], N[((-N[Sqrt[N[(2.0 * N[(B * N[(F * N[(t$95$0 - N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.5e+138], N[(t$95$2 * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \left(C \cdot A\right) \cdot 4\\
t_1 := B \cdot B + -4 \cdot \left(C \cdot A\right)\\
t_2 := \sqrt{2 \cdot \left(t_1 \cdot \left(F \cdot \left(A + A\right)\right)\right)}\\
\mathbf{if}\;B \leq 4.35 \cdot 10^{-13}:\\
\;\;\;\;\frac{-t_2}{t_1}\\

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

\mathbf{elif}\;B \leq 2.5 \cdot 10^{+138}:\\
\;\;\;\;t_2 \cdot \frac{-1}{t_1}\\

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


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

    1. Initial program 22.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. Simplified22.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 18.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-inv18.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-eval18.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-identity18.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. Simplified18.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-neg18.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*20.2%

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

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

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

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

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

      \[\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.35000000000000014e-13 < B < 1.4499999999999999e69

    1. Initial program 36.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. Simplified36.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. Step-by-step derivation
      1. flip--35.8%

        \[\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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. add-sqr-sqrt35.8%

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

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

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

      \[\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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Step-by-step derivation
      1. rem-square-sqrt35.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    7. Taylor expanded in A around 0 38.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(-1 \cdot \frac{{B}^{2}}{C + \sqrt{{B}^{2} + {C}^{2}}}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    8. Step-by-step derivation
      1. associate-*r/38.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}{\frac{-1 \cdot {B}^{2}}{C + \sqrt{{B}^{2} + {C}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg38.0%

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

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{-B \cdot B}{C + \color{blue}{\mathsf{hypot}\left(B, C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    9. Simplified37.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}{\frac{-B \cdot B}{C + \mathsf{hypot}\left(B, C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    10. Taylor expanded in B around inf 38.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(-1 \cdot B\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    11. Step-by-step derivation
      1. neg-mul-138.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(-B\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    12. Simplified38.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(-B\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 1.4499999999999999e69 < B < 2.50000000000000008e138

    1. Initial program 7.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. Simplified7.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 17.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\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)}\right) \cdot \frac{1}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
      2. associate-*l*18.0%

        \[\leadsto \left(-\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)}}\right) \cdot \frac{1}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. cancel-sign-sub-inv18.0%

        \[\leadsto \left(-\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)}\right) \cdot \frac{1}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. metadata-eval18.0%

        \[\leadsto \left(-\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)}\right) \cdot \frac{1}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv18.0%

        \[\leadsto \left(-\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)}\right) \cdot \frac{1}{\color{blue}{B \cdot B + \left(-4\right) \cdot \left(A \cdot C\right)}} \]
      6. metadata-eval18.0%

        \[\leadsto \left(-\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)}\right) \cdot \frac{1}{B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)} \]
    7. Applied egg-rr18.0%

      \[\leadsto \color{blue}{\left(-\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)}\right) \cdot \frac{1}{B \cdot B + -4 \cdot \left(A \cdot C\right)}} \]

    if 2.50000000000000008e138 < B

    1. Initial program 2.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. Simplified2.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 0.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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv0.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 + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval0.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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity0.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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified0.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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 10.7%

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

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

        \[\leadsto -2 \cdot \left({\color{blue}{\left(F \cdot A\right)}}^{0.5} \cdot \frac{1}{B}\right) \]
    8. Applied egg-rr10.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 4.35 \cdot 10^{-13}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B + -4 \cdot \left(C \cdot A\right)}\\ \mathbf{elif}\;B \leq 1.45 \cdot 10^{+69}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(\left(C \cdot A\right) \cdot 4 - B \cdot B\right)\right)\right)}}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\ \mathbf{elif}\;B \leq 2.5 \cdot 10^{+138}:\\ \;\;\;\;\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)} \cdot \frac{-1}{B \cdot B + -4 \cdot \left(C \cdot A\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\right)\\ \end{array} \]

Alternative 9: 29.1% accurate, 4.7× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \left(C \cdot A\right) \cdot 4\\ t_1 := B \cdot B + -4 \cdot \left(C \cdot A\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 6.8 \cdot 10^{-13}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;B \leq 5.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{B \cdot B - t_0}\\ \mathbf{elif}\;B \leq 2.25 \cdot 10^{+126}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\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 (* (* C A) 4.0))
        (t_1 (+ (* B B) (* -4.0 (* C A))))
        (t_2 (/ (- (sqrt (* 2.0 (* t_1 (* F (+ A A)))))) t_1)))
   (if (<= B 6.8e-13)
     t_2
     (if (<= B 5.5e+69)
       (/ (- (sqrt (* 2.0 (* B (* F (- t_0 (* B B))))))) (- (* B B) t_0))
       (if (<= B 2.25e+126) t_2 (* -2.0 (* (pow (* F A) 0.5) (/ 1.0 B))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (C * A) * 4.0;
	double t_1 = (B * B) + (-4.0 * (C * A));
	double t_2 = -sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	double tmp;
	if (B <= 6.8e-13) {
		tmp = t_2;
	} else if (B <= 5.5e+69) {
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / ((B * B) - t_0);
	} else if (B <= 2.25e+126) {
		tmp = t_2;
	} else {
		tmp = -2.0 * (pow((F * A), 0.5) * (1.0 / 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 = (c * a) * 4.0d0
    t_1 = (b * b) + ((-4.0d0) * (c * a))
    t_2 = -sqrt((2.0d0 * (t_1 * (f * (a + a))))) / t_1
    if (b <= 6.8d-13) then
        tmp = t_2
    else if (b <= 5.5d+69) then
        tmp = -sqrt((2.0d0 * (b * (f * (t_0 - (b * b)))))) / ((b * b) - t_0)
    else if (b <= 2.25d+126) then
        tmp = t_2
    else
        tmp = (-2.0d0) * (((f * a) ** 0.5d0) * (1.0d0 / 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 = (C * A) * 4.0;
	double t_1 = (B * B) + (-4.0 * (C * A));
	double t_2 = -Math.sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	double tmp;
	if (B <= 6.8e-13) {
		tmp = t_2;
	} else if (B <= 5.5e+69) {
		tmp = -Math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / ((B * B) - t_0);
	} else if (B <= 2.25e+126) {
		tmp = t_2;
	} else {
		tmp = -2.0 * (Math.pow((F * A), 0.5) * (1.0 / B));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (C * A) * 4.0
	t_1 = (B * B) + (-4.0 * (C * A))
	t_2 = -math.sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1
	tmp = 0
	if B <= 6.8e-13:
		tmp = t_2
	elif B <= 5.5e+69:
		tmp = -math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / ((B * B) - t_0)
	elif B <= 2.25e+126:
		tmp = t_2
	else:
		tmp = -2.0 * (math.pow((F * A), 0.5) * (1.0 / B))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(C * A) * 4.0)
	t_1 = Float64(Float64(B * B) + Float64(-4.0 * Float64(C * A)))
	t_2 = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(A + A)))))) / t_1)
	tmp = 0.0
	if (B <= 6.8e-13)
		tmp = t_2;
	elseif (B <= 5.5e+69)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * Float64(F * Float64(t_0 - Float64(B * B))))))) / Float64(Float64(B * B) - t_0));
	elseif (B <= 2.25e+126)
		tmp = t_2;
	else
		tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) * Float64(1.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 = (C * A) * 4.0;
	t_1 = (B * B) + (-4.0 * (C * A));
	t_2 = -sqrt((2.0 * (t_1 * (F * (A + A))))) / t_1;
	tmp = 0.0;
	if (B <= 6.8e-13)
		tmp = t_2;
	elseif (B <= 5.5e+69)
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / ((B * B) - t_0);
	elseif (B <= 2.25e+126)
		tmp = t_2;
	else
		tmp = -2.0 * (((F * A) ^ 0.5) * (1.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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(C * A), $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, 6.8e-13], t$95$2, If[LessEqual[B, 5.5e+69], N[((-N[Sqrt[N[(2.0 * N[(B * N[(F * N[(t$95$0 - N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.25e+126], t$95$2, N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \left(C \cdot A\right) \cdot 4\\
t_1 := B \cdot B + -4 \cdot \left(C \cdot A\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 6.8 \cdot 10^{-13}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;B \leq 2.25 \cdot 10^{+126}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 6.80000000000000031e-13 or 5.50000000000000002e69 < B < 2.24999999999999987e126

    1. Initial program 21.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified21.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 inf 18.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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv18.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 + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval18.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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity18.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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified18.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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Step-by-step derivation
      1. distribute-frac-neg18.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(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
      2. associate-*l*19.9%

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

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

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

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

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

      \[\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 6.80000000000000031e-13 < B < 5.50000000000000002e69

    1. Initial program 36.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. Simplified36.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. Step-by-step derivation
      1. flip--35.8%

        \[\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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. add-sqr-sqrt35.8%

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

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

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

      \[\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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Step-by-step derivation
      1. rem-square-sqrt35.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    7. Taylor expanded in A around 0 38.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(-1 \cdot \frac{{B}^{2}}{C + \sqrt{{B}^{2} + {C}^{2}}}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    8. Step-by-step derivation
      1. associate-*r/38.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}{\frac{-1 \cdot {B}^{2}}{C + \sqrt{{B}^{2} + {C}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg38.0%

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

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{-B \cdot B}{C + \color{blue}{\mathsf{hypot}\left(B, C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    9. Simplified37.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}{\frac{-B \cdot B}{C + \mathsf{hypot}\left(B, C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    10. Taylor expanded in B around inf 38.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(-1 \cdot B\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    11. Step-by-step derivation
      1. neg-mul-138.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(-B\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    12. Simplified38.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(-B\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 2.24999999999999987e126 < B

    1. Initial program 5.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. Simplified5.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 3.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(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-inv3.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval3.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(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity3.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(A + \color{blue}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified3.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(A + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 12.1%

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

        \[\leadsto -2 \cdot \left(\color{blue}{{\left(A \cdot F\right)}^{0.5}} \cdot \frac{1}{B}\right) \]
      2. *-commutative12.3%

        \[\leadsto -2 \cdot \left({\color{blue}{\left(F \cdot A\right)}}^{0.5} \cdot \frac{1}{B}\right) \]
    8. Applied egg-rr12.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6.8 \cdot 10^{-13}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B + -4 \cdot \left(C \cdot A\right)}\\ \mathbf{elif}\;B \leq 5.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(\left(C \cdot A\right) \cdot 4 - B \cdot B\right)\right)\right)}}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\ \mathbf{elif}\;B \leq 2.25 \cdot 10^{+126}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{B \cdot B + -4 \cdot \left(C \cdot A\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\right)\\ \end{array} \]

Alternative 10: 24.2% accurate, 4.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \left(C \cdot A\right) \cdot 4\\ t_1 := B \cdot B - t_0\\ \mathbf{if}\;B \leq 6.5 \cdot 10^{-40}:\\ \;\;\;\;\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{elif}\;B \leq 10^{+70}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\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 (* (* C A) 4.0)) (t_1 (- (* B B) t_0)))
   (if (<= B 6.5e-40)
     (/ (- (sqrt (* 2.0 (* (+ A A) (* -4.0 (* A (* C F))))))) t_1)
     (if (<= B 1e+70)
       (/ (- (sqrt (* 2.0 (* B (* F (- t_0 (* B B))))))) t_1)
       (* -2.0 (* (pow (* F A) 0.5) (/ 1.0 B)))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (C * A) * 4.0;
	double t_1 = (B * B) - t_0;
	double tmp;
	if (B <= 6.5e-40) {
		tmp = -sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / t_1;
	} else if (B <= 1e+70) {
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	} else {
		tmp = -2.0 * (pow((F * A), 0.5) * (1.0 / 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) :: tmp
    t_0 = (c * a) * 4.0d0
    t_1 = (b * b) - t_0
    if (b <= 6.5d-40) then
        tmp = -sqrt((2.0d0 * ((a + a) * ((-4.0d0) * (a * (c * f)))))) / t_1
    else if (b <= 1d+70) then
        tmp = -sqrt((2.0d0 * (b * (f * (t_0 - (b * b)))))) / t_1
    else
        tmp = (-2.0d0) * (((f * a) ** 0.5d0) * (1.0d0 / 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 = (C * A) * 4.0;
	double t_1 = (B * B) - t_0;
	double tmp;
	if (B <= 6.5e-40) {
		tmp = -Math.sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / t_1;
	} else if (B <= 1e+70) {
		tmp = -Math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	} else {
		tmp = -2.0 * (Math.pow((F * A), 0.5) * (1.0 / B));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (C * A) * 4.0
	t_1 = (B * B) - t_0
	tmp = 0
	if B <= 6.5e-40:
		tmp = -math.sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / t_1
	elif B <= 1e+70:
		tmp = -math.sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1
	else:
		tmp = -2.0 * (math.pow((F * A), 0.5) * (1.0 / B))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(C * A) * 4.0)
	t_1 = Float64(Float64(B * B) - t_0)
	tmp = 0.0
	if (B <= 6.5e-40)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(-4.0 * Float64(A * Float64(C * F))))))) / t_1);
	elseif (B <= 1e+70)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(B * Float64(F * Float64(t_0 - Float64(B * B))))))) / t_1);
	else
		tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) * Float64(1.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 = (C * A) * 4.0;
	t_1 = (B * B) - t_0;
	tmp = 0.0;
	if (B <= 6.5e-40)
		tmp = -sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / t_1;
	elseif (B <= 1e+70)
		tmp = -sqrt((2.0 * (B * (F * (t_0 - (B * B)))))) / t_1;
	else
		tmp = -2.0 * (((F * A) ^ 0.5) * (1.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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[B, 6.5e-40], 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], If[LessEqual[B, 1e+70], 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], N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \left(C \cdot A\right) \cdot 4\\
t_1 := B \cdot B - t_0\\
\mathbf{if}\;B \leq 6.5 \cdot 10^{-40}:\\
\;\;\;\;\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{elif}\;B \leq 10^{+70}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(t_0 - B \cdot B\right)\right)\right)}}{t_1}\\

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


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

    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 19.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(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-inv19.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval19.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(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity19.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(A + \color{blue}{A}\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(A + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around 0 13.6%

      \[\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 6.4999999999999999e-40 < B < 1.00000000000000007e70

    1. Initial program 37.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. Simplified37.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. Step-by-step derivation
      1. flip--32.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}{\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. add-sqr-sqrt32.2%

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\color{blue}{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr32.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - \mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}{\left(A + C\right) + \sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Step-by-step derivation
      1. rem-square-sqrt32.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Simplified32.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}{\frac{\left(A + C\right) \cdot \left(A + C\right) - {\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{2}}{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    7. Taylor expanded in A around 0 34.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(-1 \cdot \frac{{B}^{2}}{C + \sqrt{{B}^{2} + {C}^{2}}}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    8. Step-by-step derivation
      1. associate-*r/34.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}{\frac{-1 \cdot {B}^{2}}{C + \sqrt{{B}^{2} + {C}^{2}}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg34.1%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \frac{-B \cdot B}{C + \sqrt{B \cdot B + \color{blue}{C \cdot C}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. 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 \frac{-B \cdot B}{C + \color{blue}{\mathsf{hypot}\left(B, C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    9. 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}{\frac{-B \cdot B}{C + \mathsf{hypot}\left(B, C\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    10. Taylor expanded in B around inf 34.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)} \]
    11. Step-by-step derivation
      1. neg-mul-134.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)} \]
    12. Simplified34.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)} \]

    if 1.00000000000000007e70 < B

    1. Initial program 4.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. Simplified4.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 6.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-inv6.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-eval6.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-identity6.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. Simplified6.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 9.8%

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

        \[\leadsto -2 \cdot \left(\color{blue}{{\left(A \cdot F\right)}^{0.5}} \cdot \frac{1}{B}\right) \]
      2. *-commutative9.9%

        \[\leadsto -2 \cdot \left({\color{blue}{\left(F \cdot A\right)}}^{0.5} \cdot \frac{1}{B}\right) \]
    8. Applied egg-rr9.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6.5 \cdot 10^{-40}:\\ \;\;\;\;\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 - \left(C \cdot A\right) \cdot 4}\\ \mathbf{elif}\;B \leq 10^{+70}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(B \cdot \left(F \cdot \left(\left(C \cdot A\right) \cdot 4 - B \cdot B\right)\right)\right)}}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\right)\\ \end{array} \]

Alternative 11: 22.7% accurate, 5.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 9.4 \cdot 10^{-17}:\\ \;\;\;\;\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 - \left(C \cdot A\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\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
 (if (<= B 9.4e-17)
   (/
    (- (sqrt (* 2.0 (* (+ A A) (* -4.0 (* A (* C F)))))))
    (- (* B B) (* (* C A) 4.0)))
   (* -2.0 (* (pow (* F A) 0.5) (/ 1.0 B)))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 9.4e-17) {
		tmp = -sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / ((B * B) - ((C * A) * 4.0));
	} else {
		tmp = -2.0 * (pow((F * A), 0.5) * (1.0 / 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) :: tmp
    if (b <= 9.4d-17) then
        tmp = -sqrt((2.0d0 * ((a + a) * ((-4.0d0) * (a * (c * f)))))) / ((b * b) - ((c * a) * 4.0d0))
    else
        tmp = (-2.0d0) * (((f * a) ** 0.5d0) * (1.0d0 / 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 tmp;
	if (B <= 9.4e-17) {
		tmp = -Math.sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / ((B * B) - ((C * A) * 4.0));
	} else {
		tmp = -2.0 * (Math.pow((F * A), 0.5) * (1.0 / B));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	tmp = 0
	if B <= 9.4e-17:
		tmp = -math.sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / ((B * B) - ((C * A) * 4.0))
	else:
		tmp = -2.0 * (math.pow((F * A), 0.5) * (1.0 / B))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 9.4e-17)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(-4.0 * Float64(A * Float64(C * F))))))) / Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0)));
	else
		tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) * Float64(1.0 / B)));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (B <= 9.4e-17)
		tmp = -sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))) / ((B * B) - ((C * A) * 4.0));
	else
		tmp = -2.0 * (((F * A) ^ 0.5) * (1.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_] := If[LessEqual[B, 9.4e-17], 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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9.4 \cdot 10^{-17}:\\
\;\;\;\;\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 - \left(C \cdot A\right) \cdot 4}\\

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


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

    1. Initial program 22.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. Simplified22.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 18.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-inv18.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-eval18.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-identity18.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. Simplified18.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. Taylor expanded in B around 0 13.2%

      \[\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.3999999999999999e-17 < B

    1. Initial program 12.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. Simplified12.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 8.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(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-inv8.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval8.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(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity8.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(A + \color{blue}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified8.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(A + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 10.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 9.4 \cdot 10^{-17}:\\ \;\;\;\;\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 - \left(C \cdot A\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\right)\\ \end{array} \]

Alternative 12: 18.6% accurate, 5.1× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 5.9 \cdot 10^{-40}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot A\right)\right)\right)}}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\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
 (if (<= B 5.9e-40)
   (/
    (- (sqrt (* 2.0 (* -8.0 (* (* C F) (* A A))))))
    (- (* B B) (* (* C A) 4.0)))
   (* -2.0 (* (pow (* F A) 0.5) (/ 1.0 B)))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 5.9e-40) {
		tmp = -sqrt((2.0 * (-8.0 * ((C * F) * (A * A))))) / ((B * B) - ((C * A) * 4.0));
	} else {
		tmp = -2.0 * (pow((F * A), 0.5) * (1.0 / 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) :: tmp
    if (b <= 5.9d-40) then
        tmp = -sqrt((2.0d0 * ((-8.0d0) * ((c * f) * (a * a))))) / ((b * b) - ((c * a) * 4.0d0))
    else
        tmp = (-2.0d0) * (((f * a) ** 0.5d0) * (1.0d0 / 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 tmp;
	if (B <= 5.9e-40) {
		tmp = -Math.sqrt((2.0 * (-8.0 * ((C * F) * (A * A))))) / ((B * B) - ((C * A) * 4.0));
	} else {
		tmp = -2.0 * (Math.pow((F * A), 0.5) * (1.0 / B));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	tmp = 0
	if B <= 5.9e-40:
		tmp = -math.sqrt((2.0 * (-8.0 * ((C * F) * (A * A))))) / ((B * B) - ((C * A) * 4.0))
	else:
		tmp = -2.0 * (math.pow((F * A), 0.5) * (1.0 / B))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 5.9e-40)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(Float64(C * F) * Float64(A * A)))))) / Float64(Float64(B * B) - Float64(Float64(C * A) * 4.0)));
	else
		tmp = Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) * Float64(1.0 / B)));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (B <= 5.9e-40)
		tmp = -sqrt((2.0 * (-8.0 * ((C * F) * (A * A))))) / ((B * B) - ((C * A) * 4.0));
	else
		tmp = -2.0 * (((F * A) ^ 0.5) * (1.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_] := If[LessEqual[B, 5.9e-40], 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[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 5.9 \cdot 10^{-40}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot A\right)\right)\right)}}{B \cdot B - \left(C \cdot A\right) \cdot 4}\\

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


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

    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 19.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(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-inv19.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval19.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(A + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity19.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(A + \color{blue}{A}\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(A + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around 0 12.8%

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

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

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

    if 5.89999999999999966e-40 < B

    1. Initial program 13.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. Simplified13.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 7.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-inv7.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-eval7.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-identity7.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. Simplified7.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. Taylor expanded in B around inf 10.2%

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

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

        \[\leadsto -2 \cdot \left({\color{blue}{\left(F \cdot A\right)}}^{0.5} \cdot \frac{1}{B}\right) \]
    8. Applied egg-rr10.5%

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

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

Alternative 13: 9.0% accurate, 5.8× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ -2 \cdot \left({\left(F \cdot A\right)}^{0.5} \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 (* (pow (* F A) 0.5) (/ 1.0 B))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return -2.0 * (pow((F * A), 0.5) * (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) * (((f * a) ** 0.5d0) * (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.pow((F * A), 0.5) * (1.0 / B));
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -2.0 * (math.pow((F * A), 0.5) * (1.0 / B))
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(-2.0 * Float64((Float64(F * A) ^ 0.5) * Float64(1.0 / B)))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -2.0 * (((F * A) ^ 0.5) * (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[Power[N[(F * A), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
-2 \cdot \left({\left(F \cdot A\right)}^{0.5} \cdot \frac{1}{B}\right)
\end{array}
Derivation
  1. Initial program 19.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. Simplified19.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 inf 15.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-inv15.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-eval15.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-identity15.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. Simplified15.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. Taylor expanded in B around inf 4.1%

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

      \[\leadsto -2 \cdot \left(\color{blue}{{\left(A \cdot F\right)}^{0.5}} \cdot \frac{1}{B}\right) \]
    2. *-commutative4.3%

      \[\leadsto -2 \cdot \left({\color{blue}{\left(F \cdot A\right)}}^{0.5} \cdot \frac{1}{B}\right) \]
  8. Applied egg-rr4.3%

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

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

Alternative 14: 9.0% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ -2 \cdot \frac{\sqrt{F \cdot A}}{B} \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 (* F A)) B)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return -2.0 * (sqrt((F * A)) / 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((f * a)) / 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((F * A)) / B);
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -2.0 * (math.sqrt((F * A)) / B)
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(-2.0 * Float64(sqrt(Float64(F * A)) / B))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -2.0 * (sqrt((F * A)) / 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[(F * A), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
-2 \cdot \frac{\sqrt{F \cdot A}}{B}
\end{array}
Derivation
  1. Initial program 19.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. Simplified19.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 inf 15.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-inv15.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-eval15.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-identity15.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. Simplified15.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. Taylor expanded in B around inf 4.1%

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

      \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F}}{B}} \]
    2. *-commutative4.1%

      \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
  8. Applied egg-rr4.1%

    \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{F \cdot A}}{B}} \]
  9. Final simplification4.1%

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

Reproduce

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