ABCF->ab-angle a

Percentage Accurate: 18.9% → 55.9%
Time: 26.0s
Alternatives: 21
Speedup: 5.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 18.9% 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: 55.9% accurate, 0.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\\ t_1 := \left(4 \cdot A\right) \cdot C\\ t_2 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_1 - {B\_m}^{2}}\\ t_3 := t\_1 - B\_m \cdot B\_m\\ t_4 := \frac{\sqrt{4 \cdot C}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_4 \cdot \left(\sqrt{t\_0} \cdot \sqrt{F}\right)\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-197}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t\_0 \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_3}\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\frac{\sqrt{F} \cdot \sqrt{\left(2 \cdot \left(B\_m \cdot B\_m\right) + \left(A \cdot C\right) \cdot -8\right) \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_3}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;t\_4 \cdot \sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (+ (* B_m B_m) (* A (* C -4.0))))
        (t_1 (* (* 4.0 A) C))
        (t_2
         (/
          (sqrt
           (*
            (* 2.0 (* (- (pow B_m 2.0) t_1) F))
            (+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
          (- t_1 (pow B_m 2.0))))
        (t_3 (- t_1 (* B_m B_m)))
        (t_4 (/ (sqrt (* 4.0 C)) (- (* 4.0 (* A C)) (* B_m B_m)))))
   (if (<= t_2 (- INFINITY))
     (* t_4 (* (sqrt t_0) (sqrt F)))
     (if (<= t_2 -5e-197)
       (/ (sqrt (* 2.0 (* t_0 (* F (+ (+ A C) (hypot B_m (- A C))))))) t_3)
       (if (<= t_2 0.0)
         (/
          (*
           (sqrt F)
           (sqrt
            (*
             (+ (* 2.0 (* B_m B_m)) (* (* A C) -8.0))
             (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
          t_3)
         (if (<= t_2 INFINITY)
           (* t_4 (sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0)))))
           (* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = (B_m * B_m) + (A * (C * -4.0));
	double t_1 = (4.0 * A) * C;
	double t_2 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_1) * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_1 - pow(B_m, 2.0));
	double t_3 = t_1 - (B_m * B_m);
	double t_4 = sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_4 * (sqrt(t_0) * sqrt(F));
	} else if (t_2 <= -5e-197) {
		tmp = sqrt((2.0 * (t_0 * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_3;
	} else if (t_2 <= 0.0) {
		tmp = (sqrt(F) * sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_3;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_4 * sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
	} else {
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (B_m * B_m) + (A * (C * -4.0));
	double t_1 = (4.0 * A) * C;
	double t_2 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_1) * F)) * ((A + C) + Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / (t_1 - Math.pow(B_m, 2.0));
	double t_3 = t_1 - (B_m * B_m);
	double t_4 = Math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_4 * (Math.sqrt(t_0) * Math.sqrt(F));
	} else if (t_2 <= -5e-197) {
		tmp = Math.sqrt((2.0 * (t_0 * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / t_3;
	} else if (t_2 <= 0.0) {
		tmp = (Math.sqrt(F) * Math.sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_3;
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = t_4 * Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
	} else {
		tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = (B_m * B_m) + (A * (C * -4.0))
	t_1 = (4.0 * A) * C
	t_2 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_1) * F)) * ((A + C) + math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / (t_1 - math.pow(B_m, 2.0))
	t_3 = t_1 - (B_m * B_m)
	t_4 = math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_4 * (math.sqrt(t_0) * math.sqrt(F))
	elif t_2 <= -5e-197:
		tmp = math.sqrt((2.0 * (t_0 * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / t_3
	elif t_2 <= 0.0:
		tmp = (math.sqrt(F) * math.sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_3
	elif t_2 <= math.inf:
		tmp = t_4 * math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))))
	else:
		tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0)))
	t_1 = Float64(Float64(4.0 * A) * C)
	t_2 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_1) * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_1 - (B_m ^ 2.0)))
	t_3 = Float64(t_1 - Float64(B_m * B_m))
	t_4 = Float64(sqrt(Float64(4.0 * C)) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(t_4 * Float64(sqrt(t_0) * sqrt(F)));
	elseif (t_2 <= -5e-197)
		tmp = Float64(sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_3);
	elseif (t_2 <= 0.0)
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(Float64(Float64(2.0 * Float64(B_m * B_m)) + Float64(Float64(A * C) * -8.0)) * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / t_3);
	elseif (t_2 <= Inf)
		tmp = Float64(t_4 * sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))));
	else
		tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = (B_m * B_m) + (A * (C * -4.0));
	t_1 = (4.0 * A) * C;
	t_2 = sqrt(((2.0 * (((B_m ^ 2.0) - t_1) * F)) * ((A + C) + sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / (t_1 - (B_m ^ 2.0));
	t_3 = t_1 - (B_m * B_m);
	t_4 = sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_4 * (sqrt(t_0) * sqrt(F));
	elseif (t_2 <= -5e-197)
		tmp = sqrt((2.0 * (t_0 * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_3;
	elseif (t_2 <= 0.0)
		tmp = (sqrt(F) * sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_3;
	elseif (t_2 <= Inf)
		tmp = t_4 * sqrt((F * ((B_m * B_m) + ((A * C) * -4.0))));
	else
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$1 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(4.0 * C), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$4 * N[(N[Sqrt[t$95$0], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-197], N[(N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(N[(2.0 * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$4 * N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\\
t_1 := \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_1 - {B\_m}^{2}}\\
t_3 := t\_1 - B\_m \cdot B\_m\\
t_4 := \frac{\sqrt{4 \cdot C}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_4 \cdot \left(\sqrt{t\_0} \cdot \sqrt{F}\right)\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-197}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t\_0 \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_3}\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\sqrt{F} \cdot \sqrt{\left(2 \cdot \left(B\_m \cdot B\_m\right) + \left(A \cdot C\right) \cdot -8\right) \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_3}\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_4 \cdot \sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 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.2%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(4, C\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(B, B\right)}, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right)\right), \mathsf{sqrt.f64}\left(F\right)\right)\right) \]
    12. Simplified34.0%

      \[\leadsto \frac{\sqrt{\color{blue}{4 \cdot C}}}{\left(A \cdot C\right) \cdot 4 - B \cdot B} \cdot \left(\sqrt{B \cdot B + A \cdot \left(C \cdot -4\right)} \cdot \sqrt{F}\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))) < -5.0000000000000002e-197

    1. Initial program 95.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

    if -5.0000000000000002e-197 < (/.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))) < -0.0

    1. Initial program 3.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{A}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), A\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(B, B\right)\right), A\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    7. Simplified26.6%

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

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

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

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

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

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

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

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

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

    if -0.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))) < +inf.0

    1. Initial program 48.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(4 \cdot C\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6443.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(4, C\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(B, B\right)}, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    10. Simplified43.8%

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

    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. Initial program 0.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\sqrt{2}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f6413.2%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified13.2%

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

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

Alternative 2: 48.6% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 1.6 \cdot 10^{-19}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{elif}\;B\_m \leq 3.1 \cdot 10^{+147}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m} \cdot \left(B\_m \cdot \sqrt{F}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 1.6e-19)
   (/
    (*
     (sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
     (sqrt (* 2.0 (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
    (- (* (* 4.0 A) C) (* B_m B_m)))
   (if (<= B_m 3.1e+147)
     (*
      (/
       (sqrt (* 2.0 (+ (+ A C) (hypot B_m (- A C)))))
       (- (* 4.0 (* A C)) (* B_m B_m)))
      (* B_m (sqrt F)))
     (* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.6e-19) {
		tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else if (B_m <= 3.1e+147) {
		tmp = (sqrt((2.0 * ((A + C) + hypot(B_m, (A - C))))) / ((4.0 * (A * C)) - (B_m * B_m))) * (B_m * sqrt(F));
	} else {
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.6e-19) {
		tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else if (B_m <= 3.1e+147) {
		tmp = (Math.sqrt((2.0 * ((A + C) + Math.hypot(B_m, (A - C))))) / ((4.0 * (A * C)) - (B_m * B_m))) * (B_m * Math.sqrt(F));
	} else {
		tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 1.6e-19:
		tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m))
	elif B_m <= 3.1e+147:
		tmp = (math.sqrt((2.0 * ((A + C) + math.hypot(B_m, (A - C))))) / ((4.0 * (A * C)) - (B_m * B_m))) * (B_m * math.sqrt(F))
	else:
		tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 1.6e-19)
		tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	elseif (B_m <= 3.1e+147)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))) * Float64(B_m * sqrt(F)));
	else
		tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 1.6e-19)
		tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
	elseif (B_m <= 3.1e+147)
		tmp = (sqrt((2.0 * ((A + C) + hypot(B_m, (A - C))))) / ((4.0 * (A * C)) - (B_m * B_m))) * (B_m * sqrt(F));
	else
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.6e-19], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 3.1e+147], N[(N[(N[Sqrt[N[(2.0 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B$95$m * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.6 \cdot 10^{-19}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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

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


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

    1. Initial program 24.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{A}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), A\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.59999999999999991e-19 < B < 3.1e147

    1. Initial program 38.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), \mathsf{+.f64}\left(A, C\right)\right), 2\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(F\right)\right)\right) \]
    10. Simplified57.6%

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

    if 3.1e147 < B

    1. Initial program 0.2%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified49.4%

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

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

Alternative 3: 40.4% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\\ \mathbf{if}\;A \leq -7.2 \cdot 10^{+49}:\\ \;\;\;\;\frac{\sqrt{F} \cdot \sqrt{\left(2 \cdot \left(B\_m \cdot B\_m\right) + \left(A \cdot C\right) \cdot -8\right) \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{elif}\;A \leq 7.4 \cdot 10^{-305}:\\ \;\;\;\;\sqrt{\frac{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}{t\_0}} \cdot \left(0 - \sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{4 \cdot C}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m} \cdot \sqrt{F \cdot t\_0}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (+ (* B_m B_m) (* (* A C) -4.0))))
   (if (<= A -7.2e+49)
     (/
      (*
       (sqrt F)
       (sqrt
        (*
         (+ (* 2.0 (* B_m B_m)) (* (* A C) -8.0))
         (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
      (- (* (* 4.0 A) C) (* B_m B_m)))
     (if (<= A 7.4e-305)
       (*
        (sqrt (/ (* F (+ A (+ C (hypot B_m (- A C))))) t_0))
        (- 0.0 (sqrt 2.0)))
       (*
        (/ (sqrt (* 4.0 C)) (- (* 4.0 (* A C)) (* B_m B_m)))
        (sqrt (* F t_0)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = (B_m * B_m) + ((A * C) * -4.0);
	double tmp;
	if (A <= -7.2e+49) {
		tmp = (sqrt(F) * sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else if (A <= 7.4e-305) {
		tmp = sqrt(((F * (A + (C + hypot(B_m, (A - C))))) / t_0)) * (0.0 - sqrt(2.0));
	} else {
		tmp = (sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * sqrt((F * t_0));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (B_m * B_m) + ((A * C) * -4.0);
	double tmp;
	if (A <= -7.2e+49) {
		tmp = (Math.sqrt(F) * Math.sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else if (A <= 7.4e-305) {
		tmp = Math.sqrt(((F * (A + (C + Math.hypot(B_m, (A - C))))) / t_0)) * (0.0 - Math.sqrt(2.0));
	} else {
		tmp = (Math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * Math.sqrt((F * t_0));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = (B_m * B_m) + ((A * C) * -4.0)
	tmp = 0
	if A <= -7.2e+49:
		tmp = (math.sqrt(F) * math.sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m))
	elif A <= 7.4e-305:
		tmp = math.sqrt(((F * (A + (C + math.hypot(B_m, (A - C))))) / t_0)) * (0.0 - math.sqrt(2.0))
	else:
		tmp = (math.sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * math.sqrt((F * t_0))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0))
	tmp = 0.0
	if (A <= -7.2e+49)
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(Float64(Float64(2.0 * Float64(B_m * B_m)) + Float64(Float64(A * C) * -8.0)) * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	elseif (A <= 7.4e-305)
		tmp = Float64(sqrt(Float64(Float64(F * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))) / t_0)) * Float64(0.0 - sqrt(2.0)));
	else
		tmp = Float64(Float64(sqrt(Float64(4.0 * C)) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))) * sqrt(Float64(F * t_0)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = (B_m * B_m) + ((A * C) * -4.0);
	tmp = 0.0;
	if (A <= -7.2e+49)
		tmp = (sqrt(F) * sqrt((((2.0 * (B_m * B_m)) + ((A * C) * -8.0)) * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / (((4.0 * A) * C) - (B_m * B_m));
	elseif (A <= 7.4e-305)
		tmp = sqrt(((F * (A + (C + hypot(B_m, (A - C))))) / t_0)) * (0.0 - sqrt(2.0));
	else
		tmp = (sqrt((4.0 * C)) / ((4.0 * (A * C)) - (B_m * B_m))) * sqrt((F * t_0));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -7.2e+49], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(N[(2.0 * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 7.4e-305], N[(N[Sqrt[N[(N[(F * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(4.0 * C), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(F * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\\
\mathbf{if}\;A \leq -7.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{\sqrt{F} \cdot \sqrt{\left(2 \cdot \left(B\_m \cdot B\_m\right) + \left(A \cdot C\right) \cdot -8\right) \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

\mathbf{elif}\;A \leq 7.4 \cdot 10^{-305}:\\
\;\;\;\;\sqrt{\frac{F \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}{t\_0}} \cdot \left(0 - \sqrt{2}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{4 \cdot C}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m} \cdot \sqrt{F \cdot t\_0}\\


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

    1. Initial program 5.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{A}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), A\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999993e49 < A < 7.39999999999999954e-305

    1. Initial program 32.1%

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

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

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

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

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

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

    if 7.39999999999999954e-305 < A

    1. Initial program 31.3%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(4 \cdot C\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6413.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(4, C\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(B, B\right)}, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    10. Simplified13.8%

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

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

Alternative 4: 48.0% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;B\_m \leq 3.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_0}\\ \mathbf{elif}\;B\_m \leq 1.1 \cdot 10^{+28}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)} \cdot \left(0 - \frac{\sqrt{2}}{B\_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= B_m 3.5e-21)
     (/
      (*
       (sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
       (sqrt (* 2.0 (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
      t_0)
     (if (<= B_m 1.1e+28)
       (/
        (sqrt
         (*
          2.0
          (*
           (+ (* B_m B_m) (* A (* C -4.0)))
           (* F (+ (+ A C) (hypot B_m (- A C)))))))
        t_0)
       (* (sqrt (* F (+ C (hypot B_m C)))) (- 0.0 (/ (sqrt 2.0) B_m)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (B_m <= 3.5e-21) {
		tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
	} else if (B_m <= 1.1e+28) {
		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = sqrt((F * (C + hypot(B_m, C)))) * (0.0 - (sqrt(2.0) / B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (B_m <= 3.5e-21) {
		tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
	} else if (B_m <= 1.1e+28) {
		tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = Math.sqrt((F * (C + Math.hypot(B_m, C)))) * (0.0 - (Math.sqrt(2.0) / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	tmp = 0
	if B_m <= 3.5e-21:
		tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0
	elif B_m <= 1.1e+28:
		tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / t_0
	else:
		tmp = math.sqrt((F * (C + math.hypot(B_m, C)))) * (0.0 - (math.sqrt(2.0) / B_m))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	tmp = 0.0
	if (B_m <= 3.5e-21)
		tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / t_0);
	elseif (B_m <= 1.1e+28)
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F * Float64(C + hypot(B_m, C)))) * Float64(0.0 - Float64(sqrt(2.0) / B_m)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((4.0 * A) * C) - (B_m * B_m);
	tmp = 0.0;
	if (B_m <= 3.5e-21)
		tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
	elseif (B_m <= 1.1e+28)
		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
	else
		tmp = sqrt((F * (C + hypot(B_m, C)))) * (0.0 - (sqrt(2.0) / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3.5e-21], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.1e+28], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 3.5 \cdot 10^{-21}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_0}\\

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

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


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

    1. Initial program 24.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{A}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), A\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000003e-21 < B < 1.09999999999999993e28

    1. Initial program 53.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

    if 1.09999999999999993e28 < B

    1. Initial program 13.6%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right)\right) \]
      11. accelerator-lowering-hypot.f6441.6%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right)\right) \]
    8. Simplified41.6%

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

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

Alternative 5: 44.7% accurate, 2.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;B\_m \leq 2.4 \cdot 10^{-22}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_0}\\ \mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{+127}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= B_m 2.4e-22)
     (/
      (*
       (sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
       (sqrt (* 2.0 (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A)))))
      t_0)
     (if (<= B_m 1.5e+127)
       (/
        (sqrt
         (*
          2.0
          (*
           (+ (* B_m B_m) (* A (* C -4.0)))
           (* F (+ (+ A C) (hypot B_m (- A C)))))))
        t_0)
       (* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (B_m <= 2.4e-22) {
		tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
	} else if (B_m <= 1.5e+127) {
		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (B_m <= 2.4e-22) {
		tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
	} else if (B_m <= 1.5e+127) {
		tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	tmp = 0
	if B_m <= 2.4e-22:
		tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0
	elif B_m <= 1.5e+127:
		tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / t_0
	else:
		tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	tmp = 0.0
	if (B_m <= 2.4e-22)
		tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A))))) / t_0);
	elseif (B_m <= 1.5e+127)
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((4.0 * A) * C) - (B_m * B_m);
	tmp = 0.0;
	if (B_m <= 2.4e-22)
		tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * ((2.0 * C) + (((B_m * B_m) * -0.5) / A))))) / t_0;
	elseif (B_m <= 1.5e+127)
		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
	else
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.4e-22], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.5e+127], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 2.4 \cdot 10^{-22}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)}}{t\_0}\\

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

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


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

    1. Initial program 24.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{A}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), A\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.40000000000000002e-22 < B < 1.5000000000000001e127

    1. Initial program 41.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

    if 1.5000000000000001e127 < B

    1. Initial program 0.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified48.4%

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

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

Alternative 6: 44.8% accurate, 2.6× speedup?

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

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

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


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

    1. Initial program 24.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(B, B\right)\right), A\right), \mathsf{*.f64}\left(4, C\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \color{blue}{B}\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    10. Simplified19.9%

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

    if 2.0000000000000001e-22 < B < 1.78e127

    1. Initial program 41.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

    if 1.78e127 < B

    1. Initial program 0.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified48.4%

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

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

Alternative 7: 44.8% accurate, 2.6× speedup?

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

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

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


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

    1. Initial program 24.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(B, B\right)\right), A\right), \mathsf{*.f64}\left(4, C\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \color{blue}{B}\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    10. Simplified19.9%

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

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

        \[\leadsto \sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F} \cdot \frac{1}{\color{blue}{\frac{\left(A \cdot C\right) \cdot 4 - B \cdot B}{\sqrt{\frac{-1 \cdot \left(B \cdot B\right)}{A} + 4 \cdot C}}}} \]
      3. un-div-invN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F}\right), \color{blue}{\left(\frac{\left(A \cdot C\right) \cdot 4 - B \cdot B}{\sqrt{\frac{-1 \cdot \left(B \cdot B\right)}{A} + 4 \cdot C}}\right)}\right) \]
    12. Applied egg-rr19.8%

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

    if 2.60000000000000017e-21 < B < 1.59999999999999988e127

    1. Initial program 41.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

    if 1.59999999999999988e127 < B

    1. Initial program 0.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified48.4%

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

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

Alternative 8: 44.5% accurate, 2.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;B\_m \leq 1.06 \cdot 10^{-48}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C\right)}}{t\_0}\\ \mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{+127}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= B_m 1.06e-48)
     (/
      (*
       (sqrt (* F (+ (* B_m B_m) (* (* A C) -4.0))))
       (sqrt (* 2.0 (* 2.0 C))))
      t_0)
     (if (<= B_m 1.5e+127)
       (/
        (sqrt
         (*
          2.0
          (*
           (+ (* B_m B_m) (* A (* C -4.0)))
           (* F (+ (+ A C) (hypot B_m (- A C)))))))
        t_0)
       (* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (B_m <= 1.06e-48) {
		tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * (2.0 * C)))) / t_0;
	} else if (B_m <= 1.5e+127) {
		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (B_m <= 1.06e-48) {
		tmp = (Math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * Math.sqrt((2.0 * (2.0 * C)))) / t_0;
	} else if (B_m <= 1.5e+127) {
		tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + Math.hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	tmp = 0
	if B_m <= 1.06e-48:
		tmp = (math.sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * math.sqrt((2.0 * (2.0 * C)))) / t_0
	elif B_m <= 1.5e+127:
		tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + math.hypot(B_m, (A - C))))))) / t_0
	else:
		tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	tmp = 0.0
	if (B_m <= 1.06e-48)
		tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)))) * sqrt(Float64(2.0 * Float64(2.0 * C)))) / t_0);
	elseif (B_m <= 1.5e+127)
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((4.0 * A) * C) - (B_m * B_m);
	tmp = 0.0;
	if (B_m <= 1.06e-48)
		tmp = (sqrt((F * ((B_m * B_m) + ((A * C) * -4.0)))) * sqrt((2.0 * (2.0 * C)))) / t_0;
	elseif (B_m <= 1.5e+127)
		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * ((A + C) + hypot(B_m, (A - C))))))) / t_0;
	else
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.06e-48], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.5e+127], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 1.06 \cdot 10^{-48}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right)} \cdot \sqrt{2 \cdot \left(2 \cdot C\right)}}{t\_0}\\

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

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


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

    1. Initial program 24.3%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(2 \cdot C\right)}, 2\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f6418.6%

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

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

    if 1.0600000000000001e-48 < B < 1.5000000000000001e127

    1. Initial program 41.2%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

    if 1.5000000000000001e127 < B

    1. Initial program 0.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified48.4%

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

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

