ABCF->ab-angle b

Percentage Accurate: 19.0% → 38.8%
Time: 19.6s
Alternatives: 12
Speedup: 6.5×

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 12 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.0% 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: 38.8% accurate, 0.4× speedup?

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

\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-199}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + C\right) - \sqrt{\mathsf{fma}\left(A - C, A - C, B \cdot B\right)}\right) \cdot t\_4}}{0 - t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{t\_4 \cdot \left(A + \mathsf{fma}\left(\frac{B \cdot B}{C}, -0.5, A\right)\right)}}{t\_1}\\


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

    1. Initial program 3.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + 1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. +-lowering-+.f6421.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified21.2%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot F\right) \cdot \left(A + A\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)} \cdot \sqrt{F \cdot \left(A + A\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left({\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}^{\frac{1}{2}} \cdot \sqrt{F \cdot \left(A + A\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left({\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{F \cdot \left(A + A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    7. Applied egg-rr29.9%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \left(B \cdot B - \color{blue}{\left(4 \cdot A\right)} \cdot C\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \left(B \cdot B - 4 \cdot \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \left(B \cdot B + \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \left(B \cdot B + -4 \cdot \left(\color{blue}{A} \cdot C\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \left(B \cdot B + \left(A \cdot C\right) \cdot \color{blue}{-4}\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \left(\left(A \cdot C\right) \cdot -4 + \color{blue}{B \cdot B}\right)\right) \]
      7. accelerator-lowering-fma.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\left(C \cdot A\right), -4, \left(B \cdot B\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(C, A\right), -4, \left(B \cdot B\right)\right)\right) \]
      10. *-lowering-*.f6429.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(C, A\right), -4, \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    9. Applied egg-rr29.9%

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

    if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -1.99999999999999996e-199

    1. Initial program 97.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. Add Preprocessing
    3. Step-by-step derivation
      1. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\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}\right) \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\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}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\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)}\right), \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right) \]
    4. Applied egg-rr97.3%

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

    if -1.99999999999999996e-199 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)))

    1. Initial program 4.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + 1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(\frac{{B}^{2}}{C} \cdot \frac{-1}{2} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\left(\frac{{B}^{2}}{C}\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\left({B}^{2}\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\left(B \cdot B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f6413.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified13.9%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. pow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B - \left(4 \cdot A\right) \cdot C\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right) \cdot F\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right) \cdot \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \left(\left(A \cdot C\right) \cdot -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\left(A \cdot C\right), -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \left(2 \cdot F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      15. *-lowering-*.f6413.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    7. Applied egg-rr13.9%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B - 4 \cdot \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + -4 \cdot \left(\color{blue}{A} \cdot C\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + \left(A \cdot C\right) \cdot \color{blue}{-4}\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(\left(A \cdot C\right) \cdot -4 + \color{blue}{B \cdot B}\right)\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\left(A \cdot C\right), \color{blue}{-4}, \left(B \cdot B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \left(B \cdot B\right)\right)\right) \]
      9. *-lowering-*.f6413.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    9. Applied egg-rr13.9%

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

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

Alternative 2: 29.4% accurate, 4.8× speedup?

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

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


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

    1. Initial program 20.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + 1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(\frac{{B}^{2}}{C} \cdot \frac{-1}{2} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\left(\frac{{B}^{2}}{C}\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\left({B}^{2}\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\left(B \cdot B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f6419.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified19.5%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. pow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B - \left(4 \cdot A\right) \cdot C\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right) \cdot F\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right) \cdot \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \left(\left(A \cdot C\right) \cdot -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\left(A \cdot C\right), -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \left(2 \cdot F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      15. *-lowering-*.f6419.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    7. Applied egg-rr19.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B - 4 \cdot \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + -4 \cdot \left(\color{blue}{A} \cdot C\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + \left(A \cdot C\right) \cdot \color{blue}{-4}\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(\left(A \cdot C\right) \cdot -4 + \color{blue}{B \cdot B}\right)\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\left(A \cdot C\right), \color{blue}{-4}, \left(B \cdot B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \left(B \cdot B\right)\right)\right) \]
      9. *-lowering-*.f6419.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    9. Applied egg-rr19.5%

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

    if 1.65000000000000004e-21 < B

    1. Initial program 10.9%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

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

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

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

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

Alternative 3: 29.5% accurate, 6.1× speedup?

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

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + 1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(\frac{{B}^{2}}{C} \cdot \frac{-1}{2} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\left(\frac{{B}^{2}}{C}\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\left({B}^{2}\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\left(B \cdot B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f6419.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified19.5%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. pow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B - \left(4 \cdot A\right) \cdot C\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(F \cdot \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right) \cdot F\right) \cdot 2\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right) \cdot \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B + \left(A \cdot C\right) \cdot -4\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \left(\left(A \cdot C\right) \cdot -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\left(A \cdot C\right), -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \left(F \cdot 2\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \left(2 \cdot F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      15. *-lowering-*.f6419.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    7. Applied egg-rr19.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B - 4 \cdot \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + -4 \cdot \left(\color{blue}{A} \cdot C\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(B \cdot B + \left(A \cdot C\right) \cdot \color{blue}{-4}\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \left(\left(A \cdot C\right) \cdot -4 + \color{blue}{B \cdot B}\right)\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\left(A \cdot C\right), \color{blue}{-4}, \left(B \cdot B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \left(B \cdot B\right)\right)\right) \]
      9. *-lowering-*.f6419.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \mathsf{fma.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), C\right), \frac{-1}{2}, A\right)\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    9. Applied egg-rr19.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{+.f64}\left(A, \color{blue}{A}\right)\right)\right)\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    11. Step-by-step derivation
      1. Simplified18.0%

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

      if 6.00000000000000006e-23 < B

      1. Initial program 10.8%

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

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

          \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
        3. distribute-rgt-neg-inN/A

          \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
        4. mul-1-negN/A

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

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

        \[\leadsto \color{blue}{\sqrt{F \cdot \left(A - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    12. Recombined 2 regimes into one program.
    13. Final simplification17.6%

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

    Alternative 4: 29.5% accurate, 6.3× speedup?

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

      1. Initial program 20.9%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + 1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        3. *-lft-identityN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        4. +-lowering-+.f6417.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. Simplified17.6%

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot F\right) \cdot \left(A + A\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        2. associate-*l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot \left(F \cdot \left(A + A\right)\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        3. sqrt-prodN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)} \cdot \sqrt{F \cdot \left(A + A\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        4. pow1/2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left({\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}^{\frac{1}{2}} \cdot \sqrt{F \cdot \left(A + A\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left({\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{F \cdot \left(A + A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. Applied egg-rr12.7%

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

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

          \[\leadsto \mathsf{neg}\left(\sqrt{A \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right)\right)} \cdot \frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right) \]
        2. distribute-rgt-neg-inN/A

          \[\leadsto \sqrt{A \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right)\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{A \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right)\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)}\right) \]
        4. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot \left(F \cdot \left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right)\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}}\right)\right)\right) \]
        5. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A \cdot F\right) \cdot \left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{\color{blue}{{\left(\sqrt{2}\right)}^{2}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(A \cdot F\right), \left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{\color{blue}{{\left(\sqrt{2}\right)}^{2}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(F \cdot A\right), \left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{{\color{blue}{\left(\sqrt{2}\right)}}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, A\right), \left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{{\color{blue}{\left(\sqrt{2}\right)}}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, A\right), \left(\left(A \cdot C\right) \cdot -4 + {B}^{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        10. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, A\right), \mathsf{fma.f64}\left(\left(A \cdot C\right), -4, \left({B}^{2}\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{{\left(\sqrt{2}\right)}^{\color{blue}{2}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, A\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \left({B}^{2}\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        12. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, A\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \left(B \cdot B\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, A\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \mathsf{*.f64}\left(B, B\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
        14. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, A\right), \mathsf{fma.f64}\left(\mathsf{*.f64}\left(A, C\right), -4, \mathsf{*.f64}\left(B, B\right)\right)\right)\right), \mathsf{neg.f64}\left(\left(\frac{{\left(\sqrt{2}\right)}^{2}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\right)\right)\right) \]
      10. Simplified17.6%

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

      if 7.79999999999999998e-28 < B

      1. Initial program 10.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. Add Preprocessing
      3. Taylor expanded in C around 0

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

          \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
        3. distribute-rgt-neg-inN/A

          \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
        4. mul-1-negN/A

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

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

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

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

    Alternative 5: 19.3% accurate, 6.5× speedup?

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

      1. Initial program 20.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. Add Preprocessing
      3. Step-by-step derivation
        1. frac-2negN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)}{\color{blue}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        2. div-invN/A

          \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        3. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \]
        4. frac-2negN/A

          \[\leadsto \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)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)}} \]
        5. metadata-evalN/A

          \[\leadsto \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)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right)} \]
        6. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{-1}{{B}^{2} - \color{blue}{\left(4 \cdot A\right) \cdot C}} \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\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)}\right), \color{blue}{\left(\frac{-1}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\right)}\right) \]
      4. Applied egg-rr20.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-8 \cdot A\right) \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-8 \cdot A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(-1 \cdot A\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        7. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{neg}\left(A\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        8. neg-lowering-neg.f6417.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      7. Simplified17.0%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      9. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-16 \cdot {A}^{2}\right) \cdot \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-16 \cdot {A}^{2}\right), \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2}\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \left(A \cdot A\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. *-lowering-*.f6412.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      10. Simplified12.3%

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

      if 2.35e-23 < B < 4.0000000000000002e96

      1. Initial program 26.9%

        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. frac-2negN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)}{\color{blue}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        2. div-invN/A

          \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        3. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \]
        4. frac-2negN/A

          \[\leadsto \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)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)}} \]
        5. metadata-evalN/A

          \[\leadsto \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)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right)} \]
        6. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{-1}{{B}^{2} - \color{blue}{\left(4 \cdot A\right) \cdot C}} \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\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)}\right), \color{blue}{\left(\frac{-1}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\right)}\right) \]
      4. Applied egg-rr26.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-2 \cdot \left({B}^{3} \cdot F\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \left({B}^{3} \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left({B}^{3}\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot \left(B \cdot B\right)\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot {B}^{2}\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left({B}^{2}\right)\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot B\right)\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        7. *-lowering-*.f6428.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      7. Simplified28.9%

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

      if 4.0000000000000002e96 < B

      1. Initial program 3.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + 1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        3. *-lft-identityN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        4. +-lowering-+.f642.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. Simplified2.4%

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot \left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(\left(A + A\right) \cdot 2\right) \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        3. sqrt-prodN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2} \cdot \sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        4. pow1/2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2} \cdot {\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2}\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        6. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + A\right) \cdot 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(A + A\right), 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        9. pow1/2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        12. pow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        13. associate-*l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        14. cancel-sign-sub-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        16. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. Applied egg-rr0.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \color{blue}{\left(\sqrt{A \cdot F}\right)}\right), B\right) \]
      12. Step-by-step derivation
        1. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right)\right), B\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right)\right), B\right) \]
        3. *-lowering-*.f647.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right)\right), B\right) \]
      13. Simplified7.9%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.35 \cdot 10^{-23}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{\left(\left(A \cdot A\right) \cdot -16\right) \cdot \left(C \cdot F\right)}\\ \mathbf{elif}\;B \leq 4 \cdot 10^{+96}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{-2 \cdot \left(F \cdot \left(B \cdot \left(B \cdot B\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot \sqrt{A \cdot F}}{B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 19.8% accurate, 6.5× speedup?

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

      1. Initial program 20.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. Add Preprocessing
      3. Step-by-step derivation
        1. frac-2negN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)}{\color{blue}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        2. div-invN/A

          \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        3. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \]
        4. frac-2negN/A

          \[\leadsto \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)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)}} \]
        5. metadata-evalN/A

          \[\leadsto \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)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right)} \]
        6. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{-1}{{B}^{2} - \color{blue}{\left(4 \cdot A\right) \cdot C}} \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\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)}\right), \color{blue}{\left(\frac{-1}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\right)}\right) \]
      4. Applied egg-rr20.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left({A}^{2} \cdot C\right) \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left({A}^{2} \cdot C\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), C\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), C\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. *-lowering-*.f6411.4%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), C\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      7. Simplified11.4%

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

      if 5.99999999999999991e-24 < B < 6.5e95

      1. Initial program 26.9%

        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. frac-2negN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)}{\color{blue}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        2. div-invN/A

          \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        3. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \]
        4. frac-2negN/A

          \[\leadsto \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)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)}} \]
        5. metadata-evalN/A

          \[\leadsto \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)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right)} \]
        6. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{-1}{{B}^{2} - \color{blue}{\left(4 \cdot A\right) \cdot C}} \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\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)}\right), \color{blue}{\left(\frac{-1}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\right)}\right) \]
      4. Applied egg-rr26.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-2 \cdot \left({B}^{3} \cdot F\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \left({B}^{3} \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left({B}^{3}\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. cube-multN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot \left(B \cdot B\right)\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot {B}^{2}\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left({B}^{2}\right)\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot B\right)\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        7. *-lowering-*.f6428.9%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      7. Simplified28.9%

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

      if 6.5e95 < B

      1. Initial program 3.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + 1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        3. *-lft-identityN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        4. +-lowering-+.f642.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. Simplified2.4%

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot \left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(\left(A + A\right) \cdot 2\right) \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        3. sqrt-prodN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2} \cdot \sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        4. pow1/2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2} \cdot {\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2}\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        6. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + A\right) \cdot 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(A + A\right), 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        9. pow1/2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        12. pow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        13. associate-*l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        14. cancel-sign-sub-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        16. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. Applied egg-rr0.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \color{blue}{\left(\sqrt{A \cdot F}\right)}\right), B\right) \]
      12. Step-by-step derivation
        1. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right)\right), B\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right)\right), B\right) \]
        3. *-lowering-*.f647.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right)\right), B\right) \]
      13. Simplified7.9%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6 \cdot 10^{-24}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}\\ \mathbf{elif}\;B \leq 6.5 \cdot 10^{+95}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{-2 \cdot \left(F \cdot \left(B \cdot \left(B \cdot B\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot \sqrt{A \cdot F}}{B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 27.1% accurate, 6.5× speedup?

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

      1. Initial program 20.9%

        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. frac-2negN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)}{\color{blue}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        2. div-invN/A

          \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        3. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \]
        4. frac-2negN/A

          \[\leadsto \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)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)}} \]
        5. metadata-evalN/A

          \[\leadsto \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)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right)} \]
        6. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{-1}{{B}^{2} - \color{blue}{\left(4 \cdot A\right) \cdot C}} \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\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)}\right), \color{blue}{\left(\frac{-1}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\right)}\right) \]
      4. Applied egg-rr20.9%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-8 \cdot A\right) \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-8 \cdot A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(-1 \cdot A\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        7. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{neg}\left(A\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        8. neg-lowering-neg.f6417.1%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      7. Simplified17.1%

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

      if 7.1999999999999997e-28 < B

      1. Initial program 10.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. Add Preprocessing
      3. Taylor expanded in C around 0

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

          \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
        3. distribute-rgt-neg-inN/A

          \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
        4. mul-1-negN/A

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

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

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

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

    Alternative 8: 20.7% accurate, 6.5× speedup?

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

      1. Initial program 20.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. Add Preprocessing
      3. Step-by-step derivation
        1. frac-2negN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)}{\color{blue}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        2. div-invN/A

          \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        3. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \]
        4. frac-2negN/A

          \[\leadsto \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)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)}} \]
        5. metadata-evalN/A

          \[\leadsto \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)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right)} \]
        6. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{-1}{{B}^{2} - \color{blue}{\left(4 \cdot A\right) \cdot C}} \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\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)}\right), \color{blue}{\left(\frac{-1}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\right)}\right) \]
      4. Applied egg-rr20.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-8 \cdot A\right) \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-8 \cdot A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \left(A - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(-1 \cdot A\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        7. mul-1-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{neg}\left(A\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        8. neg-lowering-neg.f6417.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      7. Simplified17.0%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      9. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-16 \cdot {A}^{2}\right) \cdot \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-16 \cdot {A}^{2}\right), \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2}\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \left(A \cdot A\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \left(C \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. *-lowering-*.f6412.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      10. Simplified12.3%

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

      if 4.5000000000000001e-25 < B

      1. Initial program 10.8%

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

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

          \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
        3. distribute-rgt-neg-inN/A

          \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
        4. mul-1-negN/A

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 4.5 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{\left(\left(A \cdot A\right) \cdot -16\right) \cdot \left(C \cdot F\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)} \cdot \frac{\sqrt{2}}{0 - B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 18.3% accurate, 7.1× speedup?

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

      1. Initial program 20.6%

        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. frac-2negN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)}{\color{blue}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        2. div-invN/A

          \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\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)}\right)\right)\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        3. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)} \]
        4. frac-2negN/A

          \[\leadsto \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)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)}} \]
        5. metadata-evalN/A

          \[\leadsto \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)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right)} \]
        6. remove-double-negN/A

          \[\leadsto \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)} \cdot \frac{-1}{{B}^{2} - \color{blue}{\left(4 \cdot A\right) \cdot C}} \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\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)}\right), \color{blue}{\left(\frac{-1}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\right)}\right) \]
      4. Applied egg-rr20.6%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left({A}^{2} \cdot C\right) \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left({A}^{2} \cdot C\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), C\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        5. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), C\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
        6. *-lowering-*.f6411.4%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), C\right), F\right)\right)\right), \mathsf{/.f64}\left(-1, \mathsf{fma.f64}\left(B, B, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), -4\right)\right)\right)\right) \]
      7. Simplified11.4%

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

      if 9.50000000000000058e-23 < B

      1. Initial program 10.9%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + 1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        3. *-lft-identityN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        4. +-lowering-+.f642.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. Simplified2.1%

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot \left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(\left(A + A\right) \cdot 2\right) \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        3. sqrt-prodN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2} \cdot \sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        4. pow1/2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2} \cdot {\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2}\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        6. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + A\right) \cdot 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(A + A\right), 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        9. pow1/2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        10. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        12. pow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        13. associate-*l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        14. cancel-sign-sub-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        16. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. Applied egg-rr1.6%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \color{blue}{\left(\sqrt{A \cdot F}\right)}\right), B\right) \]
      12. Step-by-step derivation
        1. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right)\right), B\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right)\right), B\right) \]
        3. *-lowering-*.f647.7%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right)\right), B\right) \]
      13. Simplified7.7%

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

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

    Alternative 10: 5.1% accurate, 15.3× speedup?

    \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \frac{-2 \cdot \sqrt{A \cdot F}}{B} \end{array} \]
    NOTE: A, B, C, and F 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 < B && B < C && C < F);
    double code(double A, double B, double C, double F) {
    	return (-2.0 * sqrt((A * F))) / B;
    }
    
    NOTE: A, B, C, and F 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 < B && B < C && C < F;
    public static double code(double A, double B, double C, double F) {
    	return (-2.0 * Math.sqrt((A * F))) / B;
    }
    
    [A, B, C, F] = sort([A, B, C, F])
    def code(A, B, C, F):
    	return (-2.0 * math.sqrt((A * F))) / B
    
    A, B, C, F = sort([A, B, C, F])
    function code(A, B, C, F)
    	return Float64(Float64(-2.0 * sqrt(Float64(A * F))) / B)
    end
    
    A, B, C, F = num2cell(sort([A, B, C, F])){:}
    function tmp = code(A, B, C, F)
    	tmp = (-2.0 * sqrt((A * F))) / B;
    end
    
    NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
    code[A_, B_, C_, F_] := N[(N[(-2.0 * N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]
    
    \begin{array}{l}
    [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
    \\
    \frac{-2 \cdot \sqrt{A \cdot F}}{B}
    \end{array}
    
    Derivation
    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + 1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. +-lowering-+.f6414.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified14.2%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot \left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(\left(A + A\right) \cdot 2\right) \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2} \cdot \sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2} \cdot {\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\left(A + A\right) \cdot 2}\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + A\right) \cdot 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(A + A\right), 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \left({\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. pow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B - \left(4 \cdot A\right) \cdot C\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      14. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(A, A\right), 2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(B \cdot B + \left(A \cdot C\right) \cdot -4\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    7. Applied egg-rr5.1%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \color{blue}{\left(\sqrt{A \cdot F}\right)}\right), B\right) \]
    12. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right)\right), B\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right)\right), B\right) \]
      3. *-lowering-*.f643.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right)\right), B\right) \]
    13. Simplified3.0%

      \[\leadsto \frac{-2 \cdot \color{blue}{\sqrt{F \cdot A}}}{B} \]
    14. Final simplification3.0%

      \[\leadsto \frac{-2 \cdot \sqrt{A \cdot F}}{B} \]
    15. Add Preprocessing

    Alternative 11: 3.2% accurate, 16.4× speedup?

    \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \sqrt{\left|\mathsf{fma}\left(2, \frac{F}{B}, 0\right)\right|} \end{array} \]
    NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
    (FPCore (A B C F) :precision binary64 (sqrt (fabs (fma 2.0 (/ F B) 0.0))))
    assert(A < B && B < C && C < F);
    double code(double A, double B, double C, double F) {
    	return sqrt(fabs(fma(2.0, (F / B), 0.0)));
    }
    
    A, B, C, F = sort([A, B, C, F])
    function code(A, B, C, F)
    	return sqrt(abs(fma(2.0, Float64(F / B), 0.0)))
    end
    
    NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
    code[A_, B_, C_, F_] := N[Sqrt[N[Abs[N[(2.0 * N[(F / B), $MachinePrecision] + 0.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
    \\
    \sqrt{\left|\mathsf{fma}\left(2, \frac{F}{B}, 0\right)\right|}
    \end{array}
    
    Derivation
    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in B around -inf

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt{\frac{F}{B}}\right), \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{F}{B}\right)\right), \left(\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left({\color{blue}{\left(\sqrt{-1}\right)}}^{2} \cdot \sqrt{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(-1 \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\sqrt{2}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f642.0%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \mathsf{sqrt.f64}\left(2\right)\right)\right)\right) \]
    5. Simplified2.0%

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

        \[\leadsto 0 - \left(-1 \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto 0 - \left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{\color{blue}{\frac{F}{B}}} \]
      3. cancel-sign-subN/A

        \[\leadsto 0 + \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      4. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{2 \cdot \frac{F}{B}}\right)\right) \]
      6. rem-square-sqrtN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \frac{F}{B}}\right)\right) \]
      7. sqr-negN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \frac{F}{B}}\right)\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
      11. swap-sqrN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right) \cdot \left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
      14. +-lft-identityN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(0 + \sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
      15. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right) + 0\right)}\right)\right) \]
      16. distribute-rgt-outN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) + 0 \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    7. Applied egg-rr2.0%

      \[\leadsto \color{blue}{0 + \sqrt{\mathsf{fma}\left(2, \frac{F}{B}, 0\right)}} \]
    8. Step-by-step derivation
      1. +-lft-identityN/A

        \[\leadsto \sqrt{2 \cdot \frac{F}{B} + 0} \]
      2. +-rgt-identityN/A

        \[\leadsto \sqrt{2 \cdot \frac{F}{B}} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(2 \cdot \frac{F}{B}\right)\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(2 \cdot \frac{F}{B} + 0\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{2 \cdot F}{B} + 0\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{F \cdot 2}{B} + 0\right)\right) \]
      7. associate-/l*N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(F \cdot \frac{2}{B} + 0\right)\right) \]
      8. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{fma.f64}\left(F, \left(\frac{2}{B}\right), 0\right)\right) \]
      9. /-lowering-/.f642.0%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{fma.f64}\left(F, \mathsf{/.f64}\left(2, B\right), 0\right)\right) \]
    9. Applied egg-rr2.0%

      \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(F, \frac{2}{B}, 0\right)}} \]
    10. Step-by-step derivation
      1. flip3-+N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) + \left(0 \cdot 0 - \left(F \cdot \frac{2}{B}\right) \cdot 0\right)}\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) + \left(0 - \left(F \cdot \frac{2}{B}\right) \cdot 0\right)}\right)\right) \]
      3. associate-+r-N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) + 0\right) - \left(F \cdot \frac{2}{B}\right) \cdot 0}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) + \left(\mathsf{neg}\left(0\right)\right)\right) - \left(F \cdot \frac{2}{B}\right) \cdot 0}\right)\right) \]
      5. sub-negN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) - 0\right) - \left(F \cdot \frac{2}{B}\right) \cdot 0}\right)\right) \]
      6. --rgt-identityN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) - \left(F \cdot \frac{2}{B}\right) \cdot 0}\right)\right) \]
      7. +-rgt-identityN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) - \left(F \cdot \frac{2}{B} + 0\right) \cdot 0}\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) - \left(F \cdot \frac{2}{B} + \left(\mathsf{neg}\left(0\right)\right)\right) \cdot 0}\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) - \left(F \cdot \frac{2}{B} - 0\right) \cdot 0}\right)\right) \]
      10. mul0-rgtN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right) - 0}\right)\right) \]
      11. --rgt-identityN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{{\left(F \cdot \frac{2}{B}\right)}^{3} + {0}^{3}}{\left(F \cdot \frac{2}{B}\right) \cdot \left(F \cdot \frac{2}{B}\right)}\right)\right) \]
    11. Applied egg-rr3.1%

      \[\leadsto \sqrt{\color{blue}{\left|\mathsf{fma}\left(2, \frac{F}{B}, 0\right)\right|}} \]
    12. Add Preprocessing

    Alternative 12: 2.0% accurate, 18.2× speedup?

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt{\frac{F}{B}}\right), \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{F}{B}\right)\right), \left(\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left({\color{blue}{\left(\sqrt{-1}\right)}}^{2} \cdot \sqrt{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(-1 \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\sqrt{2}\right)}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f642.0%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \mathsf{sqrt.f64}\left(2\right)\right)\right)\right) \]
    5. Simplified2.0%

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

        \[\leadsto 0 - \left(-1 \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      2. mul-1-negN/A

        \[\leadsto 0 - \left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{\color{blue}{\frac{F}{B}}} \]
      3. cancel-sign-subN/A

        \[\leadsto 0 + \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      4. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{2 \cdot \frac{F}{B}}\right)\right) \]
      6. rem-square-sqrtN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \frac{F}{B}}\right)\right) \]
      7. sqr-negN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \frac{F}{B}}\right)\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
      11. swap-sqrN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right) \cdot \left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
      14. +-lft-identityN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(0 + \sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
      15. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right) + 0\right)}\right)\right) \]
      16. distribute-rgt-outN/A

        \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) + 0 \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    7. Applied egg-rr2.0%

      \[\leadsto \color{blue}{0 + \sqrt{\mathsf{fma}\left(2, \frac{F}{B}, 0\right)}} \]
    8. Step-by-step derivation
      1. +-lft-identityN/A

        \[\leadsto \sqrt{2 \cdot \frac{F}{B} + 0} \]
      2. +-rgt-identityN/A

        \[\leadsto \sqrt{2 \cdot \frac{F}{B}} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(2 \cdot \frac{F}{B}\right)\right) \]
      4. +-rgt-identityN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(2 \cdot \frac{F}{B} + 0\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{2 \cdot F}{B} + 0\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{F \cdot 2}{B} + 0\right)\right) \]
      7. associate-/l*N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(F \cdot \frac{2}{B} + 0\right)\right) \]
      8. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{fma.f64}\left(F, \left(\frac{2}{B}\right), 0\right)\right) \]
      9. /-lowering-/.f642.0%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{fma.f64}\left(F, \mathsf{/.f64}\left(2, B\right), 0\right)\right) \]
    9. Applied egg-rr2.0%

      \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(F, \frac{2}{B}, 0\right)}} \]
    10. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(F \cdot \frac{2}{B}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{2}{B} \cdot F\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{2}{B}\right), F\right)\right) \]
      4. /-lowering-/.f642.0%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, B\right), F\right)\right) \]
    11. Applied egg-rr2.0%

      \[\leadsto \sqrt{\color{blue}{\frac{2}{B} \cdot F}} \]
    12. Final simplification2.0%

      \[\leadsto \sqrt{F \cdot \frac{2}{B}} \]
    13. Add Preprocessing

    Reproduce

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