ABCF->ab-angle a

Percentage Accurate: 19.3% → 45.3%
Time: 29.1s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 19.3% 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: 45.3% accurate, 1.0× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\ t_2 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;A \leq -2.25 \cdot 10^{+23}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_2}\\ \mathbf{elif}\;A \leq 1.4 \cdot 10^{-304}:\\ \;\;\;\;\frac{\left(\sqrt{2} \cdot \left(\sqrt{F} \cdot \sqrt{t_0}\right)\right) \cdot \left(-t_1\right)}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot t_0\right)}}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{t_1}}\\ \end{array} \end{array} \]
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))))
        (t_1 (sqrt (+ C (+ A (hypot B (- A C))))))
        (t_2 (- (* B B) (* 4.0 (* A C)))))
   (if (<= A -2.25e+23)
     (/
      (- (sqrt (* (* 2.0 (* t_2 F)) (fma 2.0 C (* -0.5 (/ (* B B) A))))))
      t_2)
     (if (<= A 1.4e-304)
       (/ (* (* (sqrt 2.0) (* (sqrt F) (sqrt t_0))) (- t_1)) t_2)
       (/ (- (sqrt (* 2.0 (* F t_0)))) (/ (fma B B (* -4.0 (* A C))) t_1))))))
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double t_1 = sqrt((C + (A + hypot(B, (A - C)))));
	double t_2 = (B * B) - (4.0 * (A * C));
	double tmp;
	if (A <= -2.25e+23) {
		tmp = -sqrt(((2.0 * (t_2 * F)) * fma(2.0, C, (-0.5 * ((B * B) / A))))) / t_2;
	} else if (A <= 1.4e-304) {
		tmp = ((sqrt(2.0) * (sqrt(F) * sqrt(t_0))) * -t_1) / t_2;
	} else {
		tmp = -sqrt((2.0 * (F * t_0))) / (fma(B, B, (-4.0 * (A * C))) / t_1);
	}
	return tmp;
}
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C)))))
	t_2 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if (A <= -2.25e+23)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A)))))) / t_2);
	elseif (A <= 1.4e-304)
		tmp = Float64(Float64(Float64(sqrt(2.0) * Float64(sqrt(F) * sqrt(t_0))) * Float64(-t_1)) / t_2);
	else
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * t_0)))) / Float64(fma(B, B, Float64(-4.0 * Float64(A * C))) / t_1));
	end
	return tmp
end
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]}, Block[{t$95$1 = N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -2.25e+23], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[A, 1.4e-304], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-t$95$1)), $MachinePrecision] / t$95$2), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}\\
t_2 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;A \leq -2.25 \cdot 10^{+23}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_2}\\

\mathbf{elif}\;A \leq 1.4 \cdot 10^{-304}:\\
\;\;\;\;\frac{\left(\sqrt{2} \cdot \left(\sqrt{F} \cdot \sqrt{t_0}\right)\right) \cdot \left(-t_1\right)}{t_2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -2.2499999999999999e23

    1. Initial program 1.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. Step-by-step derivation
      1. associate-*l*1.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow21.6%

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

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

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

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

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

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

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

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

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

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

    if -2.2499999999999999e23 < A < 1.3999999999999999e-304

    1. Initial program 34.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. Step-by-step derivation
      1. associate-*l*34.3%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow234.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999e-304 < A

    1. Initial program 29.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. Step-by-step derivation
      1. associate-*l*29.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow229.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 42.4% accurate, 1.2× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;A \leq -1.55 \cdot 10^{+23}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \frac{-\sqrt{2 \cdot \left(F \cdot t_0\right)}}{t_0}\\ \end{array} \end{array} \]
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)))) (t_1 (- (* B B) (* 4.0 (* A C)))))
   (if (<= A -1.55e+23)
     (/
      (- (sqrt (* (* 2.0 (* t_1 F)) (fma 2.0 C (* -0.5 (/ (* B B) A))))))
      t_1)
     (*
      (sqrt (+ C (+ A (hypot B (- A C)))))
      (/ (- (sqrt (* 2.0 (* F t_0)))) t_0)))))
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double t_1 = (B * B) - (4.0 * (A * C));
	double tmp;
	if (A <= -1.55e+23) {
		tmp = -sqrt(((2.0 * (t_1 * F)) * fma(2.0, C, (-0.5 * ((B * B) / A))))) / t_1;
	} else {
		tmp = sqrt((C + (A + hypot(B, (A - C))))) * (-sqrt((2.0 * (F * t_0))) / t_0);
	}
	return tmp;
}
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if (A <= -1.55e+23)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A)))))) / t_1);
	else
		tmp = Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(Float64(-sqrt(Float64(2.0 * Float64(F * t_0)))) / t_0));
	end
	return tmp
