ABCF->ab-angle a

Percentage Accurate: 19.0% → 55.4%
Time: 28.0s
Alternatives: 22
Speedup: 4.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 19.0% accurate, 1.0× speedup?

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

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

Alternative 1: 55.4% accurate, 0.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\\ t_1 := \sqrt{2 \cdot \left(F \cdot t\_0\right)}\\ t_2 := \mathsf{hypot}\left(B\_m, A - C\right)\\ t_3 := \sqrt{\left(A + C\right) + t\_2}\\ t_4 := \left(4 \cdot A\right) \cdot C\\ t_5 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_4\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_4 - {B\_m}^{2}}\\ t_6 := t\_4 - B\_m \cdot B\_m\\ \mathbf{if}\;t\_5 \leq -4 \cdot 10^{-217}:\\ \;\;\;\;\frac{\sqrt{2 \cdot t\_0} \cdot \sqrt{F}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m} \cdot t\_3\\ \mathbf{elif}\;t\_5 \leq 0:\\ \;\;\;\;\frac{\sqrt{-0.5 \cdot \frac{B\_m \cdot B\_m}{A} + 2 \cdot C} \cdot t\_1}{t\_6}\\ \mathbf{elif}\;t\_5 \leq \infty:\\ \;\;\;\;\frac{t\_1 \cdot \sqrt{C + \left(A + t\_2\right)}}{t\_6}\\ \mathbf{else}:\\ \;\;\;\;t\_3 \cdot \left(\sqrt{F} \cdot \frac{\sqrt{2}}{0 - B\_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (+ (* B_m B_m) (* -4.0 (* A C))))
        (t_1 (sqrt (* 2.0 (* F t_0))))
        (t_2 (hypot B_m (- A C)))
        (t_3 (sqrt (+ (+ A C) t_2)))
        (t_4 (* (* 4.0 A) C))
        (t_5
         (/
          (sqrt
           (*
            (* 2.0 (* (- (pow B_m 2.0) t_4) F))
            (+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
          (- t_4 (pow B_m 2.0))))
        (t_6 (- t_4 (* B_m B_m))))
   (if (<= t_5 -4e-217)
     (*
      (/ (* (sqrt (* 2.0 t_0)) (sqrt F)) (- (* 4.0 (* A C)) (* B_m B_m)))
      t_3)
     (if (<= t_5 0.0)
       (/ (* (sqrt (+ (* -0.5 (/ (* B_m B_m) A)) (* 2.0 C))) t_1) t_6)
       (if (<= t_5 INFINITY)
         (/ (* t_1 (sqrt (+ C (+ A t_2)))) t_6)
         (* t_3 (* (sqrt F) (/ (sqrt 2.0) (- 0.0 B_m)))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (B_m * B_m) + (-4.0 * (A * C));
	double t_1 = sqrt((2.0 * (F * t_0)));
	double t_2 = hypot(B_m, (A - C));
	double t_3 = sqrt(((A + C) + t_2));
	double t_4 = (4.0 * A) * C;
	double t_5 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_4) * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_4 - pow(B_m, 2.0));
	double t_6 = t_4 - (B_m * B_m);
	double tmp;
	if (t_5 <= -4e-217) {
		tmp = ((sqrt((2.0 * t_0)) * sqrt(F)) / ((4.0 * (A * C)) - (B_m * B_m))) * t_3;
	} else if (t_5 <= 0.0) {
		tmp = (sqrt(((-0.5 * ((B_m * B_m) / A)) + (2.0 * C))) * t_1) / t_6;
	} else if (t_5 <= ((double) INFINITY)) {
		tmp = (t_1 * sqrt((C + (A + t_2)))) / t_6;
	} else {
		tmp = t_3 * (sqrt(F) * (sqrt(2.0) / (0.0 - B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (B_m * B_m) + (-4.0 * (A * C));
	double t_1 = Math.sqrt((2.0 * (F * t_0)));
	double t_2 = Math.hypot(B_m, (A - C));
	double t_3 = Math.sqrt(((A + C) + t_2));
	double t_4 = (4.0 * A) * C;
	double t_5 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_4) * F)) * ((A + C) + Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / (t_4 - Math.pow(B_m, 2.0));
	double t_6 = t_4 - (B_m * B_m);
	double tmp;
	if (t_5 <= -4e-217) {
		tmp = ((Math.sqrt((2.0 * t_0)) * Math.sqrt(F)) / ((4.0 * (A * C)) - (B_m * B_m))) * t_3;
	} else if (t_5 <= 0.0) {
		tmp = (Math.sqrt(((-0.5 * ((B_m * B_m) / A)) + (2.0 * C))) * t_1) / t_6;
	} else if (t_5 <= Double.POSITIVE_INFINITY) {
		tmp = (t_1 * Math.sqrt((C + (A + t_2)))) / t_6;
	} else {
		tmp = t_3 * (Math.sqrt(F) * (Math.sqrt(2.0) / (0.0 - B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (B_m * B_m) + (-4.0 * (A * C))
	t_1 = math.sqrt((2.0 * (F * t_0)))
	t_2 = math.hypot(B_m, (A - C))
	t_3 = math.sqrt(((A + C) + t_2))
	t_4 = (4.0 * A) * C
	t_5 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_4) * F)) * ((A + C) + math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / (t_4 - math.pow(B_m, 2.0))
	t_6 = t_4 - (B_m * B_m)
	tmp = 0
	if t_5 <= -4e-217:
		tmp = ((math.sqrt((2.0 * t_0)) * math.sqrt(F)) / ((4.0 * (A * C)) - (B_m * B_m))) * t_3
	elif t_5 <= 0.0:
		tmp = (math.sqrt(((-0.5 * ((B_m * B_m) / A)) + (2.0 * C))) * t_1) / t_6
	elif t_5 <= math.inf:
		tmp = (t_1 * math.sqrt((C + (A + t_2)))) / t_6
	else:
		tmp = t_3 * (math.sqrt(F) * (math.sqrt(2.0) / (0.0 - B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))
	t_1 = sqrt(Float64(2.0 * Float64(F * t_0)))
	t_2 = hypot(B_m, Float64(A - C))
	t_3 = sqrt(Float64(Float64(A + C) + t_2))
	t_4 = Float64(Float64(4.0 * A) * C)
	t_5 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_4) * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_4 - (B_m ^ 2.0)))
	t_6 = Float64(t_4 - Float64(B_m * B_m))
	tmp = 0.0
	if (t_5 <= -4e-217)
		tmp = Float64(Float64(Float64(sqrt(Float64(2.0 * t_0)) * sqrt(F)) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))) * t_3);
	elseif (t_5 <= 0.0)
		tmp = Float64(Float64(sqrt(Float64(Float64(-0.5 * Float64(Float64(B_m * B_m) / A)) + Float64(2.0 * C))) * t_1) / t_6);
	elseif (t_5 <= Inf)
		tmp = Float64(Float64(t_1 * sqrt(Float64(C + Float64(A + t_2)))) / t_6);
	else
		tmp = Float64(t_3 * Float64(sqrt(F) * Float64(sqrt(2.0) / Float64(0.0 - B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (B_m * B_m) + (-4.0 * (A * C));
	t_1 = sqrt((2.0 * (F * t_0)));
	t_2 = hypot(B_m, (A - C));
	t_3 = sqrt(((A + C) + t_2));
	t_4 = (4.0 * A) * C;
	t_5 = sqrt(((2.0 * (((B_m ^ 2.0) - t_4) * F)) * ((A + C) + sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / (t_4 - (B_m ^ 2.0));
	t_6 = t_4 - (B_m * B_m);
	tmp = 0.0;
	if (t_5 <= -4e-217)
		tmp = ((sqrt((2.0 * t_0)) * sqrt(F)) / ((4.0 * (A * C)) - (B_m * B_m))) * t_3;
	elseif (t_5 <= 0.0)
		tmp = (sqrt(((-0.5 * ((B_m * B_m) / A)) + (2.0 * C))) * t_1) / t_6;
	elseif (t_5 <= Inf)
		tmp = (t_1 * sqrt((C + (A + t_2)))) / t_6;
	else
		tmp = t_3 * (sqrt(F) * (sqrt(2.0) / (0.0 - B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$4), $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$4 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -4e-217], N[(N[(N[(N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[t$95$5, 0.0], N[(N[(N[Sqrt[N[(N[(-0.5 * N[(N[(B$95$m * B$95$m), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] / t$95$6), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(N[(t$95$1 * N[Sqrt[N[(C + N[(A + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$6), $MachinePrecision], N[(t$95$3 * N[(N[Sqrt[F], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\\
t_1 := \sqrt{2 \cdot \left(F \cdot t\_0\right)}\\
t_2 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_3 := \sqrt{\left(A + C\right) + t\_2}\\
t_4 := \left(4 \cdot A\right) \cdot C\\
t_5 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_4\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_4 - {B\_m}^{2}}\\
t_6 := t\_4 - B\_m \cdot B\_m\\
\mathbf{if}\;t\_5 \leq -4 \cdot 10^{-217}:\\
\;\;\;\;\frac{\sqrt{2 \cdot t\_0} \cdot \sqrt{F}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m} \cdot t\_3\\

\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;\frac{\sqrt{-0.5 \cdot \frac{B\_m \cdot B\_m}{A} + 2 \cdot C} \cdot t\_1}{t\_6}\\

\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;\frac{t\_1 \cdot \sqrt{C + \left(A + t\_2\right)}}{t\_6}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 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))) < -4.00000000000000033e-217

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\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(C, A\right)\right)\right), 2\right)\right), \mathsf{sqrt.f64}\left(F\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, A\right), 4\right), \mathsf{*.f64}\left(B, B\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{hypot.f64}\left(B, \color{blue}{\mathsf{\_.f64}\left(A, C\right)}\right), \mathsf{+.f64}\left(C, A\right)\right)\right)\right) \]
    10. Applied egg-rr81.4%

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

    if -4.00000000000000033e-217 < (/.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.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. Simplified3.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{{B}^{2}}{A} + 2 \cdot C\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), 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) \]
    8. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), A\right)\right), \left(2 \cdot C\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), 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. *-lowering-*.f6431.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, B\right), A\right)\right), \mathsf{*.f64}\left(2, C\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), 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. Simplified31.2%

      \[\leadsto \frac{\sqrt{\color{blue}{-0.5 \cdot \frac{B \cdot B}{A} + 2 \cdot C}} \cdot \sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)}}{\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 32.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. Simplified48.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

    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.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), \color{blue}{\mathsf{+.f64}\left(C, A\right)}\right)\right)\right) \]
    11. Simplified22.3%

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

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

Alternative 2: 50.4% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\ \mathbf{if}\;B\_m \leq 2 \cdot 10^{+70}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{C + \left(A + t\_0\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(A + C\right) + t\_0} \cdot \left(\sqrt{F} \cdot \frac{\sqrt{2}}{0 - B\_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (hypot B_m (- A C))))
   (if (<= B_m 2e+70)
     (/
      (*
       (sqrt (* 2.0 (* F (+ (* B_m B_m) (* -4.0 (* A C))))))
       (sqrt (+ C (+ A t_0))))
      (- (* (* 4.0 A) C) (* B_m B_m)))
     (* (sqrt (+ (+ A C) t_0)) (* (sqrt F) (/ (sqrt 2.0) (- 0.0 B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = hypot(B_m, (A - C));
	double tmp;
	if (B_m <= 2e+70) {
		tmp = (sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * sqrt((C + (A + t_0)))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = sqrt(((A + C) + t_0)) * (sqrt(F) * (sqrt(2.0) / (0.0 - B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.hypot(B_m, (A - C));
	double tmp;
	if (B_m <= 2e+70) {
		tmp = (Math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * Math.sqrt((C + (A + t_0)))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = Math.sqrt(((A + C) + t_0)) * (Math.sqrt(F) * (Math.sqrt(2.0) / (0.0 - B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.hypot(B_m, (A - C))
	tmp = 0
	if B_m <= 2e+70:
		tmp = (math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * math.sqrt((C + (A + t_0)))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = math.sqrt(((A + C) + t_0)) * (math.sqrt(F) * (math.sqrt(2.0) / (0.0 - B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = hypot(B_m, Float64(A - C))
	tmp = 0.0
	if (B_m <= 2e+70)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))) * sqrt(Float64(C + Float64(A + t_0)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(sqrt(Float64(Float64(A + C) + t_0)) * Float64(sqrt(F) * Float64(sqrt(2.0) / Float64(0.0 - B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = hypot(B_m, (A - C));
	tmp = 0.0;
	if (B_m <= 2e+70)
		tmp = (sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * sqrt((C + (A + t_0)))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = sqrt(((A + C) + t_0)) * (sqrt(F) * (sqrt(2.0) / (0.0 - B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[B$95$m, 2e+70], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(C + N[(A + t$95$0), $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[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\
\mathbf{if}\;B\_m \leq 2 \cdot 10^{+70}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{C + \left(A + t\_0\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

    if 2.00000000000000015e70 < B

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), \color{blue}{\mathsf{+.f64}\left(C, A\right)}\right)\right)\right) \]
    11. Simplified72.3%

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

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

Alternative 3: 40.9% accurate, 1.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\ t_1 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ t_2 := 2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)\\ \mathbf{if}\;B\_m \leq 3.2 \cdot 10^{-228}:\\ \;\;\;\;\frac{\sqrt{t\_2} \cdot \sqrt{2 \cdot C}}{t\_1}\\ \mathbf{elif}\;B\_m \leq 9 \cdot 10^{-121}:\\ \;\;\;\;\sqrt{\left(A + C\right) + t\_0} \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\ \mathbf{elif}\;B\_m \leq 33000000000000:\\ \;\;\;\;\frac{\sqrt{A \cdot t\_2 + t\_2 \cdot \left(C + t\_0\right)}}{t\_1}\\ \mathbf{elif}\;B\_m \leq 9.2 \cdot 10^{+150}:\\ \;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \left(C + \left(A + t\_0\right)\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (hypot B_m (- A C)))
        (t_1 (- (* (* 4.0 A) C) (* B_m B_m)))
        (t_2 (* 2.0 (* F (+ (* B_m B_m) (* -4.0 (* A C)))))))
   (if (<= B_m 3.2e-228)
     (/ (* (sqrt t_2) (sqrt (* 2.0 C))) t_1)
     (if (<= B_m 9e-121)
       (*
        (sqrt (+ (+ A C) t_0))
        (/ (sqrt (* -8.0 (* A (* C F)))) (- (* 4.0 (* A C)) (* B_m B_m))))
       (if (<= B_m 33000000000000.0)
         (/ (sqrt (+ (* A t_2) (* t_2 (+ C t_0)))) t_1)
         (if (<= B_m 9.2e+150)
           (/ (* (* B_m (sqrt F)) (sqrt (* 2.0 (+ C (+ A t_0))))) t_1)
           (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = hypot(B_m, (A - C));
	double t_1 = ((4.0 * A) * C) - (B_m * B_m);
	double t_2 = 2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C))));
	double tmp;
	if (B_m <= 3.2e-228) {
		tmp = (sqrt(t_2) * sqrt((2.0 * C))) / t_1;
	} else if (B_m <= 9e-121) {
		tmp = sqrt(((A + C) + t_0)) * (sqrt((-8.0 * (A * (C * F)))) / ((4.0 * (A * C)) - (B_m * B_m)));
	} else if (B_m <= 33000000000000.0) {
		tmp = sqrt(((A * t_2) + (t_2 * (C + t_0)))) / t_1;
	} else if (B_m <= 9.2e+150) {
		tmp = ((B_m * sqrt(F)) * sqrt((2.0 * (C + (A + t_0))))) / t_1;
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.hypot(B_m, (A - C));
	double t_1 = ((4.0 * A) * C) - (B_m * B_m);
	double t_2 = 2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C))));
	double tmp;
	if (B_m <= 3.2e-228) {
		tmp = (Math.sqrt(t_2) * Math.sqrt((2.0 * C))) / t_1;
	} else if (B_m <= 9e-121) {
		tmp = Math.sqrt(((A + C) + t_0)) * (Math.sqrt((-8.0 * (A * (C * F)))) / ((4.0 * (A * C)) - (B_m * B_m)));
	} else if (B_m <= 33000000000000.0) {
		tmp = Math.sqrt(((A * t_2) + (t_2 * (C + t_0)))) / t_1;
	} else if (B_m <= 9.2e+150) {
		tmp = ((B_m * Math.sqrt(F)) * Math.sqrt((2.0 * (C + (A + t_0))))) / t_1;
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.hypot(B_m, (A - C))
	t_1 = ((4.0 * A) * C) - (B_m * B_m)
	t_2 = 2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C))))
	tmp = 0
	if B_m <= 3.2e-228:
		tmp = (math.sqrt(t_2) * math.sqrt((2.0 * C))) / t_1
	elif B_m <= 9e-121:
		tmp = math.sqrt(((A + C) + t_0)) * (math.sqrt((-8.0 * (A * (C * F)))) / ((4.0 * (A * C)) - (B_m * B_m)))
	elif B_m <= 33000000000000.0:
		tmp = math.sqrt(((A * t_2) + (t_2 * (C + t_0)))) / t_1
	elif B_m <= 9.2e+150:
		tmp = ((B_m * math.sqrt(F)) * math.sqrt((2.0 * (C + (A + t_0))))) / t_1
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = hypot(B_m, Float64(A - C))
	t_1 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	t_2 = Float64(2.0 * Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))
	tmp = 0.0
	if (B_m <= 3.2e-228)
		tmp = Float64(Float64(sqrt(t_2) * sqrt(Float64(2.0 * C))) / t_1);
	elseif (B_m <= 9e-121)
		tmp = Float64(sqrt(Float64(Float64(A + C) + t_0)) * Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * F)))) / Float64(Float64(4.0 * Float64(A * C)) - Float64(B_m * B_m))));
	elseif (B_m <= 33000000000000.0)
		tmp = Float64(sqrt(Float64(Float64(A * t_2) + Float64(t_2 * Float64(C + t_0)))) / t_1);
	elseif (B_m <= 9.2e+150)
		tmp = Float64(Float64(Float64(B_m * sqrt(F)) * sqrt(Float64(2.0 * Float64(C + Float64(A + t_0))))) / t_1);
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = hypot(B_m, (A - C));
	t_1 = ((4.0 * A) * C) - (B_m * B_m);
	t_2 = 2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C))));
	tmp = 0.0;
	if (B_m <= 3.2e-228)
		tmp = (sqrt(t_2) * sqrt((2.0 * C))) / t_1;
	elseif (B_m <= 9e-121)
		tmp = sqrt(((A + C) + t_0)) * (sqrt((-8.0 * (A * (C * F)))) / ((4.0 * (A * C)) - (B_m * B_m)));
	elseif (B_m <= 33000000000000.0)
		tmp = sqrt(((A * t_2) + (t_2 * (C + t_0)))) / t_1;
	elseif (B_m <= 9.2e+150)
		tmp = ((B_m * sqrt(F)) * sqrt((2.0 * (C + (A + t_0))))) / t_1;
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3.2e-228], N[(N[(N[Sqrt[t$95$2], $MachinePrecision] * N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 9e-121], N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * F), $MachinePrecision]), $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, 33000000000000.0], N[(N[Sqrt[N[(N[(A * t$95$2), $MachinePrecision] + N[(t$95$2 * N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 9.2e+150], N[(N[(N[(B$95$m * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(C + N[(A + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_1 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
t_2 := 2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)\\
\mathbf{if}\;B\_m \leq 3.2 \cdot 10^{-228}:\\
\;\;\;\;\frac{\sqrt{t\_2} \cdot \sqrt{2 \cdot C}}{t\_1}\\

\mathbf{elif}\;B\_m \leq 9 \cdot 10^{-121}:\\
\;\;\;\;\sqrt{\left(A + C\right) + t\_0} \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}}{4 \cdot \left(A \cdot C\right) - B\_m \cdot B\_m}\\

\mathbf{elif}\;B\_m \leq 33000000000000:\\
\;\;\;\;\frac{\sqrt{A \cdot t\_2 + t\_2 \cdot \left(C + t\_0\right)}}{t\_1}\\

\mathbf{elif}\;B\_m \leq 9.2 \cdot 10^{+150}:\\
\;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \left(C + \left(A + t\_0\right)\right)}}{t\_1}\\

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


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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(2 \cdot C\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), 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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f6414.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, C\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), F\right)\right)\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) \]
    9. Simplified14.9%

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

    if 3.20000000000000022e-228 < B < 9.0000000000000007e-121

    1. Initial program 18.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. Simplified18.8%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000007e-121 < B < 3.3e13

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      2. distribute-lft-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot A\right), \left(\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(C + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
    6. Applied egg-rr25.5%

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

    if 3.3e13 < B < 9.20000000000000004e150

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot \left(2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F} \cdot \sqrt{2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      6. pow1/2N/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(B \cdot \sqrt{F}\right)}, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(\sqrt{F}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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. sqrt-lowering-sqrt.f6453.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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) \]
    9. Simplified53.1%

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

    if 9.20000000000000004e150 < 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. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.f6460.7%

        \[\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) \]
    5. Simplified60.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.2 \cdot 10^{-228}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{2 \cdot C}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{elif}\;B \leq 9 \cdot 10^{-121}:\\ \;\;\;\;\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)} \cdot \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)}}{4 \cdot \left(A \cdot C\right) - B \cdot B}\\ \mathbf{elif}\;B \leq 33000000000000:\\ \;\;\;\;\frac{\sqrt{A \cdot \left(2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right) + \left(2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{elif}\;B \leq 9.2 \cdot 10^{+150}:\\ \;\;\;\;\frac{\left(B \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 45.5% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\\ t_1 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;B\_m \leq 2.6 \cdot 10^{+70}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{t\_0}}{t\_1}\\ \mathbf{elif}\;B\_m \leq 7.2 \cdot 10^{+150}:\\ \;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot t\_0}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (+ C (+ A (hypot B_m (- A C)))))
        (t_1 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= B_m 2.6e+70)
     (/
      (* (sqrt (* 2.0 (* F (+ (* B_m B_m) (* -4.0 (* A C)))))) (sqrt t_0))
      t_1)
     (if (<= B_m 7.2e+150)
       (/ (* (* B_m (sqrt F)) (sqrt (* 2.0 t_0))) t_1)
       (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = C + (A + hypot(B_m, (A - C)));
	double t_1 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (B_m <= 2.6e+70) {
		tmp = (sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * sqrt(t_0)) / t_1;
	} else if (B_m <= 7.2e+150) {
		tmp = ((B_m * sqrt(F)) * sqrt((2.0 * t_0))) / t_1;
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = C + (A + Math.hypot(B_m, (A - C)));
	double t_1 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (B_m <= 2.6e+70) {
		tmp = (Math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * Math.sqrt(t_0)) / t_1;
	} else if (B_m <= 7.2e+150) {
		tmp = ((B_m * Math.sqrt(F)) * Math.sqrt((2.0 * t_0))) / t_1;
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = C + (A + math.hypot(B_m, (A - C)))
	t_1 = ((4.0 * A) * C) - (B_m * B_m)
	tmp = 0
	if B_m <= 2.6e+70:
		tmp = (math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * math.sqrt(t_0)) / t_1
	elif B_m <= 7.2e+150:
		tmp = ((B_m * math.sqrt(F)) * math.sqrt((2.0 * t_0))) / t_1
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(C + Float64(A + hypot(B_m, Float64(A - C))))
	t_1 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	tmp = 0.0
	if (B_m <= 2.6e+70)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))) * sqrt(t_0)) / t_1);
	elseif (B_m <= 7.2e+150)
		tmp = Float64(Float64(Float64(B_m * sqrt(F)) * sqrt(Float64(2.0 * t_0))) / t_1);
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = C + (A + hypot(B_m, (A - C)));
	t_1 = ((4.0 * A) * C) - (B_m * B_m);
	tmp = 0.0;
	if (B_m <= 2.6e+70)
		tmp = (sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * sqrt(t_0)) / t_1;
	elseif (B_m <= 7.2e+150)
		tmp = ((B_m * sqrt(F)) * sqrt((2.0 * t_0))) / t_1;
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(C + N[(A + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.6e+70], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 7.2e+150], N[(N[(N[(B$95$m * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\\
t_1 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 2.6 \cdot 10^{+70}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{t\_0}}{t\_1}\\

\mathbf{elif}\;B\_m \leq 7.2 \cdot 10^{+150}:\\
\;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot t\_0}}{t\_1}\\

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


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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

    if 2.6e70 < B < 7.19999999999999972e150

    1. Initial program 32.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. Simplified33.5%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot \left(2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F} \cdot \sqrt{2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      6. pow1/2N/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(B \cdot \sqrt{F}\right)}, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(\sqrt{F}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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. sqrt-lowering-sqrt.f6459.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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) \]
    9. Simplified59.8%

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

    if 7.19999999999999972e150 < 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. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.f6460.7%

        \[\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) \]
    5. Simplified60.7%

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

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

Alternative 5: 45.5% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\\ \mathbf{if}\;B\_m \leq 2 \cdot 10^{+70}:\\ \;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \frac{\sqrt{t\_0}}{A \cdot \left(4 \cdot C\right) - B\_m \cdot B\_m}\\ \mathbf{elif}\;B\_m \leq 1.2 \cdot 10^{+151}:\\ \;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot t\_0}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (+ C (+ A (hypot B_m (- A C))))))
   (if (<= B_m 2e+70)
     (*
      (sqrt (* 2.0 (* F (+ (* B_m B_m) (* -4.0 (* A C))))))
      (/ (sqrt t_0) (- (* A (* 4.0 C)) (* B_m B_m))))
     (if (<= B_m 1.2e+151)
       (/
        (* (* B_m (sqrt F)) (sqrt (* 2.0 t_0)))
        (- (* (* 4.0 A) C) (* B_m B_m)))
       (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = C + (A + hypot(B_m, (A - C)));
	double tmp;
	if (B_m <= 2e+70) {
		tmp = sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * (sqrt(t_0) / ((A * (4.0 * C)) - (B_m * B_m)));
	} else if (B_m <= 1.2e+151) {
		tmp = ((B_m * sqrt(F)) * sqrt((2.0 * t_0))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = C + (A + Math.hypot(B_m, (A - C)));
	double tmp;
	if (B_m <= 2e+70) {
		tmp = Math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * (Math.sqrt(t_0) / ((A * (4.0 * C)) - (B_m * B_m)));
	} else if (B_m <= 1.2e+151) {
		tmp = ((B_m * Math.sqrt(F)) * Math.sqrt((2.0 * t_0))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = C + (A + math.hypot(B_m, (A - C)))
	tmp = 0
	if B_m <= 2e+70:
		tmp = math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * (math.sqrt(t_0) / ((A * (4.0 * C)) - (B_m * B_m)))
	elif B_m <= 1.2e+151:
		tmp = ((B_m * math.sqrt(F)) * math.sqrt((2.0 * t_0))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(C + Float64(A + hypot(B_m, Float64(A - C))))
	tmp = 0.0
	if (B_m <= 2e+70)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))) * Float64(sqrt(t_0) / Float64(Float64(A * Float64(4.0 * C)) - Float64(B_m * B_m))));
	elseif (B_m <= 1.2e+151)
		tmp = Float64(Float64(Float64(B_m * sqrt(F)) * sqrt(Float64(2.0 * t_0))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = C + (A + hypot(B_m, (A - C)));
	tmp = 0.0;
	if (B_m <= 2e+70)
		tmp = sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * (sqrt(t_0) / ((A * (4.0 * C)) - (B_m * B_m)));
	elseif (B_m <= 1.2e+151)
		tmp = ((B_m * sqrt(F)) * sqrt((2.0 * t_0))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(C + N[(A + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2e+70], N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[t$95$0], $MachinePrecision] / N[(N[(A * N[(4.0 * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.2e+151], N[(N[(N[(B$95$m * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\\
\mathbf{if}\;B\_m \leq 2 \cdot 10^{+70}:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \frac{\sqrt{t\_0}}{A \cdot \left(4 \cdot C\right) - B\_m \cdot B\_m}\\

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

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


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

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

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

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

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

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

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

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

    if 2.00000000000000015e70 < B < 1.20000000000000005e151

    1. Initial program 32.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. Simplified33.5%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot \left(2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F} \cdot \sqrt{2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      6. pow1/2N/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(B \cdot \sqrt{F}\right)}, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(\sqrt{F}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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. sqrt-lowering-sqrt.f6459.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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) \]
    9. Simplified59.8%

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

    if 1.20000000000000005e151 < 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. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.f6460.7%

        \[\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) \]
    5. Simplified60.7%

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

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

Alternative 6: 41.7% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}\\ \mathbf{if}\;B\_m \leq 10^{-45}:\\ \;\;\;\;\frac{t\_0 \cdot \sqrt{F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B\_m \leq 8.6 \cdot 10^{+150}:\\ \;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot t\_0}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (sqrt (* 2.0 (+ C (+ A (hypot B_m (- A C))))))))
   (if (<= B_m 1e-45)
     (/ (* t_0 (sqrt (* F (+ (* B_m B_m) (* -4.0 (* A C)))))) (* 4.0 (* A C)))
     (if (<= B_m 8.6e+150)
       (/ (* (* B_m (sqrt F)) t_0) (- (* (* 4.0 A) C) (* B_m B_m)))
       (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt((2.0 * (C + (A + hypot(B_m, (A - C))))));
	double tmp;
	if (B_m <= 1e-45) {
		tmp = (t_0 * sqrt((F * ((B_m * B_m) + (-4.0 * (A * C)))))) / (4.0 * (A * C));
	} else if (B_m <= 8.6e+150) {
		tmp = ((B_m * sqrt(F)) * t_0) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.sqrt((2.0 * (C + (A + Math.hypot(B_m, (A - C))))));
	double tmp;
	if (B_m <= 1e-45) {
		tmp = (t_0 * Math.sqrt((F * ((B_m * B_m) + (-4.0 * (A * C)))))) / (4.0 * (A * C));
	} else if (B_m <= 8.6e+150) {
		tmp = ((B_m * Math.sqrt(F)) * t_0) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.sqrt((2.0 * (C + (A + math.hypot(B_m, (A - C))))))
	tmp = 0
	if B_m <= 1e-45:
		tmp = (t_0 * math.sqrt((F * ((B_m * B_m) + (-4.0 * (A * C)))))) / (4.0 * (A * C))
	elif B_m <= 8.6e+150:
		tmp = ((B_m * math.sqrt(F)) * t_0) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = sqrt(Float64(2.0 * Float64(C + Float64(A + hypot(B_m, Float64(A - C))))))
	tmp = 0.0
	if (B_m <= 1e-45)
		tmp = Float64(Float64(t_0 * sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))) / Float64(4.0 * Float64(A * C)));
	elseif (B_m <= 8.6e+150)
		tmp = Float64(Float64(Float64(B_m * sqrt(F)) * t_0) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = sqrt((2.0 * (C + (A + hypot(B_m, (A - C))))));
	tmp = 0.0;
	if (B_m <= 1e-45)
		tmp = (t_0 * sqrt((F * ((B_m * B_m) + (-4.0 * (A * C)))))) / (4.0 * (A * C));
	elseif (B_m <= 8.6e+150)
		tmp = ((B_m * sqrt(F)) * t_0) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * N[(C + N[(A + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B$95$m, 1e-45], N[(N[(t$95$0 * N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 8.6e+150], N[(N[(N[(B$95$m * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}\\
\mathbf{if}\;B\_m \leq 10^{-45}:\\
\;\;\;\;\frac{t\_0 \cdot \sqrt{F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\

\mathbf{elif}\;B\_m \leq 8.6 \cdot 10^{+150}:\\
\;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot t\_0}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot \left(2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F} \cdot \sqrt{2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      6. pow1/2N/A

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

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

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

        \[\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(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    9. Simplified20.4%

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

    if 9.99999999999999984e-46 < B < 8.59999999999999994e150

    1. Initial program 43.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. Simplified44.2%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot \left(2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F} \cdot \sqrt{2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      6. pow1/2N/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(B \cdot \sqrt{F}\right)}, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(\sqrt{F}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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. sqrt-lowering-sqrt.f6449.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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) \]
    9. Simplified49.9%

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

    if 8.59999999999999994e150 < 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. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.f6460.7%

        \[\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) \]
    5. Simplified60.7%

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

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

Alternative 7: 41.7% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\ t_1 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ t_2 := 2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)\\ \mathbf{if}\;B\_m \leq 2.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{\sqrt{A \cdot t\_2 + t\_2 \cdot \left(C + t\_0\right)}}{t\_1}\\ \mathbf{elif}\;B\_m \leq 6.1 \cdot 10^{+150}:\\ \;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \left(C + \left(A + t\_0\right)\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (hypot B_m (- A C)))
        (t_1 (- (* (* 4.0 A) C) (* B_m B_m)))
        (t_2 (* 2.0 (* F (+ (* B_m B_m) (* -4.0 (* A C)))))))
   (if (<= B_m 2.2e+14)
     (/ (sqrt (+ (* A t_2) (* t_2 (+ C t_0)))) t_1)
     (if (<= B_m 6.1e+150)
       (/ (* (* B_m (sqrt F)) (sqrt (* 2.0 (+ C (+ A t_0))))) t_1)
       (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = hypot(B_m, (A - C));
	double t_1 = ((4.0 * A) * C) - (B_m * B_m);
	double t_2 = 2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C))));
	double tmp;
	if (B_m <= 2.2e+14) {
		tmp = sqrt(((A * t_2) + (t_2 * (C + t_0)))) / t_1;
	} else if (B_m <= 6.1e+150) {
		tmp = ((B_m * sqrt(F)) * sqrt((2.0 * (C + (A + t_0))))) / t_1;
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.hypot(B_m, (A - C));
	double t_1 = ((4.0 * A) * C) - (B_m * B_m);
	double t_2 = 2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C))));
	double tmp;
	if (B_m <= 2.2e+14) {
		tmp = Math.sqrt(((A * t_2) + (t_2 * (C + t_0)))) / t_1;
	} else if (B_m <= 6.1e+150) {
		tmp = ((B_m * Math.sqrt(F)) * Math.sqrt((2.0 * (C + (A + t_0))))) / t_1;
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.hypot(B_m, (A - C))
	t_1 = ((4.0 * A) * C) - (B_m * B_m)
	t_2 = 2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C))))
	tmp = 0
	if B_m <= 2.2e+14:
		tmp = math.sqrt(((A * t_2) + (t_2 * (C + t_0)))) / t_1
	elif B_m <= 6.1e+150:
		tmp = ((B_m * math.sqrt(F)) * math.sqrt((2.0 * (C + (A + t_0))))) / t_1
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = hypot(B_m, Float64(A - C))
	t_1 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	t_2 = Float64(2.0 * Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))
	tmp = 0.0
	if (B_m <= 2.2e+14)
		tmp = Float64(sqrt(Float64(Float64(A * t_2) + Float64(t_2 * Float64(C + t_0)))) / t_1);
	elseif (B_m <= 6.1e+150)
		tmp = Float64(Float64(Float64(B_m * sqrt(F)) * sqrt(Float64(2.0 * Float64(C + Float64(A + t_0))))) / t_1);
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = hypot(B_m, (A - C));
	t_1 = ((4.0 * A) * C) - (B_m * B_m);
	t_2 = 2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C))));
	tmp = 0.0;
	if (B_m <= 2.2e+14)
		tmp = sqrt(((A * t_2) + (t_2 * (C + t_0)))) / t_1;
	elseif (B_m <= 6.1e+150)
		tmp = ((B_m * sqrt(F)) * sqrt((2.0 * (C + (A + t_0))))) / t_1;
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.2e+14], N[(N[Sqrt[N[(N[(A * t$95$2), $MachinePrecision] + N[(t$95$2 * N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 6.1e+150], N[(N[(N[(B$95$m * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(C + N[(A + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_1 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
t_2 := 2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)\\
\mathbf{if}\;B\_m \leq 2.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{\sqrt{A \cdot t\_2 + t\_2 \cdot \left(C + t\_0\right)}}{t\_1}\\

\mathbf{elif}\;B\_m \leq 6.1 \cdot 10^{+150}:\\
\;\;\;\;\frac{\left(B\_m \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \left(C + \left(A + t\_0\right)\right)}}{t\_1}\\

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


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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      2. distribute-lft-inN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot A\right), \left(\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(C + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
    6. Applied egg-rr27.0%

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

    if 2.2e14 < B < 6.10000000000000026e150

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right) \cdot \left(2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\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) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F} \cdot \sqrt{2 \cdot \left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\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) \]
      6. pow1/2N/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(B \cdot \sqrt{F}\right)}, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(\sqrt{F}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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. sqrt-lowering-sqrt.f6453.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(F\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{+.f64}\left(C, \mathsf{+.f64}\left(A, \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\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) \]
    9. Simplified53.1%

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

    if 6.10000000000000026e150 < 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. Add Preprocessing
    3. Taylor expanded in B around inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.f6460.7%

        \[\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) \]
    5. Simplified60.7%

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

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

Alternative 8: 37.8% accurate, 2.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := t\_0 - B\_m \cdot B\_m\\ \mathbf{if}\;B\_m \leq 1.9 \cdot 10^{-169}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{2 \cdot C}}{t\_1}\\ \mathbf{elif}\;B\_m \leq 1.9 \cdot 10^{+63}:\\ \;\;\;\;\frac{\sqrt{\left(\left(B\_m \cdot B\_m - t\_0\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C)) (t_1 (- t_0 (* B_m B_m))))
   (if (<= B_m 1.9e-169)
     (/
      (*
       (sqrt (* 2.0 (* F (+ (* B_m B_m) (* -4.0 (* A C))))))
       (sqrt (* 2.0 C)))
      t_1)
     (if (<= B_m 1.9e+63)
       (/
        (sqrt
         (* (* (- (* B_m B_m) t_0) (* 2.0 F)) (+ (+ A C) (hypot B_m (- A C)))))
        t_1)
       (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - (B_m * B_m);
	double tmp;
	if (B_m <= 1.9e-169) {
		tmp = (sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * sqrt((2.0 * C))) / t_1;
	} else if (B_m <= 1.9e+63) {
		tmp = sqrt(((((B_m * B_m) - t_0) * (2.0 * F)) * ((A + C) + hypot(B_m, (A - C))))) / t_1;
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - (B_m * B_m);
	double tmp;
	if (B_m <= 1.9e-169) {
		tmp = (Math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * Math.sqrt((2.0 * C))) / t_1;
	} else if (B_m <= 1.9e+63) {
		tmp = Math.sqrt(((((B_m * B_m) - t_0) * (2.0 * F)) * ((A + C) + Math.hypot(B_m, (A - C))))) / t_1;
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	t_1 = t_0 - (B_m * B_m)
	tmp = 0
	if B_m <= 1.9e-169:
		tmp = (math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * math.sqrt((2.0 * C))) / t_1
	elif B_m <= 1.9e+63:
		tmp = math.sqrt(((((B_m * B_m) - t_0) * (2.0 * F)) * ((A + C) + math.hypot(B_m, (A - C))))) / t_1
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64(t_0 - Float64(B_m * B_m))
	tmp = 0.0
	if (B_m <= 1.9e-169)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))) * sqrt(Float64(2.0 * C))) / t_1);
	elseif (B_m <= 1.9e+63)
		tmp = Float64(sqrt(Float64(Float64(Float64(Float64(B_m * B_m) - t_0) * Float64(2.0 * F)) * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / t_1);
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	t_1 = t_0 - (B_m * B_m);
	tmp = 0.0;
	if (B_m <= 1.9e-169)
		tmp = (sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * sqrt((2.0 * C))) / t_1;
	elseif (B_m <= 1.9e+63)
		tmp = sqrt(((((B_m * B_m) - t_0) * (2.0 * F)) * ((A + C) + hypot(B_m, (A - C))))) / t_1;
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.9e-169], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 1.9e+63], N[(N[Sqrt[N[(N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 1.9 \cdot 10^{-169}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{2 \cdot C}}{t\_1}\\

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

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


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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(2 \cdot C\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), 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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f6416.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, C\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), F\right)\right)\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) \]
    9. Simplified16.1%

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

    if 1.9e-169 < B < 1.9000000000000001e63

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

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

    if 1.9000000000000001e63 < B

    1. Initial program 10.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 B around inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.f6453.0%

        \[\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) \]
    5. Simplified53.0%

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

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

Alternative 9: 36.6% accurate, 2.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ t_1 := B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B\_m \leq 1.9 \cdot 10^{-188}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t\_1\right)} \cdot \sqrt{2 \cdot C}}{t\_0}\\ \mathbf{elif}\;B\_m \leq 2.2 \cdot 10^{+64}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(t\_1 \cdot \left(C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(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) (* -4.0 (* A C)))))
   (if (<= B_m 1.9e-188)
     (/ (* (sqrt (* 2.0 (* F t_1))) (sqrt (* 2.0 C))) t_0)
     (if (<= B_m 2.2e+64)
       (/ (sqrt (* (* 2.0 F) (* t_1 (+ C (+ A (hypot B_m (- A C))))))) t_0)
       (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))))
B_m = fabs(B);
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) + (-4.0 * (A * C));
	double tmp;
	if (B_m <= 1.9e-188) {
		tmp = (sqrt((2.0 * (F * t_1))) * sqrt((2.0 * C))) / t_0;
	} else if (B_m <= 2.2e+64) {
		tmp = sqrt(((2.0 * F) * (t_1 * (C + (A + hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
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) + (-4.0 * (A * C));
	double tmp;
	if (B_m <= 1.9e-188) {
		tmp = (Math.sqrt((2.0 * (F * t_1))) * Math.sqrt((2.0 * C))) / t_0;
	} else if (B_m <= 2.2e+64) {
		tmp = Math.sqrt(((2.0 * F) * (t_1 * (C + (A + Math.hypot(B_m, (A - C))))))) / t_0;
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	t_1 = (B_m * B_m) + (-4.0 * (A * C))
	tmp = 0
	if B_m <= 1.9e-188:
		tmp = (math.sqrt((2.0 * (F * t_1))) * math.sqrt((2.0 * C))) / t_0
	elif B_m <= 2.2e+64:
		tmp = math.sqrt(((2.0 * F) * (t_1 * (C + (A + math.hypot(B_m, (A - C))))))) / t_0
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
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(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B_m <= 1.9e-188)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_1))) * sqrt(Float64(2.0 * C))) / t_0);
	elseif (B_m <= 2.2e+64)
		tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(t_1 * Float64(C + Float64(A + hypot(B_m, Float64(A - C))))))) / t_0);
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
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) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B_m <= 1.9e-188)
		tmp = (sqrt((2.0 * (F * t_1))) * sqrt((2.0 * C))) / t_0;
	elseif (B_m <= 2.2e+64)
		tmp = sqrt(((2.0 * F) * (t_1 * (C + (A + hypot(B_m, (A - C))))))) / t_0;
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
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[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.9e-188], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 2.2e+64], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(t$95$1 * N[(C + N[(A + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
t_1 := B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B\_m \leq 1.9 \cdot 10^{-188}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t\_1\right)} \cdot \sqrt{2 \cdot C}}{t\_0}\\

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

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


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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(2 \cdot C\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), 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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f6415.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, C\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), F\right)\right)\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) \]
    9. Simplified15.7%

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

    if 1.9e-188 < B < 2.20000000000000002e64

    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. Simplified28.1%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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. pow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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) \]
      3. associate-*r*N/A

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

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

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

    if 2.20000000000000002e64 < B

    1. Initial program 10.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 B around inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.f6453.0%

        \[\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) \]
    5. Simplified53.0%

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

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

Alternative 10: 39.4% accurate, 2.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 3.2 \cdot 10^{+63}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 3.2e+63)
   (/
    (sqrt
     (*
      (+ (* B_m B_m) (* -4.0 (* A C)))
      (* 2.0 (* F (+ C (+ A (hypot B_m (- A C))))))))
    (- (* (* 4.0 A) C) (* B_m B_m)))
   (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 3.2e+63) {
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * (F * (C + (A + hypot(B_m, (A - C)))))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 3.2e+63) {
		tmp = Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * (F * (C + (A + Math.hypot(B_m, (A - C)))))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 3.2e+63:
		tmp = math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * (F * (C + (A + math.hypot(B_m, (A - C)))))))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 3.2e+63)
		tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(2.0 * Float64(F * Float64(C + Float64(A + hypot(B_m, Float64(A - C)))))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 3.2e+63)
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * (F * (C + (A + hypot(B_m, (A - C)))))))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 3.2e+63], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * N[(C + N[(A + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $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[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 3.2 \cdot 10^{+63}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

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

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

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

    if 3.20000000000000011e63 < B

    1. Initial program 10.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 B around inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.f6453.0%

        \[\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) \]
    5. Simplified53.0%

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

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

Alternative 11: 33.4% accurate, 2.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 1.55 \cdot 10^{-55}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{2 \cdot C}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 1.55e-55)
   (/
    (* (sqrt (* 2.0 (* F (+ (* B_m B_m) (* -4.0 (* A C)))))) (sqrt (* 2.0 C)))
    (- (* (* 4.0 A) C) (* B_m B_m)))
   (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.55e-55) {
		tmp = (sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * sqrt((2.0 * C))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = abs(b)
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.55d-55) then
        tmp = (sqrt((2.0d0 * (f * ((b_m * b_m) + ((-4.0d0) * (a * c)))))) * sqrt((2.0d0 * c))) / (((4.0d0 * a) * c) - (b_m * b_m))
    else
        tmp = 0.0d0 - (sqrt(2.0d0) * sqrt((f / b_m)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.55e-55) {
		tmp = (Math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * Math.sqrt((2.0 * C))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 1.55e-55:
		tmp = (math.sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * math.sqrt((2.0 * C))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 1.55e-55)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))) * sqrt(Float64(2.0 * C))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 1.55e-55)
		tmp = (sqrt((2.0 * (F * ((B_m * B_m) + (-4.0 * (A * C)))))) * sqrt((2.0 * C))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.55e-55], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 1.55 \cdot 10^{-55}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{2 \cdot C}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(\left(A + C\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right)}^{\frac{1}{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) \]
      3. unpow-prod-downN/A

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(2 \cdot C\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), 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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f6417.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, C\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), F\right)\right)\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) \]
    9. Simplified17.9%

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

    if 1.54999999999999998e-55 < B

    1. Initial program 23.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.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) \]
    5. Simplified44.4%

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

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

Alternative 12: 33.6% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 3.25 \cdot 10^{-55}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{2} \cdot \sqrt{\frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 3.25e-55)
   (/ (sqrt (* -16.0 (* C (* A (* C F))))) (- (* (* 4.0 A) C) (* B_m B_m)))
   (- 0.0 (* (sqrt 2.0) (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 3.25e-55) {
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	}
	return tmp;
}
B_m = abs(b)
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.25d-55) then
        tmp = sqrt(((-16.0d0) * (c * (a * (c * f))))) / (((4.0d0 * a) * c) - (b_m * b_m))
    else
        tmp = 0.0d0 - (sqrt(2.0d0) * sqrt((f / b_m)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 3.25e-55) {
		tmp = Math.sqrt((-16.0 * (C * (A * (C * F))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = 0.0 - (Math.sqrt(2.0) * Math.sqrt((F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 3.25e-55:
		tmp = math.sqrt((-16.0 * (C * (A * (C * F))))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = 0.0 - (math.sqrt(2.0) * math.sqrt((F / B_m)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 3.25e-55)
		tmp = Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * Float64(C * F))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(0.0 - Float64(sqrt(2.0) * sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 3.25e-55)
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = 0.0 - (sqrt(2.0) * sqrt((F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 3.25e-55], N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * N[(C * F), $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[(0.0 - N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 3.25 \cdot 10^{-55}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(\left(C \cdot C\right) \cdot F\right) \cdot A\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) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(C \cdot \left(C \cdot F\right)\right) \cdot 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. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\left(C \cdot F\right), A\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-*.f6416.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), A\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-rr16.1%

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

    if 3.25000000000000003e-55 < B

    1. Initial program 23.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. 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.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) \]
    5. Simplified44.4%

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

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

Alternative 13: 19.4% accurate, 4.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ t_1 := F \cdot \left(A + C\right)\\ \mathbf{if}\;A \leq 1.85 \cdot 10^{-175}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{t\_0}\\ \mathbf{elif}\;A \leq 3.4 \cdot 10^{-27}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right) \cdot \left(2 \cdot F + 2 \cdot \frac{t\_1}{B\_m}\right)}}{t\_0}\\ \mathbf{elif}\;A \leq 6.7 \cdot 10^{+136}:\\ \;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right) + 4 \cdot \left(A \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{1}{A \cdot C} \cdot \sqrt{-8 \cdot \left(A \cdot \left(C \cdot t\_1\right)\right) + -8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\right)}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))) (t_1 (* F (+ A C))))
   (if (<= A 1.85e-175)
     (/ (sqrt (* -16.0 (* C (* A (* C F))))) t_0)
     (if (<= A 3.4e-27)
       (/ (sqrt (* (* B_m (* B_m B_m)) (+ (* 2.0 F) (* 2.0 (/ t_1 B_m))))) t_0)
       (if (<= A 6.7e+136)
         (/
          (sqrt
           (+ (* (* C F) (* -16.0 (* A A))) (* 4.0 (* A (* F (* B_m B_m))))))
          t_0)
         (*
          0.25
          (*
           (/ 1.0 (* A C))
           (sqrt
            (+
             (* -8.0 (* A (* C t_1)))
             (* -8.0 (* A (* C (* F (- A C))))))))))))))
B_m = fabs(B);
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 = F * (A + C);
	double tmp;
	if (A <= 1.85e-175) {
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	} else if (A <= 3.4e-27) {
		tmp = sqrt(((B_m * (B_m * B_m)) * ((2.0 * F) + (2.0 * (t_1 / B_m))))) / t_0;
	} else if (A <= 6.7e+136) {
		tmp = sqrt((((C * F) * (-16.0 * (A * A))) + (4.0 * (A * (F * (B_m * B_m)))))) / t_0;
	} else {
		tmp = 0.25 * ((1.0 / (A * C)) * sqrt(((-8.0 * (A * (C * t_1))) + (-8.0 * (A * (C * (F * (A - C))))))));
	}
	return tmp;
}
B_m = abs(b)
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 = f * (a + c)
    if (a <= 1.85d-175) then
        tmp = sqrt(((-16.0d0) * (c * (a * (c * f))))) / t_0
    else if (a <= 3.4d-27) then
        tmp = sqrt(((b_m * (b_m * b_m)) * ((2.0d0 * f) + (2.0d0 * (t_1 / b_m))))) / t_0
    else if (a <= 6.7d+136) then
        tmp = sqrt((((c * f) * ((-16.0d0) * (a * a))) + (4.0d0 * (a * (f * (b_m * b_m)))))) / t_0
    else
        tmp = 0.25d0 * ((1.0d0 / (a * c)) * sqrt((((-8.0d0) * (a * (c * t_1))) + ((-8.0d0) * (a * (c * (f * (a - c))))))))
    end if
    code = tmp
end function
B_m = Math.abs(B);
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 = F * (A + C);
	double tmp;
	if (A <= 1.85e-175) {
		tmp = Math.sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	} else if (A <= 3.4e-27) {
		tmp = Math.sqrt(((B_m * (B_m * B_m)) * ((2.0 * F) + (2.0 * (t_1 / B_m))))) / t_0;
	} else if (A <= 6.7e+136) {
		tmp = Math.sqrt((((C * F) * (-16.0 * (A * A))) + (4.0 * (A * (F * (B_m * B_m)))))) / t_0;
	} else {
		tmp = 0.25 * ((1.0 / (A * C)) * Math.sqrt(((-8.0 * (A * (C * t_1))) + (-8.0 * (A * (C * (F * (A - C))))))));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	t_1 = F * (A + C)
	tmp = 0
	if A <= 1.85e-175:
		tmp = math.sqrt((-16.0 * (C * (A * (C * F))))) / t_0
	elif A <= 3.4e-27:
		tmp = math.sqrt(((B_m * (B_m * B_m)) * ((2.0 * F) + (2.0 * (t_1 / B_m))))) / t_0
	elif A <= 6.7e+136:
		tmp = math.sqrt((((C * F) * (-16.0 * (A * A))) + (4.0 * (A * (F * (B_m * B_m)))))) / t_0
	else:
		tmp = 0.25 * ((1.0 / (A * C)) * math.sqrt(((-8.0 * (A * (C * t_1))) + (-8.0 * (A * (C * (F * (A - C))))))))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	t_1 = Float64(F * Float64(A + C))
	tmp = 0.0
	if (A <= 1.85e-175)
		tmp = Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * Float64(C * F))))) / t_0);
	elseif (A <= 3.4e-27)
		tmp = Float64(sqrt(Float64(Float64(B_m * Float64(B_m * B_m)) * Float64(Float64(2.0 * F) + Float64(2.0 * Float64(t_1 / B_m))))) / t_0);
	elseif (A <= 6.7e+136)
		tmp = Float64(sqrt(Float64(Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A))) + Float64(4.0 * Float64(A * Float64(F * Float64(B_m * B_m)))))) / t_0);
	else
		tmp = Float64(0.25 * Float64(Float64(1.0 / Float64(A * C)) * sqrt(Float64(Float64(-8.0 * Float64(A * Float64(C * t_1))) + Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A - C)))))))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((4.0 * A) * C) - (B_m * B_m);
	t_1 = F * (A + C);
	tmp = 0.0;
	if (A <= 1.85e-175)
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	elseif (A <= 3.4e-27)
		tmp = sqrt(((B_m * (B_m * B_m)) * ((2.0 * F) + (2.0 * (t_1 / B_m))))) / t_0;
	elseif (A <= 6.7e+136)
		tmp = sqrt((((C * F) * (-16.0 * (A * A))) + (4.0 * (A * (F * (B_m * B_m)))))) / t_0;
	else
		tmp = 0.25 * ((1.0 / (A * C)) * sqrt(((-8.0 * (A * (C * t_1))) + (-8.0 * (A * (C * (F * (A - C))))))));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
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[(F * N[(A + C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 1.85e-175], N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[A, 3.4e-27], N[(N[Sqrt[N[(N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * F), $MachinePrecision] + N[(2.0 * N[(t$95$1 / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[A, 6.7e+136], N[(N[Sqrt[N[(N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(A * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(0.25 * N[(N[(1.0 / N[(A * C), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(-8.0 * N[(A * N[(C * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-8.0 * N[(A * N[(C * N[(F * N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
t_1 := F \cdot \left(A + C\right)\\
\mathbf{if}\;A \leq 1.85 \cdot 10^{-175}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{t\_0}\\

\mathbf{elif}\;A \leq 3.4 \cdot 10^{-27}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right) \cdot \left(2 \cdot F + 2 \cdot \frac{t\_1}{B\_m}\right)}}{t\_0}\\

\mathbf{elif}\;A \leq 6.7 \cdot 10^{+136}:\\
\;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right) + 4 \cdot \left(A \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\frac{1}{A \cdot C} \cdot \sqrt{-8 \cdot \left(A \cdot \left(C \cdot t\_1\right)\right) + -8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < 1.84999999999999999e-175

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

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

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

      \[\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(\left(C \cdot C\right) \cdot F\right) \cdot A\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) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(C \cdot \left(C \cdot F\right)\right) \cdot 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. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\left(C \cdot F\right), A\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-*.f6419.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), A\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-rr19.2%

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

    if 1.84999999999999999e-175 < A < 3.3999999999999997e-27

    1. Initial program 46.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. Simplified46.7%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right), \left(\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\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) \]
    6. Applied egg-rr46.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left({B}^{3} \cdot \left(2 \cdot F + 2 \cdot \frac{F \cdot \left(A + C\right)}{B}\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. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left({B}^{3}\right), \left(2 \cdot F + 2 \cdot \frac{F \cdot \left(A + C\right)}{B}\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. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(B \cdot \left(B \cdot B\right)\right), \left(2 \cdot F + 2 \cdot \frac{F \cdot \left(A + C\right)}{B}\right)\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) \]
      3. unpow2N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(A + C\right)\right), B\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) \]
      12. +-lowering-+.f6410.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, C\right)\right), B\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) \]
    9. Simplified10.7%

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

    if 3.3999999999999997e-27 < A < 6.7e136

    1. Initial program 43.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. Simplified43.8%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right) + {B}^{2} \cdot \left(2 \cdot \left(F \cdot \left(-2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot A\right)\right) + 2 \cdot \left({B}^{2} \cdot \left(F \cdot \left(\frac{1}{2} \cdot \frac{A \cdot C}{{\left(A - C\right)}^{3}} + \frac{1}{2} \cdot \frac{1}{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) \]
    6. Simplified30.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), 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) \]
    9. Simplified30.9%

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

    if 6.7e136 < A

    1. Initial program 4.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right), \left(\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\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) \]
    6. Applied egg-rr9.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq 1.85 \cdot 10^{-175}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{elif}\;A \leq 3.4 \cdot 10^{-27}:\\ \;\;\;\;\frac{\sqrt{\left(B \cdot \left(B \cdot B\right)\right) \cdot \left(2 \cdot F + 2 \cdot \frac{F \cdot \left(A + C\right)}{B}\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{elif}\;A \leq 6.7 \cdot 10^{+136}:\\ \;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right) + 4 \cdot \left(A \cdot \left(F \cdot \left(B \cdot B\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{1}{A \cdot C} \cdot \sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right) + -8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 19.6% accurate, 4.4× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ t_1 := F \cdot \left(A + C\right)\\ \mathbf{if}\;A \leq 1.4 \cdot 10^{-186}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{t\_0}\\ \mathbf{elif}\;A \leq 3.7 \cdot 10^{-34}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right) \cdot \left(2 \cdot F + 2 \cdot \frac{t\_1}{B\_m}\right)}}{t\_0}\\ \mathbf{elif}\;A \leq 1.32 \cdot 10^{+137}:\\ \;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right) + 4 \cdot \left(A \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(t\_1 + F \cdot \left(A - C\right)\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))) (t_1 (* F (+ A C))))
   (if (<= A 1.4e-186)
     (/ (sqrt (* -16.0 (* C (* A (* C F))))) t_0)
     (if (<= A 3.7e-34)
       (/ (sqrt (* (* B_m (* B_m B_m)) (+ (* 2.0 F) (* 2.0 (/ t_1 B_m))))) t_0)
       (if (<= A 1.32e+137)
         (/
          (sqrt
           (+ (* (* C F) (* -16.0 (* A A))) (* 4.0 (* A (* F (* B_m B_m))))))
          t_0)
         (/ (sqrt (* -8.0 (* (* A C) (+ t_1 (* F (- A C)))))) t_0))))))
B_m = fabs(B);
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 = F * (A + C);
	double tmp;
	if (A <= 1.4e-186) {
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	} else if (A <= 3.7e-34) {
		tmp = sqrt(((B_m * (B_m * B_m)) * ((2.0 * F) + (2.0 * (t_1 / B_m))))) / t_0;
	} else if (A <= 1.32e+137) {
		tmp = sqrt((((C * F) * (-16.0 * (A * A))) + (4.0 * (A * (F * (B_m * B_m)))))) / t_0;
	} else {
		tmp = sqrt((-8.0 * ((A * C) * (t_1 + (F * (A - C)))))) / t_0;
	}
	return tmp;
}
B_m = abs(b)
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 = f * (a + c)
    if (a <= 1.4d-186) then
        tmp = sqrt(((-16.0d0) * (c * (a * (c * f))))) / t_0
    else if (a <= 3.7d-34) then
        tmp = sqrt(((b_m * (b_m * b_m)) * ((2.0d0 * f) + (2.0d0 * (t_1 / b_m))))) / t_0
    else if (a <= 1.32d+137) then
        tmp = sqrt((((c * f) * ((-16.0d0) * (a * a))) + (4.0d0 * (a * (f * (b_m * b_m)))))) / t_0
    else
        tmp = sqrt(((-8.0d0) * ((a * c) * (t_1 + (f * (a - c)))))) / t_0
    end if
    code = tmp
end function
B_m = Math.abs(B);
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 = F * (A + C);
	double tmp;
	if (A <= 1.4e-186) {
		tmp = Math.sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	} else if (A <= 3.7e-34) {
		tmp = Math.sqrt(((B_m * (B_m * B_m)) * ((2.0 * F) + (2.0 * (t_1 / B_m))))) / t_0;
	} else if (A <= 1.32e+137) {
		tmp = Math.sqrt((((C * F) * (-16.0 * (A * A))) + (4.0 * (A * (F * (B_m * B_m)))))) / t_0;
	} else {
		tmp = Math.sqrt((-8.0 * ((A * C) * (t_1 + (F * (A - C)))))) / t_0;
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	t_1 = F * (A + C)
	tmp = 0
	if A <= 1.4e-186:
		tmp = math.sqrt((-16.0 * (C * (A * (C * F))))) / t_0
	elif A <= 3.7e-34:
		tmp = math.sqrt(((B_m * (B_m * B_m)) * ((2.0 * F) + (2.0 * (t_1 / B_m))))) / t_0
	elif A <= 1.32e+137:
		tmp = math.sqrt((((C * F) * (-16.0 * (A * A))) + (4.0 * (A * (F * (B_m * B_m)))))) / t_0
	else:
		tmp = math.sqrt((-8.0 * ((A * C) * (t_1 + (F * (A - C)))))) / t_0
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))
	t_1 = Float64(F * Float64(A + C))
	tmp = 0.0
	if (A <= 1.4e-186)
		tmp = Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * Float64(C * F))))) / t_0);
	elseif (A <= 3.7e-34)
		tmp = Float64(sqrt(Float64(Float64(B_m * Float64(B_m * B_m)) * Float64(Float64(2.0 * F) + Float64(2.0 * Float64(t_1 / B_m))))) / t_0);
	elseif (A <= 1.32e+137)
		tmp = Float64(sqrt(Float64(Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A))) + Float64(4.0 * Float64(A * Float64(F * Float64(B_m * B_m)))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(-8.0 * Float64(Float64(A * C) * Float64(t_1 + Float64(F * Float64(A - C)))))) / t_0);
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((4.0 * A) * C) - (B_m * B_m);
	t_1 = F * (A + C);
	tmp = 0.0;
	if (A <= 1.4e-186)
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	elseif (A <= 3.7e-34)
		tmp = sqrt(((B_m * (B_m * B_m)) * ((2.0 * F) + (2.0 * (t_1 / B_m))))) / t_0;
	elseif (A <= 1.32e+137)
		tmp = sqrt((((C * F) * (-16.0 * (A * A))) + (4.0 * (A * (F * (B_m * B_m)))))) / t_0;
	else
		tmp = sqrt((-8.0 * ((A * C) * (t_1 + (F * (A - C)))))) / t_0;
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
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[(F * N[(A + C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, 1.4e-186], N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[A, 3.7e-34], N[(N[Sqrt[N[(N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * F), $MachinePrecision] + N[(2.0 * N[(t$95$1 / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[A, 1.32e+137], N[(N[Sqrt[N[(N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(A * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(-8.0 * N[(N[(A * C), $MachinePrecision] * N[(t$95$1 + N[(F * N[(A - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
t_1 := F \cdot \left(A + C\right)\\
\mathbf{if}\;A \leq 1.4 \cdot 10^{-186}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{t\_0}\\

\mathbf{elif}\;A \leq 3.7 \cdot 10^{-34}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right) \cdot \left(2 \cdot F + 2 \cdot \frac{t\_1}{B\_m}\right)}}{t\_0}\\

\mathbf{elif}\;A \leq 1.32 \cdot 10^{+137}:\\
\;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right) + 4 \cdot \left(A \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(t\_1 + F \cdot \left(A - C\right)\right)\right)}}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < 1.39999999999999992e-186

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

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

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

      \[\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(\left(C \cdot C\right) \cdot F\right) \cdot A\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) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(C \cdot \left(C \cdot F\right)\right) \cdot 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. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\left(C \cdot F\right), A\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-*.f6419.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), A\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-rr19.2%

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

    if 1.39999999999999992e-186 < A < 3.69999999999999988e-34

    1. Initial program 46.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. Simplified46.7%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right), \left(\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\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) \]
    6. Applied egg-rr46.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left({B}^{3} \cdot \left(2 \cdot F + 2 \cdot \frac{F \cdot \left(A + C\right)}{B}\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. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left({B}^{3}\right), \left(2 \cdot F + 2 \cdot \frac{F \cdot \left(A + C\right)}{B}\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. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(B \cdot \left(B \cdot B\right)\right), \left(2 \cdot F + 2 \cdot \frac{F \cdot \left(A + C\right)}{B}\right)\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) \]
      3. unpow2N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(A + C\right)\right), B\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) \]
      12. +-lowering-+.f6410.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, C\right)\right), B\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) \]
    9. Simplified10.7%

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

    if 3.69999999999999988e-34 < A < 1.31999999999999997e137

    1. Initial program 43.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. Simplified43.8%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right) + {B}^{2} \cdot \left(2 \cdot \left(F \cdot \left(-2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot A\right)\right) + 2 \cdot \left({B}^{2} \cdot \left(F \cdot \left(\frac{1}{2} \cdot \frac{A \cdot C}{{\left(A - C\right)}^{3}} + \frac{1}{2} \cdot \frac{1}{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) \]
    6. Simplified30.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), 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) \]
    9. Simplified30.9%

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

    if 1.31999999999999997e137 < A

    1. Initial program 4.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right), \left(\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\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) \]
    6. Applied egg-rr9.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right) + -8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(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) \]
    8. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right)\right), \left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\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(\mathsf{*.f64}\left(-8, \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right)\right), \left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\right)\right)\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) \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \left(F \cdot \left(A + C\right)\right)\right)\right)\right), \left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(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) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \left(A + C\right)\right)\right)\right)\right), \left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(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. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, C\right)\right)\right)\right)\right), \left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(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) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(-8, \left(A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\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) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \left(C \cdot \left(F \cdot \left(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) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \left(F \cdot \left(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) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \left(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) \]
      11. --lowering--.f6417.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(A, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(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) \]
    9. Simplified17.3%

      \[\leadsto \frac{\sqrt{\color{blue}{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right)\right) + -8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
    10. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right) + A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right) + A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\right) \cdot -8\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) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(A \cdot \left(C \cdot \left(F \cdot \left(A + C\right)\right)\right) + A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\right), -8\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) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + C\right)\right) + A \cdot \left(C \cdot \left(F \cdot \left(A - C\right)\right)\right)\right), -8\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + C\right)\right) + \left(A \cdot C\right) \cdot \left(F \cdot \left(A - C\right)\right)\right), -8\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. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + C\right) + F \cdot \left(A - C\right)\right)\right), -8\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) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot C\right), \left(F \cdot \left(A + C\right) + F \cdot \left(A - C\right)\right)\right), -8\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) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(C \cdot A\right), \left(F \cdot \left(A + C\right) + F \cdot \left(A - C\right)\right)\right), -8\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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 15: 19.9% accurate, 4.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;C \leq -1.3 \cdot 10^{-137}:\\ \;\;\;\;\frac{\sqrt{A \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -16\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{F \cdot \left(B\_m \cdot B\_m\right)}{C}\right)\right)}}{t\_0}\\ \mathbf{elif}\;C \leq 5.3 \cdot 10^{-92}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= C -1.3e-137)
     (/
      (sqrt
       (+
        (* A (* (* C F) (* A -16.0)))
        (* (* B_m B_m) (* 2.0 (* -0.5 (/ (* F (* B_m B_m)) C))))))
      t_0)
     (if (<= C 5.3e-92)
       (/ (sqrt (* 2.0 (* F (* B_m (* B_m B_m))))) t_0)
       (/ (sqrt (* -16.0 (* C (* A (* C F))))) t_0)))))
