ABCF->ab-angle a

Percentage Accurate: 19.1% → 51.7%
Time: 48.6s
Alternatives: 21
Speedup: 3.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 51.7% accurate, 1.5× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := 2 \cdot \left(t_0 \cdot F\right)\\ \mathbf{if}\;B \leq 1.55 \cdot 10^{-260}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + C\right)}}{t_0}\\ \mathbf{elif}\;B \leq 1.1 \cdot 10^{-221}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + A\right)}}{t_0}\\ \mathbf{elif}\;B \leq 2.2 \cdot 10^{-185}:\\ \;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\ \mathbf{elif}\;B \leq 1.9 \cdot 10^{+97}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* A (* C -4.0)))) (t_1 (* 2.0 (* t_0 F))))
   (if (<= B 1.55e-260)
     (/ (- (sqrt (* t_1 (+ C C)))) t_0)
     (if (<= B 1.1e-221)
       (/ (- (sqrt (* t_1 (+ A A)))) t_0)
       (if (<= B 2.2e-185)
         (*
          -0.5
          (* (sqrt 2.0) (sqrt (/ F (/ A (fma 0.5 (* (/ B A) (/ B A)) -2.0))))))
         (if (<= B 1.9e+97)
           (/
            (*
             (sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
             (- (sqrt (+ A (+ C (hypot B (- A C)))))))
            (- (* B B) (* (* A C) 4.0)))
           (* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F))))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double t_1 = 2.0 * (t_0 * F);
	double tmp;
	if (B <= 1.55e-260) {
		tmp = -sqrt((t_1 * (C + C))) / t_0;
	} else if (B <= 1.1e-221) {
		tmp = -sqrt((t_1 * (A + A))) / t_0;
	} else if (B <= 2.2e-185) {
		tmp = -0.5 * (sqrt(2.0) * sqrt((F / (A / fma(0.5, ((B / A) * (B / A)), -2.0)))));
	} else if (B <= 1.9e+97) {
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(2.0 * Float64(t_0 * F))
	tmp = 0.0
	if (B <= 1.55e-260)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(C + C)))) / t_0);
	elseif (B <= 1.1e-221)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + A)))) / t_0);
	elseif (B <= 2.2e-185)
		tmp = Float64(-0.5 * Float64(sqrt(2.0) * sqrt(Float64(F / Float64(A / fma(0.5, Float64(Float64(B / A) * Float64(B / A)), -2.0))))));
	elseif (B <= 1.9e+97)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F))));
	end
	return tmp