Alternative 9: 43.8% accurate, 2.7× speedup?

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

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


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

    1. Initial program 26.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(2 \cdot C\right)}, 2\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f6418.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, C\right), 2\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    8. Simplified18.0%

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

    if 2.9500000000000002 < B

    1. Initial program 19.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\sqrt{2}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f6444.1%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified44.1%

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

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

Alternative 10: 43.8% accurate, 2.8× speedup?

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

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


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

    1. Initial program 26.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(4 \cdot C\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6418.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(4, C\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(B, B\right)}, \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    10. Simplified18.1%

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

    if 3.7999999999999998 < B

    1. Initial program 19.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\sqrt{2}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f6444.1%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified44.1%

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

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

Alternative 11: 44.2% accurate, 3.0× speedup?

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

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


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

    1. Initial program 26.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \color{blue}{\left(C \cdot \left(2 + \left(-1 \cdot \frac{A}{C} + \frac{A}{C}\right)\right)\right)}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Step-by-step derivation
      1. distribute-lft1-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \left(C \cdot \left(2 + 0 \cdot \frac{A}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. mul0-lftN/A

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

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

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

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

    if 1.46 < B

    1. Initial program 19.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\sqrt{2}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f6444.1%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    8. Simplified44.1%

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

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

Alternative 12: 30.3% accurate, 4.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ t_1 := B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\\ \mathbf{if}\;C \leq 10^{-122}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t\_1 \cdot \left(F \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t\_1 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m)))
        (t_1 (+ (* B_m B_m) (* A (* C -4.0)))))
   (if (<= C 1e-122)
     (/
      (sqrt (* 2.0 (* t_1 (* F (+ (* 2.0 C) (/ (* (* B_m B_m) -0.5) A))))))
      t_0)
     (/ (sqrt (* 2.0 (* t_1 (* F (* 2.0 C))))) t_0))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double t_1 = (B_m * B_m) + (A * (C * -4.0));
	double tmp;
	if (C <= 1e-122) {
		tmp = sqrt((2.0 * (t_1 * (F * ((2.0 * C) + (((B_m * B_m) * -0.5) / A)))))) / t_0;
	} else {
		tmp = sqrt((2.0 * (t_1 * (F * (2.0 * C))))) / t_0;
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((4.0d0 * a) * c) - (b_m * b_m)
    t_1 = (b_m * b_m) + (a * (c * (-4.0d0)))
    if (c <= 1d-122) then
        tmp = sqrt((2.0d0 * (t_1 * (f * ((2.0d0 * c) + (((b_m * b_m) * (-0.5d0)) / a)))))) / t_0
    else
        tmp = sqrt((2.0d0 * (t_1 * (f * (2.0d0 * c))))) / t_0
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double t_1 = (B_m * B_m) + (A * (C * -4.0));
	double tmp;
	if (C <= 1e-122) {
		tmp = Math.sqrt((2.0 * (t_1 * (F * ((2.0 * C) + (((B_m * B_m) * -0.5) / A)))))) / t_0;
	} else {
		tmp = Math.sqrt((2.0 * (t_1 * (F * (2.0 * C))))) / t_0;
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	t_1 = (B_m * B_m) + (A * (C * -4.0))
	tmp = 0
	if C <= 1e-122:
		tmp = math.sqrt((2.0 * (t_1 * (F * ((2.0 * C) + (((B_m * B_m) * -0.5) / A)))))) / t_0
	else:
		tmp = math.sqrt((2.0 * (t_1 * (F * (2.0 * C))))) / t_0
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	t_1 = Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (C <= 1e-122)
		tmp = Float64(sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(Float64(2.0 * C) + Float64(Float64(Float64(B_m * B_m) * -0.5) / A)))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(2.0 * C))))) / t_0);
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((4.0 * A) * C) - (B_m * B_m);
	t_1 = (B_m * B_m) + (A * (C * -4.0));
	tmp = 0.0;
	if (C <= 1e-122)
		tmp = sqrt((2.0 * (t_1 * (F * ((2.0 * C) + (((B_m * B_m) * -0.5) / A)))))) / t_0;
	else
		tmp = sqrt((2.0 * (t_1 * (F * (2.0 * C))))) / t_0;
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 1e-122], N[(N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(N[(2.0 * C), $MachinePrecision] + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(t$95$1 * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
t_1 := B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\\
\mathbf{if}\;C \leq 10^{-122}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t\_1 \cdot \left(F \cdot \left(2 \cdot C + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{A}\right)\right)\right)}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t\_1 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t\_0}\\


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

    1. Initial program 24.3%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{A}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, C\right), \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), A\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

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

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

    if 1.00000000000000006e-122 < C

    1. Initial program 26.2%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \color{blue}{\left(C \cdot \left(2 + \left(-1 \cdot \frac{A}{C} + \frac{A}{C}\right)\right)\right)}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Step-by-step derivation
      1. distribute-lft1-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \left(C \cdot \left(2 + 0 \cdot \frac{A}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. mul0-lftN/A

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

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

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

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

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

Alternative 13: 30.2% accurate, 4.7× speedup?

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

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


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

    1. Initial program 24.3%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(B, B\right)\right), A\right), \mathsf{*.f64}\left(4, C\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \color{blue}{B}\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), F\right)\right)\right) \]
    10. Simplified8.9%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\frac{-1 \cdot \left(B \cdot B\right)}{A} + 4 \cdot C} \cdot \sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F}\right), \color{blue}{\left(\left(4 \cdot A\right) \cdot C - B \cdot B\right)}\right) \]
    12. Applied egg-rr10.0%

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

    if 6.9999999999999997e-134 < C

    1. Initial program 26.2%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \color{blue}{\left(C \cdot \left(2 + \left(-1 \cdot \frac{A}{C} + \frac{A}{C}\right)\right)\right)}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Step-by-step derivation
      1. distribute-lft1-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \left(C \cdot \left(2 + 0 \cdot \frac{A}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. mul0-lftN/A

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

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

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

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

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

Alternative 14: 28.7% accurate, 4.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;B\_m \leq 3.1:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(B\_m \cdot F\right)\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C)))
   (if (<= B_m 3.1)
     (/
      (sqrt (* 2.0 (* (+ (* B_m B_m) (* A (* C -4.0))) (* F (* 2.0 C)))))
      (- t_0 (* B_m B_m)))
     (*
      (/ -1.0 (- (* B_m B_m) t_0))
      (sqrt (* 2.0 (* (+ (* B_m B_m) (* (* A C) -4.0)) (* B_m F))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double tmp;
	if (B_m <= 3.1) {
		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (t_0 - (B_m * B_m));
	} else {
		tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (4.0d0 * a) * c
    if (b_m <= 3.1d0) then
        tmp = sqrt((2.0d0 * (((b_m * b_m) + (a * (c * (-4.0d0)))) * (f * (2.0d0 * c))))) / (t_0 - (b_m * b_m))
    else
        tmp = ((-1.0d0) / ((b_m * b_m) - t_0)) * sqrt((2.0d0 * (((b_m * b_m) + ((a * c) * (-4.0d0))) * (b_m * f))))
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double tmp;
	if (B_m <= 3.1) {
		tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (t_0 - (B_m * B_m));
	} else {
		tmp = (-1.0 / ((B_m * B_m) - t_0)) * Math.sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	tmp = 0
	if B_m <= 3.1:
		tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (t_0 - (B_m * B_m))
	else:
		tmp = (-1.0 / ((B_m * B_m) - t_0)) * math.sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	tmp = 0.0
	if (B_m <= 3.1)
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(F * Float64(2.0 * C))))) / Float64(t_0 - Float64(B_m * B_m)));
	else
		tmp = Float64(Float64(-1.0 / Float64(Float64(B_m * B_m) - t_0)) * sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) * Float64(B_m * F)))));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	tmp = 0.0;
	if (B_m <= 3.1)
		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (F * (2.0 * C))))) / (t_0 - (B_m * B_m));
	else
		tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 3.1], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 3.1:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(B\_m \cdot F\right)\right)}\\


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

    1. Initial program 26.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. 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. distribute-neg-frac2N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \color{blue}{\left(C \cdot \left(2 + \left(-1 \cdot \frac{A}{C} + \frac{A}{C}\right)\right)\right)}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Step-by-step derivation
      1. distribute-lft1-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \left(C \cdot \left(2 + 0 \cdot \frac{A}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. mul0-lftN/A

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

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

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

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

    if 3.10000000000000009 < B

    1. Initial program 19.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. distribute-neg-frac2N/A

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, 4\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \mathsf{*.f64}\left(F, \color{blue}{B}\right)\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. Simplified15.9%

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

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

    Alternative 15: 27.4% accurate, 4.8× speedup?

    \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;B\_m \leq 9.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(B\_m \cdot F\right)\right)}\\ \end{array} \end{array} \]
    B_m = (fabs.f64 B)
    NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
    (FPCore (A B_m C F)
     :precision binary64
     (let* ((t_0 (* (* 4.0 A) C)))
       (if (<= B_m 9.5e-6)
         (/ (sqrt (* -16.0 (* (* A C) (* C F)))) (- t_0 (* B_m B_m)))
         (*
          (/ -1.0 (- (* B_m B_m) t_0))
          (sqrt (* 2.0 (* (+ (* B_m B_m) (* (* A C) -4.0)) (* B_m F))))))))
    B_m = fabs(B);
    assert(A < B_m && B_m < C && C < F);
    double code(double A, double B_m, double C, double F) {
    	double t_0 = (4.0 * A) * C;
    	double tmp;
    	if (B_m <= 9.5e-6) {
    		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
    	} else {
    		tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
    	}
    	return tmp;
    }
    
    B_m = abs(b)
    NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
    real(8) function code(a, b_m, c, f)
        real(8), intent (in) :: a
        real(8), intent (in) :: b_m
        real(8), intent (in) :: c
        real(8), intent (in) :: f
        real(8) :: t_0
        real(8) :: tmp
        t_0 = (4.0d0 * a) * c
        if (b_m <= 9.5d-6) then
            tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / (t_0 - (b_m * b_m))
        else
            tmp = ((-1.0d0) / ((b_m * b_m) - t_0)) * sqrt((2.0d0 * (((b_m * b_m) + ((a * c) * (-4.0d0))) * (b_m * f))))
        end if
        code = tmp
    end function
    
    B_m = Math.abs(B);
    assert A < B_m && B_m < C && C < F;
    public static double code(double A, double B_m, double C, double F) {
    	double t_0 = (4.0 * A) * C;
    	double tmp;
    	if (B_m <= 9.5e-6) {
    		tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
    	} else {
    		tmp = (-1.0 / ((B_m * B_m) - t_0)) * Math.sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
    	}
    	return tmp;
    }
    
    B_m = math.fabs(B)
    [A, B_m, C, F] = sort([A, B_m, C, F])
    def code(A, B_m, C, F):
    	t_0 = (4.0 * A) * C
    	tmp = 0
    	if B_m <= 9.5e-6:
    		tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m))
    	else:
    		tmp = (-1.0 / ((B_m * B_m) - t_0)) * math.sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))))
    	return tmp
    
    B_m = abs(B)
    A, B_m, C, F = sort([A, B_m, C, F])
    function code(A, B_m, C, F)
    	t_0 = Float64(Float64(4.0 * A) * C)
    	tmp = 0.0
    	if (B_m <= 9.5e-6)
    		tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / Float64(t_0 - Float64(B_m * B_m)));
    	else
    		tmp = Float64(Float64(-1.0 / Float64(Float64(B_m * B_m) - t_0)) * sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(Float64(A * C) * -4.0)) * Float64(B_m * F)))));
    	end
    	return tmp
    end
    
    B_m = abs(B);
    A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
    function tmp_2 = code(A, B_m, C, F)
    	t_0 = (4.0 * A) * C;
    	tmp = 0.0;
    	if (B_m <= 9.5e-6)
    		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
    	else
    		tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (((B_m * B_m) + ((A * C) * -4.0)) * (B_m * F))));
    	end
    	tmp_2 = tmp;
    end
    
    B_m = N[Abs[B], $MachinePrecision]
    NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
    code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 9.5e-6], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    B_m = \left|B\right|
    \\
    [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
    \\
    \begin{array}{l}
    t_0 := \left(4 \cdot A\right) \cdot C\\
    \mathbf{if}\;B\_m \leq 9.5 \cdot 10^{-6}:\\
    \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + \left(A \cdot C\right) \cdot -4\right) \cdot \left(B\_m \cdot F\right)\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if B < 9.5000000000000005e-6

      1. Initial program 25.4%

        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      2. Step-by-step derivation
        1. 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. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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 \cdot \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
        2. *-lowering-*.f64N/A

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{-16 \cdot \left(A \cdot \left(\left(C \cdot C\right) \cdot F\right)\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
      8. Step-by-step derivation
        1. associate-*l*N/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left(A \cdot C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\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(A, C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
        5. *-lowering-*.f6415.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), \mathsf{*.f64}\left(C, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. Applied egg-rr15.9%

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

      if 9.5000000000000005e-6 < B

      1. Initial program 23.6%

        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      2. 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. distribute-neg-frac2N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, 4\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \mathsf{*.f64}\left(F, \color{blue}{B}\right)\right)\right)\right)\right) \]
      7. Step-by-step derivation
        1. Simplified16.9%

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

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

      Alternative 16: 27.4% accurate, 4.9× speedup?

      \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;B\_m \leq 6.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(B\_m \cdot F\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
      B_m = (fabs.f64 B)
      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
      (FPCore (A B_m C F)
       :precision binary64
       (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
         (if (<= B_m 6.2e-6)
           (/ (sqrt (* -16.0 (* (* A C) (* C F)))) t_0)
           (/ (sqrt (* 2.0 (* (+ (* B_m B_m) (* A (* C -4.0))) (* B_m F)))) t_0))))
      B_m = fabs(B);
      assert(A < B_m && B_m < C && C < F);
      double code(double A, double B_m, double C, double F) {
      	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
      	double tmp;
      	if (B_m <= 6.2e-6) {
      		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
      	} else {
      		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (B_m * F)))) / t_0;
      	}
      	return tmp;
      }
      
      B_m = abs(b)
      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
      real(8) function code(a, b_m, c, f)
          real(8), intent (in) :: a
          real(8), intent (in) :: b_m
          real(8), intent (in) :: c
          real(8), intent (in) :: f
          real(8) :: t_0
          real(8) :: tmp
          t_0 = ((4.0d0 * a) * c) - (b_m * b_m)
          if (b_m <= 6.2d-6) then
              tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / t_0
          else
              tmp = sqrt((2.0d0 * (((b_m * b_m) + (a * (c * (-4.0d0)))) * (b_m * f)))) / t_0
          end if
          code = tmp
      end function
      
      B_m = Math.abs(B);
      assert A < B_m && B_m < C && C < F;
      public static double code(double A, double B_m, double C, double F) {
      	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
      	double tmp;
      	if (B_m <= 6.2e-6) {
      		tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
      	} else {
      		tmp = Math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (B_m * F)))) / t_0;
      	}
      	return tmp;
      }
      
      B_m = math.fabs(B)
      [A, B_m, C, F] = sort([A, B_m, C, F])
      def code(A, B_m, C, F):
      	t_0 = ((4.0 * A) * C) - (B_m * B_m)
      	tmp = 0
      	if B_m <= 6.2e-6:
      		tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / t_0
      	else:
      		tmp = math.sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (B_m * F)))) / t_0
      	return tmp
      
      B_m = abs(B)
      A, B_m, C, F = sort([A, B_m, C, F])
      function code(A, B_m, C, F)
      	t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
      	tmp = 0.0
      	if (B_m <= 6.2e-6)
      		tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / t_0);
      	else
      		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(B_m * F)))) / t_0);
      	end
      	return tmp
      end
      
      B_m = abs(B);
      A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
      function tmp_2 = code(A, B_m, C, F)
      	t_0 = ((4.0 * A) * C) - (B_m * B_m);
      	tmp = 0.0;
      	if (B_m <= 6.2e-6)
      		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
      	else
      		tmp = sqrt((2.0 * (((B_m * B_m) + (A * (C * -4.0))) * (B_m * F)))) / t_0;
      	end
      	tmp_2 = tmp;
      end
      
      B_m = N[Abs[B], $MachinePrecision]
      NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
      code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 6.2e-6], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
      
      \begin{array}{l}
      B_m = \left|B\right|
      \\
      [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
      \\
      \begin{array}{l}
      t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
      \mathbf{if}\;B\_m \leq 6.2 \cdot 10^{-6}:\\
      \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(B\_m \cdot F\right)\right)}}{t\_0}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if B < 6.1999999999999999e-6

        1. Initial program 25.4%

          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
        2. Step-by-step derivation
          1. 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. distribute-neg-frac2N/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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 \cdot \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          2. *-lowering-*.f64N/A

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

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

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

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

          \[\leadsto \frac{\sqrt{\color{blue}{-16 \cdot \left(A \cdot \left(\left(C \cdot C\right) \cdot F\right)\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
        8. Step-by-step derivation
          1. associate-*l*N/A

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left(A \cdot C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\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(A, C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          5. *-lowering-*.f6415.9%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), \mathsf{*.f64}\left(C, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
        9. Applied egg-rr15.9%

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

        if 6.1999999999999999e-6 < B

        1. Initial program 23.6%

          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
        2. 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. distribute-neg-frac2N/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(F, \color{blue}{B}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
        6. Step-by-step derivation
          1. Simplified16.9%

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

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

        Alternative 17: 26.0% accurate, 5.0× speedup?

        \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 4.8 \cdot 10^{-6}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{B\_m \cdot B\_m - A \cdot \left(4 \cdot C\right)}{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}}\\ \end{array} \end{array} \]
        B_m = (fabs.f64 B)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B_m C F)
         :precision binary64
         (if (<= B_m 4.8e-6)
           (/ (sqrt (* -16.0 (* (* A C) (* C F)))) (- (* (* 4.0 A) C) (* B_m B_m)))
           (/
            -1.0
            (/
             (- (* B_m B_m) (* A (* 4.0 C)))
             (sqrt (* 2.0 (* F (* B_m (* B_m B_m)))))))))
        B_m = fabs(B);
        assert(A < B_m && B_m < C && C < F);
        double code(double A, double B_m, double C, double F) {
        	double tmp;
        	if (B_m <= 4.8e-6) {
        		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
        	} else {
        		tmp = -1.0 / (((B_m * B_m) - (A * (4.0 * C))) / sqrt((2.0 * (F * (B_m * (B_m * B_m))))));
        	}
        	return tmp;
        }
        
        B_m = abs(b)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        real(8) function code(a, b_m, c, f)
            real(8), intent (in) :: a
            real(8), intent (in) :: b_m
            real(8), intent (in) :: c
            real(8), intent (in) :: f
            real(8) :: tmp
            if (b_m <= 4.8d-6) then
                tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / (((4.0d0 * a) * c) - (b_m * b_m))
            else
                tmp = (-1.0d0) / (((b_m * b_m) - (a * (4.0d0 * c))) / sqrt((2.0d0 * (f * (b_m * (b_m * b_m))))))
            end if
            code = tmp
        end function
        
        B_m = Math.abs(B);
        assert A < B_m && B_m < C && C < F;
        public static double code(double A, double B_m, double C, double F) {
        	double tmp;
        	if (B_m <= 4.8e-6) {
        		tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
        	} else {
        		tmp = -1.0 / (((B_m * B_m) - (A * (4.0 * C))) / Math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))));
        	}
        	return tmp;
        }
        
        B_m = math.fabs(B)
        [A, B_m, C, F] = sort([A, B_m, C, F])
        def code(A, B_m, C, F):
        	tmp = 0
        	if B_m <= 4.8e-6:
        		tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m))
        	else:
        		tmp = -1.0 / (((B_m * B_m) - (A * (4.0 * C))) / math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))))
        	return tmp
        
        B_m = abs(B)
        A, B_m, C, F = sort([A, B_m, C, F])
        function code(A, B_m, C, F)
        	tmp = 0.0
        	if (B_m <= 4.8e-6)
        		tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
        	else
        		tmp = Float64(-1.0 / Float64(Float64(Float64(B_m * B_m) - Float64(A * Float64(4.0 * C))) / sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m)))))));
        	end
        	return tmp
        end
        
        B_m = abs(B);
        A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
        function tmp_2 = code(A, B_m, C, F)
        	tmp = 0.0;
        	if (B_m <= 4.8e-6)
        		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
        	else
        		tmp = -1.0 / (((B_m * B_m) - (A * (4.0 * C))) / sqrt((2.0 * (F * (B_m * (B_m * B_m))))));
        	end
        	tmp_2 = tmp;
        end
        
        B_m = N[Abs[B], $MachinePrecision]
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 4.8e-6], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] - N[(A * N[(4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        B_m = \left|B\right|
        \\
        [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;B\_m \leq 4.8 \cdot 10^{-6}:\\
        \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{-1}{\frac{B\_m \cdot B\_m - A \cdot \left(4 \cdot C\right)}{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if B < 4.7999999999999998e-6

          1. Initial program 25.4%

            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          2. Step-by-step derivation
            1. 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. distribute-neg-frac2N/A

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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 \cdot \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
            2. *-lowering-*.f64N/A

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

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

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

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

            \[\leadsto \frac{\sqrt{\color{blue}{-16 \cdot \left(A \cdot \left(\left(C \cdot C\right) \cdot F\right)\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
          8. Step-by-step derivation
            1. associate-*l*N/A

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left(A \cdot C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\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(A, C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
            5. *-lowering-*.f6415.9%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), \mathsf{*.f64}\left(C, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          9. Applied egg-rr15.9%

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

          if 4.7999999999999998e-6 < B

          1. Initial program 23.6%

            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, 4\right)\right), \mathsf{*.f64}\left(B, B\right)\right), \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)\right)\right) \]
            17. *-lowering-*.f6414.6%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, 4\right)\right), \mathsf{*.f64}\left(B, B\right)\right), \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)\right)\right) \]
          10. Applied egg-rr14.6%

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

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

        Alternative 18: 26.0% accurate, 5.0× speedup?

        \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;B\_m \leq 1.16 \cdot 10^{-5}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}\\ \end{array} \end{array} \]
        B_m = (fabs.f64 B)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B_m C F)
         :precision binary64
         (let* ((t_0 (* (* 4.0 A) C)))
           (if (<= B_m 1.16e-5)
             (/ (sqrt (* -16.0 (* (* A C) (* C F)))) (- t_0 (* B_m B_m)))
             (*
              (/ -1.0 (- (* B_m B_m) t_0))
              (sqrt (* 2.0 (* F (* B_m (* B_m B_m)))))))))
        B_m = fabs(B);
        assert(A < B_m && B_m < C && C < F);
        double code(double A, double B_m, double C, double F) {
        	double t_0 = (4.0 * A) * C;
        	double tmp;
        	if (B_m <= 1.16e-5) {
        		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
        	} else {
        		tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (F * (B_m * (B_m * B_m)))));
        	}
        	return tmp;
        }
        
        B_m = abs(b)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        real(8) function code(a, b_m, c, f)
            real(8), intent (in) :: a
            real(8), intent (in) :: b_m
            real(8), intent (in) :: c
            real(8), intent (in) :: f
            real(8) :: t_0
            real(8) :: tmp
            t_0 = (4.0d0 * a) * c
            if (b_m <= 1.16d-5) then
                tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / (t_0 - (b_m * b_m))
            else
                tmp = ((-1.0d0) / ((b_m * b_m) - t_0)) * sqrt((2.0d0 * (f * (b_m * (b_m * b_m)))))
            end if
            code = tmp
        end function
        
        B_m = Math.abs(B);
        assert A < B_m && B_m < C && C < F;
        public static double code(double A, double B_m, double C, double F) {
        	double t_0 = (4.0 * A) * C;
        	double tmp;
        	if (B_m <= 1.16e-5) {
        		tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
        	} else {
        		tmp = (-1.0 / ((B_m * B_m) - t_0)) * Math.sqrt((2.0 * (F * (B_m * (B_m * B_m)))));
        	}
        	return tmp;
        }
        
        B_m = math.fabs(B)
        [A, B_m, C, F] = sort([A, B_m, C, F])
        def code(A, B_m, C, F):
        	t_0 = (4.0 * A) * C
        	tmp = 0
        	if B_m <= 1.16e-5:
        		tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m))
        	else:
        		tmp = (-1.0 / ((B_m * B_m) - t_0)) * math.sqrt((2.0 * (F * (B_m * (B_m * B_m)))))
        	return tmp
        
        B_m = abs(B)
        A, B_m, C, F = sort([A, B_m, C, F])
        function code(A, B_m, C, F)
        	t_0 = Float64(Float64(4.0 * A) * C)
        	tmp = 0.0
        	if (B_m <= 1.16e-5)
        		tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / Float64(t_0 - Float64(B_m * B_m)));
        	else
        		tmp = Float64(Float64(-1.0 / Float64(Float64(B_m * B_m) - t_0)) * sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m))))));
        	end
        	return tmp
        end
        
        B_m = abs(B);
        A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
        function tmp_2 = code(A, B_m, C, F)
        	t_0 = (4.0 * A) * C;
        	tmp = 0.0;
        	if (B_m <= 1.16e-5)
        		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (t_0 - (B_m * B_m));
        	else
        		tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((2.0 * (F * (B_m * (B_m * B_m)))));
        	end
        	tmp_2 = tmp;
        end
        
        B_m = N[Abs[B], $MachinePrecision]
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 1.16e-5], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        B_m = \left|B\right|
        \\
        [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
        \\
        \begin{array}{l}
        t_0 := \left(4 \cdot A\right) \cdot C\\
        \mathbf{if}\;B\_m \leq 1.16 \cdot 10^{-5}:\\
        \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0 - B\_m \cdot B\_m}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if B < 1.1600000000000001e-5

          1. Initial program 25.4%

            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          2. Step-by-step derivation
            1. 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. distribute-neg-frac2N/A

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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 \cdot \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
            2. *-lowering-*.f64N/A

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

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

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

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

            \[\leadsto \frac{\sqrt{\color{blue}{-16 \cdot \left(A \cdot \left(\left(C \cdot C\right) \cdot F\right)\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
          8. Step-by-step derivation
            1. associate-*l*N/A

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left(A \cdot C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\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(A, C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
            5. *-lowering-*.f6415.9%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), \mathsf{*.f64}\left(C, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          9. Applied egg-rr15.9%

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

          if 1.1600000000000001e-5 < B

          1. Initial program 23.6%

            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          2. 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. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, 4\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \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)\right) \]
            6. *-lowering-*.f6414.6%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, 4\right)\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \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)\right) \]
          8. Simplified14.6%

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

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

        Alternative 19: 26.0% accurate, 5.1× speedup?

        \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;B\_m \leq 8 \cdot 10^{-6}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
        B_m = (fabs.f64 B)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B_m C F)
         :precision binary64
         (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
           (if (<= B_m 8e-6)
             (/ (sqrt (* -16.0 (* (* A C) (* C F)))) t_0)
             (/ (sqrt (* 2.0 (* F (* B_m (* B_m B_m))))) t_0))))
        B_m = fabs(B);
        assert(A < B_m && B_m < C && C < F);
        double code(double A, double B_m, double C, double F) {
        	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
        	double tmp;
        	if (B_m <= 8e-6) {
        		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
        	} else {
        		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
        	}
        	return tmp;
        }
        
        B_m = abs(b)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        real(8) function code(a, b_m, c, f)
            real(8), intent (in) :: a
            real(8), intent (in) :: b_m
            real(8), intent (in) :: c
            real(8), intent (in) :: f
            real(8) :: t_0
            real(8) :: tmp
            t_0 = ((4.0d0 * a) * c) - (b_m * b_m)
            if (b_m <= 8d-6) then
                tmp = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / t_0
            else
                tmp = sqrt((2.0d0 * (f * (b_m * (b_m * b_m))))) / t_0
            end if
            code = tmp
        end function
        
        B_m = Math.abs(B);
        assert A < B_m && B_m < C && C < F;
        public static double code(double A, double B_m, double C, double F) {
        	double t_0 = ((4.0 * A) * C) - (B_m * B_m);
        	double tmp;
        	if (B_m <= 8e-6) {
        		tmp = Math.sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
        	} else {
        		tmp = Math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
        	}
        	return tmp;
        }
        
        B_m = math.fabs(B)
        [A, B_m, C, F] = sort([A, B_m, C, F])
        def code(A, B_m, C, F):
        	t_0 = ((4.0 * A) * C) - (B_m * B_m)
        	tmp = 0
        	if B_m <= 8e-6:
        		tmp = math.sqrt((-16.0 * ((A * C) * (C * F)))) / t_0
        	else:
        		tmp = math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0
        	return tmp
        
        B_m = abs(B)
        A, B_m, C, F = sort([A, B_m, C, F])
        function code(A, B_m, C, F)
        	t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
        	tmp = 0.0
        	if (B_m <= 8e-6)
        		tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / t_0);
        	else
        		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m))))) / t_0);
        	end
        	return tmp
        end
        
        B_m = abs(B);
        A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
        function tmp_2 = code(A, B_m, C, F)
        	t_0 = ((4.0 * A) * C) - (B_m * B_m);
        	tmp = 0.0;
        	if (B_m <= 8e-6)
        		tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / t_0;
        	else
        		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
        	end
        	tmp_2 = tmp;
        end
        
        B_m = N[Abs[B], $MachinePrecision]
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 8e-6], N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
        
        \begin{array}{l}
        B_m = \left|B\right|
        \\
        [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
        \\
        \begin{array}{l}
        t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
        \mathbf{if}\;B\_m \leq 8 \cdot 10^{-6}:\\
        \;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{t\_0}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if B < 7.99999999999999964e-6

          1. Initial program 25.4%

            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          2. Step-by-step derivation
            1. 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. distribute-neg-frac2N/A

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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 \cdot \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
            2. *-lowering-*.f64N/A

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

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

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

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

            \[\leadsto \frac{\sqrt{\color{blue}{-16 \cdot \left(A \cdot \left(\left(C \cdot C\right) \cdot F\right)\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
          8. Step-by-step derivation
            1. associate-*l*N/A

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left(A \cdot C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\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(A, C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
            5. *-lowering-*.f6415.9%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), \mathsf{*.f64}\left(C, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          9. Applied egg-rr15.9%

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

          if 7.99999999999999964e-6 < B

          1. Initial program 23.6%

            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          2. 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. distribute-neg-frac2N/A

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

            \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot \left(\left(B \cdot B + A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}} \]
          4. Add Preprocessing
          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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
            7. *-lowering-*.f6414.6%

              \[\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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          7. Simplified14.6%

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

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

        Alternative 20: 24.7% accurate, 5.3× speedup?

        \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m} \end{array} \]
        B_m = (fabs.f64 B)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B_m C F)
         :precision binary64
         (/ (sqrt (* -16.0 (* (* A C) (* C F)))) (- (* (* 4.0 A) C) (* B_m B_m))))
        B_m = fabs(B);
        assert(A < B_m && B_m < C && C < F);
        double code(double A, double B_m, double C, double F) {
        	return sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
        }
        
        B_m = abs(b)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        real(8) function code(a, b_m, c, f)
            real(8), intent (in) :: a
            real(8), intent (in) :: b_m
            real(8), intent (in) :: c
            real(8), intent (in) :: f
            code = sqrt(((-16.0d0) * ((a * c) * (c * f)))) / (((4.0d0 * a) * c) - (b_m * b_m))
        end function
        
        B_m = Math.abs(B);
        assert A < B_m && B_m < C && C < F;
        public static double code(double A, double B_m, double C, double F) {
        	return Math.sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
        }
        
        B_m = math.fabs(B)
        [A, B_m, C, F] = sort([A, B_m, C, F])
        def code(A, B_m, C, F):
        	return math.sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m))
        
        B_m = abs(B)
        A, B_m, C, F = sort([A, B_m, C, F])
        function code(A, B_m, C, F)
        	return Float64(sqrt(Float64(-16.0 * Float64(Float64(A * C) * Float64(C * F)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)))
        end
        
        B_m = abs(B);
        A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
        function tmp = code(A, B_m, C, F)
        	tmp = sqrt((-16.0 * ((A * C) * (C * F)))) / (((4.0 * A) * C) - (B_m * B_m));
        end
        
        B_m = N[Abs[B], $MachinePrecision]
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(-16.0 * N[(N[(A * C), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        B_m = \left|B\right|
        \\
        [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
        \\
        \frac{\sqrt{-16 \cdot \left(\left(A \cdot C\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}
        \end{array}
        
        Derivation
        1. Initial program 25.0%

          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
        2. Step-by-step derivation
          1. 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. distribute-neg-frac2N/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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 \cdot \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          2. *-lowering-*.f64N/A

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

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

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

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

          \[\leadsto \frac{\sqrt{\color{blue}{-16 \cdot \left(A \cdot \left(\left(C \cdot C\right) \cdot F\right)\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
        8. Step-by-step derivation
          1. associate-*l*N/A

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left(A \cdot C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\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(A, C\right), \left(C \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          5. *-lowering-*.f6413.3%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, C\right), \mathsf{*.f64}\left(C, F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
        9. Applied egg-rr13.3%

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

        Alternative 21: 16.9% accurate, 5.3× speedup?

        \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m} \end{array} \]
        B_m = (fabs.f64 B)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B_m C F)
         :precision binary64
         (/ (sqrt (* -16.0 (* A (* F (* C C))))) (- (* (* 4.0 A) C) (* B_m B_m))))
        B_m = fabs(B);
        assert(A < B_m && B_m < C && C < F);
        double code(double A, double B_m, double C, double F) {
        	return sqrt((-16.0 * (A * (F * (C * C))))) / (((4.0 * A) * C) - (B_m * B_m));
        }
        
        B_m = abs(b)
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        real(8) function code(a, b_m, c, f)
            real(8), intent (in) :: a
            real(8), intent (in) :: b_m
            real(8), intent (in) :: c
            real(8), intent (in) :: f
            code = sqrt(((-16.0d0) * (a * (f * (c * c))))) / (((4.0d0 * a) * c) - (b_m * b_m))
        end function
        
        B_m = Math.abs(B);
        assert A < B_m && B_m < C && C < F;
        public static double code(double A, double B_m, double C, double F) {
        	return Math.sqrt((-16.0 * (A * (F * (C * C))))) / (((4.0 * A) * C) - (B_m * B_m));
        }
        
        B_m = math.fabs(B)
        [A, B_m, C, F] = sort([A, B_m, C, F])
        def code(A, B_m, C, F):
        	return math.sqrt((-16.0 * (A * (F * (C * C))))) / (((4.0 * A) * C) - (B_m * B_m))
        
        B_m = abs(B)
        A, B_m, C, F = sort([A, B_m, C, F])
        function code(A, B_m, C, F)
        	return Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)))
        end
        
        B_m = abs(B);
        A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
        function tmp = code(A, B_m, C, F)
        	tmp = sqrt((-16.0 * (A * (F * (C * C))))) / (((4.0 * A) * C) - (B_m * B_m));
        end
        
        B_m = N[Abs[B], $MachinePrecision]
        NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
        code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        B_m = \left|B\right|
        \\
        [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
        \\
        \frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}
        \end{array}
        
        Derivation
        1. Initial program 25.0%

          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
        2. Step-by-step derivation
          1. 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. distribute-neg-frac2N/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\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 \cdot \left({C}^{2} \cdot F\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
          2. *-lowering-*.f64N/A

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

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

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

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

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

          \[\leadsto \frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
        9. Add Preprocessing

        Reproduce

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