B_m = fabs(B);
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 (C <= -1.3e-137) {
		tmp = sqrt(((A * ((C * F) * (A * -16.0))) + ((B_m * B_m) * (2.0 * (-0.5 * ((F * (B_m * B_m)) / C)))))) / t_0;
	} else if (C <= 5.3e-92) {
		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
	} else {
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	}
	return tmp;
}
B_m = abs(b)
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 (c <= (-1.3d-137)) then
        tmp = sqrt(((a * ((c * f) * (a * (-16.0d0)))) + ((b_m * b_m) * (2.0d0 * ((-0.5d0) * ((f * (b_m * b_m)) / c)))))) / t_0
    else if (c <= 5.3d-92) then
        tmp = sqrt((2.0d0 * (f * (b_m * (b_m * b_m))))) / t_0
    else
        tmp = sqrt(((-16.0d0) * (c * (a * (c * f))))) / t_0
    end if
    code = tmp
end function
B_m = Math.abs(B);
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 (C <= -1.3e-137) {
		tmp = Math.sqrt(((A * ((C * F) * (A * -16.0))) + ((B_m * B_m) * (2.0 * (-0.5 * ((F * (B_m * B_m)) / C)))))) / t_0;
	} else if (C <= 5.3e-92) {
		tmp = Math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
	} else {
		tmp = Math.sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	tmp = 0
	if C <= -1.3e-137:
		tmp = math.sqrt(((A * ((C * F) * (A * -16.0))) + ((B_m * B_m) * (2.0 * (-0.5 * ((F * (B_m * B_m)) / C)))))) / t_0
	elif C <= 5.3e-92:
		tmp = math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0
	else:
		tmp = math.sqrt((-16.0 * (C * (A * (C * F))))) / t_0
	return tmp
B_m = abs(B)
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 (C <= -1.3e-137)
		tmp = Float64(sqrt(Float64(Float64(A * Float64(Float64(C * F) * Float64(A * -16.0))) + Float64(Float64(B_m * B_m) * Float64(2.0 * Float64(-0.5 * Float64(Float64(F * Float64(B_m * B_m)) / C)))))) / t_0);
	elseif (C <= 5.3e-92)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * Float64(C * F))))) / t_0);
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((4.0 * A) * C) - (B_m * B_m);
	tmp = 0.0;
	if (C <= -1.3e-137)
		tmp = sqrt(((A * ((C * F) * (A * -16.0))) + ((B_m * B_m) * (2.0 * (-0.5 * ((F * (B_m * B_m)) / C)))))) / t_0;
	elseif (C <= 5.3e-92)
		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
	else
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
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[C, -1.3e-137], N[(N[Sqrt[N[(N[(A * N[(N[(C * F), $MachinePrecision] * N[(A * -16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(2.0 * N[(-0.5 * N[(N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[C, 5.3e-92], 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], N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;C \leq -1.3 \cdot 10^{-137}:\\
\;\;\;\;\frac{\sqrt{A \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -16\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{F \cdot \left(B\_m \cdot B\_m\right)}{C}\right)\right)}}{t\_0}\\

\mathbf{elif}\;C \leq 5.3 \cdot 10^{-92}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\

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


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

    1. Initial program 15.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. Simplified18.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right) + {B}^{2} \cdot \left(2 \cdot \left(F \cdot \left(-2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot A\right)\right) + 2 \cdot \left({B}^{2} \cdot \left(F \cdot \left(\frac{1}{2} \cdot \frac{A \cdot C}{{\left(A - C\right)}^{3}} + \frac{1}{2} \cdot \frac{1}{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) \]
    6. Simplified21.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \color{blue}{\left(\frac{-1}{2} \cdot \frac{{B}^{2} \cdot F}{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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), F\right), 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) \]
      5. *-lowering-*.f6421.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right), 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) \]
    9. Simplified21.5%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right), C\right)\right)\right)\right)\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(C \cdot F\right) \cdot \left(\left(-16 \cdot A\right) \cdot A\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right), 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. associate-*r*N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \left(A \cdot -16\right)\right), A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right), 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) \]
      8. *-lowering-*.f6424.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{*.f64}\left(A, -16\right)\right), A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right), 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) \]
    11. Applied egg-rr24.8%

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

    if -1.3e-137 < C < 5.30000000000000029e-92

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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-*.f6412.3%

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

      \[\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} \]

    if 5.30000000000000029e-92 < C

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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-*.f6415.5%

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

      \[\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(\left(C \cdot C\right) \cdot F\right) \cdot A\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) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(C \cdot \left(C \cdot F\right)\right) \cdot 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. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\left(C \cdot F\right), A\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-*.f6421.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), A\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-rr21.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -1.3 \cdot 10^{-137}:\\ \;\;\;\;\frac{\sqrt{A \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -16\right)\right) + \left(B \cdot B\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{F \cdot \left(B \cdot B\right)}{C}\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{elif}\;C \leq 5.3 \cdot 10^{-92}:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 18.6% accurate, 4.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;C \leq -9.2 \cdot 10^{-143}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{F \cdot \left(B\_m \cdot B\_m\right)}{C}\right)\right) + \left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t\_0}\\ \mathbf{elif}\;C \leq 5.2 \cdot 10^{-95}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= C -9.2e-143)
     (/
      (sqrt
       (+
        (* (* B_m B_m) (* 2.0 (* -0.5 (/ (* F (* B_m B_m)) C))))
        (* (* C F) (* -16.0 (* A A)))))
      t_0)
     (if (<= C 5.2e-95)
       (/ (sqrt (* 2.0 (* F (* B_m (* B_m B_m))))) t_0)
       (/ (sqrt (* -16.0 (* C (* A (* C F))))) t_0)))))