end
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]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.55e+23], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;A \leq -1.55 \cdot 10^{+23}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -1.54999999999999985e23

    1. Initial program 1.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. Step-by-step derivation
      1. associate-*l*1.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow21.6%

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999985e23 < A

    1. Initial program 31.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. Step-by-step derivation
      1. associate-*l*31.3%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow231.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 42.4% accurate, 1.2× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;A \leq -1.38 \cdot 10^{+23}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}{\frac{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}}}\\ \end{array} \end{array} \]
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 (<= A -1.38e+23)
     (/
      (- (sqrt (* (* 2.0 (* t_0 F)) (fma 2.0 C (* -0.5 (/ (* B B) A))))))
      t_0)
     (/
      (- (sqrt (* 2.0 (* F (fma B B (* A (* C -4.0)))))))
      (/ (fma B B (* -4.0 (* A C))) (sqrt (+ C (+ A (hypot B (- A C))))))))))
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 (A <= -1.38e+23) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * fma(2.0, C, (-0.5 * ((B * B) / A))))) / t_0;
	} else {
		tmp = -sqrt((2.0 * (F * fma(B, B, (A * (C * -4.0)))))) / (fma(B, B, (-4.0 * (A * C))) / sqrt((C + (A + hypot(B, (A - C))))));
	}
	return tmp;
}
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 (A <= -1.38e+23)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A)))))) / t_0);
	else
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * fma(B, B, Float64(A * Float64(C * -4.0))))))) / Float64(fma(B, B, Float64(-4.0 * Float64(A * C))) / sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C)))))));
	end
	return tmp
end
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[A, -1.38e+23], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(2.0 * N[(F * N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;A \leq -1.38 \cdot 10^{+23}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -1.38e23

    1. Initial program 1.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. Step-by-step derivation
      1. associate-*l*1.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow21.6%

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

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

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

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

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

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

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

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

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

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

    if -1.38e23 < A

    1. Initial program 31.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. Step-by-step derivation
      1. associate-*l*31.3%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow231.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 42.4% accurate, 1.9× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;A \leq -1.6 \cdot 10^{+23}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)}\right)}{t_0}\\ \end{array} \end{array} \]
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 (<= A -1.6e+23)
     (/
      (- (sqrt (* (* 2.0 (* t_0 F)) (fma 2.0 C (* -0.5 (/ (* B B) A))))))
      t_0)
     (/
      (*
       (sqrt (+ C (+ A (hypot B (- A C)))))
       (- (sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))))
      t_0))))
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 (A <= -1.6e+23) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * fma(2.0, C, (-0.5 * ((B * B) / A))))) / t_0;
	} else {
		tmp = (sqrt((C + (A + hypot(B, (A - C))))) * -sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C))))))) / t_0;
	}
	return tmp;
}
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 (A <= -1.6e+23)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A)))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))))) / t_0);
	end
	return tmp
