ABCF->ab-angle b

Percentage Accurate: 19.2% → 39.8%
Time: 32.9s
Alternatives: 11
Speedup: 2.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 11 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: 39.8% accurate, 1.0× speedup?

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

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

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


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

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

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

    if 4.40000000000000023e-292 < C < 4.2e5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2e5 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 39.2% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 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))) < -5.0000000000000002e-197

    1. Initial program 50.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. Simplified50.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e-197 < (/.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 6.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. Simplified12.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 26.5% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 23.6%

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

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

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

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

    if 9.99999999999999908e-22 < (pow.f64 B 2) < 3e262

    1. Initial program 42.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. Simplified42.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e262 < (pow.f64 B 2)

    1. Initial program 0.2%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{F \cdot A} \cdot \frac{1}{B}\right)} \]
    7. Taylor expanded in B around 0 4.8%

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

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

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

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

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

Alternative 4: 36.2% accurate, 1.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 25000

    1. Initial program 27.0%

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

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

    if 25000 < C

    1. Initial program 5.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. Simplified10.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 28.9% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 21.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. Simplified31.8%

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

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

    if 4.19999999999999962e-15 < B < 1.9000000000000002e131

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000002e131 < B

    1. Initial program 0.2%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{F \cdot A} \cdot \frac{1}{B}\right)} \]
    7. Taylor expanded in B around 0 8.4%

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

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

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

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

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

Alternative 6: 24.3% accurate, 1.5× speedup?

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

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


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

    1. Initial program 28.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. Simplified35.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}^{2}\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}} \]
    3. Taylor expanded in C around inf 21.1%

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

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

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

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

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

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

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

    if 5.00000000000000008e115 < (pow.f64 B 2)

    1. Initial program 10.4%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{F \cdot A} \cdot \frac{1}{B}\right)} \]
    7. Taylor expanded in B around 0 4.1%

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

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

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

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

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

Alternative 7: 28.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 21.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. Simplified31.7%

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

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

    if 5.6999999999999997e-11 < B < 1.9000000000000002e131

    1. Initial program 39.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. Simplified39.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000002e131 < B

    1. Initial program 0.2%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{F \cdot A} \cdot \frac{1}{B}\right)} \]
    7. Taylor expanded in B around 0 8.4%

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

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

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

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

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

Alternative 8: 26.1% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 21.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. Simplified25.8%

      \[\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}^{2}\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}} \]
    3. Taylor expanded in C around inf 17.0%

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

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

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

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

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

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

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

    if 5.00000000000000018e-11 < B < 1.9000000000000002e131

    1. Initial program 39.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. Simplified39.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000002e131 < B

    1. Initial program 0.2%

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{F \cdot A} \cdot \frac{1}{B}\right)} \]
    7. Taylor expanded in B around 0 8.4%

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

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

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

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

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

Alternative 9: 21.6% accurate, 2.9× speedup?

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

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


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

    1. Initial program 23.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. Simplified32.8%

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

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

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

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

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

    if 2.8999999999999999e54 < B

    1. Initial program 11.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. Simplified11.7%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 5.4% accurate, 5.9× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{F \cdot A} \cdot \frac{1}{B}\right)} \]
  7. Taylor expanded in B around 0 2.6%

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

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

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

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

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

Alternative 11: 3.8% accurate, 634.0× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ 0 \end{array} \]
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F) :precision binary64 0.0)
assert(A < C);
double code(double A, double B, double C, double F) {
	return 0.0;
}
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 = 0.0d0
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
	return 0.0;
}
[A, C] = sort([A, C])
def code(A, B, C, F):
	return 0.0
A, C = sort([A, C])
function code(A, B, C, F)
	return 0.0
end
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = 0.0;
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := 0.0
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
0
\end{array}
Derivation
  1. Initial program 21.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. Simplified29.0%

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

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

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

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

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

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

      \[\leadsto \frac{-{\left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \color{blue}{0}\right)}^{0.5}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    5. metadata-eval2.1%

      \[\leadsto \frac{-{\left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \color{blue}{\left(0 - 0\right)}\right)}^{0.5}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    6. mul0-rgt2.1%

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

      \[\leadsto \frac{-{\left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot 0 - \color{blue}{F \cdot 0}\right)\right)}^{0.5}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    8. distribute-lft-out--2.1%

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

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

      \[\leadsto \frac{-\color{blue}{0}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    11. metadata-eval3.7%

      \[\leadsto \frac{\color{blue}{0}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    12. div03.8%

      \[\leadsto \color{blue}{0} \]
  6. Simplified3.8%

    \[\leadsto \color{blue}{0} \]
  7. Final simplification3.8%

    \[\leadsto 0 \]

Reproduce

?
herbie shell --seed 2023301 
(FPCore (A B C F)
  :name "ABCF->ab-angle b"
  :precision binary64
  (/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))