ABCF->ab-angle b

Percentage Accurate: 18.6% → 46.0%
Time: 49.6s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 18.6% 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: 46.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(A \cdot C\right)\\ t_1 := \frac{\sqrt{2}}{B}\\ t_2 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 3.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 3.6 \cdot 10^{-55}:\\ \;\;\;\;t_1 \cdot \left(-\sqrt{-0.5 \cdot \frac{{B}^{2} \cdot F}{C}}\right)\\ \mathbf{elif}\;B \leq 7.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;t_1 \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 (* A C))))
        (t_1 (/ (sqrt 2.0) B))
        (t_2 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 3.5e-97)
     (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A A))))) t_0)
     (if (<= B 3.6e-55)
       (* t_1 (- (sqrt (* -0.5 (/ (* (pow B 2.0) F) C)))))
       (if (<= B 7.5e-12)
         (/ (- (sqrt (* 2.0 (* t_2 (* F (+ A A)))))) t_2)
         (* t_1 (- (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 * (A * C));
	double t_1 = sqrt(2.0) / B;
	double t_2 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 3.5e-97) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0;
	} else if (B <= 3.6e-55) {
		tmp = t_1 * -sqrt((-0.5 * ((pow(B, 2.0) * F) / C)));
	} else if (B <= 7.5e-12) {
		tmp = -sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	} else {
		tmp = t_1 * -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 * (A * C));
	double t_1 = Math.sqrt(2.0) / B;
	double t_2 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 3.5e-97) {
		tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0;
	} else if (B <= 3.6e-55) {
		tmp = t_1 * -Math.sqrt((-0.5 * ((Math.pow(B, 2.0) * F) / C)));
	} else if (B <= 7.5e-12) {
		tmp = -Math.sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	} else {
		tmp = t_1 * -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 * (A * C))
	t_1 = math.sqrt(2.0) / B
	t_2 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 3.5e-97:
		tmp = -math.sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0
	elif B <= 3.6e-55:
		tmp = t_1 * -math.sqrt((-0.5 * ((math.pow(B, 2.0) * F) / C)))
	elif B <= 7.5e-12:
		tmp = -math.sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2
	else:
		tmp = t_1 * -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(A * C)))
	t_1 = Float64(sqrt(2.0) / B)
	t_2 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 3.5e-97)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + A))))) / t_0);
	elseif (B <= 3.6e-55)
		tmp = Float64(t_1 * Float64(-sqrt(Float64(-0.5 * Float64(Float64((B ^ 2.0) * F) / C)))));
	elseif (B <= 7.5e-12)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(F * Float64(A + A)))))) / t_2);
	else
		tmp = Float64(t_1 * 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 * (A * C));
	t_1 = sqrt(2.0) / B;
	t_2 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 3.5e-97)
		tmp = -sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0;
	elseif (B <= 3.6e-55)
		tmp = t_1 * -sqrt((-0.5 * (((B ^ 2.0) * F) / C)));
	elseif (B <= 7.5e-12)
		tmp = -sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	else
		tmp = t_1 * -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[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.5e-97], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 3.6e-55], N[(t$95$1 * (-N[Sqrt[N[(-0.5 * N[(N[(N[Power[B, 2.0], $MachinePrecision] * F), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B, 7.5e-12], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], N[(t$95$1 * (-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(A \cdot C\right)\\
t_1 := \frac{\sqrt{2}}{B}\\
t_2 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 3.5 \cdot 10^{-97}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + A\right)\right)}}{t_0}\\

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

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

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


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

    1. Initial program 16.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. Simplified16.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 17.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-inv17.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-eval17.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-identity17.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. Simplified17.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)} \]

    if 3.50000000000000019e-97 < B < 3.6000000000000001e-55

    1. Initial program 16.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. Simplified16.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 A around 0 3.5%

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

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

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

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

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

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

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

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

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

    if 3.6000000000000001e-55 < B < 7.5e-12

    1. Initial program 31.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. Simplified31.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 45.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-inv45.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-eval45.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-identity45.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. Simplified45.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. Step-by-step derivation
      1. distribute-frac-neg45.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(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
      2. associate-*l*45.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-inv45.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-eval45.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-inv45.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-eval45.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-rr45.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 7.5e-12 < B

    1. Initial program 18.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. Simplified18.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 25.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right)}\right) \]
    5. Simplified46.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 4 regimes into one program.
  4. Final simplification24.9%

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

Alternative 2: 47.9% accurate, 1.5× speedup?

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

\mathbf{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) < 5.0000000000000002e-23

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, C - A\right)\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Taylor expanded in B around 0 24.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(A + -0.5 \cdot \frac{{B}^{2}}{C - A}\right)}\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. unpow224.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(A + -0.5 \cdot \frac{\color{blue}{B \cdot B}}{C - A}\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Simplified24.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(A + -0.5 \cdot \frac{B \cdot B}{C - A}\right)}\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 5.0000000000000002e-23 < (pow.f64 B 2)

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right)}\right) \]
    5. Simplified22.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 simplification23.6%

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