end
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[A, -1.6e+23], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;A \leq -1.6 \cdot 10^{+23}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -1.6e23

    1. Initial program 1.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. Step-by-step derivation
      1. associate-*l*1.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow21.6%

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

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

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

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

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

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

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

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

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

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

    if -1.6e23 < A

    1. Initial program 31.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. Step-by-step derivation
      1. associate-*l*31.3%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow231.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 36.7% accurate, 2.7× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_1 := 2 \cdot \left(t_0 \cdot F\right)\\ \mathbf{if}\;A \leq -1.55 \cdot 10^{+23}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}}{t_0}\\ \end{array} \end{array} \]
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 (* 2.0 (* t_0 F))))
   (if (<= A -1.55e+23)
     (/ (- (sqrt (* t_1 (fma 2.0 C (* -0.5 (/ (* B B) A)))))) t_0)
     (/ (- (sqrt (* t_1 (+ C (hypot C B))))) t_0))))
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 = 2.0 * (t_0 * F);
	double tmp;
	if (A <= -1.55e+23) {
		tmp = -sqrt((t_1 * fma(2.0, C, (-0.5 * ((B * B) / A))))) / t_0;
	} else {
		tmp = -sqrt((t_1 * (C + hypot(C, B)))) / t_0;
	}
	return tmp;
}
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(2.0 * Float64(t_0 * F))
	tmp = 0.0
	if (A <= -1.55e+23)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * fma(2.0, C, Float64(-0.5 * Float64(Float64(B * B) / A)))))) / t_0);
	else
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(C + hypot(C, B))))) / t_0);
	end
	return tmp
end
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[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -1.55e+23], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[((-N[Sqrt[N[(t$95$1 * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := 2 \cdot \left(t_0 \cdot F\right)\\
\mathbf{if}\;A \leq -1.55 \cdot 10^{+23}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B \cdot B}{A}\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}}{t_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -1.54999999999999985e23

    1. Initial program 1.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. Step-by-step derivation
      1. associate-*l*1.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow21.6%

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999985e23 < A

    1. Initial program 31.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. Step-by-step derivation
      1. associate-*l*31.3%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow231.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 36.6% accurate, 2.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -2.2499999999999999e23

    1. Initial program 1.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. Step-by-step derivation
      1. associate-*l*1.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow21.6%

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

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

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

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

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

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

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

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

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

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

    if -2.2499999999999999e23 < A

    1. Initial program 31.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. Step-by-step derivation
      1. associate-*l*31.3%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow231.3%

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

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

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

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

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

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

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

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

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

Alternative 7: 36.1% accurate, 2.7× speedup?

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

\mathbf{elif}\;C \leq 1.45 \cdot 10^{+87}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -5.79999999999999961e-180

    1. Initial program 18.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*18.4%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow218.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.79999999999999961e-180 < C < 1.4499999999999999e87

    1. Initial program 35.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*35.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4499999999999999e87 < C

    1. Initial program 6.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. Step-by-step derivation
      1. associate-*l*6.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow26.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 31.8% accurate, 2.7× speedup?

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

\mathbf{elif}\;C \leq 3.5 \cdot 10^{-172}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + \left(B + C\right)\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -1.70000000000000002e-184

    1. Initial program 18.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*18.4%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow218.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.70000000000000002e-184 < C < 3.50000000000000029e-172

    1. Initial program 38.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*38.7%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow238.7%

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

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

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

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

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

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

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

    if 3.50000000000000029e-172 < C

    1. Initial program 21.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*21.0%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow221.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 28.6% accurate, 2.8× speedup?

\[\begin{array}{l} [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{4 \cdot \left(C \cdot \left(F \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{t_0}\\ \mathbf{if}\;C \leq -1.7 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 3.5 \cdot 10^{-171}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(A + \left(B + C\right)\right)}}{t_0}\\ \mathbf{elif}\;C \leq 6.6 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_0}\\ \end{array} \end{array} \]
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 (* 4.0 (* C (* F (+ (* B B) (* C (* A -4.0)))))))) t_0)))
   (if (<= C -1.7e-182)
     t_1
     (if (<= C 3.5e-171)
       (/ (- (sqrt (* (* 2.0 (* t_0 F)) (+ A (+ B C))))) t_0)
       (if (<= C 6.6e+87)
         t_1
         (/
          (* (sqrt (* 2.0 (* F (* A (* C -4.0))))) (- (sqrt (* 2.0 C))))
          t_0))))))
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((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	double tmp;
	if (C <= -1.7e-182) {
		tmp = t_1;
	} else if (C <= 3.5e-171) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	} else if (C <= 6.6e+87) {
		tmp = t_1;
	} else {
		tmp = (sqrt((2.0 * (F * (A * (C * -4.0))))) * -sqrt((2.0 * C))) / t_0;
	}
	return tmp;
}
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((4.0d0 * (c * (f * ((b * b) + (c * (a * (-4.0d0)))))))) / t_0
    if (c <= (-1.7d-182)) then
        tmp = t_1
    else if (c <= 3.5d-171) then
        tmp = -sqrt(((2.0d0 * (t_0 * f)) * (a + (b + c)))) / t_0
    else if (c <= 6.6d+87) then
        tmp = t_1
    else
        tmp = (sqrt((2.0d0 * (f * (a * (c * (-4.0d0)))))) * -sqrt((2.0d0 * c))) / t_0
    end if
    code = tmp