end
NOTE: B should be positive 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[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.55e-260], N[((-N[Sqrt[N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 1.1e-221], N[((-N[Sqrt[N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 2.2e-185], N[(-0.5 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / N[(A / N[(0.5 * N[(N[(B / A), $MachinePrecision] * N[(B / A), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.9e+97], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := 2 \cdot \left(t_0 \cdot F\right)\\
\mathbf{if}\;B \leq 1.55 \cdot 10^{-260}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + C\right)}}{t_0}\\

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

\mathbf{elif}\;B \leq 2.2 \cdot 10^{-185}:\\
\;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.54999999999999991e-260

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

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

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

    if 1.54999999999999991e-260 < B < 1.10000000000000001e-221

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

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

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

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

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

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

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

    if 1.10000000000000001e-221 < B < 2.2e-185

    1. Initial program 1.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. Simplified1.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)}} \]
    3. 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 \left(\left(A + C\right) + \color{blue}{\left(C + \left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + \left(-0.5 \cdot \frac{{B}^{2}}{A} + -1 \cdot A\right)\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. associate-+r+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 \left(\left(A + C\right) + \left(C + \color{blue}{\left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) + -1 \cdot A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg3.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) + \left(C + \left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) + \color{blue}{\left(-A\right)}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unsub-neg3.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) + \left(C + \color{blue}{\left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) - A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. distribute-lft-out3.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) + \left(C + \left(\color{blue}{-0.5 \cdot \left(\frac{C \cdot {B}^{2}}{{A}^{2}} + \frac{{B}^{2}}{A}\right)} - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. *-commutative3.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) + \left(C + \left(-0.5 \cdot \left(\frac{\color{blue}{{B}^{2} \cdot C}}{{A}^{2}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{{B}^{2} \cdot C}{\color{blue}{A \cdot A}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. times-frac3.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) + \left(C + \left(-0.5 \cdot \left(\color{blue}{\frac{{B}^{2}}{A} \cdot \frac{C}{A}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      8. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{\color{blue}{B \cdot B}}{A} \cdot \frac{C}{A} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      9. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{B \cdot B}{A} \cdot \frac{C}{A} + \frac{\color{blue}{B \cdot B}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified3.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) + \color{blue}{\left(C + \left(-0.5 \cdot \left(\frac{B \cdot B}{A} \cdot \frac{C}{A} + \frac{B \cdot B}{A}\right) - A\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in C around -inf 30.1%

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\frac{F \cdot \left(0.5 \cdot \frac{{B}^{2}}{{A}^{2}} - 2\right)}{A}}\right)} \]
      2. associate-/l*30.1%

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

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

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

        \[\leadsto -0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B \cdot B}{\color{blue}{A \cdot A}}, -2\right)}}}\right) \]
      6. times-frac30.1%

        \[\leadsto -0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \color{blue}{\frac{B}{A} \cdot \frac{B}{A}}, -2\right)}}}\right) \]
      7. metadata-eval30.1%

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

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

    if 2.2e-185 < B < 1.90000000000000018e97

    1. Initial program 40.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. Simplified40.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)}} \]
    3. Step-by-step derivation
      1. sqrt-prod46.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. *-commutative46.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-inv46.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-eval46.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. associate-+l+46.8%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\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)} \]
      6. unpow246.8%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\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)} \]
      7. hypot-udef52.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\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)} \]
    4. Applied egg-rr52.2%

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

    if 1.90000000000000018e97 < B

    1. Initial program 4.5%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\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)}} \]
    3. Taylor expanded in C around 0 14.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 53.5% accurate, 1.0× speedup?

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

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


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

    1. Initial program 29.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. Simplified37.1%

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

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

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

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

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

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

    if 3.99999999999999978e194 < (pow.f64 B 2)

    1. Initial program 3.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. Simplified3.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)}} \]
    3. Taylor expanded in C around 0 8.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 51.5% accurate, 1.5× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := 2 \cdot \left(t_0 \cdot F\right)\\ \mathbf{if}\;B \leq 1.5 \cdot 10^{-264}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + C\right)}}{t_0}\\ \mathbf{elif}\;B \leq 2.2 \cdot 10^{-222}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + A\right)}}{t_0}\\ \mathbf{elif}\;B \leq 5.3 \cdot 10^{-182}:\\ \;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{+131}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(C, B\right)}\right)\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* A (* C -4.0)))) (t_1 (* 2.0 (* t_0 F))))
   (if (<= B 1.5e-264)
     (/ (- (sqrt (* t_1 (+ C C)))) t_0)
     (if (<= B 2.2e-222)
       (/ (- (sqrt (* t_1 (+ A A)))) t_0)
       (if (<= B 5.3e-182)
         (*
          -0.5
          (* (sqrt 2.0) (sqrt (/ F (/ A (fma 0.5 (* (/ B A) (/ B A)) -2.0))))))
         (if (<= B 2.3e+131)
           (/
            (*
             (sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
             (- (sqrt (+ A (+ C (hypot B (- A C)))))))
            (- (* B B) (* (* A C) 4.0)))
           (* (/ (sqrt 2.0) B) (* (sqrt F) (- (sqrt (+ C (hypot C B))))))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double t_1 = 2.0 * (t_0 * F);
	double tmp;
	if (B <= 1.5e-264) {
		tmp = -sqrt((t_1 * (C + C))) / t_0;
	} else if (B <= 2.2e-222) {
		tmp = -sqrt((t_1 * (A + A))) / t_0;
	} else if (B <= 5.3e-182) {
		tmp = -0.5 * (sqrt(2.0) * sqrt((F / (A / fma(0.5, ((B / A) * (B / A)), -2.0)))));
	} else if (B <= 2.3e+131) {
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt(F) * -sqrt((C + hypot(C, B))));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(2.0 * Float64(t_0 * F))
	tmp = 0.0
	if (B <= 1.5e-264)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(C + C)))) / t_0);
	elseif (B <= 2.2e-222)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + A)))) / t_0);
	elseif (B <= 5.3e-182)
		tmp = Float64(-0.5 * Float64(sqrt(2.0) * sqrt(Float64(F / Float64(A / fma(0.5, Float64(Float64(B / A) * Float64(B / A)), -2.0))))));
	elseif (B <= 2.3e+131)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(C, B))))));
	end
	return tmp