Alternative 3: 45.8% 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(A \cdot C\right)\\ t_1 := \frac{\sqrt{2}}{B}\\ t_2 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 7.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{-55}:\\ \;\;\;\;t_1 \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{B \cdot B}{C}\right)}\right)\\ \mathbf{elif}\;B \leq 7 \cdot 10^{-12}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_2 \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;t_1 \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 (* A C))))
        (t_1 (/ (sqrt 2.0) B))
        (t_2 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 7.5e-97)
     (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A A))))) t_0)
     (if (<= B 4.8e-55)
       (* t_1 (- (sqrt (* F (* -0.5 (/ (* B B) C))))))
       (if (<= B 7e-12)
         (/ (- (sqrt (* 2.0 (* t_2 (* F (+ A A)))))) t_2)
         (* t_1 (- (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 * (A * C));
	double t_1 = sqrt(2.0) / B;
	double t_2 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 7.5e-97) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0;
	} else if (B <= 4.8e-55) {
		tmp = t_1 * -sqrt((F * (-0.5 * ((B * B) / C))));
	} else if (B <= 7e-12) {
		tmp = -sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	} else {
		tmp = t_1 * -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 * (A * C));
	double t_1 = Math.sqrt(2.0) / B;
	double t_2 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 7.5e-97) {
		tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0;
	} else if (B <= 4.8e-55) {
		tmp = t_1 * -Math.sqrt((F * (-0.5 * ((B * B) / C))));
	} else if (B <= 7e-12) {
		tmp = -Math.sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	} else {
		tmp = t_1 * -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 * (A * C))
	t_1 = math.sqrt(2.0) / B
	t_2 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 7.5e-97:
		tmp = -math.sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0
	elif B <= 4.8e-55:
		tmp = t_1 * -math.sqrt((F * (-0.5 * ((B * B) / C))))
	elif B <= 7e-12:
		tmp = -math.sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2
	else:
		tmp = t_1 * -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(A * C)))
	t_1 = Float64(sqrt(2.0) / B)
	t_2 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 7.5e-97)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + A))))) / t_0);
	elseif (B <= 4.8e-55)
		tmp = Float64(t_1 * Float64(-sqrt(Float64(F * Float64(-0.5 * Float64(Float64(B * B) / C))))));
	elseif (B <= 7e-12)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_2 * Float64(F * Float64(A + A)))))) / t_2);
	else
		tmp = Float64(t_1 * 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 * (A * C));
	t_1 = sqrt(2.0) / B;
	t_2 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 7.5e-97)
		tmp = -sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0;
	elseif (B <= 4.8e-55)
		tmp = t_1 * -sqrt((F * (-0.5 * ((B * B) / C))));
	elseif (B <= 7e-12)
		tmp = -sqrt((2.0 * (t_2 * (F * (A + A))))) / t_2;
	else
		tmp = t_1 * -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[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 7.5e-97], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 4.8e-55], N[(t$95$1 * (-N[Sqrt[N[(F * N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B, 7e-12], N[((-N[Sqrt[N[(2.0 * N[(t$95$2 * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], N[(t$95$1 * (-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(A \cdot C\right)\\
t_1 := \frac{\sqrt{2}}{B}\\
t_2 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 7.5 \cdot 10^{-97}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + A\right)\right)}}{t_0}\\

\mathbf{elif}\;B \leq 4.8 \cdot 10^{-55}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{B \cdot B}{C}\right)}\right)\\

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

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


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

    1. Initial program 16.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. Simplified16.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 17.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-inv17.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-eval17.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-identity17.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. Simplified17.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)} \]

    if 7.5e-97 < B < 4.79999999999999983e-55

    1. Initial program 16.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. Simplified16.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 A around 0 3.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{\color{blue}{B \cdot B}}{C}\right)}\right) \]
    8. Simplified59.0%

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

    if 4.79999999999999983e-55 < B < 7.0000000000000001e-12

    1. Initial program 31.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. Simplified31.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 45.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-inv45.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-eval45.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-identity45.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. Simplified45.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. Step-by-step derivation
      1. distribute-frac-neg45.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(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
      2. associate-*l*45.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-inv45.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-eval45.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-inv45.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-eval45.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-rr45.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 7.0000000000000001e-12 < B

    1. Initial program 18.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. Simplified18.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 25.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right)}\right) \]
    5. Simplified46.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 4 regimes into one program.
  4. Final simplification24.8%

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