end function
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((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	double tmp;
	if (C <= -1.7e-182) {
		tmp = t_1;
	} else if (C <= 3.5e-171) {
		tmp = -Math.sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	} else if (C <= 6.6e+87) {
		tmp = t_1;
	} else {
		tmp = (Math.sqrt((2.0 * (F * (A * (C * -4.0))))) * -Math.sqrt((2.0 * C))) / t_0;
	}
	return tmp;
}
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) - (4.0 * (A * C))
	t_1 = -math.sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0
	tmp = 0
	if C <= -1.7e-182:
		tmp = t_1
	elif C <= 3.5e-171:
		tmp = -math.sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0
	elif C <= 6.6e+87:
		tmp = t_1
	else:
		tmp = (math.sqrt((2.0 * (F * (A * (C * -4.0))))) * -math.sqrt((2.0 * C))) / t_0
	return tmp
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(4.0 * Float64(C * Float64(F * Float64(Float64(B * B) + Float64(C * Float64(A * -4.0)))))))) / t_0)
	tmp = 0.0
	if (C <= -1.7e-182)
		tmp = t_1;
	elseif (C <= 3.5e-171)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(A + Float64(B + C))))) / t_0);
	elseif (C <= 6.6e+87)
		tmp = t_1;
	else
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(A * Float64(C * -4.0))))) * Float64(-sqrt(Float64(2.0 * C)))) / t_0);
	end
	return tmp