end
NOTE: B should be positive 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[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.5e-264], N[((-N[Sqrt[N[(t$95$1 * N[(C + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 2.2e-222], N[((-N[Sqrt[N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 5.3e-182], N[(-0.5 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / N[(A / N[(0.5 * N[(N[(B / A), $MachinePrecision] * N[(B / A), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.3e+131], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := 2 \cdot \left(t_0 \cdot F\right)\\
\mathbf{if}\;B \leq 1.5 \cdot 10^{-264}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(C + C\right)}}{t_0}\\

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

\mathbf{elif}\;B \leq 5.3 \cdot 10^{-182}:\\
\;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.5e-264

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

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

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

    if 1.5e-264 < B < 2.2e-222

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

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

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

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

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

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

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

    if 2.2e-222 < B < 5.30000000000000005e-182

    1. Initial program 1.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. Simplified1.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)}} \]
    3. 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 \left(\left(A + C\right) + \color{blue}{\left(C + \left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + \left(-0.5 \cdot \frac{{B}^{2}}{A} + -1 \cdot A\right)\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. associate-+r+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 \left(\left(A + C\right) + \left(C + \color{blue}{\left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) + -1 \cdot A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg3.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) + \left(C + \left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) + \color{blue}{\left(-A\right)}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unsub-neg3.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) + \left(C + \color{blue}{\left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) - A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. distribute-lft-out3.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) + \left(C + \left(\color{blue}{-0.5 \cdot \left(\frac{C \cdot {B}^{2}}{{A}^{2}} + \frac{{B}^{2}}{A}\right)} - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. *-commutative3.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) + \left(C + \left(-0.5 \cdot \left(\frac{\color{blue}{{B}^{2} \cdot C}}{{A}^{2}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{{B}^{2} \cdot C}{\color{blue}{A \cdot A}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. times-frac3.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) + \left(C + \left(-0.5 \cdot \left(\color{blue}{\frac{{B}^{2}}{A} \cdot \frac{C}{A}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      8. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{\color{blue}{B \cdot B}}{A} \cdot \frac{C}{A} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      9. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{B \cdot B}{A} \cdot \frac{C}{A} + \frac{\color{blue}{B \cdot B}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified3.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) + \color{blue}{\left(C + \left(-0.5 \cdot \left(\frac{B \cdot B}{A} \cdot \frac{C}{A} + \frac{B \cdot B}{A}\right) - A\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in C around -inf 30.1%

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\frac{F \cdot \left(0.5 \cdot \frac{{B}^{2}}{{A}^{2}} - 2\right)}{A}}\right)} \]
      2. associate-/l*30.1%

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

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

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

        \[\leadsto -0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B \cdot B}{\color{blue}{A \cdot A}}, -2\right)}}}\right) \]
      6. times-frac30.1%

        \[\leadsto -0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \color{blue}{\frac{B}{A} \cdot \frac{B}{A}}, -2\right)}}}\right) \]
      7. metadata-eval30.1%

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

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

    if 5.30000000000000005e-182 < B < 2.29999999999999992e131

    1. Initial program 38.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. Simplified38.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)}} \]
    3. Step-by-step derivation
      1. sqrt-prod45.7%

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

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

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

        \[\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. associate-+l+45.7%

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\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)} \]
      7. hypot-udef53.6%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\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)} \]
    4. Applied egg-rr53.6%

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

    if 2.29999999999999992e131 < B

    1. Initial program 2.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. Simplified2.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)}} \]
    3. Taylor expanded in A around 0 7.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 42.8% accurate, 1.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)}\\ t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ t_2 := 2 \cdot \left(t_1 \cdot F\right)\\ \mathbf{if}\;B \leq 4.4 \cdot 10^{-262}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(C + C\right)}}{t_1}\\ \mathbf{elif}\;B \leq 1.05 \cdot 10^{-221}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(A + A\right)}}{t_1}\\ \mathbf{elif}\;B \leq 3.65 \cdot 10^{-183}:\\ \;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\ \mathbf{elif}\;B \leq 5.9 \cdot 10^{+99}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;B \leq 7.5 \cdot 10^{+270}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot t_0\\ \mathbf{elif}\;B \leq 2.8 \cdot 10^{+302}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-t_0\right)}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (sqrt (* F (+ A (hypot A B)))))
        (t_1 (fma B B (* A (* C -4.0))))
        (t_2 (* 2.0 (* t_1 F))))
   (if (<= B 4.4e-262)
     (/ (- (sqrt (* t_2 (+ C C)))) t_1)
     (if (<= B 1.05e-221)
       (/ (- (sqrt (* t_2 (+ A A)))) t_1)
       (if (<= B 3.65e-183)
         (*
          -0.5
          (* (sqrt 2.0) (sqrt (/ F (/ A (fma 0.5 (* (/ B A) (/ B A)) -2.0))))))
         (if (<= B 5.9e+99)
           (/
            (*
             (sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
             (- (sqrt (+ A (+ C (hypot B (- A C)))))))
            (- (* B B) (* (* A C) 4.0)))
           (if (<= B 7.5e+270)
             (* (/ (- (sqrt 2.0)) B) t_0)
             (if (<= B 2.8e+302)
               (* (sqrt 2.0) (- (sqrt (/ F B))))
               (/ (* (sqrt 2.0) (- t_0)) B)))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = sqrt((F * (A + hypot(A, B))));
	double t_1 = fma(B, B, (A * (C * -4.0)));
	double t_2 = 2.0 * (t_1 * F);
	double tmp;
	if (B <= 4.4e-262) {
		tmp = -sqrt((t_2 * (C + C))) / t_1;
	} else if (B <= 1.05e-221) {
		tmp = -sqrt((t_2 * (A + A))) / t_1;
	} else if (B <= 3.65e-183) {
		tmp = -0.5 * (sqrt(2.0) * sqrt((F / (A / fma(0.5, ((B / A) * (B / A)), -2.0)))));
	} else if (B <= 5.9e+99) {
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - ((A * C) * 4.0));
	} else if (B <= 7.5e+270) {
		tmp = (-sqrt(2.0) / B) * t_0;
	} else if (B <= 2.8e+302) {
		tmp = sqrt(2.0) * -sqrt((F / B));
	} else {
		tmp = (sqrt(2.0) * -t_0) / B;
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = sqrt(Float64(F * Float64(A + hypot(A, B))))
	t_1 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_2 = Float64(2.0 * Float64(t_1 * F))
	tmp = 0.0
	if (B <= 4.4e-262)
		tmp = Float64(Float64(-sqrt(Float64(t_2 * Float64(C + C)))) / t_1);
	elseif (B <= 1.05e-221)
		tmp = Float64(Float64(-sqrt(Float64(t_2 * Float64(A + A)))) / t_1);
	elseif (B <= 3.65e-183)
		tmp = Float64(-0.5 * Float64(sqrt(2.0) * sqrt(Float64(F / Float64(A / fma(0.5, Float64(Float64(B / A) * Float64(B / A)), -2.0))))));
	elseif (B <= 5.9e+99)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(Float64(A * C) * 4.0)));
	elseif (B <= 7.5e+270)
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B) * t_0);
	elseif (B <= 2.8e+302)
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	else
		tmp = Float64(Float64(sqrt(2.0) * Float64(-t_0)) / B);
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(F * N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 4.4e-262], N[((-N[Sqrt[N[(t$95$2 * N[(C + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 1.05e-221], N[((-N[Sqrt[N[(t$95$2 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[B, 3.65e-183], N[(-0.5 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / N[(A / N[(0.5 * N[(N[(B / A), $MachinePrecision] * N[(B / A), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 5.9e+99], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 7.5e+270], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[B, 2.8e+302], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-t$95$0)), $MachinePrecision] / B), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)}\\
t_1 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := 2 \cdot \left(t_1 \cdot F\right)\\
\mathbf{if}\;B \leq 4.4 \cdot 10^{-262}:\\
\;\;\;\;\frac{-\sqrt{t_2 \cdot \left(C + C\right)}}{t_1}\\

\mathbf{elif}\;B \leq 1.05 \cdot 10^{-221}:\\
\;\;\;\;\frac{-\sqrt{t_2 \cdot \left(A + A\right)}}{t_1}\\

\mathbf{elif}\;B \leq 3.65 \cdot 10^{-183}:\\
\;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\

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

\mathbf{elif}\;B \leq 7.5 \cdot 10^{+270}:\\
\;\;\;\;\frac{-\sqrt{2}}{B} \cdot t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if B < 4.39999999999999977e-262

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

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

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

    if 4.39999999999999977e-262 < B < 1.05e-221

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

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

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

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

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

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

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

    if 1.05e-221 < B < 3.64999999999999999e-183

    1. Initial program 1.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. Simplified1.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)}} \]
    3. 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 \left(\left(A + C\right) + \color{blue}{\left(C + \left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + \left(-0.5 \cdot \frac{{B}^{2}}{A} + -1 \cdot A\right)\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. associate-+r+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 \left(\left(A + C\right) + \left(C + \color{blue}{\left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) + -1 \cdot A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg3.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) + \left(C + \left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) + \color{blue}{\left(-A\right)}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unsub-neg3.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) + \left(C + \color{blue}{\left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) - A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. distribute-lft-out3.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) + \left(C + \left(\color{blue}{-0.5 \cdot \left(\frac{C \cdot {B}^{2}}{{A}^{2}} + \frac{{B}^{2}}{A}\right)} - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. *-commutative3.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) + \left(C + \left(-0.5 \cdot \left(\frac{\color{blue}{{B}^{2} \cdot C}}{{A}^{2}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{{B}^{2} \cdot C}{\color{blue}{A \cdot A}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. times-frac3.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) + \left(C + \left(-0.5 \cdot \left(\color{blue}{\frac{{B}^{2}}{A} \cdot \frac{C}{A}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      8. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{\color{blue}{B \cdot B}}{A} \cdot \frac{C}{A} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      9. unpow23.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) + \left(C + \left(-0.5 \cdot \left(\frac{B \cdot B}{A} \cdot \frac{C}{A} + \frac{\color{blue}{B \cdot B}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified3.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) + \color{blue}{\left(C + \left(-0.5 \cdot \left(\frac{B \cdot B}{A} \cdot \frac{C}{A} + \frac{B \cdot B}{A}\right) - A\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in C around -inf 30.1%

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\frac{F \cdot \left(0.5 \cdot \frac{{B}^{2}}{{A}^{2}} - 2\right)}{A}}\right)} \]
      2. associate-/l*30.1%

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

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

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

        \[\leadsto -0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B \cdot B}{\color{blue}{A \cdot A}}, -2\right)}}}\right) \]
      6. times-frac30.1%

        \[\leadsto -0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \color{blue}{\frac{B}{A} \cdot \frac{B}{A}}, -2\right)}}}\right) \]
      7. metadata-eval30.1%

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

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

    if 3.64999999999999999e-183 < B < 5.8999999999999999e99

    1. Initial program 40.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. Simplified40.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)}} \]
    3. Step-by-step derivation
      1. sqrt-prod46.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. *-commutative46.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-inv46.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-eval46.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. associate-+l+46.8%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\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)} \]
      6. unpow246.8%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\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)} \]
      7. hypot-udef52.2%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\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)} \]
    4. Applied egg-rr52.2%

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

    if 5.8999999999999999e99 < B < 7.5000000000000001e270

    1. Initial program 6.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. Simplified6.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)}} \]
    3. Taylor expanded in C around 0 19.3%

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

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

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

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

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

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

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

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

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

    if 7.5000000000000001e270 < B < 2.7999999999999999e302

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\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)}} \]
    3. Taylor expanded in C around 0 2.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.7999999999999999e302 < B

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\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)}} \]
    3. Taylor expanded in C around 0 2.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 4.4 \cdot 10^{-262}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right)\right) \cdot \left(C + C\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 1.05 \cdot 10^{-221}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right)\right) \cdot \left(A + A\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 3.65 \cdot 10^{-183}:\\ \;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\ \mathbf{elif}\;B \leq 5.9 \cdot 10^{+99}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - \left(A \cdot C\right) \cdot 4}\\ \mathbf{elif}\;B \leq 7.5 \cdot 10^{+270}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)}\\ \mathbf{elif}\;B \leq 2.8 \cdot 10^{+302}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)}\right)}{B}\\ \end{array} \]