Alternative 4: 42.3% accurate, 2.7× speedup?

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

\mathbf{elif}\;B \leq 3.8 \cdot 10^{-55}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;B \leq 4.8 \cdot 10^{+122}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 16.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. Simplified16.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 17.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-inv17.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-eval17.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-identity17.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. Simplified17.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)} \]

    if 5.49999999999999948e-97 < B < 3.7999999999999997e-55 or 4.80000000000000009e26 < B < 4.8000000000000004e122

    1. Initial program 25.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. Simplified25.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 A around 0 26.9%

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999997e-55 < B < 4.80000000000000009e26

    1. Initial program 35.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified35.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. Step-by-step derivation
      1. add-cbrt-cube34.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(\left(A + C\right) - \color{blue}{\sqrt[3]{\left(\sqrt{B \cdot B + {\left(A - C\right)}^{2}} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right) \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. add-sqr-sqrt34.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(\left(A + C\right) - \sqrt[3]{\color{blue}{\left(B \cdot B + {\left(A - C\right)}^{2}\right)} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. fma-def34.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(\left(A + C\right) - \sqrt[3]{\color{blue}{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)} \cdot \sqrt{B \cdot B + {\left(A - C\right)}^{2}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. fma-def34.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(\left(A + C\right) - \sqrt[3]{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Applied egg-rr34.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(\left(A + C\right) - \color{blue}{\sqrt[3]{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right) \cdot \sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Step-by-step derivation
      1. rem-square-sqrt34.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(\left(A + C\right) - \sqrt[3]{\color{blue}{\left(\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)}\right)} \cdot \sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. unpow334.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(\left(A + C\right) - \sqrt[3]{\color{blue}{{\left(\sqrt{\mathsf{fma}\left(B, B, {\left(A - C\right)}^{2}\right)}\right)}^{3}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. fma-udef34.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(\left(A + C\right) - \sqrt[3]{{\left(\sqrt{\color{blue}{B \cdot B + {\left(A - C\right)}^{2}}}\right)}^{3}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. unpow234.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(\left(A + C\right) - \sqrt[3]{{\left(\sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}\right)}^{3}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. hypot-def34.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(\left(A + C\right) - \sqrt[3]{{\color{blue}{\left(\mathsf{hypot}\left(B, A - C\right)\right)}}^{3}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Simplified34.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(\left(A + C\right) - \color{blue}{\sqrt[3]{{\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{3}}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    7. Step-by-step derivation
      1. distribute-frac-neg34.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[3]{{\left(\mathsf{hypot}\left(B, A - C\right)\right)}^{3}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    8. Applied egg-rr44.7%

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

    if 4.8000000000000004e122 < B

    1. Initial program 7.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. Simplified7.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 A around 0 26.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 5.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 3.8 \cdot 10^{-55}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{B \cdot B}{C}\right)}\right)\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{+26}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{B \cdot B}{C}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - B\right)}\right)\\ \end{array} \]

Alternative 5: 42.3% accurate, 2.7× speedup?

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

\mathbf{elif}\;B \leq 3.6 \cdot 10^{-55}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;B \leq 4.5 \cdot 10^{+122}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 16.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. Simplified16.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 17.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-inv17.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-eval17.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-identity17.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. Simplified17.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)} \]

    if 6.6000000000000002e-97 < B < 3.6000000000000001e-55 or 8.19999999999999967e26 < B < 4.49999999999999997e122

    1. Initial program 25.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. Simplified25.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 A around 0 26.9%

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

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

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

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

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

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

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

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

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

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

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

    if 3.6000000000000001e-55 < B < 8.19999999999999967e26

    1. Initial program 35.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified35.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 28.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(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. unpow228.2%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A - \sqrt{A \cdot A + \color{blue}{B \cdot B}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. hypot-def36.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. Simplified36.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 4.49999999999999997e122 < B

    1. Initial program 7.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. Simplified7.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 A around 0 26.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6.6 \cdot 10^{-97}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 3.6 \cdot 10^{-55}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{B \cdot B}{C}\right)}\right)\\ \mathbf{elif}\;B \leq 8.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot \left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 4.5 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{B \cdot B}{C}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - B\right)}\right)\\ \end{array} \]

Alternative 6: 40.8% accurate, 2.9× speedup?

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

\mathbf{elif}\;B \leq 5 \cdot 10^{-55}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;B \leq 4.5 \cdot 10^{+122}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 2.4999999999999998e-97 or 5.0000000000000002e-55 < B < 1.48e26

    1. Initial program 17.4%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around inf 18.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(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.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval18.1%

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

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

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

    if 2.4999999999999998e-97 < B < 5.0000000000000002e-55 or 1.48e26 < B < 4.49999999999999997e122

    1. Initial program 25.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. Simplified25.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 A around 0 26.9%

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

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

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

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

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

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

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

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

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

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

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

    if 4.49999999999999997e122 < B

    1. Initial program 7.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. Simplified7.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 A around 0 26.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 5 \cdot 10^{-55}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{B \cdot B}{C}\right)}\right)\\ \mathbf{elif}\;B \leq 1.48 \cdot 10^{+26}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 4.5 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-0.5 \cdot \frac{B \cdot B}{C}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - B\right)}\right)\\ \end{array} \]

Alternative 7: 42.9% accurate, 2.9× speedup?

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

\mathbf{elif}\;B \leq 1.05 \cdot 10^{+52}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{-0.5 \cdot \frac{B \cdot B}{\frac{C}{F}}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 3.0999999999999998e25

    1. Initial program 17.4%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around inf 18.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-inv18.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-eval18.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-identity18.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. Simplified18.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)} \]

    if 3.0999999999999998e25 < B < 1.05e52

    1. Initial program 0.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified0.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 A around 0 2.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\color{blue}{-0.5 \cdot \frac{{B}^{2} \cdot F}{C}}}\right) \]
    7. Step-by-step derivation
      1. associate-/l*100.0%

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{-0.5 \cdot \frac{\color{blue}{B \cdot B}}{\frac{C}{F}}}\right) \]
    8. Simplified100.0%

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

    if 1.05e52 < B

    1. Initial program 16.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.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 A around 0 30.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 43.1% 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(A \cdot C\right)\\ \mathbf{if}\;B \leq 7 \cdot 10^{-12}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + A\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 (* A C)))))
   (if (<= B 7e-12)
     (/ (- (sqrt (* 2.0 (* (* F t_0) (+ 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 * (A * C));
	double tmp;
	if (B <= 7e-12) {
		tmp = -sqrt((2.0 * ((F * t_0) * (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 * (a * c))
    if (b <= 7d-12) then
        tmp = -sqrt((2.0d0 * ((f * t_0) * (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 * (A * C));
	double tmp;
	if (B <= 7e-12) {
		tmp = -Math.sqrt((2.0 * ((F * t_0) * (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 * (A * C))
	tmp = 0
	if B <= 7e-12:
		tmp = -math.sqrt((2.0 * ((F * t_0) * (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(A * C)))
	tmp = 0.0
	if (B <= 7e-12)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * 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 * (A * C));
	tmp = 0.0;
	if (B <= 7e-12)
		tmp = -sqrt((2.0 * ((F * t_0) * (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[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 7e-12], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + A), $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(A \cdot C\right)\\
\mathbf{if}\;B \leq 7 \cdot 10^{-12}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + A\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.0000000000000001e-12

    1. Initial program 16.8%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around inf 17.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(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.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval17.9%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified17.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(A + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 7.0000000000000001e-12 < B

    1. Initial program 18.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. Simplified18.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 A around 0 31.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 29.4% accurate, 4.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 3.4999999999999998e99

    1. Initial program 17.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. Simplified17.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 17.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-inv17.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-eval17.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-identity17.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. Simplified17.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-neg17.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*16.7%

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

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

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

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

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

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

    if 3.4999999999999998e99 < B

    1. Initial program 12.3%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around inf 0.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-inv0.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-eval0.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-identity0.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. Simplified0.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. Taylor expanded in B around inf 9.2%

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{A \cdot F}}{B}} \]
    9. Step-by-step derivation
      1. pow1/29.3%

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

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

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

Alternative 10: 29.4% accurate, 4.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 2.19999999999999978e99

    1. Initial program 17.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. Simplified17.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 17.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-inv17.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-eval17.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-identity17.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. Simplified17.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)} \]

    if 2.19999999999999978e99 < B

    1. Initial program 12.3%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Taylor expanded in C around inf 0.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-inv0.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-eval0.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-identity0.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. Simplified0.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. Taylor expanded in B around inf 9.2%

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{A \cdot F}}{B}} \]
    9. Step-by-step derivation
      1. pow1/29.3%

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

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

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

Alternative 11: 23.5% accurate, 5.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 3.5e16

    1. Initial program 16.6%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified16.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(\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.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(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.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval18.1%

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

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

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

      \[\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 3.5e16 < B

    1. Initial program 19.1%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified19.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 2.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(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-inv2.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval2.9%

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

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

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

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

        \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
    8. Simplified7.0%

      \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{A \cdot F}}{B}} \]
    9. Step-by-step derivation
      1. pow1/27.3%

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

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

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

Alternative 12: 8.8% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ -2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{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 (/ (pow (* A F) 0.5) B)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return -2.0 * (pow((A * F), 0.5) / 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) * (((a * f) ** 0.5d0) / 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((A * F), 0.5) / B);
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -2.0 * (math.pow((A * F), 0.5) / B)
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -2.0 * (((A * F) ^ 0.5) / 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[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}
\end{array}
Derivation
  1. Initial program 17.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. Simplified17.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 15.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(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.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    2. metadata-eval15.2%

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

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

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

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

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

    \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{A \cdot F}}{B}} \]
  9. Step-by-step derivation
    1. pow1/23.0%

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

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

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

Alternative 13: 8.7% accurate, 5.9× speedup?

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

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

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

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

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

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

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

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

Reproduce

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