ABCF->ab-angle a

Percentage Accurate: 19.5% → 56.7%
Time: 26.8s
Alternatives: 28
Speedup: 4.6×

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 28 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.5% 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: 56.7% accurate, 0.4× 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 := \mathsf{hypot}\left(B\_m, A - C\right)\\ t_2 := \left(4 \cdot A\right) \cdot C\\ t_3 := t\_2 - B\_m \cdot B\_m\\ t_4 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_2\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2 - {B\_m}^{2}}\\ t_5 := \sqrt{\left(A + C\right) + t\_1}\\ \mathbf{if}\;t\_4 \leq 0:\\ \;\;\;\;\left(\sqrt{2 \cdot t\_0} \cdot \sqrt{F}\right) \cdot \frac{{\left(A + \left(C + t\_1\right)\right)}^{0.5}}{t\_3}\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;\frac{\sqrt{t\_0 \cdot \left(2 \cdot F\right)}}{t\_3} \cdot t\_5\\ \mathbf{else}:\\ \;\;\;\;t\_5 \cdot \frac{\sqrt{2 \cdot F}}{0 - B\_m}\\ \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 (hypot B_m (- A C)))
        (t_2 (* (* 4.0 A) C))
        (t_3 (- t_2 (* B_m B_m)))
        (t_4
         (/
          (sqrt
           (*
            (* 2.0 (* (- (pow B_m 2.0) t_2) F))
            (+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
          (- t_2 (pow B_m 2.0))))
        (t_5 (sqrt (+ (+ A C) t_1))))
   (if (<= t_4 0.0)
     (* (* (sqrt (* 2.0 t_0)) (sqrt F)) (/ (pow (+ A (+ C t_1)) 0.5) t_3))
     (if (<= t_4 INFINITY)
       (* (/ (sqrt (* t_0 (* 2.0 F))) t_3) t_5)
       (* t_5 (/ (sqrt (* 2.0 F)) (- 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 = hypot(B_m, (A - C));
	double t_2 = (4.0 * A) * C;
	double t_3 = t_2 - (B_m * B_m);
	double t_4 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_2) * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_2 - pow(B_m, 2.0));
	double t_5 = sqrt(((A + C) + t_1));
	double tmp;
	if (t_4 <= 0.0) {
		tmp = (sqrt((2.0 * t_0)) * sqrt(F)) * (pow((A + (C + t_1)), 0.5) / t_3);
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = (sqrt((t_0 * (2.0 * F))) / t_3) * t_5;
	} else {
		tmp = t_5 * (sqrt((2.0 * F)) / (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.hypot(B_m, (A - C));
	double t_2 = (4.0 * A) * C;
	double t_3 = t_2 - (B_m * B_m);
	double t_4 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_2) * F)) * ((A + C) + Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / (t_2 - Math.pow(B_m, 2.0));
	double t_5 = Math.sqrt(((A + C) + t_1));
	double tmp;
	if (t_4 <= 0.0) {
		tmp = (Math.sqrt((2.0 * t_0)) * Math.sqrt(F)) * (Math.pow((A + (C + t_1)), 0.5) / t_3);
	} else if (t_4 <= Double.POSITIVE_INFINITY) {
		tmp = (Math.sqrt((t_0 * (2.0 * F))) / t_3) * t_5;
	} else {
		tmp = t_5 * (Math.sqrt((2.0 * F)) / (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.hypot(B_m, (A - C))
	t_2 = (4.0 * A) * C
	t_3 = t_2 - (B_m * B_m)
	t_4 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_2) * F)) * ((A + C) + math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / (t_2 - math.pow(B_m, 2.0))
	t_5 = math.sqrt(((A + C) + t_1))
	tmp = 0
	if t_4 <= 0.0:
		tmp = (math.sqrt((2.0 * t_0)) * math.sqrt(F)) * (math.pow((A + (C + t_1)), 0.5) / t_3)
	elif t_4 <= math.inf:
		tmp = (math.sqrt((t_0 * (2.0 * F))) / t_3) * t_5
	else:
		tmp = t_5 * (math.sqrt((2.0 * F)) / (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 = hypot(B_m, Float64(A - C))
	t_2 = Float64(Float64(4.0 * A) * C)
	t_3 = Float64(t_2 - Float64(B_m * B_m))
	t_4 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_2) * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_2 - (B_m ^ 2.0)))
	t_5 = sqrt(Float64(Float64(A + C) + t_1))
	tmp = 0.0
	if (t_4 <= 0.0)
		tmp = Float64(Float64(sqrt(Float64(2.0 * t_0)) * sqrt(F)) * Float64((Float64(A + Float64(C + t_1)) ^ 0.5) / t_3));
	elseif (t_4 <= Inf)
		tmp = Float64(Float64(sqrt(Float64(t_0 * Float64(2.0 * F))) / t_3) * t_5);
	else
		tmp = Float64(t_5 * Float64(sqrt(Float64(2.0 * F)) / 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 = hypot(B_m, (A - C));
	t_2 = (4.0 * A) * C;
	t_3 = t_2 - (B_m * B_m);
	t_4 = sqrt(((2.0 * (((B_m ^ 2.0) - t_2) * F)) * ((A + C) + sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / (t_2 - (B_m ^ 2.0));
	t_5 = sqrt(((A + C) + t_1));
	tmp = 0.0;
	if (t_4 <= 0.0)
		tmp = (sqrt((2.0 * t_0)) * sqrt(F)) * (((A + (C + t_1)) ^ 0.5) / t_3);
	elseif (t_4 <= Inf)
		tmp = (sqrt((t_0 * (2.0 * F))) / t_3) * t_5;
	else
		tmp = t_5 * (sqrt((2.0 * F)) / (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[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$2), $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$2 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(N[(N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(A + N[(C + t$95$1), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(N[Sqrt[N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision] * t$95$5), $MachinePrecision], N[(t$95$5 * N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $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 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_2 := \left(4 \cdot A\right) \cdot C\\
t_3 := t\_2 - B\_m \cdot B\_m\\
t_4 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_2\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2 - {B\_m}^{2}}\\
t_5 := \sqrt{\left(A + C\right) + t\_1}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\left(\sqrt{2 \cdot t\_0} \cdot \sqrt{F}\right) \cdot \frac{{\left(A + \left(C + t\_1\right)\right)}^{0.5}}{t\_3}\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{\sqrt{t\_0 \cdot \left(2 \cdot F\right)}}{t\_3} \cdot t\_5\\

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


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

    1. Initial program 41.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. Simplified47.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-rr60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. 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.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-rr0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 51.6% 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)\\ \mathbf{if}\;B\_m \leq 1.75 \cdot 10^{+25}:\\ \;\;\;\;\frac{{\left(A + \left(C + t\_0\right)\right)}^{0.5} \cdot \sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(A + C\right) + t\_0} \cdot \frac{\sqrt{2 \cdot F}}{0 - 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))))
   (if (<= B_m 1.75e+25)
     (/
      (*
       (pow (+ A (+ C t_0)) 0.5)
       (sqrt (* (+ (* B_m B_m) (* -4.0 (* A C))) (* 2.0 F))))
      (- (* (* 4.0 A) C) (* B_m B_m)))
     (* (sqrt (+ (+ A C) t_0)) (/ (sqrt (* 2.0 F)) (- 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 <= 1.75e+25) {
		tmp = (pow((A + (C + t_0)), 0.5) * sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = sqrt(((A + C) + t_0)) * (sqrt((2.0 * F)) / (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 <= 1.75e+25) {
		tmp = (Math.pow((A + (C + t_0)), 0.5) * Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = Math.sqrt(((A + C) + t_0)) * (Math.sqrt((2.0 * F)) / (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 <= 1.75e+25:
		tmp = (math.pow((A + (C + t_0)), 0.5) * math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = math.sqrt(((A + C) + t_0)) * (math.sqrt((2.0 * F)) / (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 <= 1.75e+25)
		tmp = Float64(Float64((Float64(A + Float64(C + t_0)) ^ 0.5) * sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(2.0 * F)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(sqrt(Float64(Float64(A + C) + t_0)) * Float64(sqrt(Float64(2.0 * F)) / 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 <= 1.75e+25)
		tmp = (((A + (C + t_0)) ^ 0.5) * sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F)))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = sqrt(((A + C) + t_0)) * (sqrt((2.0 * F)) / (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, 1.75e+25], N[(N[(N[Power[N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $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 1.75 \cdot 10^{+25}:\\
\;\;\;\;\frac{{\left(A + \left(C + t\_0\right)\right)}^{0.5} \cdot \sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

    1. Initial program 30.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. Simplified35.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. 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-rr46.4%

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

    if 1.75e25 < B

    1. Initial program 12.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. Simplified13.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-rr13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 51.5% 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)\\ \mathbf{if}\;B\_m \leq 1.76 \cdot 10^{+22}:\\ \;\;\;\;\frac{{\left(A + \left(C + t\_0\right)\right)}^{0.5}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m} \cdot \sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(A + C\right) + t\_0} \cdot \frac{\sqrt{2 \cdot F}}{0 - 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))))
   (if (<= B_m 1.76e+22)
     (*
      (/ (pow (+ A (+ C t_0)) 0.5) (- (* (* 4.0 A) C) (* B_m B_m)))
      (sqrt (* (+ (* B_m B_m) (* -4.0 (* A C))) (* 2.0 F))))
     (* (sqrt (+ (+ A C) t_0)) (/ (sqrt (* 2.0 F)) (- 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 <= 1.76e+22) {
		tmp = (pow((A + (C + t_0)), 0.5) / (((4.0 * A) * C) - (B_m * B_m))) * sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F)));
	} else {
		tmp = sqrt(((A + C) + t_0)) * (sqrt((2.0 * F)) / (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 <= 1.76e+22) {
		tmp = (Math.pow((A + (C + t_0)), 0.5) / (((4.0 * A) * C) - (B_m * B_m))) * Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F)));
	} else {
		tmp = Math.sqrt(((A + C) + t_0)) * (Math.sqrt((2.0 * F)) / (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 <= 1.76e+22:
		tmp = (math.pow((A + (C + t_0)), 0.5) / (((4.0 * A) * C) - (B_m * B_m))) * math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F)))
	else:
		tmp = math.sqrt(((A + C) + t_0)) * (math.sqrt((2.0 * F)) / (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 <= 1.76e+22)
		tmp = Float64(Float64((Float64(A + Float64(C + t_0)) ^ 0.5) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m))) * sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(2.0 * F))));
	else
		tmp = Float64(sqrt(Float64(Float64(A + C) + t_0)) * Float64(sqrt(Float64(2.0 * F)) / 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 <= 1.76e+22)
		tmp = (((A + (C + t_0)) ^ 0.5) / (((4.0 * A) * C) - (B_m * B_m))) * sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F)));
	else
		tmp = sqrt(((A + C) + t_0)) * (sqrt((2.0 * F)) / (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, 1.76e+22], N[(N[(N[Power[N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $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 1.76 \cdot 10^{+22}:\\
\;\;\;\;\frac{{\left(A + \left(C + t\_0\right)\right)}^{0.5}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m} \cdot \sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)}\\

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


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

    1. Initial program 30.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. Simplified35.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. 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-rr46.4%

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

    if 1.76e22 < B

    1. Initial program 12.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. Simplified13.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-rr13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 51.6% 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)\\ \mathbf{if}\;B\_m \leq 1.12 \cdot 10^{+28}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{2 \cdot \left(A + \left(C + t\_0\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(A + C\right) + t\_0} \cdot \frac{\sqrt{2 \cdot F}}{0 - 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))))
   (if (<= B_m 1.12e+28)
     (/
      (*
       (sqrt (* F (+ (* B_m B_m) (* -4.0 (* A C)))))
       (sqrt (* 2.0 (+ A (+ C t_0)))))
      (- (* (* 4.0 A) C) (* B_m B_m)))
     (* (sqrt (+ (+ A C) t_0)) (/ (sqrt (* 2.0 F)) (- 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 <= 1.12e+28) {
		tmp = (sqrt((F * ((B_m * B_m) + (-4.0 * (A * C))))) * sqrt((2.0 * (A + (C + t_0))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = sqrt(((A + C) + t_0)) * (sqrt((2.0 * F)) / (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 <= 1.12e+28) {
		tmp = (Math.sqrt((F * ((B_m * B_m) + (-4.0 * (A * C))))) * Math.sqrt((2.0 * (A + (C + t_0))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = Math.sqrt(((A + C) + t_0)) * (Math.sqrt((2.0 * F)) / (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 <= 1.12e+28:
		tmp = (math.sqrt((F * ((B_m * B_m) + (-4.0 * (A * C))))) * math.sqrt((2.0 * (A + (C + t_0))))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = math.sqrt(((A + C) + t_0)) * (math.sqrt((2.0 * F)) / (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 <= 1.12e+28)
		tmp = Float64(Float64(sqrt(Float64(F * Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))))) * sqrt(Float64(2.0 * Float64(A + Float64(C + 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(Float64(2.0 * F)) / 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 <= 1.12e+28)
		tmp = (sqrt((F * ((B_m * B_m) + (-4.0 * (A * C))))) * sqrt((2.0 * (A + (C + t_0))))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = sqrt(((A + C) + t_0)) * (sqrt((2.0 * F)) / (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, 1.12e+28], N[(N[(N[Sqrt[N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $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 1.12 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{2 \cdot \left(A + \left(C + t\_0\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

    1. Initial program 30.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. Simplified35.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. 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-rr46.3%

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

    if 1.12e28 < B

    1. Initial program 12.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. Simplified13.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-rr13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.12 \cdot 10^{+28}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)} \cdot \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\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 \frac{\sqrt{2 \cdot F}}{0 - B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 51.0% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 30.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. Simplified35.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. 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-rr46.4%

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

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

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

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

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

    if 6.19999999999999992e27 < B

    1. Initial program 12.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. Simplified13.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-rr13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 43.9% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 26.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. Simplified32.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-rr43.2%

      \[\leadsto \frac{\color{blue}{{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}^{0.5} \cdot \sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \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{pow.f64}\left(\color{blue}{\left(2 \cdot A\right)}, \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \mathsf{*.f64}\left(2, 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-*.f6422.7%

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

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

    if 8.5999999999999997e-63 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 43.2% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 31.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. Simplified36.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. *-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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

    if 1.4999999999999999e87 < B

    1. Initial program 2.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. Simplified3.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-rr3.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right), \mathsf{sqrt.f64}\left(F\right)\right)\right), \color{blue}{\left(\sqrt{B}\right)}\right) \]
    13. Step-by-step derivation
      1. sqrt-lowering-sqrt.f6453.7%

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

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

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

Alternative 8: 36.3% 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 6.2 \cdot 10^{-63}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)} \cdot {\left(2 \cdot A\right)}^{0.5}}{t\_1}\\ \mathbf{elif}\;B\_m \leq 8.2 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{\left(\left(2 \cdot F\right) \cdot \left(B\_m \cdot B\_m - t\_0\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\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)) (t_1 (- t_0 (* B_m B_m))))
   (if (<= B_m 6.2e-63)
     (/
      (*
       (sqrt (* (+ (* B_m B_m) (* -4.0 (* A C))) (* 2.0 F)))
       (pow (* 2.0 A) 0.5))
      t_1)
     (if (<= B_m 8.2e+122)
       (/
        (sqrt
         (* (* (* 2.0 F) (- (* B_m B_m) t_0)) (+ (+ A C) (hypot B_m (- A C)))))
        t_1)
       (* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.0)))))))
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 <= 6.2e-63) {
		tmp = (sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * pow((2.0 * A), 0.5)) / t_1;
	} else if (B_m <= 8.2e+122) {
		tmp = sqrt((((2.0 * F) * ((B_m * B_m) - t_0)) * ((A + C) + hypot(B_m, (A - C))))) / t_1;
	} else {
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	}
	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 <= 6.2e-63) {
		tmp = (Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * Math.pow((2.0 * A), 0.5)) / t_1;
	} else if (B_m <= 8.2e+122) {
		tmp = Math.sqrt((((2.0 * F) * ((B_m * B_m) - t_0)) * ((A + C) + Math.hypot(B_m, (A - C))))) / t_1;
	} else {
		tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.0));
	}
	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 <= 6.2e-63:
		tmp = (math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * math.pow((2.0 * A), 0.5)) / t_1
	elif B_m <= 8.2e+122:
		tmp = math.sqrt((((2.0 * F) * ((B_m * B_m) - t_0)) * ((A + C) + math.hypot(B_m, (A - C))))) / t_1
	else:
		tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.0))
	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 <= 6.2e-63)
		tmp = Float64(Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(2.0 * F))) * (Float64(2.0 * A) ^ 0.5)) / t_1);
	elseif (B_m <= 8.2e+122)
		tmp = Float64(sqrt(Float64(Float64(Float64(2.0 * F) * Float64(Float64(B_m * B_m) - t_0)) * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / t_1);
	else
		tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0)));
	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 <= 6.2e-63)
		tmp = (sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * ((2.0 * A) ^ 0.5)) / t_1;
	elseif (B_m <= 8.2e+122)
		tmp = sqrt((((2.0 * F) * ((B_m * B_m) - t_0)) * ((A + C) + hypot(B_m, (A - C))))) / t_1;
	else
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.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[(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, 6.2e-63], N[(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 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[(2.0 * A), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 8.2e+122], N[(N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * N[(N[(B$95$m * B$95$m), $MachinePrecision] - t$95$0), $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[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\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 6.2 \cdot 10^{-63}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)} \cdot {\left(2 \cdot A\right)}^{0.5}}{t\_1}\\

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

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


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

    1. Initial program 26.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. Simplified32.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-rr43.2%

      \[\leadsto \frac{\color{blue}{{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}^{0.5} \cdot \sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \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{pow.f64}\left(\color{blue}{\left(2 \cdot A\right)}, \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \mathsf{*.f64}\left(2, 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-*.f6422.7%

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

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

    if 6.19999999999999968e-63 < B < 8.2000000000000004e122

    1. Initial program 56.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. Simplified59.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

    if 8.2000000000000004e122 < B

    1. Initial program 0.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.f6444.8%

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

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

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

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

\\
\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 5.8 \cdot 10^{-62}:\\
\;\;\;\;\frac{\sqrt{t\_1 \cdot \left(2 \cdot F\right)} \cdot {\left(2 \cdot A\right)}^{0.5}}{t\_0}\\

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

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


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

    1. Initial program 26.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. Simplified32.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-rr43.2%

      \[\leadsto \frac{\color{blue}{{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}^{0.5} \cdot \sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \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{pow.f64}\left(\color{blue}{\left(2 \cdot A\right)}, \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \mathsf{*.f64}\left(2, 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-*.f6422.7%

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

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

    if 5.79999999999999971e-62 < B < 1.1799999999999999e87

    1. Initial program 60.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. Simplified61.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. 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-rr57.6%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(\left(A + \left(C + \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 1.1799999999999999e87 < B

    1. Initial program 2.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.f6443.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. Simplified43.7%

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

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

Alternative 10: 34.0% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;B\_m \leq 1.2 \cdot 10^{-80}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(A \cdot \left(\left(A \cdot F\right) \cdot \left(0 - 16\right) - \frac{t\_0 \cdot -8}{C}\right)\right)}}{t\_1}\\

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

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


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

    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. Simplified31.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. Applied egg-rr17.9%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified5.8%

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

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

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

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

    if 3.40000000000000027e-188 < B < 1.2e-80

    1. Initial program 21.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right) \]
    3. Simplified35.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 C around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e-80 < B < 1.49999999999999993e122

    1. Initial program 53.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. Simplified56.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. Taylor expanded in B around inf

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

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

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

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

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

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

    if 1.49999999999999993e122 < B

    1. Initial program 0.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.f6444.8%

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

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

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

Alternative 11: 39.4% accurate, 2.7× speedup?

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

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

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


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

    1. Initial program 31.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. Simplified36.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. *-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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

    if 9.2000000000000002e122 < B

    1. Initial program 0.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.f6444.8%

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

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

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

Alternative 12: 34.2% accurate, 2.7× 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 3.9 \cdot 10^{-61}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)} \cdot {\left(2 \cdot A\right)}^{0.5}}{t\_0}\\ \mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= B_m 3.9e-61)
     (/
      (*
       (sqrt (* (+ (* B_m B_m) (* -4.0 (* A C))) (* 2.0 F)))
       (pow (* 2.0 A) 0.5))
      t_0)
     (if (<= B_m 1.5e+122)
       (/
        (sqrt (* (+ (+ A C) (hypot B_m (- A C))) (* 2.0 (* F (* B_m B_m)))))
        t_0)
       (* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.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 <= 3.9e-61) {
		tmp = (sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * pow((2.0 * A), 0.5)) / t_0;
	} else if (B_m <= 1.5e+122) {
		tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * (2.0 * (F * (B_m * B_m))))) / t_0;
	} else {
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	}
	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 tmp;
	if (B_m <= 3.9e-61) {
		tmp = (Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * Math.pow((2.0 * A), 0.5)) / t_0;
	} else if (B_m <= 1.5e+122) {
		tmp = Math.sqrt((((A + C) + Math.hypot(B_m, (A - C))) * (2.0 * (F * (B_m * B_m))))) / t_0;
	} else {
		tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.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 <= 3.9e-61:
		tmp = (math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * math.pow((2.0 * A), 0.5)) / t_0
	elif B_m <= 1.5e+122:
		tmp = math.sqrt((((A + C) + math.hypot(B_m, (A - C))) * (2.0 * (F * (B_m * B_m))))) / t_0
	else:
		tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.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 <= 3.9e-61)
		tmp = Float64(Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(2.0 * F))) * (Float64(2.0 * A) ^ 0.5)) / t_0);
	elseif (B_m <= 1.5e+122)
		tmp = Float64(sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(2.0 * Float64(F * Float64(B_m * B_m))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.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 <= 3.9e-61)
		tmp = (sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * ((2.0 * A) ^ 0.5)) / t_0;
	elseif (B_m <= 1.5e+122)
		tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * (2.0 * (F * (B_m * B_m))))) / t_0;
	else
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.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, 3.9e-61], N[(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 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[(2.0 * A), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.5e+122], N[(N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

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

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

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


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

    1. Initial program 26.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. Simplified32.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-rr43.2%

      \[\leadsto \frac{\color{blue}{{\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}^{0.5} \cdot \sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \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{pow.f64}\left(\color{blue}{\left(2 \cdot A\right)}, \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(A, C\right)\right)\right), \mathsf{*.f64}\left(2, 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-*.f6422.7%

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

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

    if 3.90000000000000033e-61 < B < 1.49999999999999993e122

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

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

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

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

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

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

    if 1.49999999999999993e122 < B

    1. Initial program 0.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.f6444.8%

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

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

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

Alternative 13: 34.2% accurate, 2.7× 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 6.8 \cdot 10^{-62}:\\ \;\;\;\;\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{{\left(2 \cdot A\right)}^{0.5}}{t\_0}\\ \mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(2 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= B_m 6.8e-62)
     (*
      (sqrt (* (+ (* B_m B_m) (* -4.0 (* A C))) (* 2.0 F)))
      (/ (pow (* 2.0 A) 0.5) t_0))
     (if (<= B_m 1.5e+122)
       (/
        (sqrt (* (+ (+ A C) (hypot B_m (- A C))) (* 2.0 (* F (* B_m B_m)))))
        t_0)
       (* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.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 <= 6.8e-62) {
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * (pow((2.0 * A), 0.5) / t_0);
	} else if (B_m <= 1.5e+122) {
		tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * (2.0 * (F * (B_m * B_m))))) / t_0;
	} else {
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	}
	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 tmp;
	if (B_m <= 6.8e-62) {
		tmp = Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * (Math.pow((2.0 * A), 0.5) / t_0);
	} else if (B_m <= 1.5e+122) {
		tmp = Math.sqrt((((A + C) + Math.hypot(B_m, (A - C))) * (2.0 * (F * (B_m * B_m))))) / t_0;
	} else {
		tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.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 <= 6.8e-62:
		tmp = math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * (math.pow((2.0 * A), 0.5) / t_0)
	elif B_m <= 1.5e+122:
		tmp = math.sqrt((((A + C) + math.hypot(B_m, (A - C))) * (2.0 * (F * (B_m * B_m))))) / t_0
	else:
		tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.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 <= 6.8e-62)
		tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(2.0 * F))) * Float64((Float64(2.0 * A) ^ 0.5) / t_0));
	elseif (B_m <= 1.5e+122)
		tmp = Float64(sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(2.0 * Float64(F * Float64(B_m * B_m))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.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 <= 6.8e-62)
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (2.0 * F))) * (((2.0 * A) ^ 0.5) / t_0);
	elseif (B_m <= 1.5e+122)
		tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * (2.0 * (F * (B_m * B_m))))) / t_0;
	else
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.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, 6.8e-62], 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 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[(2.0 * A), $MachinePrecision], 0.5], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.5e+122], N[(N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

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

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

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


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

    1. Initial program 26.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. Simplified32.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 \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-rr43.2%

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

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

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

    if 6.79999999999999975e-62 < B < 1.49999999999999993e122

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

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

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

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

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

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

    if 1.49999999999999993e122 < B

    1. Initial program 0.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.f6444.8%

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

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

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

Alternative 14: 34.9% accurate, 2.7× 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 5 \cdot 10^{-186}:\\ \;\;\;\;\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot \left(4 \cdot F\right)\right)} \cdot \frac{1}{A \cdot \left(4 \cdot C\right) - B\_m \cdot B\_m}\\ \mathbf{elif}\;B\_m \leq 1.02 \cdot 10^{-82}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(A \cdot \left(\left(A \cdot F\right) \cdot \left(0 - 16\right) - \frac{\left(F \cdot \left(B\_m \cdot B\_m\right)\right) \cdot -8}{C}\right)\right)}}{t\_0}\\ \mathbf{elif}\;B\_m \leq 4.7 \cdot 10^{+138}:\\ \;\;\;\;\frac{B\_m \cdot \sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B\_m}} \cdot \left(0 - \sqrt{2}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (* (* 4.0 A) C) (* B_m B_m))))
   (if (<= B_m 5e-186)
     (*
      (sqrt (* (+ (* B_m B_m) (* -4.0 (* A C))) (* C (* 4.0 F))))
      (/ 1.0 (- (* A (* 4.0 C)) (* B_m B_m))))
     (if (<= B_m 1.02e-82)
       (/
        (sqrt
         (*
          C
          (* A (- (* (* A F) (- 0.0 16.0)) (/ (* (* F (* B_m B_m)) -8.0) C)))))
        t_0)
       (if (<= B_m 4.7e+138)
         (/ (* B_m (sqrt (* 2.0 (* F (+ C (hypot B_m C)))))) t_0)
         (* (sqrt (/ F B_m)) (- 0.0 (sqrt 2.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 <= 5e-186) {
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * B_m)));
	} else if (B_m <= 1.02e-82) {
		tmp = sqrt((C * (A * (((A * F) * (0.0 - 16.0)) - (((F * (B_m * B_m)) * -8.0) / C))))) / t_0;
	} else if (B_m <= 4.7e+138) {
		tmp = (B_m * sqrt((2.0 * (F * (C + hypot(B_m, C)))))) / t_0;
	} else {
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	}
	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 tmp;
	if (B_m <= 5e-186) {
		tmp = Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * B_m)));
	} else if (B_m <= 1.02e-82) {
		tmp = Math.sqrt((C * (A * (((A * F) * (0.0 - 16.0)) - (((F * (B_m * B_m)) * -8.0) / C))))) / t_0;
	} else if (B_m <= 4.7e+138) {
		tmp = (B_m * Math.sqrt((2.0 * (F * (C + Math.hypot(B_m, C)))))) / t_0;
	} else {
		tmp = Math.sqrt((F / B_m)) * (0.0 - Math.sqrt(2.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 <= 5e-186:
		tmp = math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * B_m)))
	elif B_m <= 1.02e-82:
		tmp = math.sqrt((C * (A * (((A * F) * (0.0 - 16.0)) - (((F * (B_m * B_m)) * -8.0) / C))))) / t_0
	elif B_m <= 4.7e+138:
		tmp = (B_m * math.sqrt((2.0 * (F * (C + math.hypot(B_m, C)))))) / t_0
	else:
		tmp = math.sqrt((F / B_m)) * (0.0 - math.sqrt(2.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 <= 5e-186)
		tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(C * Float64(4.0 * F)))) * Float64(1.0 / Float64(Float64(A * Float64(4.0 * C)) - Float64(B_m * B_m))));
	elseif (B_m <= 1.02e-82)
		tmp = Float64(sqrt(Float64(C * Float64(A * Float64(Float64(Float64(A * F) * Float64(0.0 - 16.0)) - Float64(Float64(Float64(F * Float64(B_m * B_m)) * -8.0) / C))))) / t_0);
	elseif (B_m <= 4.7e+138)
		tmp = Float64(Float64(B_m * sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(B_m, C)))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F / B_m)) * Float64(0.0 - sqrt(2.0)));
	end
	return tmp
end
B_m = abs(B);
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 <= 5e-186)
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * B_m)));
	elseif (B_m <= 1.02e-82)
		tmp = sqrt((C * (A * (((A * F) * (0.0 - 16.0)) - (((F * (B_m * B_m)) * -8.0) / C))))) / t_0;
	elseif (B_m <= 4.7e+138)
		tmp = (B_m * sqrt((2.0 * (F * (C + hypot(B_m, C)))))) / t_0;
	else
		tmp = sqrt((F / B_m)) * (0.0 - sqrt(2.0));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
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, 5e-186], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C * N[(4.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / 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.02e-82], N[(N[Sqrt[N[(C * N[(A * N[(N[(N[(A * F), $MachinePrecision] * N[(0.0 - 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 4.7e+138], N[(N[(B$95$m * N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

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

\mathbf{elif}\;B\_m \leq 1.02 \cdot 10^{-82}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(A \cdot \left(\left(A \cdot F\right) \cdot \left(0 - 16\right) - \frac{\left(F \cdot \left(B\_m \cdot B\_m\right)\right) \cdot -8}{C}\right)\right)}}{t\_0}\\

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

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


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

    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. Simplified31.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. Applied egg-rr17.9%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified5.8%

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

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

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

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

    if 5e-186 < B < 1.02000000000000007e-82

    1. Initial program 21.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right) \]
    3. Simplified35.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 C around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.02000000000000007e-82 < B < 4.6999999999999998e138

    1. Initial program 52.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. Simplified55.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.6999999999999998e138 < B

    1. Initial program 0.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.f6443.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. Simplified43.7%

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

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

Alternative 15: 34.8% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;B\_m \leq 8.5 \cdot 10^{-83}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(A \cdot \left(\left(A \cdot F\right) \cdot \left(0 - 16\right) - \frac{\left(F \cdot \left(B\_m \cdot B\_m\right)\right) \cdot -8}{C}\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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

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


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

    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. Simplified31.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. Applied egg-rr17.9%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified5.8%

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

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

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

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

    if 2.3500000000000001e-185 < B < 8.49999999999999938e-83

    1. Initial program 21.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right) \]
    3. Simplified35.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 C around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.49999999999999938e-83 < B < 6.80000000000000002e123

    1. Initial program 53.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. Simplified56.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. Taylor expanded in A around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.80000000000000002e123 < B

    1. Initial program 0.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.f6444.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.35 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot \left(4 \cdot F\right)\right)} \cdot \frac{1}{A \cdot \left(4 \cdot C\right) - B \cdot B}\\ \mathbf{elif}\;B \leq 8.5 \cdot 10^{-83}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(A \cdot \left(\left(A \cdot F\right) \cdot \left(0 - 16\right) - \frac{\left(F \cdot \left(B \cdot B\right)\right) \cdot -8}{C}\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{elif}\;B \leq 6.8 \cdot 10^{+123}:\\ \;\;\;\;B \cdot \frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{A \cdot \left(4 \cdot C\right) - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(0 - \sqrt{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 33.2% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;B\_m \leq 1.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(A \cdot \left(\left(A \cdot F\right) \cdot \left(0 - 16\right) - \frac{\left(F \cdot \left(B\_m \cdot B\_m\right)\right) \cdot -8}{C}\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

    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. Simplified31.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. Applied egg-rr17.9%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified5.8%

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

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

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

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

    if 3.1999999999999997e-185 < B < 1.6000000000000001e-82

    1. Initial program 21.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right) \]
    3. Simplified35.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 C around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6000000000000001e-82 < B

    1. Initial program 23.0%

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

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

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

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

Alternative 17: 21.0% accurate, 4.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -2.10000000000000015e69

    1. Initial program 0.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. Simplified1.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 C around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, 4\right)\right), \mathsf{*.f64}\left(B, B\right)\right), \mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(C\right)\right) \cdot \left(-8 \cdot \frac{A \cdot \left(\left(B \cdot B\right) \cdot F\right)}{C} + 16 \cdot \left(\left(A \cdot A\right) \cdot F\right)\right)\right)\right)\right)\right) \]
      11. distribute-lft-neg-outN/A

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

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

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

    if -2.10000000000000015e69 < C < 6.6e-146

    1. Initial program 33.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right) \]
    3. Simplified36.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-*.f6410.0%

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

      \[\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} \]
    8. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

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

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

    if 6.6e-146 < C

    1. Initial program 30.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. Simplified37.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. Applied egg-rr18.7%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified13.3%

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

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

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

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

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

Alternative 18: 21.0% accurate, 4.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\\ \mathbf{if}\;C \leq -2.1 \cdot 10^{+69}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(A \cdot \left(\left(A \cdot F\right) \cdot \left(0 - 16\right) - \frac{\left(F \cdot \left(B\_m \cdot B\_m\right)\right) \cdot -8}{C}\right)\right)}}{t\_0}\\ \mathbf{elif}\;C \leq 2.3 \cdot 10^{-145}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot \left(B\_m \cdot F\right)\right) \cdot \left(2 \cdot B\_m\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot \left(4 \cdot F\right)\right)} \cdot \frac{1}{A \cdot \left(4 \cdot C\right) - B\_m \cdot 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))))
   (if (<= C -2.1e+69)
     (/
      (sqrt
       (*
        C
        (* A (- (* (* A F) (- 0.0 16.0)) (/ (* (* F (* B_m B_m)) -8.0) C)))))
      t_0)
     (if (<= C 2.3e-145)
       (/ (sqrt (* (* B_m (* B_m F)) (* 2.0 B_m))) t_0)
       (*
        (sqrt (* (+ (* B_m B_m) (* -4.0 (* A C))) (* C (* 4.0 F))))
        (/ 1.0 (- (* A (* 4.0 C)) (* B_m 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 tmp;
	if (C <= -2.1e+69) {
		tmp = sqrt((C * (A * (((A * F) * (0.0 - 16.0)) - (((F * (B_m * B_m)) * -8.0) / C))))) / t_0;
	} else if (C <= 2.3e-145) {
		tmp = sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	} else {
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * 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) :: t_0
    real(8) :: tmp
    t_0 = ((4.0d0 * a) * c) - (b_m * b_m)
    if (c <= (-2.1d+69)) then
        tmp = sqrt((c * (a * (((a * f) * (0.0d0 - 16.0d0)) - (((f * (b_m * b_m)) * (-8.0d0)) / c))))) / t_0
    else if (c <= 2.3d-145) then
        tmp = sqrt(((b_m * (b_m * f)) * (2.0d0 * b_m))) / t_0
    else
        tmp = sqrt((((b_m * b_m) + ((-4.0d0) * (a * c))) * (c * (4.0d0 * f)))) * (1.0d0 / ((a * (4.0d0 * 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 t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (C <= -2.1e+69) {
		tmp = Math.sqrt((C * (A * (((A * F) * (0.0 - 16.0)) - (((F * (B_m * B_m)) * -8.0) / C))))) / t_0;
	} else if (C <= 2.3e-145) {
		tmp = Math.sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	} else {
		tmp = Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * 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)
	tmp = 0
	if C <= -2.1e+69:
		tmp = math.sqrt((C * (A * (((A * F) * (0.0 - 16.0)) - (((F * (B_m * B_m)) * -8.0) / C))))) / t_0
	elif C <= 2.3e-145:
		tmp = math.sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0
	else:
		tmp = math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * 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))
	tmp = 0.0
	if (C <= -2.1e+69)
		tmp = Float64(sqrt(Float64(C * Float64(A * Float64(Float64(Float64(A * F) * Float64(0.0 - 16.0)) - Float64(Float64(Float64(F * Float64(B_m * B_m)) * -8.0) / C))))) / t_0);
	elseif (C <= 2.3e-145)
		tmp = Float64(sqrt(Float64(Float64(B_m * Float64(B_m * F)) * Float64(2.0 * B_m))) / t_0);
	else
		tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(C * Float64(4.0 * F)))) * Float64(1.0 / Float64(Float64(A * Float64(4.0 * C)) - Float64(B_m * 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);
	tmp = 0.0;
	if (C <= -2.1e+69)
		tmp = sqrt((C * (A * (((A * F) * (0.0 - 16.0)) - (((F * (B_m * B_m)) * -8.0) / C))))) / t_0;
	elseif (C <= 2.3e-145)
		tmp = sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	else
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * 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]}, If[LessEqual[C, -2.1e+69], N[(N[Sqrt[N[(C * N[(A * N[(N[(N[(A * F), $MachinePrecision] * N[(0.0 - 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision] * -8.0), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[C, 2.3e-145], N[(N[Sqrt[N[(N[(B$95$m * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C * N[(4.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(N[(A * N[(4.0 * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * 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\\
\mathbf{if}\;C \leq -2.1 \cdot 10^{+69}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(A \cdot \left(\left(A \cdot F\right) \cdot \left(0 - 16\right) - \frac{\left(F \cdot \left(B\_m \cdot B\_m\right)\right) \cdot -8}{C}\right)\right)}}{t\_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -2.10000000000000015e69

    1. Initial program 0.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. Simplified1.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 C around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000015e69 < C < 2.30000000000000007e-145

    1. Initial program 33.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right) \]
    3. Simplified36.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-*.f6410.0%

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

      \[\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} \]
    8. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

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

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

    if 2.30000000000000007e-145 < C

    1. Initial program 30.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. Simplified37.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. Applied egg-rr18.7%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified13.3%

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

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

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

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

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

Alternative 19: 20.7% accurate, 4.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\\ \mathbf{if}\;C \leq -7.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{\sqrt{\left(0 - C\right) \cdot \left(16 \cdot \left(F \cdot \left(A \cdot A\right)\right)\right)}}{t\_0}\\ \mathbf{elif}\;C \leq 6.2 \cdot 10^{-146}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot \left(B\_m \cdot F\right)\right) \cdot \left(2 \cdot B\_m\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot \left(4 \cdot F\right)\right)} \cdot \frac{1}{A \cdot \left(4 \cdot C\right) - B\_m \cdot 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))))
   (if (<= C -7.5e+69)
     (/ (sqrt (* (- 0.0 C) (* 16.0 (* F (* A A))))) t_0)
     (if (<= C 6.2e-146)
       (/ (sqrt (* (* B_m (* B_m F)) (* 2.0 B_m))) t_0)
       (*
        (sqrt (* (+ (* B_m B_m) (* -4.0 (* A C))) (* C (* 4.0 F))))
        (/ 1.0 (- (* A (* 4.0 C)) (* B_m 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 tmp;
	if (C <= -7.5e+69) {
		tmp = sqrt(((0.0 - C) * (16.0 * (F * (A * A))))) / t_0;
	} else if (C <= 6.2e-146) {
		tmp = sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	} else {
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * 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) :: t_0
    real(8) :: tmp
    t_0 = ((4.0d0 * a) * c) - (b_m * b_m)
    if (c <= (-7.5d+69)) then
        tmp = sqrt(((0.0d0 - c) * (16.0d0 * (f * (a * a))))) / t_0
    else if (c <= 6.2d-146) then
        tmp = sqrt(((b_m * (b_m * f)) * (2.0d0 * b_m))) / t_0
    else
        tmp = sqrt((((b_m * b_m) + ((-4.0d0) * (a * c))) * (c * (4.0d0 * f)))) * (1.0d0 / ((a * (4.0d0 * 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 t_0 = ((4.0 * A) * C) - (B_m * B_m);
	double tmp;
	if (C <= -7.5e+69) {
		tmp = Math.sqrt(((0.0 - C) * (16.0 * (F * (A * A))))) / t_0;
	} else if (C <= 6.2e-146) {
		tmp = Math.sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	} else {
		tmp = Math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * 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)
	tmp = 0
	if C <= -7.5e+69:
		tmp = math.sqrt(((0.0 - C) * (16.0 * (F * (A * A))))) / t_0
	elif C <= 6.2e-146:
		tmp = math.sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0
	else:
		tmp = math.sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * 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))
	tmp = 0.0
	if (C <= -7.5e+69)
		tmp = Float64(sqrt(Float64(Float64(0.0 - C) * Float64(16.0 * Float64(F * Float64(A * A))))) / t_0);
	elseif (C <= 6.2e-146)
		tmp = Float64(sqrt(Float64(Float64(B_m * Float64(B_m * F)) * Float64(2.0 * B_m))) / t_0);
	else
		tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))) * Float64(C * Float64(4.0 * F)))) * Float64(1.0 / Float64(Float64(A * Float64(4.0 * C)) - Float64(B_m * 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);
	tmp = 0.0;
	if (C <= -7.5e+69)
		tmp = sqrt(((0.0 - C) * (16.0 * (F * (A * A))))) / t_0;
	elseif (C <= 6.2e-146)
		tmp = sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	else
		tmp = sqrt((((B_m * B_m) + (-4.0 * (A * C))) * (C * (4.0 * F)))) * (1.0 / ((A * (4.0 * C)) - (B_m * 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]}, If[LessEqual[C, -7.5e+69], N[(N[Sqrt[N[(N[(0.0 - C), $MachinePrecision] * N[(16.0 * N[(F * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[C, 6.2e-146], N[(N[Sqrt[N[(N[(B$95$m * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C * N[(4.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(N[(A * N[(4.0 * C), $MachinePrecision]), $MachinePrecision] - N[(B$95$m * 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\\
\mathbf{if}\;C \leq -7.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{\sqrt{\left(0 - C\right) \cdot \left(16 \cdot \left(F \cdot \left(A \cdot A\right)\right)\right)}}{t\_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -7.49999999999999939e69

    1. Initial program 0.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. Simplified1.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 C around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999939e69 < C < 6.1999999999999997e-146

    1. Initial program 33.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right)}\right) \]
    3. Simplified36.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-*.f6410.0%

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

      \[\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} \]
    8. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

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

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

    if 6.1999999999999997e-146 < C

    1. Initial program 30.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. Simplified37.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. Applied egg-rr18.7%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified13.3%

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

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

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

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

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

Alternative 20: 17.2% accurate, 4.8× 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}\;A \leq -4.9 \cdot 10^{-14}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{t\_0}\\ \mathbf{elif}\;A \leq 1.8 \cdot 10^{-49}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot \left(B\_m \cdot F\right)\right) \cdot \left(2 \cdot B\_m\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(0 - C\right) \cdot \left(16 \cdot \left(F \cdot \left(A \cdot A\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 (<= A -4.9e-14)
     (/ (sqrt (* (* A -16.0) (* F (* C C)))) t_0)
     (if (<= A 1.8e-49)
       (/ (sqrt (* (* B_m (* B_m F)) (* 2.0 B_m))) t_0)
       (/ (sqrt (* (- 0.0 C) (* 16.0 (* F (* A A))))) 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 (A <= -4.9e-14) {
		tmp = sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	} else if (A <= 1.8e-49) {
		tmp = sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	} else {
		tmp = sqrt(((0.0 - C) * (16.0 * (F * (A * A))))) / 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 (a <= (-4.9d-14)) then
        tmp = sqrt(((a * (-16.0d0)) * (f * (c * c)))) / t_0
    else if (a <= 1.8d-49) then
        tmp = sqrt(((b_m * (b_m * f)) * (2.0d0 * b_m))) / t_0
    else
        tmp = sqrt(((0.0d0 - c) * (16.0d0 * (f * (a * a))))) / 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 (A <= -4.9e-14) {
		tmp = Math.sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	} else if (A <= 1.8e-49) {
		tmp = Math.sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	} else {
		tmp = Math.sqrt(((0.0 - C) * (16.0 * (F * (A * A))))) / 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 A <= -4.9e-14:
		tmp = math.sqrt(((A * -16.0) * (F * (C * C)))) / t_0
	elif A <= 1.8e-49:
		tmp = math.sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0
	else:
		tmp = math.sqrt(((0.0 - C) * (16.0 * (F * (A * A))))) / 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 (A <= -4.9e-14)
		tmp = Float64(sqrt(Float64(Float64(A * -16.0) * Float64(F * Float64(C * C)))) / t_0);
	elseif (A <= 1.8e-49)
		tmp = Float64(sqrt(Float64(Float64(B_m * Float64(B_m * F)) * Float64(2.0 * B_m))) / t_0);
	else
		tmp = Float64(sqrt(Float64(Float64(0.0 - C) * Float64(16.0 * Float64(F * Float64(A * A))))) / 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 (A <= -4.9e-14)
		tmp = sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	elseif (A <= 1.8e-49)
		tmp = sqrt(((B_m * (B_m * F)) * (2.0 * B_m))) / t_0;
	else
		tmp = sqrt(((0.0 - C) * (16.0 * (F * (A * A))))) / 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[A, -4.9e-14], N[(N[Sqrt[N[(N[(A * -16.0), $MachinePrecision] * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[A, 1.8e-49], N[(N[Sqrt[N[(N[(B$95$m * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(N[(0.0 - C), $MachinePrecision] * N[(16.0 * N[(F * N[(A * A), $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}\;A \leq -4.9 \cdot 10^{-14}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{t\_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -4.89999999999999995e-14

    1. Initial program 7.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. Simplified11.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. associate-*r*N/A

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

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

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

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

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

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

    if -4.89999999999999995e-14 < A < 1.79999999999999985e-49

    1. Initial program 39.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. Simplified40.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-*.f6410.6%

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, B\right), \mathsf{*.f64}\left(B, \left(B \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) \]
      7. *-lowering-*.f6411.8%

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

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

    if 1.79999999999999985e-49 < A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(C\right), \mathsf{*.f64}\left(16, \mathsf{*.f64}\left(F, \mathsf{*.f64}\left(A, A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    10. Simplified13.2%

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

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

Alternative 21: 15.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 5.3 \cdot 10^{-82}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot \left(B\_m \cdot F\right)\right) \cdot \left(2 \cdot B\_m\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 5.3e-82)
     (/ (sqrt (* (* A -16.0) (* F (* C C)))) t_0)
     (/ (sqrt (* (* B_m (* B_m F)) (* 2.0 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 <= 5.3e-82) {
		tmp = sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	} else {
		tmp = sqrt(((B_m * (B_m * F)) * (2.0 * 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 <= 5.3d-82) then
        tmp = sqrt(((a * (-16.0d0)) * (f * (c * c)))) / t_0
    else
        tmp = sqrt(((b_m * (b_m * f)) * (2.0d0 * 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 <= 5.3e-82) {
		tmp = Math.sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	} else {
		tmp = Math.sqrt(((B_m * (B_m * F)) * (2.0 * 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 <= 5.3e-82:
		tmp = math.sqrt(((A * -16.0) * (F * (C * C)))) / t_0
	else:
		tmp = math.sqrt(((B_m * (B_m * F)) * (2.0 * 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 <= 5.3e-82)
		tmp = Float64(sqrt(Float64(Float64(A * -16.0) * Float64(F * Float64(C * C)))) / t_0);
	else
		tmp = Float64(sqrt(Float64(Float64(B_m * Float64(B_m * F)) * Float64(2.0 * 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 <= 5.3e-82)
		tmp = sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	else
		tmp = sqrt(((B_m * (B_m * F)) * (2.0 * 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, 5.3e-82], N[(N[Sqrt[N[(N[(A * -16.0), $MachinePrecision] * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(N[(B$95$m * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * B$95$m), $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 5.3 \cdot 10^{-82}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{t\_0}\\

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


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

    1. Initial program 26.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. Simplified32.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. 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. associate-*r*N/A

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

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

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

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

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

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

    if 5.29999999999999956e-82 < B

    1. Initial program 23.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. 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. 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-*.f6415.4%

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

      \[\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} \]
    8. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

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

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

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

Alternative 22: 15.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 3.1 \cdot 10^{-82}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m\right) \cdot \left(B\_m \cdot F\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 3.1e-82)
     (/ (sqrt (* (* A -16.0) (* F (* C C)))) t_0)
     (/ (sqrt (* 2.0 (* (* B_m B_m) (* B_m 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 (B_m <= 3.1e-82) {
		tmp = sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	} else {
		tmp = sqrt((2.0 * ((B_m * B_m) * (B_m * 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 (b_m <= 3.1d-82) then
        tmp = sqrt(((a * (-16.0d0)) * (f * (c * c)))) / t_0
    else
        tmp = sqrt((2.0d0 * ((b_m * b_m) * (b_m * 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 (B_m <= 3.1e-82) {
		tmp = Math.sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	} else {
		tmp = Math.sqrt((2.0 * ((B_m * B_m) * (B_m * 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 B_m <= 3.1e-82:
		tmp = math.sqrt(((A * -16.0) * (F * (C * C)))) / t_0
	else:
		tmp = math.sqrt((2.0 * ((B_m * B_m) * (B_m * 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 (B_m <= 3.1e-82)
		tmp = Float64(sqrt(Float64(Float64(A * -16.0) * Float64(F * Float64(C * C)))) / t_0);
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(B_m * B_m) * Float64(B_m * 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 (B_m <= 3.1e-82)
		tmp = sqrt(((A * -16.0) * (F * (C * C)))) / t_0;
	else
		tmp = sqrt((2.0 * ((B_m * B_m) * (B_m * 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[B$95$m, 3.1e-82], N[(N[Sqrt[N[(N[(A * -16.0), $MachinePrecision] * N[(F * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(B$95$m * F), $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 3.1 \cdot 10^{-82}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{t\_0}\\

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


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

    1. Initial program 26.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. Simplified32.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. 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. associate-*r*N/A

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

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

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

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

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

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

    if 3.1e-82 < B

    1. Initial program 23.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. 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. 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-*.f6415.4%

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

      \[\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} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(F, B\right), \mathsf{*.f64}\left(B, 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. Applied egg-rr16.5%

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

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

Alternative 23: 12.8% accurate, 5.1× speedup?

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

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

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


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

    1. Initial program 24.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(F, B\right), \mathsf{*.f64}\left(B, 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. Applied egg-rr8.2%

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

    if 3900 < C

    1. Initial program 27.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. Simplified34.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. Applied egg-rr12.2%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified12.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right) \]
    11. Simplified8.1%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\left(F \cdot C\right), \frac{1}{2}\right)\right) \]
      4. *-lowering-*.f648.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(F, C\right), \frac{1}{2}\right)\right) \]
    13. Applied egg-rr8.3%

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

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

Alternative 24: 11.1% accurate, 5.1× speedup?

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

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

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


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

    1. Initial program 24.9%

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

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

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

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

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

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

    if 1.6e9 < C

    1. Initial program 27.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. Simplified34.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. Applied egg-rr12.2%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified12.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right) \]
    11. Simplified8.1%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\left(F \cdot C\right), \frac{1}{2}\right)\right) \]
      4. *-lowering-*.f648.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(F, C\right), \frac{1}{2}\right)\right) \]
    13. Applied egg-rr8.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq 1600000000:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(-2 \cdot \frac{1}{B}\right) \cdot {\left(C \cdot F\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 10.4% accurate, 5.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq 5000000000000:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{0 - B\_m \cdot B\_m}\\

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


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

    1. Initial program 24.9%

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

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

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

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

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

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

      \[\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), \color{blue}{\left(-1 \cdot {B}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

    if 5e12 < C

    1. Initial program 27.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. Simplified34.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. Applied egg-rr12.2%

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

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

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
    8. Simplified12.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right) \]
    11. Simplified8.1%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\left(F \cdot C\right), \frac{1}{2}\right)\right) \]
      4. *-lowering-*.f648.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(F, C\right), \frac{1}{2}\right)\right) \]
    13. Applied egg-rr8.3%

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

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

Alternative 26: 5.6% accurate, 5.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \left(-2 \cdot \frac{1}{B\_m}\right) \cdot {\left(\left(C \cdot F\right) \cdot \left(C \cdot F\right)\right)}^{0.25} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (* (* -2.0 (/ 1.0 B_m)) (pow (* (* C F) (* C F)) 0.25)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return (-2.0 * (1.0 / B_m)) * pow(((C * F) * (C * F)), 0.25);
}
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 = ((-2.0d0) * (1.0d0 / b_m)) * (((c * f) * (c * f)) ** 0.25d0)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return (-2.0 * (1.0 / B_m)) * Math.pow(((C * F) * (C * F)), 0.25);
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return (-2.0 * (1.0 / B_m)) * math.pow(((C * F) * (C * F)), 0.25)
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(Float64(-2.0 * Float64(1.0 / B_m)) * (Float64(Float64(C * F) * Float64(C * F)) ^ 0.25))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = (-2.0 * (1.0 / B_m)) * (((C * F) * (C * F)) ^ 0.25);
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[(-2.0 * N[(1.0 / B$95$m), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(C * F), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\left(-2 \cdot \frac{1}{B\_m}\right) \cdot {\left(\left(C \cdot F\right) \cdot \left(C \cdot F\right)\right)}^{0.25}
\end{array}
Derivation
  1. Initial program 25.4%

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

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

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

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

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

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

      \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
  8. Simplified5.2%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right) \]
  11. Simplified3.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, C\right), \left(F \cdot C\right)\right), \frac{1}{4}\right)\right) \]
    10. *-lowering-*.f644.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, C\right), \mathsf{*.f64}\left(F, C\right)\right), \frac{1}{4}\right)\right) \]
  13. Applied egg-rr4.8%

    \[\leadsto \left(-2 \cdot \frac{1}{B}\right) \cdot \color{blue}{{\left(\left(F \cdot C\right) \cdot \left(F \cdot C\right)\right)}^{0.25}} \]
  14. Final simplification4.8%

    \[\leadsto \left(-2 \cdot \frac{1}{B}\right) \cdot {\left(\left(C \cdot F\right) \cdot \left(C \cdot F\right)\right)}^{0.25} \]
  15. Add Preprocessing

Alternative 27: 5.2% accurate, 5.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \left(-2 \cdot \frac{1}{B\_m}\right) \cdot {\left(C \cdot F\right)}^{0.5} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (* (* -2.0 (/ 1.0 B_m)) (pow (* C F) 0.5)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return (-2.0 * (1.0 / B_m)) * pow((C * F), 0.5);
}
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 = ((-2.0d0) * (1.0d0 / b_m)) * ((c * f) ** 0.5d0)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return (-2.0 * (1.0 / B_m)) * Math.pow((C * F), 0.5);
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return (-2.0 * (1.0 / B_m)) * math.pow((C * F), 0.5)
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(Float64(-2.0 * Float64(1.0 / B_m)) * (Float64(C * F) ^ 0.5))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = (-2.0 * (1.0 / B_m)) * ((C * F) ^ 0.5);
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[(-2.0 * N[(1.0 / B$95$m), $MachinePrecision]), $MachinePrecision] * N[Power[N[(C * F), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\left(-2 \cdot \frac{1}{B\_m}\right) \cdot {\left(C \cdot F\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 25.4%

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

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

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

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

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

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

      \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
  8. Simplified5.2%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right) \]
  11. Simplified3.2%

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\left(F \cdot C\right), \frac{1}{2}\right)\right) \]
    4. *-lowering-*.f643.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(F, C\right), \frac{1}{2}\right)\right) \]
  13. Applied egg-rr3.4%

    \[\leadsto \left(-2 \cdot \frac{1}{B}\right) \cdot \color{blue}{{\left(F \cdot C\right)}^{0.5}} \]
  14. Final simplification3.4%

    \[\leadsto \left(-2 \cdot \frac{1}{B}\right) \cdot {\left(C \cdot F\right)}^{0.5} \]
  15. Add Preprocessing

Alternative 28: 5.0% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \frac{-2}{B\_m} \cdot \sqrt{C \cdot F} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (* (/ -2.0 B_m) (sqrt (* C F))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return (-2.0 / B_m) * sqrt((C * F));
}
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 = ((-2.0d0) / b_m) * sqrt((c * f))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return (-2.0 / B_m) * Math.sqrt((C * F));
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return (-2.0 / B_m) * math.sqrt((C * F))
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(Float64(-2.0 / B_m) * sqrt(Float64(C * F)))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = (-2.0 / B_m) * sqrt((C * F));
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[(-2.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\frac{-2}{B\_m} \cdot \sqrt{C \cdot F}
\end{array}
Derivation
  1. Initial program 25.4%

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

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

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

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

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

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

      \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(2, F\right), \mathsf{*.f64}\left(2, C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{*.f64}\left(C, C\right)\right), 16\right), \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, 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) \]
  8. Simplified5.2%

    \[\leadsto \frac{\sqrt{\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \color{blue}{\left(2 \cdot C\right)}\right)}}{\left(\left(A \cdot A\right) \cdot \left(C \cdot C\right)\right) \cdot 16 - B \cdot \left(B \cdot \left(B \cdot B\right)\right)} \cdot \left(\left(4 \cdot A\right) \cdot C + B \cdot B\right) \]
  9. Taylor expanded in B around inf

    \[\leadsto \color{blue}{-2 \cdot \left(\frac{1}{B} \cdot \sqrt{C \cdot F}\right)} \]
  10. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(-2 \cdot \frac{1}{B}\right) \cdot \color{blue}{\sqrt{C \cdot F}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(-2 \cdot \frac{1}{B}\right), \color{blue}{\left(\sqrt{C \cdot F}\right)}\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \left(\frac{1}{B}\right)\right), \left(\sqrt{\color{blue}{C \cdot F}}\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \left(\sqrt{C \cdot \color{blue}{F}}\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right)\right) \]
    6. *-lowering-*.f643.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{/.f64}\left(1, B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, F\right)\right)\right) \]
  11. Simplified3.2%

    \[\leadsto \color{blue}{\left(-2 \cdot \frac{1}{B}\right) \cdot \sqrt{C \cdot F}} \]
  12. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(-2 \cdot \frac{1}{B}\right), \color{blue}{\left(\sqrt{C \cdot F}\right)}\right) \]
    2. un-div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{-2}{B}\right), \left(\sqrt{\color{blue}{C \cdot F}}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-2, B\right), \left(\sqrt{\color{blue}{C \cdot F}}\right)\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-2, B\right), \mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-2, B\right), \mathsf{sqrt.f64}\left(\left(F \cdot C\right)\right)\right) \]
    6. *-lowering-*.f643.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-2, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right)\right) \]
  13. Applied egg-rr3.2%

    \[\leadsto \color{blue}{\frac{-2}{B} \cdot \sqrt{F \cdot C}} \]
  14. Final simplification3.2%

    \[\leadsto \frac{-2}{B} \cdot \sqrt{C \cdot F} \]
  15. Add Preprocessing

Reproduce

?
herbie shell --seed 2024158 
(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))))