Alternative 5: 42.8% accurate, 1.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+25}:\\ \;\;\;\;\sqrt{2} \cdot \left(\sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-1}{B}\right)\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+185} \lor \neg \left(F \leq 3.6 \cdot 10^{+197}\right):\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= F -5e-310)
     (/ (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_0))))) t_0)
     (if (<= F 1.8e+25)
       (* (sqrt 2.0) (* (sqrt (* F (+ A (hypot A B)))) (/ -1.0 B)))
       (if (or (<= F 5.8e+185) (not (<= F 3.6e+197)))
         (* (sqrt 2.0) (- (sqrt (/ F B))))
         (*
          -0.5
          (*
           (sqrt 2.0)
           (sqrt (/ F (/ A (fma 0.5 (* (/ B A) (/ B A)) -2.0)))))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= -5e-310) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 1.8e+25) {
		tmp = sqrt(2.0) * (sqrt((F * (A + hypot(A, B)))) * (-1.0 / B));
	} else if ((F <= 5.8e+185) || !(F <= 3.6e+197)) {
		tmp = sqrt(2.0) * -sqrt((F / B));
	} else {
		tmp = -0.5 * (sqrt(2.0) * sqrt((F / (A / fma(0.5, ((B / A) * (B / A)), -2.0)))));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0);
	elseif (F <= 1.8e+25)
		tmp = Float64(sqrt(2.0) * Float64(sqrt(Float64(F * Float64(A + hypot(A, B)))) * Float64(-1.0 / B)));
	elseif ((F <= 5.8e+185) || !(F <= 3.6e+197))
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	else
		tmp = Float64(-0.5 * Float64(sqrt(2.0) * sqrt(Float64(F / Float64(A / fma(0.5, Float64(Float64(B / A) * Float64(B / A)), -2.0))))));
	end
	return tmp
end
NOTE: B should be positive 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[F, -5e-310], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 1.8e+25], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(F * N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 5.8e+185], N[Not[LessEqual[F, 3.6e+197]], $MachinePrecision]], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(-0.5 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / N[(A / N[(0.5 * N[(N[(B / A), $MachinePrecision] * N[(B / A), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\

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

\mathbf{elif}\;F \leq 5.8 \cdot 10^{+185} \lor \neg \left(F \leq 3.6 \cdot 10^{+197}\right):\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\

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


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

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg26.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. Applied egg-rr54.5%

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

    if -4.999999999999985e-310 < F < 1.80000000000000008e25

    1. Initial program 23.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. Simplified23.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)}} \]
    3. Taylor expanded in C around 0 12.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.80000000000000008e25 < F < 5.79999999999999976e185 or 3.59999999999999982e197 < F

    1. Initial program 14.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. Simplified14.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)}} \]
    3. Taylor expanded in C around 0 11.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.79999999999999976e185 < F < 3.59999999999999982e197

    1. Initial program 19.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. Simplified19.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)}} \]
    3. Taylor expanded in A around -inf 18.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) + \color{blue}{\left(C + \left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + \left(-0.5 \cdot \frac{{B}^{2}}{A} + -1 \cdot A\right)\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. associate-+r+18.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) + \left(C + \color{blue}{\left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) + -1 \cdot A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg18.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) + \left(C + \left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) + \color{blue}{\left(-A\right)}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. unsub-neg18.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) + \left(C + \color{blue}{\left(\left(-0.5 \cdot \frac{C \cdot {B}^{2}}{{A}^{2}} + -0.5 \cdot \frac{{B}^{2}}{A}\right) - A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. distribute-lft-out18.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) + \left(C + \left(\color{blue}{-0.5 \cdot \left(\frac{C \cdot {B}^{2}}{{A}^{2}} + \frac{{B}^{2}}{A}\right)} - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. *-commutative18.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) + \left(C + \left(-0.5 \cdot \left(\frac{\color{blue}{{B}^{2} \cdot C}}{{A}^{2}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow218.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) + \left(C + \left(-0.5 \cdot \left(\frac{{B}^{2} \cdot C}{\color{blue}{A \cdot A}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. times-frac18.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) + \left(C + \left(-0.5 \cdot \left(\color{blue}{\frac{{B}^{2}}{A} \cdot \frac{C}{A}} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      8. unpow218.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) + \left(C + \left(-0.5 \cdot \left(\frac{\color{blue}{B \cdot B}}{A} \cdot \frac{C}{A} + \frac{{B}^{2}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      9. unpow218.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) + \left(C + \left(-0.5 \cdot \left(\frac{B \cdot B}{A} \cdot \frac{C}{A} + \frac{\color{blue}{B \cdot B}}{A}\right) - A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified18.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) + \color{blue}{\left(C + \left(-0.5 \cdot \left(\frac{B \cdot B}{A} \cdot \frac{C}{A} + \frac{B \cdot B}{A}\right) - A\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in C around -inf 82.7%

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{\frac{F \cdot \left(0.5 \cdot \frac{{B}^{2}}{{A}^{2}} - 2\right)}{A}}\right)} \]
      2. associate-/l*82.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \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)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+25}:\\ \;\;\;\;\sqrt{2} \cdot \left(\sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-1}{B}\right)\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+185} \lor \neg \left(F \leq 3.6 \cdot 10^{+197}\right):\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{\frac{A}{\mathsf{fma}\left(0.5, \frac{B}{A} \cdot \frac{B}{A}, -2\right)}}}\right)\\ \end{array} \]

Alternative 6: 43.1% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{+23}:\\ \;\;\;\;\sqrt{2} \cdot \left(\sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)} \cdot \frac{-1}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= F -5e-310)
     (/ (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_0))))) t_0)
     (if (<= F 1.42e+23)
       (* (sqrt 2.0) (* (sqrt (* F (+ A (hypot A B)))) (/ -1.0 B)))
       (* (sqrt 2.0) (- (sqrt (/ F B))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= -5e-310) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 1.42e+23) {
		tmp = sqrt(2.0) * (sqrt((F * (A + hypot(A, B)))) * (-1.0 / B));
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= -5e-310) {
		tmp = -Math.sqrt((2.0 * ((A + (C + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 1.42e+23) {
		tmp = Math.sqrt(2.0) * (Math.sqrt((F * (A + Math.hypot(A, B)))) * (-1.0 / B));
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if F <= -5e-310:
		tmp = -math.sqrt((2.0 * ((A + (C + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0
	elif F <= 1.42e+23:
		tmp = math.sqrt(2.0) * (math.sqrt((F * (A + math.hypot(A, B)))) * (-1.0 / B))
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0);
	elseif (F <= 1.42e+23)
		tmp = Float64(sqrt(2.0) * Float64(sqrt(Float64(F * Float64(A + hypot(A, B)))) * Float64(-1.0 / B)));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (F <= -5e-310)
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	elseif (F <= 1.42e+23)
		tmp = sqrt(2.0) * (sqrt((F * (A + hypot(A, B)))) * (-1.0 / B));
	else
		tmp = sqrt(2.0) * -sqrt((F / B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive 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[F, -5e-310], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 1.42e+23], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(F * N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\

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

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


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

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg26.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. Applied egg-rr54.5%

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

    if -4.999999999999985e-310 < F < 1.42000000000000004e23

    1. Initial program 23.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. Simplified23.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)}} \]
    3. Taylor expanded in C around 0 12.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.42000000000000004e23 < F

    1. Initial program 14.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. Simplified14.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)}} \]
    3. Taylor expanded in C around 0 11.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 42.9% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= F -5e-310)
     (/ (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_0))))) t_0)
     (if (<= F 4.8e-5)
       (* (/ (sqrt 2.0) B) (- (sqrt (* F (+ C (hypot C B))))))
       (* (sqrt 2.0) (- (sqrt (/ F B))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= -5e-310) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 4.8e-5) {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(C, B))));
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= -5e-310) {
		tmp = -Math.sqrt((2.0 * ((A + (C + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 4.8e-5) {
		tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((F * (C + Math.hypot(C, B))));
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if F <= -5e-310:
		tmp = -math.sqrt((2.0 * ((A + (C + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0
	elif F <= 4.8e-5:
		tmp = (math.sqrt(2.0) / B) * -math.sqrt((F * (C + math.hypot(C, B))))
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0);
	elseif (F <= 4.8e-5)
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(C + hypot(C, B))))));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (F <= -5e-310)
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	elseif (F <= 4.8e-5)
		tmp = (sqrt(2.0) / B) * -sqrt((F * (C + hypot(C, B))));
	else
		tmp = sqrt(2.0) * -sqrt((F / B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive 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[F, -5e-310], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 4.8e-5], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\

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

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


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

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg26.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. Applied egg-rr54.5%

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

    if -4.999999999999985e-310 < F < 4.8000000000000001e-5

    1. Initial program 24.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. Simplified24.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)}} \]
    3. Taylor expanded in A around 0 14.0%

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

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

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

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

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

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

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

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

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

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

    if 4.8000000000000001e-5 < F

    1. Initial program 14.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. Simplified14.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)}} \]
    3. Taylor expanded in C around 0 11.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 43.1% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;F \leq 3 \cdot 10^{-309}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{+23}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= F 3e-309)
     (/ (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_0))))) t_0)
     (if (<= F 3.5e+23)
       (* (/ (- (sqrt 2.0)) B) (sqrt (* F (+ A (hypot A B)))))
       (* (sqrt 2.0) (- (sqrt (/ F B))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= 3e-309) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 3.5e+23) {
		tmp = (-sqrt(2.0) / B) * sqrt((F * (A + hypot(A, B))));
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= 3e-309) {
		tmp = -Math.sqrt((2.0 * ((A + (C + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 3.5e+23) {
		tmp = (-Math.sqrt(2.0) / B) * Math.sqrt((F * (A + Math.hypot(A, B))));
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if F <= 3e-309:
		tmp = -math.sqrt((2.0 * ((A + (C + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0
	elif F <= 3.5e+23:
		tmp = (-math.sqrt(2.0) / B) * math.sqrt((F * (A + math.hypot(A, B))))
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (F <= 3e-309)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0);
	elseif (F <= 3.5e+23)
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B) * sqrt(Float64(F * Float64(A + hypot(A, B)))));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (F <= 3e-309)
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	elseif (F <= 3.5e+23)
		tmp = (-sqrt(2.0) / B) * sqrt((F * (A + hypot(A, B))));
	else
		tmp = sqrt(2.0) * -sqrt((F / B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive 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[F, 3e-309], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 3.5e+23], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision] * N[Sqrt[N[(F * N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq 3 \cdot 10^{-309}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < 3.000000000000001e-309

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg26.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. Applied egg-rr54.5%

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

    if 3.000000000000001e-309 < F < 3.5000000000000002e23

    1. Initial program 23.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. Simplified23.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)}} \]
    3. Taylor expanded in C around 0 12.3%

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

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

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

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

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

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

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

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

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

    if 3.5000000000000002e23 < F

    1. Initial program 14.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. Simplified14.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)}} \]
    3. Taylor expanded in C around 0 11.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 43.1% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{elif}\;F \leq 1.08 \cdot 10^{+24}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(A, B\right)\right)}\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= F -5e-310)
     (/ (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_0))))) t_0)
     (if (<= F 1.08e+24)
       (/ (* (sqrt 2.0) (- (sqrt (* F (+ A (hypot A B)))))) B)
       (* (sqrt 2.0) (- (sqrt (/ F B))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= -5e-310) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 1.08e+24) {
		tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(A, B))))) / B;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (F <= -5e-310) {
		tmp = -Math.sqrt((2.0 * ((A + (C + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else if (F <= 1.08e+24) {
		tmp = (Math.sqrt(2.0) * -Math.sqrt((F * (A + Math.hypot(A, B))))) / B;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if F <= -5e-310:
		tmp = -math.sqrt((2.0 * ((A + (C + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0
	elif F <= 1.08e+24:
		tmp = (math.sqrt(2.0) * -math.sqrt((F * (A + math.hypot(A, B))))) / B
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0);
	elseif (F <= 1.08e+24)
		tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A + hypot(A, B)))))) / B);
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (F <= -5e-310)
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	elseif (F <= 1.08e+24)
		tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(A, B))))) / B;
	else
		tmp = sqrt(2.0) * -sqrt((F / B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive 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[F, -5e-310], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 1.08e+24], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\

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

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


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

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg26.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. Applied egg-rr54.5%

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

    if -4.999999999999985e-310 < F < 1.0799999999999999e24

    1. Initial program 23.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. Simplified23.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)}} \]
    3. Taylor expanded in C around 0 12.3%

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

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

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

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

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

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

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

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

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

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

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

    if 1.0799999999999999e24 < F

    1. Initial program 14.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. Simplified14.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)}} \]
    3. Taylor expanded in C around 0 11.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 39.1% accurate, 2.7× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 7.2 \cdot 10^{+96}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 7.2e+96)
     (/ (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_0))))) t_0)
     (* (sqrt 2.0) (- (sqrt (/ F B)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 7.2e+96) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B));
	}
	return tmp;
}
B = Math.abs(B);
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 <= 7.2e+96) {
		tmp = -Math.sqrt((2.0 * ((A + (C + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 7.2e+96:
		tmp = -math.sqrt((2.0 * ((A + (C + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 7.2e+96)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0);
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 7.2e+96)
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	else
		tmp = sqrt(2.0) * -sqrt((F / B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive 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, 7.2e+96], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 7.2 \cdot 10^{+96}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\

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


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

    1. Initial program 24.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. Simplified24.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)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg24.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. Applied egg-rr30.7%

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

    if 7.20000000000000026e96 < B

    1. Initial program 4.5%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\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)}} \]
    3. Taylor expanded in C around 0 14.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 40.8% accurate, 2.7× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \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)}}{C \cdot \left(A \cdot -4\right)}\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-43}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{B \cdot F}\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= F -5e-310)
   (/
    (-
     (sqrt
      (*
       2.0
       (* (+ A (+ C (hypot B (- A C)))) (* F (+ (* B B) (* -4.0 (* A C))))))))
    (* C (* A -4.0)))
   (if (<= F 3.1e-43)
     (/ (* (sqrt 2.0) (- (sqrt (* B F)))) B)
     (* (sqrt 2.0) (- (sqrt (/ F B)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= -5e-310) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * ((B * B) + (-4.0 * (A * C))))))) / (C * (A * -4.0));
	} else if (F <= 3.1e-43) {
		tmp = (sqrt(2.0) * -sqrt((B * F))) / B;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (F <= -5e-310) {
		tmp = -Math.sqrt((2.0 * ((A + (C + Math.hypot(B, (A - C)))) * (F * ((B * B) + (-4.0 * (A * C))))))) / (C * (A * -4.0));
	} else if (F <= 3.1e-43) {
		tmp = (Math.sqrt(2.0) * -Math.sqrt((B * F))) / B;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if F <= -5e-310:
		tmp = -math.sqrt((2.0 * ((A + (C + math.hypot(B, (A - C)))) * (F * ((B * B) + (-4.0 * (A * C))))))) / (C * (A * -4.0))
	elif F <= 3.1e-43:
		tmp = (math.sqrt(2.0) * -math.sqrt((B * F))) / B
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))))) / Float64(C * Float64(A * -4.0)));
	elseif (F <= 3.1e-43)
		tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(B * F)))) / B);
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (F <= -5e-310)
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * ((B * B) + (-4.0 * (A * C))))))) / (C * (A * -4.0));
	elseif (F <= 3.1e-43)
		tmp = (sqrt(2.0) * -sqrt((B * F))) / B;
	else
		tmp = sqrt(2.0) * -sqrt((F / B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[F, -5e-310], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-43], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(B * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \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)}}{C \cdot \left(A \cdot -4\right)}\\