end
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((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	tmp = 0.0;
	if (C <= -1.7e-182)
		tmp = t_1;
	elseif (C <= 3.5e-171)
		tmp = -sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	elseif (C <= 6.6e+87)
		tmp = t_1;
	else
		tmp = (sqrt((2.0 * (F * (A * (C * -4.0))))) * -sqrt((2.0 * C))) / t_0;
	end
	tmp_2 = tmp;
end
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[(4.0 * N[(C * N[(F * N[(N[(B * B), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, If[LessEqual[C, -1.7e-182], t$95$1, If[LessEqual[C, 3.5e-171], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[C, 6.6e+87], t$95$1, N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
[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{4 \cdot \left(C \cdot \left(F \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{t_0}\\
\mathbf{if}\;C \leq -1.7 \cdot 10^{-182}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;C \leq 3.5 \cdot 10^{-171}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(A + \left(B + C\right)\right)}}{t_0}\\

\mathbf{elif}\;C \leq 6.6 \cdot 10^{+87}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -1.69999999999999995e-182 or 3.49999999999999994e-171 < C < 6.6000000000000003e87

    1. Initial program 23.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. Step-by-step derivation
      1. associate-*l*23.8%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow223.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999995e-182 < C < 3.49999999999999994e-171

    1. Initial program 38.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*38.7%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow238.7%

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

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

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

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

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

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

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

    if 6.6000000000000003e87 < C

    1. Initial program 6.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. Step-by-step derivation
      1. associate-*l*6.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow26.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 30.5% accurate, 3.0× speedup?

\[\begin{array}{l} [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 13600:\\ \;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.42 \cdot 10^{+107}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(A + \left(B + C\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\left(\sqrt{F} \cdot \sqrt{C}\right) \cdot \frac{1}{B}\right)\\ \end{array} \end{array} \]
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 13600.0)
     (/ (- (sqrt (* 4.0 (* C (* F (+ (* B B) (* C (* A -4.0)))))))) t_0)
     (if (<= B 1.42e+107)
       (/ (- (sqrt (* (* 2.0 (* t_0 F)) (+ A (+ B C))))) t_0)
       (* -2.0 (* (* (sqrt F) (sqrt C)) (/ 1.0 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 <= 13600.0) {
		tmp = -sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	} else if (B <= 1.42e+107) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	} else {
		tmp = -2.0 * ((sqrt(F) * sqrt(C)) * (1.0 / B));
	}
	return tmp;
}
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 <= 13600.0d0) then
        tmp = -sqrt((4.0d0 * (c * (f * ((b * b) + (c * (a * (-4.0d0)))))))) / t_0
    else if (b <= 1.42d+107) then
        tmp = -sqrt(((2.0d0 * (t_0 * f)) * (a + (b + c)))) / t_0
    else
        tmp = (-2.0d0) * ((sqrt(f) * sqrt(c)) * (1.0d0 / b))
    end if
    code = tmp
end function
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 <= 13600.0) {
		tmp = -Math.sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	} else if (B <= 1.42e+107) {
		tmp = -Math.sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	} else {
		tmp = -2.0 * ((Math.sqrt(F) * Math.sqrt(C)) * (1.0 / B));
	}
	return tmp;
}
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) - (4.0 * (A * C))
	tmp = 0
	if B <= 13600.0:
		tmp = -math.sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0
	elif B <= 1.42e+107:
		tmp = -math.sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0
	else:
		tmp = -2.0 * ((math.sqrt(F) * math.sqrt(C)) * (1.0 / B))
	return tmp
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 <= 13600.0)
		tmp = Float64(Float64(-sqrt(Float64(4.0 * Float64(C * Float64(F * Float64(Float64(B * B) + Float64(C * Float64(A * -4.0)))))))) / t_0);
	elseif (B <= 1.42e+107)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(A + Float64(B + C))))) / t_0);
	else
		tmp = Float64(-2.0 * Float64(Float64(sqrt(F) * sqrt(C)) * Float64(1.0 / B)));
	end
	return tmp
end
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 <= 13600.0)
		tmp = -sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	elseif (B <= 1.42e+107)
		tmp = -sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	else
		tmp = -2.0 * ((sqrt(F) * sqrt(C)) * (1.0 / B));
	end
	tmp_2 = tmp;
end
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, 13600.0], N[((-N[Sqrt[N[(4.0 * N[(C * N[(F * N[(N[(B * B), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.42e+107], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(-2.0 * N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[C], $MachinePrecision]), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[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 13600:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{t_0}\\

\mathbf{elif}\;B \leq 1.42 \cdot 10^{+107}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(A + \left(B + C\right)\right)}}{t_0}\\

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


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

    1. Initial program 24.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*24.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 13600 < B < 1.42000000000000006e107

    1. Initial program 57.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*57.5%

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

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

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

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

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

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

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

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

    if 1.42000000000000006e107 < B

    1. Initial program 0.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*0.9%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow20.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 29.7% accurate, 4.7× speedup?

\[\begin{array}{l} [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.1:\\ \;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 3.9 \cdot 10^{+108}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(A + \left(B + C\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\ \end{array} \end{array} \]
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.1)
     (/ (- (sqrt (* 4.0 (* C (* F (+ (* B B) (* C (* A -4.0)))))))) t_0)
     (if (<= B 3.9e+108)
       (/ (- (sqrt (* (* 2.0 (* t_0 F)) (+ A (+ B C))))) t_0)
       (* -2.0 (/ (sqrt (* C F)) 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.1) {
		tmp = -sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	} else if (B <= 3.9e+108) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	} else {
		tmp = -2.0 * (sqrt((C * F)) / B);
	}
	return tmp;
}
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.1d0) then
        tmp = -sqrt((4.0d0 * (c * (f * ((b * b) + (c * (a * (-4.0d0)))))))) / t_0
    else if (b <= 3.9d+108) then
        tmp = -sqrt(((2.0d0 * (t_0 * f)) * (a + (b + c)))) / t_0
    else
        tmp = (-2.0d0) * (sqrt((c * f)) / b)
    end if
    code = tmp
end function
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.1) {
		tmp = -Math.sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	} else if (B <= 3.9e+108) {
		tmp = -Math.sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	} else {
		tmp = -2.0 * (Math.sqrt((C * F)) / B);
	}
	return tmp;
}
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = (B * B) - (4.0 * (A * C))
	tmp = 0
	if B <= 3.1:
		tmp = -math.sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0
	elif B <= 3.9e+108:
		tmp = -math.sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0
	else:
		tmp = -2.0 * (math.sqrt((C * F)) / B)
	return tmp
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.1)
		tmp = Float64(Float64(-sqrt(Float64(4.0 * Float64(C * Float64(F * Float64(Float64(B * B) + Float64(C * Float64(A * -4.0)))))))) / t_0);
	elseif (B <= 3.9e+108)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(A + Float64(B + C))))) / t_0);
	else
		tmp = Float64(-2.0 * Float64(sqrt(Float64(C * F)) / B));
	end
	return tmp
end
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.1)
		tmp = -sqrt((4.0 * (C * (F * ((B * B) + (C * (A * -4.0))))))) / t_0;
	elseif (B <= 3.9e+108)
		tmp = -sqrt(((2.0 * (t_0 * F)) * (A + (B + C)))) / t_0;
	else
		tmp = -2.0 * (sqrt((C * F)) / B);
	end
	tmp_2 = tmp;
end
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.1], N[((-N[Sqrt[N[(4.0 * N[(C * N[(F * N[(N[(B * B), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 3.9e+108], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(B + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[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.1:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)\right)\right)}}{t_0}\\

\mathbf{elif}\;B \leq 3.9 \cdot 10^{+108}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(A + \left(B + C\right)\right)}}{t_0}\\

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


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

    1. Initial program 24.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*24.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.10000000000000009 < B < 3.89999999999999985e108

    1. Initial program 57.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*57.5%

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

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

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

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

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

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

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

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

    if 3.89999999999999985e108 < B

    1. Initial program 0.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*0.9%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow20.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{C \cdot F} \cdot 1}{B}} \]
      2. *-commutative5.9%

        \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot C}} \cdot 1}{B} \]
      3. *-rgt-identity5.9%

        \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{F \cdot C}}}{B} \]
    8. Simplified5.9%

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

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

Alternative 12: 28.8% accurate, 5.0× speedup?

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

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


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

    1. Initial program 27.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. Step-by-step derivation
      1. associate-*l*27.6%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow227.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1e52 < B

    1. Initial program 12.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*12.9%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow212.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{C \cdot F} \cdot 1}{B}} \]
      2. *-commutative7.3%

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

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

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

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

Alternative 13: 18.9% accurate, 5.2× speedup?

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

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


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

    1. Initial program 26.2%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*26.2%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow226.2%

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

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

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

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

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

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

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

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

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

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

    if 1.4500000000000001e34 < B

    1. Initial program 19.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*19.9%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow219.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{C \cdot F} \cdot 1}{B}} \]
      2. *-commutative6.7%

        \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot C}} \cdot 1}{B} \]
      3. *-rgt-identity6.7%

        \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{F \cdot C}}}{B} \]
    8. Simplified6.7%

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

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