B_m = fabs(B);
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 (C <= -9.2e-143) {
		tmp = sqrt((((B_m * B_m) * (2.0 * (-0.5 * ((F * (B_m * B_m)) / C)))) + ((C * F) * (-16.0 * (A * A))))) / t_0;
	} else if (C <= 5.2e-95) {
		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
	} else {
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	}
	return tmp;
}
B_m = abs(b)
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 (c <= (-9.2d-143)) then
        tmp = sqrt((((b_m * b_m) * (2.0d0 * ((-0.5d0) * ((f * (b_m * b_m)) / c)))) + ((c * f) * ((-16.0d0) * (a * a))))) / t_0
    else if (c <= 5.2d-95) then
        tmp = sqrt((2.0d0 * (f * (b_m * (b_m * b_m))))) / t_0
    else
        tmp = sqrt(((-16.0d0) * (c * (a * (c * f))))) / t_0
    end if
    code = tmp
end function
B_m = Math.abs(B);
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 (C <= -9.2e-143) {
		tmp = Math.sqrt((((B_m * B_m) * (2.0 * (-0.5 * ((F * (B_m * B_m)) / C)))) + ((C * F) * (-16.0 * (A * A))))) / t_0;
	} else if (C <= 5.2e-95) {
		tmp = Math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
	} else {
		tmp = Math.sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	tmp = 0
	if C <= -9.2e-143:
		tmp = math.sqrt((((B_m * B_m) * (2.0 * (-0.5 * ((F * (B_m * B_m)) / C)))) + ((C * F) * (-16.0 * (A * A))))) / t_0
	elif C <= 5.2e-95:
		tmp = math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0
	else:
		tmp = math.sqrt((-16.0 * (C * (A * (C * F))))) / t_0
	return tmp
B_m = abs(B)
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 (C <= -9.2e-143)
		tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) * Float64(2.0 * Float64(-0.5 * Float64(Float64(F * Float64(B_m * B_m)) / C)))) + Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A))))) / t_0);
	elseif (C <= 5.2e-95)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * Float64(C * F))))) / t_0);
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((4.0 * A) * C) - (B_m * B_m);
	tmp = 0.0;
	if (C <= -9.2e-143)
		tmp = sqrt((((B_m * B_m) * (2.0 * (-0.5 * ((F * (B_m * B_m)) / C)))) + ((C * F) * (-16.0 * (A * A))))) / t_0;
	elseif (C <= 5.2e-95)
		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
	else
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
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[C, -9.2e-143], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(2.0 * N[(-0.5 * N[(N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[C, 5.2e-95], 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], N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;C \leq -9.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{F \cdot \left(B\_m \cdot B\_m\right)}{C}\right)\right) + \left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t\_0}\\

\mathbf{elif}\;C \leq 5.2 \cdot 10^{-95}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\

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


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

    1. Initial program 15.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. Simplified18.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right) + {B}^{2} \cdot \left(2 \cdot \left(F \cdot \left(-2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot A\right)\right) + 2 \cdot \left({B}^{2} \cdot \left(F \cdot \left(\frac{1}{2} \cdot \frac{A \cdot C}{{\left(A - C\right)}^{3}} + \frac{1}{2} \cdot \frac{1}{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) \]
    6. Simplified21.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \color{blue}{\left(\frac{-1}{2} \cdot \frac{{B}^{2} \cdot F}{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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), F\right), 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) \]
      5. *-lowering-*.f6421.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right), 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) \]
    9. Simplified21.5%

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

    if -9.20000000000000045e-143 < C < 5.20000000000000001e-95

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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-*.f6412.3%

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

      \[\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} \]

    if 5.20000000000000001e-95 < C

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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-*.f6415.5%

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

      \[\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(\left(C \cdot C\right) \cdot F\right) \cdot A\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) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(C \cdot \left(C \cdot F\right)\right) \cdot 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. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\left(C \cdot F\right), A\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-*.f6421.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), A\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-rr21.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -9.2 \cdot 10^{-143}:\\ \;\;\;\;\frac{\sqrt{\left(B \cdot B\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{F \cdot \left(B \cdot B\right)}{C}\right)\right) + \left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{elif}\;C \leq 5.2 \cdot 10^{-95}:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 18.6% accurate, 4.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := t\_0 - B\_m \cdot B\_m\\ \mathbf{if}\;C \leq -2.9 \cdot 10^{-142}:\\ \;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{\left(C \cdot F\right) \cdot \left(A \cdot \left(A \cdot -16\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \frac{-1}{\frac{C}{F \cdot \left(B\_m \cdot B\_m\right)}}}\\ \mathbf{elif}\;C \leq 8.2 \cdot 10^{-95}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{t\_1}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C)) (t_1 (- t_0 (* B_m B_m))))
   (if (<= C -2.9e-142)
     (*
      (/ -1.0 (- (* B_m B_m) t_0))
      (sqrt
       (+
        (* (* C F) (* A (* A -16.0)))
        (* (* B_m B_m) (/ -1.0 (/ C (* F (* B_m B_m))))))))
     (if (<= C 8.2e-95)
       (/ (sqrt (* 2.0 (* F (* B_m (* B_m B_m))))) t_1)
       (/ (sqrt (* -16.0 (* C (* A (* C F))))) t_1)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - (B_m * B_m);
	double tmp;
	if (C <= -2.9e-142) {
		tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((((C * F) * (A * (A * -16.0))) + ((B_m * B_m) * (-1.0 / (C / (F * (B_m * B_m)))))));
	} else if (C <= 8.2e-95) {
		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_1;
	} else {
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_1;
	}
	return tmp;
}
B_m = abs(b)
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
    t_1 = t_0 - (b_m * b_m)
    if (c <= (-2.9d-142)) then
        tmp = ((-1.0d0) / ((b_m * b_m) - t_0)) * sqrt((((c * f) * (a * (a * (-16.0d0)))) + ((b_m * b_m) * ((-1.0d0) / (c / (f * (b_m * b_m)))))))
    else if (c <= 8.2d-95) then
        tmp = sqrt((2.0d0 * (f * (b_m * (b_m * b_m))))) / t_1
    else
        tmp = sqrt(((-16.0d0) * (c * (a * (c * f))))) / t_1
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - (B_m * B_m);
	double tmp;
	if (C <= -2.9e-142) {
		tmp = (-1.0 / ((B_m * B_m) - t_0)) * Math.sqrt((((C * F) * (A * (A * -16.0))) + ((B_m * B_m) * (-1.0 / (C / (F * (B_m * B_m)))))));
	} else if (C <= 8.2e-95) {
		tmp = Math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_1;
	} else {
		tmp = Math.sqrt((-16.0 * (C * (A * (C * F))))) / t_1;
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	t_1 = t_0 - (B_m * B_m)
	tmp = 0
	if C <= -2.9e-142:
		tmp = (-1.0 / ((B_m * B_m) - t_0)) * math.sqrt((((C * F) * (A * (A * -16.0))) + ((B_m * B_m) * (-1.0 / (C / (F * (B_m * B_m)))))))
	elif C <= 8.2e-95:
		tmp = math.sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_1
	else:
		tmp = math.sqrt((-16.0 * (C * (A * (C * F))))) / t_1
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64(t_0 - Float64(B_m * B_m))
	tmp = 0.0
	if (C <= -2.9e-142)
		tmp = Float64(Float64(-1.0 / Float64(Float64(B_m * B_m) - t_0)) * sqrt(Float64(Float64(Float64(C * F) * Float64(A * Float64(A * -16.0))) + Float64(Float64(B_m * B_m) * Float64(-1.0 / Float64(C / Float64(F * Float64(B_m * B_m))))))));
	elseif (C <= 8.2e-95)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(B_m * Float64(B_m * B_m))))) / t_1);
	else
		tmp = Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * Float64(C * F))))) / t_1);
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	t_1 = t_0 - (B_m * B_m);
	tmp = 0.0;
	if (C <= -2.9e-142)
		tmp = (-1.0 / ((B_m * B_m) - t_0)) * sqrt((((C * F) * (A * (A * -16.0))) + ((B_m * B_m) * (-1.0 / (C / (F * (B_m * B_m)))))));
	elseif (C <= 8.2e-95)
		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_1;
	else
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_1;
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -2.9e-142], N[(N[(-1.0 / N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(N[(C * F), $MachinePrecision] * N[(A * N[(A * -16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(-1.0 / N[(C / N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 8.2e-95], 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$1), $MachinePrecision], N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - B\_m \cdot B\_m\\
\mathbf{if}\;C \leq -2.9 \cdot 10^{-142}:\\
\;\;\;\;\frac{-1}{B\_m \cdot B\_m - t\_0} \cdot \sqrt{\left(C \cdot F\right) \cdot \left(A \cdot \left(A \cdot -16\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \frac{-1}{\frac{C}{F \cdot \left(B\_m \cdot B\_m\right)}}}\\

\mathbf{elif}\;C \leq 8.2 \cdot 10^{-95}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{t\_1}\\


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

    1. Initial program 15.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. Simplified18.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right) + {B}^{2} \cdot \left(2 \cdot \left(F \cdot \left(-2 \cdot \frac{A \cdot C}{A - C} + 2 \cdot A\right)\right) + 2 \cdot \left({B}^{2} \cdot \left(F \cdot \left(\frac{1}{2} \cdot \frac{A \cdot C}{{\left(A - C\right)}^{3}} + \frac{1}{2} \cdot \frac{1}{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) \]
    6. Simplified21.2%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \color{blue}{\left(\frac{-1}{2} \cdot \frac{{B}^{2} \cdot F}{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) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), F\right), 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) \]
      5. *-lowering-*.f6421.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right), 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) \]
    9. Simplified21.5%

      \[\leadsto \frac{\sqrt{\left(-16 \cdot \left(A \cdot A\right)\right) \cdot \left(C \cdot F\right) + \left(B \cdot B\right) \cdot \left(2 \cdot \color{blue}{\left(-0.5 \cdot \frac{\left(B \cdot B\right) \cdot F}{C}\right)}\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
    10. 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{\left(-16 \cdot \left(A \cdot A\right)\right) \cdot \left(C \cdot F\right) + \left(B \cdot B\right) \cdot \left(2 \cdot \left(\frac{-1}{2} \cdot \frac{\left(B \cdot B\right) \cdot F}{C}\right)\right)}}}} \]
      2. associate-/r/N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, \left(A \cdot 4\right)\right), \left(B \cdot B\right)\right)\right), \left(\sqrt{\left(-16 \cdot \left(A \cdot A\right)\right) \cdot \left(C \cdot F\right) + \left(B \cdot \color{blue}{B}\right) \cdot \left(2 \cdot \left(\frac{-1}{2} \cdot \frac{\left(B \cdot B\right) \cdot F}{C}\right)\right)}\right)\right) \]
      11. *-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), \left(B \cdot B\right)\right)\right), \left(\sqrt{\left(-16 \cdot \left(A \cdot A\right)\right) \cdot \left(C \cdot F\right) + \left(B \cdot \color{blue}{B}\right) \cdot \left(2 \cdot \left(\frac{-1}{2} \cdot \frac{\left(B \cdot B\right) \cdot F}{C}\right)\right)}\right)\right) \]
      12. *-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), \left(\sqrt{\left(-16 \cdot \left(A \cdot A\right)\right) \cdot \left(C \cdot F\right) + \left(B \cdot B\right) \cdot \color{blue}{\left(2 \cdot \left(\frac{-1}{2} \cdot \frac{\left(B \cdot B\right) \cdot F}{C}\right)\right)}}\right)\right) \]
      13. sqrt-lowering-sqrt.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(\left(\left(-16 \cdot \left(A \cdot A\right)\right) \cdot \left(C \cdot F\right) + \left(B \cdot B\right) \cdot \left(2 \cdot \left(\frac{-1}{2} \cdot \frac{\left(B \cdot B\right) \cdot F}{C}\right)\right)\right)\right)\right) \]
    11. Applied egg-rr21.4%

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

    if -2.8999999999999999e-142 < C < 8.1999999999999995e-95

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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-*.f6412.3%

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

      \[\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} \]

    if 8.1999999999999995e-95 < C

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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-*.f6415.5%

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

      \[\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(\left(C \cdot C\right) \cdot F\right) \cdot A\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) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(C \cdot \left(C \cdot F\right)\right) \cdot 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. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\left(C \cdot F\right), A\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-*.f6421.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), A\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-rr21.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -2.9 \cdot 10^{-142}:\\ \;\;\;\;\frac{-1}{B \cdot B - \left(4 \cdot A\right) \cdot C} \cdot \sqrt{\left(C \cdot F\right) \cdot \left(A \cdot \left(A \cdot -16\right)\right) + \left(B \cdot B\right) \cdot \frac{-1}{\frac{C}{F \cdot \left(B \cdot B\right)}}}\\ \mathbf{elif}\;C \leq 8.2 \cdot 10^{-95}:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 16.1% accurate, 5.1× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\ \mathbf{if}\;B\_m \leq 2.7 \cdot 10^{-55}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\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)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= B_m 2.7e-55)
     (/ (sqrt (* -16.0 (* C (* A (* C F))))) t_0)
     (/ (sqrt (* 2.0 (* F (* B_m (* B_m B_m))))) t_0))))