\mathbf{elif}\;F \leq 3.1 \cdot 10^{-43}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{B \cdot F}\right)}{B}\\

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


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

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg26.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. Applied egg-rr54.5%

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

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

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

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

    if -4.999999999999985e-310 < F < 3.0999999999999999e-43

    1. Initial program 24.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. Simplified24.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)}} \]
    3. Taylor expanded in C around 0 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot B}}}{B} \]
      2. distribute-rgt-neg-in22.7%

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

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

    if 3.0999999999999999e-43 < F

    1. Initial program 15.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. Simplified15.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)}} \]
    3. Taylor expanded in C around 0 11.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 38.7% accurate, 3.0× speedup?

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

\mathbf{elif}\;F \leq 6.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\

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


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

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Taylor expanded in A around inf 34.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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in B around 0 23.8%

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

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

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

    if -4.999999999999985e-310 < F < 6.80000000000000012e-6

    1. Initial program 24.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. Simplified24.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)}} \]
    3. Taylor expanded in C around 0 12.1%

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

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

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

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

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

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

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

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

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

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

    if 6.80000000000000012e-6 < F

    1. Initial program 14.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. Simplified14.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)}} \]
    3. Taylor expanded in C around 0 11.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 38.6% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Taylor expanded in A around inf 34.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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in B around 0 23.8%

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

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

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

    if -4.999999999999985e-310 < F < 3.5999999999999999e-43

    1. Initial program 24.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. Simplified24.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)}} \]
    3. Taylor expanded in C around 0 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\sqrt{2} \cdot \sqrt{F \cdot B}}}{B} \]
      2. distribute-rgt-neg-in22.7%

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

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

    if 3.5999999999999999e-43 < F

    1. Initial program 15.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. Simplified15.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)}} \]
    3. Taylor expanded in C around 0 11.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 30.2% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 19.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. Simplified19.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)}} \]
    3. Taylor expanded in A around inf 11.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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in B around 0 7.9%

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

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

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

    if 9.2000000000000005e-222 < B < 7.9e-75

    1. Initial program 18.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. Simplified18.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)}} \]
    3. Taylor expanded in C around inf 13.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) + \color{blue}{\left(C + \left(0.5 \cdot \frac{\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C} + -1 \cdot A\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg13.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) + \left(C + \left(0.5 \cdot \frac{\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C} + \color{blue}{\left(-A\right)}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. unsub-neg13.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) + \left(C + \color{blue}{\left(0.5 \cdot \frac{\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C} - A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified14.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) + \color{blue}{\left(C + \left(0.5 \cdot \frac{B \cdot B + 0}{C} - A\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 7.9e-75 < B

    1. Initial program 22.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. Simplified22.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)}} \]
    3. Taylor expanded in C around 0 25.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 16.2% accurate, 4.7× speedup?

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

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

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


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

    1. Initial program 12.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. Simplified12.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)}} \]
    3. Taylor expanded in A around inf 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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in A around inf 14.1%

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

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

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

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

    if -4.4999999999999999e-132 < C < 4.19999999999999982e-145

    1. Initial program 26.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. Simplified26.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)}} \]
    3. Taylor expanded in A around inf 18.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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 4.19999999999999982e-145 < C

    1. Initial program 22.3%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\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)}} \]
    3. Taylor expanded in A around -inf 21.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) + \color{blue}{\left(C + -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg21.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) + \left(C + \color{blue}{\left(-A\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. sub-neg21.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) + \color{blue}{\left(C - A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified21.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) + \color{blue}{\left(C - A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification18.1%

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

Alternative 16: 12.3% accurate, 4.8× speedup?

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

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


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

    1. Initial program 12.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. Simplified12.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)}} \]
    3. Taylor expanded in A around inf 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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in A around inf 14.1%

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

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

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

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

    if -4.1000000000000002e-134 < C

    1. Initial program 24.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. Simplified24.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)}} \]
    3. Taylor expanded in A around inf 11.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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification12.4%

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