Alternative 14: 9.0% accurate, 5.7× speedup?

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

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


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

    1. Initial program 23.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*23.9%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow223.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{B} \cdot \sqrt{C \cdot F} \]
      2. rem-square-sqrt5.9%

        \[\leadsto \frac{\color{blue}{2}}{B} \cdot \sqrt{C \cdot F} \]
    9. Simplified5.9%

      \[\leadsto \color{blue}{\frac{2}{B} \cdot \sqrt{C \cdot F}} \]

    if 6.1999999999999997e-305 < B

    1. Initial program 25.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. Step-by-step derivation
      1. associate-*l*25.4%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow225.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left({\color{blue}{\left(F \cdot C\right)}}^{0.5} \cdot \frac{1}{B}\right) \]
    7. Applied egg-rr5.6%

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

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

Alternative 15: 9.0% accurate, 5.8× speedup?

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

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


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

    1. Initial program 24.1%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. associate-*l*24.1%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow224.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{B} \cdot \sqrt{C \cdot F} \]
      2. rem-square-sqrt5.9%

        \[\leadsto \frac{\color{blue}{2}}{B} \cdot \sqrt{C \cdot F} \]
    9. Simplified5.9%

      \[\leadsto \color{blue}{\frac{2}{B} \cdot \sqrt{C \cdot F}} \]

    if -4.999999999999985e-310 < B

    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. Step-by-step derivation
      1. associate-*l*25.3%

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow225.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{C \cdot F} \cdot 1}{B}} \]
      2. *-commutative5.5%

        \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot C}} \cdot 1}{B} \]
      3. *-rgt-identity5.5%

        \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{F \cdot C}}}{B} \]
    8. Simplified5.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{C \cdot F} \cdot \frac{2}{B}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\ \end{array} \]