B_m = fabs(B);
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.7e-55) {
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / t_0;
	} else {
		tmp = sqrt((2.0 * (F * (B_m * (B_m * B_m))))) / t_0;
	}
	return tmp;
}
B_m = abs(b)
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 <= 2.7d-55) then
        tmp = sqrt(((-16.0d0) * (c * (a * (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);
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.7e-55) {
		tmp = Math.sqrt((-16.0 * (C * (A * (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)
def code(A, B_m, C, F):
	t_0 = ((4.0 * A) * C) - (B_m * B_m)
	tmp = 0
	if B_m <= 2.7e-55:
		tmp = math.sqrt((-16.0 * (C * (A * (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)
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.7e-55)
		tmp = Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * 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);
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.7e-55)
		tmp = sqrt((-16.0 * (C * (A * (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]
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.7e-55], N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * N[(C * F), $MachinePrecision]), $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|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m\\
\mathbf{if}\;B\_m \leq 2.7 \cdot 10^{-55}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\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 < 2.70000000000000004e-55

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(\left(C \cdot C\right) \cdot F\right) \cdot A\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) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(C \cdot \left(C \cdot F\right)\right) \cdot 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. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\left(C \cdot F\right), A\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-*.f6416.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), A\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-rr16.1%

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

    if 2.70000000000000004e-55 < B

    1. Initial program 23.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. Simplified24.2%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.7 \cdot 10^{-55}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\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 19: 16.5% accurate, 5.1× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -1.25 \cdot 10^{-171}:\\ \;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -1.25e-171)
   (/ (sqrt (* (* C F) (* -16.0 (* A A)))) (* 4.0 (* A C)))
   (/ (sqrt (* -16.0 (* C (* A (* C F))))) (- (* (* 4.0 A) C) (* B_m B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -1.25e-171) {
		tmp = sqrt(((C * F) * (-16.0 * (A * A)))) / (4.0 * (A * C));
	} else {
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / (((4.0 * A) * C) - (B_m * B_m));
	}
	return tmp;
}
B_m = abs(b)
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 <= (-1.25d-171)) then
        tmp = sqrt(((c * f) * ((-16.0d0) * (a * a)))) / (4.0d0 * (a * c))
    else
        tmp = sqrt(((-16.0d0) * (c * (a * (c * f))))) / (((4.0d0 * a) * c) - (b_m * b_m))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -1.25e-171) {
		tmp = Math.sqrt(((C * F) * (-16.0 * (A * A)))) / (4.0 * (A * C));
	} else {
		tmp = Math.sqrt((-16.0 * (C * (A * (C * F))))) / (((4.0 * A) * C) - (B_m * B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if C <= -1.25e-171:
		tmp = math.sqrt(((C * F) * (-16.0 * (A * A)))) / (4.0 * (A * C))
	else:
		tmp = math.sqrt((-16.0 * (C * (A * (C * F))))) / (((4.0 * A) * C) - (B_m * B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -1.25e-171)
		tmp = Float64(sqrt(Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A)))) / Float64(4.0 * Float64(A * C)));
	else
		tmp = Float64(sqrt(Float64(-16.0 * Float64(C * Float64(A * Float64(C * F))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -1.25e-171)
		tmp = sqrt(((C * F) * (-16.0 * (A * A)))) / (4.0 * (A * C));
	else
		tmp = sqrt((-16.0 * (C * (A * (C * F))))) / (((4.0 * A) * C) - (B_m * B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -1.25e-171], N[(N[Sqrt[N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(-16.0 * N[(C * N[(A * N[(C * F), $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|

\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.25 \cdot 10^{-171}:\\
\;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(C \cdot \left(A \cdot \left(C \cdot F\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 < -1.24999999999999998e-171

    1. Initial program 16.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. Simplified18.4%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(2 \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + C\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + C\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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. *-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(C + A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
      5. flip-+N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\left(2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(C \cdot C - A \cdot A\right)\right), \left(C - A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\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) \]
    8. Applied egg-rr14.8%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{*.f64}\left(A, A\right)\right)\right), \mathsf{\_.f64}\left(C, A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    11. Simplified7.7%

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

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

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

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

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

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

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

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

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

    if -1.24999999999999998e-171 < C

    1. Initial program 23.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. Simplified28.0%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\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.0%

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

      \[\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. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(\left(C \cdot C\right) \cdot F\right) \cdot A\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) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left(C \cdot \left(C \cdot F\right)\right) \cdot 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. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\left(C \cdot F\right), A\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-*.f6416.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), A\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-rr16.6%

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

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

Alternative 20: 13.9% accurate, 5.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;C \leq 2.6 \cdot 10^{-256}:\\ \;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))))
   (if (<= C 2.6e-256)
     (/ (sqrt (* (* C F) (* -16.0 (* A A)))) t_0)
     (/ (sqrt (* -16.0 (* A (* F (* C C))))) t_0))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (C <= 2.6e-256) {
		tmp = sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
	} else {
		tmp = sqrt((-16.0 * (A * (F * (C * C))))) / t_0;
	}
	return tmp;
}
B_m = abs(b)
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 (c <= 2.6d-256) then
        tmp = sqrt(((c * f) * ((-16.0d0) * (a * a)))) / t_0
    else
        tmp = sqrt(((-16.0d0) * (a * (f * (c * c))))) / t_0
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (C <= 2.6e-256) {
		tmp = Math.sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
	} else {
		tmp = Math.sqrt((-16.0 * (A * (F * (C * C))))) / t_0;
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = 4.0 * (A * C)
	tmp = 0
	if C <= 2.6e-256:
		tmp = math.sqrt(((C * F) * (-16.0 * (A * A)))) / t_0
	else:
		tmp = math.sqrt((-16.0 * (A * (F * (C * C))))) / t_0
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	tmp = 0.0
	if (C <= 2.6e-256)
		tmp = Float64(sqrt(Float64(Float64(C * F) * Float64(-16.0 * Float64(A * A)))) / t_0);
	else
		tmp = Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C))))) / t_0);
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = 4.0 * (A * C);
	tmp = 0.0;
	if (C <= 2.6e-256)
		tmp = sqrt(((C * F) * (-16.0 * (A * A)))) / t_0;
	else
		tmp = sqrt((-16.0 * (A * (F * (C * C))))) / t_0;
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 2.6e-256], N[(N[Sqrt[N[(N[(C * F), $MachinePrecision] * N[(-16.0 * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq 2.6 \cdot 10^{-256}:\\
\;\;\;\;\frac{\sqrt{\left(C \cdot F\right) \cdot \left(-16 \cdot \left(A \cdot A\right)\right)}}{t\_0}\\

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


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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right), \left(\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\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) \]
    6. Applied egg-rr17.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(2 \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + C\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + C\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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. *-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(C + A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
      5. flip-+N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\left(2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(C \cdot C - A \cdot A\right)\right), \left(C - A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\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) \]
    8. Applied egg-rr16.0%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{*.f64}\left(A, A\right)\right)\right), \mathsf{\_.f64}\left(C, A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    11. Simplified6.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(A, A\right)\right), \mathsf{*.f64}\left(C, F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    14. Simplified14.0%

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

    if 2.6000000000000001e-256 < C

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right), \left(\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\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) \]
    6. Applied egg-rr26.4%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(2 \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + C\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\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. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + C\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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. *-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(C + A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
      5. flip-+N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\left(2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(C \cdot C - A \cdot A\right)\right), \left(C - A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\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) \]
    8. Applied egg-rr24.1%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{*.f64}\left(A, A\right)\right)\right), \mathsf{\_.f64}\left(C, A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    11. Simplified9.6%

      \[\leadsto \frac{\sqrt{\frac{\left(\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(C \cdot C - A \cdot A\right)}{C - A} + 2 \cdot \left(\left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \mathsf{hypot}\left(B, A - C\right)\right)}}{\color{blue}{4 \cdot \left(A \cdot C\right)}} \]
    12. Taylor expanded in C 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(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    13. 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(4, \mathsf{*.f64}\left(A, C\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(4, \mathsf{*.f64}\left(A, C\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(4, \mathsf{*.f64}\left(A, C\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(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      5. *-lowering-*.f6416.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(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    14. Simplified16.4%

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

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

Alternative 21: 9.6% accurate, 5.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{4 \cdot \left(A \cdot C\right)} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (/ (sqrt (* -16.0 (* A (* F (* C C))))) (* 4.0 (* A C))))
B_m = fabs(B);
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 = abs(b)
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))
end function
B_m = Math.abs(B);
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 = math.fabs(B)
def code(A, B_m, C, F):
	return math.sqrt((-16.0 * (A * (F * (C * C))))) / (4.0 * (A * C))
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(sqrt(Float64(-16.0 * Float64(A * Float64(F * Float64(C * C))))) / Float64(4.0 * Float64(A * C)))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = sqrt((-16.0 * (A * (F * (C * C))))) / (4.0 * (A * C));
end
B_m = N[Abs[B], $MachinePrecision]
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[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\frac{\sqrt{-16 \cdot \left(A \cdot \left(F \cdot \left(C \cdot C\right)\right)\right)}}{4 \cdot \left(A \cdot C\right)}
\end{array}
Derivation
  1. Initial program 20.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. Simplified24.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right), \left(\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\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) \]
  6. Applied egg-rr21.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(\left(2 \cdot F\right) \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + C\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\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. associate-*r*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + C\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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. *-commutativeN/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(\left(2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(C + A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(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) \]
    5. flip-+N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\left(2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(C \cdot C - A \cdot A\right)\right), \left(C - A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\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) \]
  8. Applied egg-rr19.9%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{*.f64}\left(2, F\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, C\right), \mathsf{*.f64}\left(A, A\right)\right)\right), \mathsf{\_.f64}\left(C, A\right)\right), \mathsf{*.f64}\left(2, \mathsf{*.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), \mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
  11. Simplified8.1%

    \[\leadsto \frac{\sqrt{\frac{\left(\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\right) \cdot \left(C \cdot C - A \cdot A\right)}{C - A} + 2 \cdot \left(\left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \mathsf{hypot}\left(B, A - C\right)\right)}}{\color{blue}{4 \cdot \left(A \cdot C\right)}} \]
  12. Taylor expanded in C 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(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
  13. 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(4, \mathsf{*.f64}\left(A, C\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(4, \mathsf{*.f64}\left(A, C\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(4, \mathsf{*.f64}\left(A, C\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(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    5. *-lowering-*.f6411.2%

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

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

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

Alternative 22: 3.8% accurate, 634.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ 0 \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 0.0)
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return 0.0;
}
B_m = abs(b)
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 = 0.0d0
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return 0.0;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return 0.0
B_m = abs(B)
function code(A, B_m, C, F)
	return 0.0
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = 0.0;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := 0.0
\begin{array}{l}
B_m = \left|B\right|

\\
0
\end{array}
Derivation
  1. Initial program 20.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. Simplified24.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right) + \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(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(\left(\left(A + C\right) \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\right)\right), \left(\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)} \cdot \left(\left(B \cdot B - \left(4 \cdot A\right) \cdot C\right) \cdot \left(2 \cdot F\right)\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) \]
  6. Applied egg-rr21.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, A\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-8, \mathsf{*.f64}\left(A, F\right)\right), \mathsf{*.f64}\left(8, \mathsf{*.f64}\left(A, F\right)\right)\right)\right)\right)\right) \]
  9. Simplified3.2%

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

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

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

      \[\leadsto \frac{\frac{-1}{4} \cdot \sqrt{-8 \cdot \left(A \cdot F\right) + 8 \cdot \left(A \cdot F\right)}}{\color{blue}{A}} \]
    4. pow1/2N/A

      \[\leadsto \frac{\frac{-1}{4} \cdot {\left(-8 \cdot \left(A \cdot F\right) + 8 \cdot \left(A \cdot F\right)\right)}^{\frac{1}{2}}}{A} \]
    5. distribute-rgt-outN/A

      \[\leadsto \frac{\frac{-1}{4} \cdot {\left(\left(A \cdot F\right) \cdot \left(-8 + 8\right)\right)}^{\frac{1}{2}}}{A} \]
    6. metadata-evalN/A

      \[\leadsto \frac{\frac{-1}{4} \cdot {\left(\left(A \cdot F\right) \cdot 0\right)}^{\frac{1}{2}}}{A} \]
    7. mul0-rgtN/A

      \[\leadsto \frac{\frac{-1}{4} \cdot {0}^{\frac{1}{2}}}{A} \]
    8. metadata-evalN/A

      \[\leadsto \frac{\frac{-1}{4} \cdot 0}{A} \]
    9. metadata-evalN/A

      \[\leadsto \frac{0}{A} \]
    10. /-lowering-/.f643.6%

      \[\leadsto \mathsf{/.f64}\left(0, \color{blue}{A}\right) \]
  11. Applied egg-rr3.6%

    \[\leadsto \color{blue}{\frac{0}{A}} \]
  12. Step-by-step derivation
    1. div03.6%

      \[\leadsto 0 \]
  13. Applied egg-rr3.6%

    \[\leadsto \color{blue}{0} \]
  14. Add Preprocessing

Reproduce

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