ABCF->ab-angle a

Percentage Accurate: 19.2% → 62.6%
Time: 36.5s
Alternatives: 20
Speedup: 5.9×

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 20 alternatives:

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

Initial Program: 19.2% accurate, 1.0× speedup?

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

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

Alternative 1: 62.6% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t_1 \cdot \left(C + \left(C + -0.5 \cdot \frac{{B}^{2}}{A}\right)\right)\right)} \cdot \left(-\sqrt{F}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{t_0 \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{C}\right)}{t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -inf.0

    1. Initial program 3.0%

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

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

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

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

    if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -1.99999999999999991e-212

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

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

    if -1.99999999999999991e-212 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -0.0

    1. Initial program 3.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. Simplified3.6%

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

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

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

    if -0.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0

    1. Initial program 36.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. Simplified40.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 59.2% accurate, 1.4× speedup?

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

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

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

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

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


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

    1. Initial program 25.4%

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

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

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

    if 8.9999999999999996e-231 < B < 2.65000000000000009e-131

    1. Initial program 9.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. Simplified13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.65000000000000009e-131 < B < 1.89999999999999999e-45

    1. Initial program 15.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. Simplified15.9%

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

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

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

    if 1.89999999999999999e-45 < B < 1.1500000000000001e29

    1. Initial program 47.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. Simplified47.1%

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

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

    if 1.1500000000000001e29 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 9 \cdot 10^{-231}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 2.65 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \mathsf{fma}\left(A \cdot C, -4, B \cdot B\right)\right) \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{C}\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 1.9 \cdot 10^{-45}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(C + C\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)} \cdot \left(-\sqrt{F}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 1.15 \cdot 10^{+29}:\\ \;\;\;\;\frac{\sqrt{F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \left(-\sqrt{2 \cdot F}\right)}{B}\\ \end{array} \]

Alternative 3: 57.4% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 25.4%

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

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

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

    if 6.19999999999999976e-231 < B < 1.49999999999999998e-131

    1. Initial program 9.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. Simplified13.6%

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

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

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

    if 1.49999999999999998e-131 < B < 1.99999999999999997e-45

    1. Initial program 15.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. Simplified15.9%

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

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

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

    if 1.99999999999999997e-45 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 57.4% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 25.4%

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

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

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

    if 9.4999999999999995e-231 < B < 2.9500000000000001e-130

    1. Initial program 9.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. Simplified13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9500000000000001e-130 < B < 1.34999999999999992e-45

    1. Initial program 15.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. Simplified15.9%

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

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

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

    if 1.34999999999999992e-45 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 23.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. Simplified27.6%

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

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

    if 1.2599999999999999e-145 < B < 3.1000000000000001e-46

    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{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
    3. Applied egg-rr19.5%

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

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

    if 3.1000000000000001e-46 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 57.9% accurate, 1.9× speedup?

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

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


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

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

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

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

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

    if 7.4e-44 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.9% accurate, 1.9× speedup?

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

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


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

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

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

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

    if 6.0000000000000005e-44 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 57.7% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.3999999999999997e-45 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 57.8% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05000000000000001e-44 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.8% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999998e-44 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 53.3% accurate, 2.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.49999999999999993e-44 < B < 1.4499999999999999e146

    1. Initial program 33.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. Simplified33.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4499999999999999e146 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 47.4% accurate, 2.7× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5999999999999999e-44 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{1}{B}} \cdot {\left(\frac{1}{\sqrt{\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)}}\right)}^{-1} \]
      7. pow1/246.2%

        \[\leadsto -\frac{1}{B} \cdot {\left(\frac{1}{\color{blue}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{0.5}}}\right)}^{-1} \]
      8. pow-flip46.2%

        \[\leadsto -\frac{1}{B} \cdot {\color{blue}{\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{\left(-0.5\right)}\right)}}^{-1} \]
      9. metadata-eval46.2%

        \[\leadsto -\frac{1}{B} \cdot {\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{\color{blue}{-0.5}}\right)}^{-1} \]
    11. Applied egg-rr46.2%

      \[\leadsto -\color{blue}{\frac{1}{B} \cdot {\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}\right)}^{-1}} \]
    12. Step-by-step derivation
      1. *-commutative46.2%

        \[\leadsto -\color{blue}{{\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}\right)}^{-1} \cdot \frac{1}{B}} \]
      2. unpow-146.2%

        \[\leadsto -\color{blue}{\frac{1}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}}} \cdot \frac{1}{B} \]
      3. associate-*l/46.3%

        \[\leadsto -\color{blue}{\frac{1 \cdot \frac{1}{B}}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}}} \]
      4. *-lft-identity46.3%

        \[\leadsto -\frac{\color{blue}{\frac{1}{B}}}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}} \]
      5. *-commutative46.3%

        \[\leadsto -\frac{\frac{1}{B}}{{\color{blue}{\left(\left(F \cdot 2\right) \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}^{-0.5}} \]
      6. *-commutative46.3%

        \[\leadsto -\frac{\frac{1}{B}}{{\left(\color{blue}{\left(2 \cdot F\right)} \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}^{-0.5}} \]
      7. hypot-def25.1%

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

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

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

        \[\leadsto -\frac{\frac{1}{B}}{{\left(\left(2 \cdot F\right) \cdot \left(C + \sqrt{\color{blue}{{B}^{2} + {C}^{2}}}\right)\right)}^{-0.5}} \]
      11. associate-*r*25.1%

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

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

        \[\leadsto -\frac{\frac{1}{B}}{{\left(2 \cdot \left(F \cdot \left(C + \sqrt{B \cdot B + \color{blue}{C \cdot C}}\right)\right)\right)}^{-0.5}} \]
      14. hypot-def46.3%

        \[\leadsto -\frac{\frac{1}{B}}{{\left(2 \cdot \left(F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)\right)\right)}^{-0.5}} \]
    13. Simplified46.3%

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

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

Alternative 13: 44.6% accurate, 2.8× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.60000000000000011e-44 < B

    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. Simplified19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{1}{B}} \cdot {\left(\frac{1}{\sqrt{\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)}}\right)}^{-1} \]
      7. pow1/246.2%

        \[\leadsto -\frac{1}{B} \cdot {\left(\frac{1}{\color{blue}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{0.5}}}\right)}^{-1} \]
      8. pow-flip46.2%

        \[\leadsto -\frac{1}{B} \cdot {\color{blue}{\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{\left(-0.5\right)}\right)}}^{-1} \]
      9. metadata-eval46.2%

        \[\leadsto -\frac{1}{B} \cdot {\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{\color{blue}{-0.5}}\right)}^{-1} \]
    11. Applied egg-rr46.2%

      \[\leadsto -\color{blue}{\frac{1}{B} \cdot {\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}\right)}^{-1}} \]
    12. Step-by-step derivation
      1. *-commutative46.2%

        \[\leadsto -\color{blue}{{\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}\right)}^{-1} \cdot \frac{1}{B}} \]
      2. unpow-146.2%

        \[\leadsto -\color{blue}{\frac{1}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}}} \cdot \frac{1}{B} \]
      3. associate-*l/46.3%

        \[\leadsto -\color{blue}{\frac{1 \cdot \frac{1}{B}}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}}} \]
      4. *-lft-identity46.3%

        \[\leadsto -\frac{\color{blue}{\frac{1}{B}}}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}} \]
      5. *-commutative46.3%

        \[\leadsto -\frac{\frac{1}{B}}{{\color{blue}{\left(\left(F \cdot 2\right) \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}^{-0.5}} \]
      6. *-commutative46.3%

        \[\leadsto -\frac{\frac{1}{B}}{{\left(\color{blue}{\left(2 \cdot F\right)} \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}^{-0.5}} \]
      7. hypot-def25.1%

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

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

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

        \[\leadsto -\frac{\frac{1}{B}}{{\left(\left(2 \cdot F\right) \cdot \left(C + \sqrt{\color{blue}{{B}^{2} + {C}^{2}}}\right)\right)}^{-0.5}} \]
      11. associate-*r*25.1%

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

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

        \[\leadsto -\frac{\frac{1}{B}}{{\left(2 \cdot \left(F \cdot \left(C + \sqrt{B \cdot B + \color{blue}{C \cdot C}}\right)\right)\right)}^{-0.5}} \]
      14. hypot-def46.3%

        \[\leadsto -\frac{\frac{1}{B}}{{\left(2 \cdot \left(F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)\right)\right)}^{-0.5}} \]
    13. Simplified46.3%

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

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

Alternative 14: 40.8% accurate, 2.9× speedup?

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

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


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

    1. Initial program 22.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. Simplified20.1%

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

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

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

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

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

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

    if 1.3500000000000001e-63 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{1}{B}} \cdot {\left(\frac{1}{\sqrt{\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)}}\right)}^{-1} \]
      7. pow1/245.6%

        \[\leadsto -\frac{1}{B} \cdot {\left(\frac{1}{\color{blue}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{0.5}}}\right)}^{-1} \]
      8. pow-flip45.6%

        \[\leadsto -\frac{1}{B} \cdot {\color{blue}{\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{\left(-0.5\right)}\right)}}^{-1} \]
      9. metadata-eval45.6%

        \[\leadsto -\frac{1}{B} \cdot {\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{\color{blue}{-0.5}}\right)}^{-1} \]
    11. Applied egg-rr45.6%

      \[\leadsto -\color{blue}{\frac{1}{B} \cdot {\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}\right)}^{-1}} \]
    12. Step-by-step derivation
      1. *-commutative45.6%

        \[\leadsto -\color{blue}{{\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}\right)}^{-1} \cdot \frac{1}{B}} \]
      2. unpow-145.6%

        \[\leadsto -\color{blue}{\frac{1}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}}} \cdot \frac{1}{B} \]
      3. associate-*l/45.7%

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

        \[\leadsto -\frac{\color{blue}{\frac{1}{B}}}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}} \]
      5. *-commutative45.7%

        \[\leadsto -\frac{\frac{1}{B}}{{\color{blue}{\left(\left(F \cdot 2\right) \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}^{-0.5}} \]
      6. *-commutative45.7%

        \[\leadsto -\frac{\frac{1}{B}}{{\left(\color{blue}{\left(2 \cdot F\right)} \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}^{-0.5}} \]
      7. hypot-def24.8%

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

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

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

        \[\leadsto -\frac{\frac{1}{B}}{{\left(\left(2 \cdot F\right) \cdot \left(C + \sqrt{\color{blue}{{B}^{2} + {C}^{2}}}\right)\right)}^{-0.5}} \]
      11. associate-*r*24.8%

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

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

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

        \[\leadsto -\frac{\frac{1}{B}}{{\left(2 \cdot \left(F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)\right)\right)}^{-0.5}} \]
    13. Simplified45.7%

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

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

Alternative 15: 41.0% accurate, 2.9× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.69999999999999993e-61 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{1}{B}} \cdot {\left(\frac{1}{\sqrt{\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)}}\right)}^{-1} \]
      7. pow1/245.6%

        \[\leadsto -\frac{1}{B} \cdot {\left(\frac{1}{\color{blue}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{0.5}}}\right)}^{-1} \]
      8. pow-flip45.6%

        \[\leadsto -\frac{1}{B} \cdot {\color{blue}{\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{\left(-0.5\right)}\right)}}^{-1} \]
      9. metadata-eval45.6%

        \[\leadsto -\frac{1}{B} \cdot {\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{\color{blue}{-0.5}}\right)}^{-1} \]
    11. Applied egg-rr45.6%

      \[\leadsto -\color{blue}{\frac{1}{B} \cdot {\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}\right)}^{-1}} \]
    12. Step-by-step derivation
      1. *-commutative45.6%

        \[\leadsto -\color{blue}{{\left({\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}\right)}^{-1} \cdot \frac{1}{B}} \]
      2. unpow-145.6%

        \[\leadsto -\color{blue}{\frac{1}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}}} \cdot \frac{1}{B} \]
      3. associate-*l/45.7%

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

        \[\leadsto -\frac{\color{blue}{\frac{1}{B}}}{{\left(\left(C + \mathsf{hypot}\left(C, B\right)\right) \cdot \left(F \cdot 2\right)\right)}^{-0.5}} \]
      5. *-commutative45.7%

        \[\leadsto -\frac{\frac{1}{B}}{{\color{blue}{\left(\left(F \cdot 2\right) \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}^{-0.5}} \]
      6. *-commutative45.7%

        \[\leadsto -\frac{\frac{1}{B}}{{\left(\color{blue}{\left(2 \cdot F\right)} \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}^{-0.5}} \]
      7. hypot-def24.8%

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

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

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

        \[\leadsto -\frac{\frac{1}{B}}{{\left(\left(2 \cdot F\right) \cdot \left(C + \sqrt{\color{blue}{{B}^{2} + {C}^{2}}}\right)\right)}^{-0.5}} \]
      11. associate-*r*24.8%

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

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

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

        \[\leadsto -\frac{\frac{1}{B}}{{\left(2 \cdot \left(F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)\right)\right)}^{-0.5}} \]
    13. Simplified45.7%

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

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

Alternative 16: 41.0% accurate, 3.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.19999999999999967e-61 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 36.9% accurate, 3.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999998e-59 < B

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 36.5% accurate, 5.1× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6000000000000001e-61 < B

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}} \]
      2. neg-sub041.9%

        \[\leadsto \color{blue}{0 - \frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}} \]
      3. cancel-sign-sub-inv41.9%

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

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

        \[\leadsto 0 + \left(-\color{blue}{\left(-\frac{\sqrt{2}}{-B}\right)}\right) \cdot \sqrt{F \cdot B} \]
      6. remove-double-neg41.9%

        \[\leadsto 0 + \color{blue}{\frac{\sqrt{2}}{-B}} \cdot \sqrt{F \cdot B} \]
      7. associate-*l/41.9%

        \[\leadsto 0 + \color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot B}}{-B}} \]
      8. sqrt-unprod41.9%

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

        \[\leadsto 0 + \frac{\sqrt{2 \cdot \color{blue}{\left(B \cdot F\right)}}}{-B} \]
    8. Applied egg-rr41.9%

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

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

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

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

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