Alternative 17: 11.2% accurate, 5.0× speedup?

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

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


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

    1. Initial program 9.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. Simplified9.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)}} \]
    3. Taylor expanded in A around inf 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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in A around inf 15.4%

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

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

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

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

    if -7.50000000000000041e-78 < C

    1. Initial program 25.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. Simplified25.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)}} \]
    3. Taylor expanded in A around inf 11.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) + \color{blue}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in B around 0 7.4%

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

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

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

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

Alternative 18: 10.8% accurate, 5.2× speedup?

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

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


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

    1. Initial program 19.1%

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

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

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

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

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

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

    if 1.44999999999999992e-145 < C

    1. Initial program 22.3%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\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)}} \]
    3. Taylor expanded in A around 0 12.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 8.1% accurate, 5.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < 9.0000000000000001e-146

    1. Initial program 20.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. Simplified20.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)}} \]
    3. Taylor expanded in A around 0 13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000001e-146 < A

    1. Initial program 20.6%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(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)}} \]
    3. Taylor expanded in C around 0 9.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 5.1% accurate, 5.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 5.1% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \frac{-2 \cdot \sqrt{A \cdot F}}{B} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F) :precision binary64 (/ (* -2.0 (sqrt (* A F))) B))
B = abs(B);
double code(double A, double B, double C, double F) {
	return (-2.0 * sqrt((A * F))) / B;
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = ((-2.0d0) * sqrt((a * f))) / b
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	return (-2.0 * Math.sqrt((A * F))) / B;
}
B = abs(B)
def code(A, B, C, F):
	return (-2.0 * math.sqrt((A * F))) / B
B = abs(B)
function code(A, B, C, F)
	return Float64(Float64(-2.0 * sqrt(Float64(A * F))) / B)
end
B = abs(B)
function tmp = code(A, B, C, F)
	tmp = (-2.0 * sqrt((A * F))) / B;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := N[(N[(-2.0 * N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{-2 \cdot \sqrt{A \cdot F}}{B}
\end{array}
Derivation
  1. Initial program 20.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-1 \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}\right) \cdot \sqrt{A \cdot F}}{B} \]
    3. rem-square-sqrt2.9%

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

      \[\leadsto \frac{\color{blue}{-2} \cdot \sqrt{A \cdot F}}{B} \]
    5. *-commutative2.9%

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

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

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

Reproduce

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