Alternative 16: 5.5% accurate, 5.9× speedup?

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

    \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
  2. Step-by-step derivation
    1. associate-*l*24.8%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow224.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{C \cdot F} \cdot 1}{B}} \]
    2. *-commutative3.7%

      \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot C}} \cdot 1}{B} \]
    3. *-rgt-identity3.7%

      \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{F \cdot C}}}{B} \]
  8. Simplified3.7%

    \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{F \cdot C}}{B}} \]
  9. Final simplification3.7%

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

Alternative 17: 3.2% accurate, 6.0× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \frac{-\sqrt{C \cdot F}}{B} \end{array} \]
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F) :precision binary64 (/ (- (sqrt (* C F))) B))
assert(A < C);
double code(double A, double B, double C, double F) {
	return -sqrt((C * F)) / B;
}
NOTE: A and C should be sorted in increasing order before calling this function.
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -sqrt((c * f)) / b
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
	return -Math.sqrt((C * F)) / B;
}
[A, C] = sort([A, C])
def code(A, B, C, F):
	return -math.sqrt((C * F)) / B
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(Float64(-sqrt(Float64(C * F))) / B)
end
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = -sqrt((C * F)) / B;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{-\sqrt{C \cdot F}}{B}
\end{array}
Derivation
  1. Initial program 24.8%

    \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
  2. Step-by-step derivation
    1. associate-*l*24.8%

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\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. unpow224.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{C \cdot F} \cdot \frac{1}{B}} \]
    2. associate-*r/2.3%

      \[\leadsto -\color{blue}{\frac{\sqrt{C \cdot F} \cdot 1}{B}} \]
    3. *-commutative2.3%

      \[\leadsto -\frac{\sqrt{\color{blue}{F \cdot C}} \cdot 1}{B} \]
    4. *-rgt-identity2.3%

      \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot C}}}{B} \]
    5. distribute-neg-frac2.3%

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

    \[\leadsto \color{blue}{\frac{-\sqrt{F \cdot C}}{B}} \]
  9. Final simplification2.3%

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

Reproduce

?
herbie shell --seed 2023196 
(FPCore (A B C F)
  :name "ABCF->ab-angle a"
  :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))))