Alternative 19: 8.9% accurate, 5.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\frac{\color{blue}{2} \cdot \sqrt{C \cdot F}}{B} \]
    4. *-commutative2.6%

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

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

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

Alternative 20: 26.9% accurate, 5.9× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(-\frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}} \]
  6. Taylor expanded in C around 0 13.6%

    \[\leadsto \left(-\frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \color{blue}{B}} \]
  7. Step-by-step derivation
    1. distribute-lft-neg-out13.6%

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}} \]
    2. neg-sub013.6%

      \[\leadsto \color{blue}{0 - \frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}} \]
    3. cancel-sign-sub-inv13.6%

      \[\leadsto \color{blue}{0 + \left(-\frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot B}} \]
    4. frac-2neg13.6%

      \[\leadsto 0 + \left(-\color{blue}{\frac{-\sqrt{2}}{-B}}\right) \cdot \sqrt{F \cdot B} \]
    5. distribute-frac-neg13.6%

      \[\leadsto 0 + \left(-\color{blue}{\left(-\frac{\sqrt{2}}{-B}\right)}\right) \cdot \sqrt{F \cdot B} \]
    6. remove-double-neg13.6%

      \[\leadsto 0 + \color{blue}{\frac{\sqrt{2}}{-B}} \cdot \sqrt{F \cdot B} \]
    7. associate-*l/13.6%

      \[\leadsto 0 + \color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot B}}{-B}} \]
    8. sqrt-unprod13.6%

      \[\leadsto 0 + \frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot B\right)}}}{-B} \]
    9. *-commutative13.6%

      \[\leadsto 0 + \frac{\sqrt{2 \cdot \color{blue}{\left(B \cdot F\right)}}}{-B} \]
  8. Applied egg-rr13.6%

    \[\leadsto \color{blue}{0 + \frac{\sqrt{2 \cdot \left(B \cdot F\right)}}{-B}} \]
  9. Step-by-step derivation
    1. +-lft-identity13.6%

      \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot \left(B \cdot F\right)}}{-B}} \]
    2. *-commutative13.6%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(B \cdot F\right) \cdot 2}}}{-B} \]
  10. Simplified13.6%

    \[\leadsto \color{blue}{\frac{\sqrt{\left(B \cdot F\right) \cdot 2}}{-B}} \]
  11. Final simplification13.6%

    \[\leadsto \frac{\sqrt{2 \cdot \left(B \cdot F\right)}}{-B} \]

Reproduce

?
herbie shell --seed 2023297 
(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))))