ABCF->ab-angle a

Percentage Accurate: 19.2% → 63.3%
Time: 38.9s
Alternatives: 21
Speedup: 6.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 19.2% accurate, 1.0× speedup?

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

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

Alternative 1: 63.3% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-169}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot t\_0}}{t\_3}\\

\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+257}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_3}\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 95.9%

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

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

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

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

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

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

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

    1. Initial program 18.9%

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

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

    if 4.00000000000000012e257 < (/.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 4.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. Simplified30.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt30.8%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/41.8%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg41.8%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified41.8%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    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. Add Preprocessing
    3. Taylor expanded in A around 0 1.8%

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

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-commutative1.8%

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in1.8%

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

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

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

        \[\leadsto \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    5. Simplified19.0%

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/227.8%

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

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

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

Alternative 2: 44.4% accurate, 1.0× speedup?

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

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-186}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-72}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999998e-267 or 5e-186 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e-72

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}}\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \]
      6. rem-square-sqrt18.3%

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

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

    if 9.9999999999999998e-267 < (pow.f64 B #s(literal 2 binary64)) < 5e-186

    1. Initial program 19.7%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt24.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.1%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.1%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.1%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 1.9999999999999999e-72 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 17.0%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in13.6%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/236.8%

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

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

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

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

Alternative 3: 48.2% accurate, 1.0× speedup?

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

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-186}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999998e-267

    1. Initial program 17.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999998e-267 < (pow.f64 B #s(literal 2 binary64)) < 5e-186

    1. Initial program 19.7%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt24.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.1%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.1%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.1%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 5e-186 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e-72

    1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}}\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \]
      6. rem-square-sqrt21.3%

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

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

    if 1.9999999999999999e-72 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 17.0%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in13.6%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/236.8%

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

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

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

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

Alternative 4: 52.9% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := A \cdot \left(C \cdot -4\right)\\ t_1 := \left(4 \cdot A\right) \cdot C\\ t_2 := t\_1 - {B\_m}^{2}\\ t_3 := 2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\\ \mathbf{if}\;B\_m \leq 3.1 \cdot 10^{-262}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B\_m \leq 2.3 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{t\_3 \cdot \left(2 \cdot C\right)}}{t\_2}\\ \mathbf{elif}\;B\_m \leq 1.9 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B\_m \leq 4.8 \cdot 10^{-32}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(2 \cdot C\right)} \cdot \left(\sqrt{F} \cdot \mathsf{hypot}\left(B\_m, \sqrt{t\_0}\right)\right)}{-\mathsf{fma}\left(B\_m, B\_m, t\_0\right)}\\ \mathbf{elif}\;B\_m \leq 4 \cdot 10^{+49}:\\ \;\;\;\;\frac{\sqrt{t\_3 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* A (* C -4.0)))
        (t_1 (* (* 4.0 A) C))
        (t_2 (- t_1 (pow B_m 2.0)))
        (t_3 (* 2.0 (* (- (pow B_m 2.0) t_1) F))))
   (if (<= B_m 3.1e-262)
     (* (sqrt (* C (/ F (fma -4.0 (* A C) (pow B_m 2.0))))) (- 2.0))
     (if (<= B_m 2.3e-131)
       (/ (sqrt (* t_3 (* 2.0 C))) t_2)
       (if (<= B_m 1.9e-93)
         (sqrt (/ F (- A)))
         (if (<= B_m 4.8e-32)
           (/
            (* (sqrt (* 2.0 (* 2.0 C))) (* (sqrt F) (hypot B_m (sqrt t_0))))
            (- (fma B_m B_m t_0)))
           (if (<= B_m 4e+49)
             (/ (sqrt (* t_3 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))) t_2)
             (*
              (* (sqrt F) (sqrt (+ C (hypot B_m C))))
              (/ (sqrt 2.0) (- B_m))))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = A * (C * -4.0);
	double t_1 = (4.0 * A) * C;
	double t_2 = t_1 - pow(B_m, 2.0);
	double t_3 = 2.0 * ((pow(B_m, 2.0) - t_1) * F);
	double tmp;
	if (B_m <= 3.1e-262) {
		tmp = sqrt((C * (F / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -2.0;
	} else if (B_m <= 2.3e-131) {
		tmp = sqrt((t_3 * (2.0 * C))) / t_2;
	} else if (B_m <= 1.9e-93) {
		tmp = sqrt((F / -A));
	} else if (B_m <= 4.8e-32) {
		tmp = (sqrt((2.0 * (2.0 * C))) * (sqrt(F) * hypot(B_m, sqrt(t_0)))) / -fma(B_m, B_m, t_0);
	} else if (B_m <= 4e+49) {
		tmp = sqrt((t_3 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_2;
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(A * Float64(C * -4.0))
	t_1 = Float64(Float64(4.0 * A) * C)
	t_2 = Float64(t_1 - (B_m ^ 2.0))
	t_3 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_1) * F))
	tmp = 0.0
	if (B_m <= 3.1e-262)
		tmp = Float64(sqrt(Float64(C * Float64(F / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-2.0));
	elseif (B_m <= 2.3e-131)
		tmp = Float64(sqrt(Float64(t_3 * Float64(2.0 * C))) / t_2);
	elseif (B_m <= 1.9e-93)
		tmp = sqrt(Float64(F / Float64(-A)));
	elseif (B_m <= 4.8e-32)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(2.0 * C))) * Float64(sqrt(F) * hypot(B_m, sqrt(t_0)))) / Float64(-fma(B_m, B_m, t_0)));
	elseif (B_m <= 4e+49)
		tmp = Float64(sqrt(Float64(t_3 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)))) / t_2);
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3.1e-262], N[(N[Sqrt[N[(C * N[(F / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[B$95$m, 2.3e-131], N[(N[Sqrt[N[(t$95$3 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[B$95$m, 1.9e-93], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 4.8e-32], N[(N[(N[Sqrt[N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B$95$m ^ 2 + N[Sqrt[t$95$0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[(B$95$m * B$95$m + t$95$0), $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 4e+49], N[(N[Sqrt[N[(t$95$3 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := A \cdot \left(C \cdot -4\right)\\
t_1 := \left(4 \cdot A\right) \cdot C\\
t_2 := t\_1 - {B\_m}^{2}\\
t_3 := 2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\\
\mathbf{if}\;B\_m \leq 3.1 \cdot 10^{-262}:\\
\;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\

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

\mathbf{elif}\;B\_m \leq 1.9 \cdot 10^{-93}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

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

\mathbf{elif}\;B\_m \leq 4 \cdot 10^{+49}:\\
\;\;\;\;\frac{\sqrt{t\_3 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if B < 3.0999999999999998e-262

    1. Initial program 15.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.0999999999999998e-262 < B < 2.30000000000000022e-131

    1. Initial program 18.3%

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

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

    if 2.30000000000000022e-131 < B < 1.8999999999999999e-93

    1. Initial program 13.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. Simplified13.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 1.8999999999999999e-93 < B < 4.8000000000000003e-32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.8000000000000003e-32 < B < 3.99999999999999979e49

    1. Initial program 39.2%

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

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

    if 3.99999999999999979e49 < B

    1. Initial program 15.7%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in21.7%

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(C + \mathsf{hypot}\left(B, C\right)\right) \cdot F\right)}}^{0.5} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      3. unpow-prod-down74.1%

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/274.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.1 \cdot 10^{-262}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;B \leq 1.9 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B \leq 4.8 \cdot 10^{-32}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(2 \cdot C\right)} \cdot \left(\sqrt{F} \cdot \mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)\right)}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 4 \cdot 10^{+49}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B, C\right)}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 53.1% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := t\_0 - {B\_m}^{2}\\ t_2 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\ \mathbf{if}\;B\_m \leq 1.45 \cdot 10^{-264}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B\_m \leq 6.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{t\_2 \cdot \left(2 \cdot C\right)}}{t\_1}\\ \mathbf{elif}\;B\_m \leq 1.85 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B\_m \leq 5 \cdot 10^{-32}:\\ \;\;\;\;\frac{\mathsf{hypot}\left(B\_m, \sqrt{-4 \cdot \left(A \cdot C\right)}\right) \cdot \left(\sqrt{F} \cdot \left(-\sqrt{4 \cdot C}\right)\right)}{\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B\_m \leq 4 \cdot 10^{+48}:\\ \;\;\;\;\frac{\sqrt{t\_2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C))
        (t_1 (- t_0 (pow B_m 2.0)))
        (t_2 (* 2.0 (* (- (pow B_m 2.0) t_0) F))))
   (if (<= B_m 1.45e-264)
     (* (sqrt (* C (/ F (fma -4.0 (* A C) (pow B_m 2.0))))) (- 2.0))
     (if (<= B_m 6.8e-129)
       (/ (sqrt (* t_2 (* 2.0 C))) t_1)
       (if (<= B_m 1.85e-93)
         (sqrt (/ F (- A)))
         (if (<= B_m 5e-32)
           (/
            (*
             (hypot B_m (sqrt (* -4.0 (* A C))))
             (* (sqrt F) (- (sqrt (* 4.0 C)))))
            (fma B_m B_m (* A (* C -4.0))))
           (if (<= B_m 4e+48)
             (/ (sqrt (* t_2 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))) t_1)
             (*
              (* (sqrt F) (sqrt (+ C (hypot B_m C))))
              (/ (sqrt 2.0) (- B_m))))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = t_0 - pow(B_m, 2.0);
	double t_2 = 2.0 * ((pow(B_m, 2.0) - t_0) * F);
	double tmp;
	if (B_m <= 1.45e-264) {
		tmp = sqrt((C * (F / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -2.0;
	} else if (B_m <= 6.8e-129) {
		tmp = sqrt((t_2 * (2.0 * C))) / t_1;
	} else if (B_m <= 1.85e-93) {
		tmp = sqrt((F / -A));
	} else if (B_m <= 5e-32) {
		tmp = (hypot(B_m, sqrt((-4.0 * (A * C)))) * (sqrt(F) * -sqrt((4.0 * C)))) / fma(B_m, B_m, (A * (C * -4.0)));
	} else if (B_m <= 4e+48) {
		tmp = sqrt((t_2 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_1;
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64(t_0 - (B_m ^ 2.0))
	t_2 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F))
	tmp = 0.0
	if (B_m <= 1.45e-264)
		tmp = Float64(sqrt(Float64(C * Float64(F / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-2.0));
	elseif (B_m <= 6.8e-129)
		tmp = Float64(sqrt(Float64(t_2 * Float64(2.0 * C))) / t_1);
	elseif (B_m <= 1.85e-93)
		tmp = sqrt(Float64(F / Float64(-A)));
	elseif (B_m <= 5e-32)
		tmp = Float64(Float64(hypot(B_m, sqrt(Float64(-4.0 * Float64(A * C)))) * Float64(sqrt(F) * Float64(-sqrt(Float64(4.0 * C))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.0))));
	elseif (B_m <= 4e+48)
		tmp = Float64(sqrt(Float64(t_2 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)))) / t_1);
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.45e-264], N[(N[Sqrt[N[(C * N[(F / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[B$95$m, 6.8e-129], N[(N[Sqrt[N[(t$95$2 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[B$95$m, 1.85e-93], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 5e-32], N[(N[(N[Sqrt[B$95$m ^ 2 + N[Sqrt[N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(4.0 * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 4e+48], N[(N[Sqrt[N[(t$95$2 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
t_2 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\
\mathbf{if}\;B\_m \leq 1.45 \cdot 10^{-264}:\\
\;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\

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

\mathbf{elif}\;B\_m \leq 1.85 \cdot 10^{-93}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{elif}\;B\_m \leq 5 \cdot 10^{-32}:\\
\;\;\;\;\frac{\mathsf{hypot}\left(B\_m, \sqrt{-4 \cdot \left(A \cdot C\right)}\right) \cdot \left(\sqrt{F} \cdot \left(-\sqrt{4 \cdot C}\right)\right)}{\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\

\mathbf{elif}\;B\_m \leq 4 \cdot 10^{+48}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if B < 1.4499999999999999e-264

    1. Initial program 15.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4499999999999999e-264 < B < 6.80000000000000026e-129

    1. Initial program 18.3%

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

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

    if 6.80000000000000026e-129 < B < 1.85000000000000001e-93

    1. Initial program 13.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. Simplified13.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 1.85000000000000001e-93 < B < 5e-32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{hypot}\left(B, \sqrt{\left(A \cdot C\right) \cdot -4}\right) \cdot \left(\sqrt{\color{blue}{4} \cdot C} \cdot {F}^{0.5}\right)}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      7. pow1/242.3%

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

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

    if 5e-32 < B < 4.00000000000000018e48

    1. Initial program 39.2%

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

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

    if 4.00000000000000018e48 < B

    1. Initial program 15.7%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in21.7%

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(C + \mathsf{hypot}\left(B, C\right)\right) \cdot F\right)}}^{0.5} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      3. unpow-prod-down74.1%

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/274.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.45 \cdot 10^{-264}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 6.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;B \leq 1.85 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B \leq 5 \cdot 10^{-32}:\\ \;\;\;\;\frac{\mathsf{hypot}\left(B, \sqrt{-4 \cdot \left(A \cdot C\right)}\right) \cdot \left(\sqrt{F} \cdot \left(-\sqrt{4 \cdot C}\right)\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 4 \cdot 10^{+48}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B, C\right)}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 55.4% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := \mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)\\ t_2 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;B\_m \leq 1.1 \cdot 10^{-263}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{t\_1}} \cdot \left(-2\right)\\ \mathbf{elif}\;B\_m \leq 7.2 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_2\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_2 - {B\_m}^{2}}\\ \mathbf{elif}\;B\_m \leq 2 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B\_m \leq 2.3 \cdot 10^{-64}:\\ \;\;\;\;\sqrt{F \cdot \frac{A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)}{t\_1}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B\_m \leq 5.4 \cdot 10^{-18}:\\ \;\;\;\;\sqrt{F \cdot \left(2 \cdot t\_0\right)} \cdot \frac{\sqrt{2 \cdot C}}{-t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
        (t_1 (fma -4.0 (* A C) (pow B_m 2.0)))
        (t_2 (* (* 4.0 A) C)))
   (if (<= B_m 1.1e-263)
     (* (sqrt (* C (/ F t_1))) (- 2.0))
     (if (<= B_m 7.2e-129)
       (/
        (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_2) F)) (* 2.0 C)))
        (- t_2 (pow B_m 2.0)))
       (if (<= B_m 2e-93)
         (sqrt (/ F (- A)))
         (if (<= B_m 2.3e-64)
           (*
            (sqrt (* F (/ (+ A (+ C (hypot B_m (- A C)))) t_1)))
            (- (sqrt 2.0)))
           (if (<= B_m 5.4e-18)
             (* (sqrt (* F (* 2.0 t_0))) (/ (sqrt (* 2.0 C)) (- t_0)))
             (*
              (* (sqrt F) (sqrt (+ C (hypot B_m C))))
              (/ (sqrt 2.0) (- B_m))))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = fma(-4.0, (A * C), pow(B_m, 2.0));
	double t_2 = (4.0 * A) * C;
	double tmp;
	if (B_m <= 1.1e-263) {
		tmp = sqrt((C * (F / t_1))) * -2.0;
	} else if (B_m <= 7.2e-129) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_2) * F)) * (2.0 * C))) / (t_2 - pow(B_m, 2.0));
	} else if (B_m <= 2e-93) {
		tmp = sqrt((F / -A));
	} else if (B_m <= 2.3e-64) {
		tmp = sqrt((F * ((A + (C + hypot(B_m, (A - C)))) / t_1))) * -sqrt(2.0);
	} else if (B_m <= 5.4e-18) {
		tmp = sqrt((F * (2.0 * t_0))) * (sqrt((2.0 * C)) / -t_0);
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = fma(-4.0, Float64(A * C), (B_m ^ 2.0))
	t_2 = Float64(Float64(4.0 * A) * C)
	tmp = 0.0
	if (B_m <= 1.1e-263)
		tmp = Float64(sqrt(Float64(C * Float64(F / t_1))) * Float64(-2.0));
	elseif (B_m <= 7.2e-129)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_2) * F)) * Float64(2.0 * C))) / Float64(t_2 - (B_m ^ 2.0)));
	elseif (B_m <= 2e-93)
		tmp = sqrt(Float64(F / Float64(-A)));
	elseif (B_m <= 2.3e-64)
		tmp = Float64(sqrt(Float64(F * Float64(Float64(A + Float64(C + hypot(B_m, Float64(A - C)))) / t_1))) * Float64(-sqrt(2.0)));
	elseif (B_m <= 5.4e-18)
		tmp = Float64(sqrt(Float64(F * Float64(2.0 * t_0))) * Float64(sqrt(Float64(2.0 * C)) / Float64(-t_0)));
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 1.1e-263], N[(N[Sqrt[N[(C * N[(F / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[B$95$m, 7.2e-129], 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[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$2 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2e-93], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 2.3e-64], N[(N[Sqrt[N[(F * N[(N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 5.4e-18], N[(N[Sqrt[N[(F * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)\\
t_2 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 1.1 \cdot 10^{-263}:\\
\;\;\;\;\sqrt{C \cdot \frac{F}{t\_1}} \cdot \left(-2\right)\\

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

\mathbf{elif}\;B\_m \leq 2 \cdot 10^{-93}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if B < 1.1e-263

    1. Initial program 15.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1e-263 < B < 7.2e-129

    1. Initial program 18.3%

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

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

    if 7.2e-129 < B < 1.9999999999999998e-93

    1. Initial program 13.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. Simplified13.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 1.9999999999999998e-93 < B < 2.3000000000000001e-64

    1. Initial program 31.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 F around 0 16.7%

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

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

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

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

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

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

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

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

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

    if 2.3000000000000001e-64 < B < 5.39999999999999977e-18

    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. Simplified51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.39999999999999977e-18 < B

    1. Initial program 19.4%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in22.5%

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

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

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

        \[\leadsto \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    5. Simplified48.8%

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/266.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.1 \cdot 10^{-263}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 7.2 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;B \leq 2 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{-64}:\\ \;\;\;\;\sqrt{F \cdot \frac{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;B \leq 5.4 \cdot 10^{-18}:\\ \;\;\;\;\sqrt{F \cdot \left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot C}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B, C\right)}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 48.1% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 5e-186

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/22.0%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg22.0%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified22.0%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 5e-186 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e-72

    1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-72 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 17.0%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in13.6%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/236.8%

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

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

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

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

Alternative 8: 47.1% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 5e-186

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/22.0%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg22.0%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified22.0%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 5e-186 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e-72

    1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-72 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 17.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg23.6%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. *-commutative23.6%

        \[\leadsto -\color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      3. distribute-rgt-neg-in23.6%

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    6. Step-by-step derivation
      1. pow1/223.6%

        \[\leadsto \sqrt{2} \cdot \left(-\color{blue}{{\left(\frac{F}{B}\right)}^{0.5}}\right) \]
      2. div-inv23.6%

        \[\leadsto \sqrt{2} \cdot \left(-{\color{blue}{\left(F \cdot \frac{1}{B}\right)}}^{0.5}\right) \]
      3. unpow-prod-down30.9%

        \[\leadsto \sqrt{2} \cdot \left(-\color{blue}{{F}^{0.5} \cdot {\left(\frac{1}{B}\right)}^{0.5}}\right) \]
      4. pow1/230.9%

        \[\leadsto \sqrt{2} \cdot \left(-\color{blue}{\sqrt{F}} \cdot {\left(\frac{1}{B}\right)}^{0.5}\right) \]
    7. Applied egg-rr30.9%

      \[\leadsto \sqrt{2} \cdot \left(-\color{blue}{\sqrt{F} \cdot {\left(\frac{1}{B}\right)}^{0.5}}\right) \]
    8. Step-by-step derivation
      1. unpow1/230.9%

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

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

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

Alternative 9: 47.1% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 5e-186

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/22.0%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg22.0%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified22.0%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 5e-186 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e-72

    1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-72 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 17.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg23.6%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. *-commutative23.6%

        \[\leadsto -\color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      3. distribute-rgt-neg-in23.6%

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

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

        \[\leadsto \sqrt{2} \cdot \left(-\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}}\right) \]
    7. Applied egg-rr30.8%

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

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

Alternative 10: 55.1% accurate, 1.4× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\ t_2 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;B\_m \leq 1.6 \cdot 10^{-264}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;B\_m \leq 1.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_2\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_2 - {B\_m}^{2}}\\ \mathbf{elif}\;B\_m \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B\_m \leq 2.3 \cdot 10^{-64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;B\_m \leq 1.55 \cdot 10^{-17}:\\ \;\;\;\;\sqrt{F \cdot \left(2 \cdot t\_0\right)} \cdot \frac{\sqrt{2 \cdot C}}{-t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
        (t_1 (* (sqrt (* C (/ F (fma -4.0 (* A C) (pow B_m 2.0))))) (- 2.0)))
        (t_2 (* (* 4.0 A) C)))
   (if (<= B_m 1.6e-264)
     t_1
     (if (<= B_m 1.8e-129)
       (/
        (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_2) F)) (* 2.0 C)))
        (- t_2 (pow B_m 2.0)))
       (if (<= B_m 2.8e-93)
         (sqrt (/ F (- A)))
         (if (<= B_m 2.3e-64)
           t_1
           (if (<= B_m 1.55e-17)
             (* (sqrt (* F (* 2.0 t_0))) (/ (sqrt (* 2.0 C)) (- t_0)))
             (*
              (* (sqrt F) (sqrt (+ C (hypot B_m C))))
              (/ (sqrt 2.0) (- B_m))))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = sqrt((C * (F / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -2.0;
	double t_2 = (4.0 * A) * C;
	double tmp;
	if (B_m <= 1.6e-264) {
		tmp = t_1;
	} else if (B_m <= 1.8e-129) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_2) * F)) * (2.0 * C))) / (t_2 - pow(B_m, 2.0));
	} else if (B_m <= 2.8e-93) {
		tmp = sqrt((F / -A));
	} else if (B_m <= 2.3e-64) {
		tmp = t_1;
	} else if (B_m <= 1.55e-17) {
		tmp = sqrt((F * (2.0 * t_0))) * (sqrt((2.0 * C)) / -t_0);
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(sqrt(Float64(C * Float64(F / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-2.0))
	t_2 = Float64(Float64(4.0 * A) * C)
	tmp = 0.0
	if (B_m <= 1.6e-264)
		tmp = t_1;
	elseif (B_m <= 1.8e-129)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_2) * F)) * Float64(2.0 * C))) / Float64(t_2 - (B_m ^ 2.0)));
	elseif (B_m <= 2.8e-93)
		tmp = sqrt(Float64(F / Float64(-A)));
	elseif (B_m <= 2.3e-64)
		tmp = t_1;
	elseif (B_m <= 1.55e-17)
		tmp = Float64(sqrt(Float64(F * Float64(2.0 * t_0))) * Float64(sqrt(Float64(2.0 * C)) / Float64(-t_0)));
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(C * N[(F / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 1.6e-264], t$95$1, If[LessEqual[B$95$m, 1.8e-129], 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[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$2 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.8e-93], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 2.3e-64], t$95$1, If[LessEqual[B$95$m, 1.55e-17], N[(N[Sqrt[N[(F * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\
t_2 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 1.6 \cdot 10^{-264}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;B\_m \leq 2.8 \cdot 10^{-93}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{elif}\;B\_m \leq 2.3 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.59999999999999998e-264 or 2.79999999999999998e-93 < B < 2.3000000000000001e-64

    1. Initial program 16.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. Simplified25.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}}\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \]
      6. rem-square-sqrt11.7%

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

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

    if 1.59999999999999998e-264 < B < 1.8e-129

    1. Initial program 18.3%

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

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

    if 1.8e-129 < B < 2.79999999999999998e-93

    1. Initial program 13.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. Simplified13.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 2.3000000000000001e-64 < B < 1.5499999999999999e-17

    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. Simplified51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5499999999999999e-17 < B

    1. Initial program 19.4%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in22.5%

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

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

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

        \[\leadsto \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    5. Simplified48.8%

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/266.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.6 \cdot 10^{-264}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;B \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B \leq 2.3 \cdot 10^{-64}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 1.55 \cdot 10^{-17}:\\ \;\;\;\;\sqrt{F \cdot \left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \frac{\sqrt{2 \cdot C}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B, C\right)}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 54.4% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\ t_1 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;B\_m \leq 1.95 \cdot 10^{-264}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B\_m \leq 7.6 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_1 - {B\_m}^{2}}\\ \mathbf{elif}\;B\_m \leq 2.9 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B\_m \leq 3.6 \cdot 10^{-32}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (sqrt (* C (/ F (fma -4.0 (* A C) (pow B_m 2.0))))) (- 2.0)))
        (t_1 (* (* 4.0 A) C)))
   (if (<= B_m 1.95e-264)
     t_0
     (if (<= B_m 7.6e-129)
       (/
        (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_1) F)) (* 2.0 C)))
        (- t_1 (pow B_m 2.0)))
       (if (<= B_m 2.9e-93)
         (sqrt (/ F (- A)))
         (if (<= B_m 3.6e-32)
           t_0
           (*
            (* (sqrt F) (sqrt (+ C (hypot B_m C))))
            (/ (sqrt 2.0) (- B_m)))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt((C * (F / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -2.0;
	double t_1 = (4.0 * A) * C;
	double tmp;
	if (B_m <= 1.95e-264) {
		tmp = t_0;
	} else if (B_m <= 7.6e-129) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_1) * F)) * (2.0 * C))) / (t_1 - pow(B_m, 2.0));
	} else if (B_m <= 2.9e-93) {
		tmp = sqrt((F / -A));
	} else if (B_m <= 3.6e-32) {
		tmp = t_0;
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(sqrt(Float64(C * Float64(F / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-2.0))
	t_1 = Float64(Float64(4.0 * A) * C)
	tmp = 0.0
	if (B_m <= 1.95e-264)
		tmp = t_0;
	elseif (B_m <= 7.6e-129)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_1) * F)) * Float64(2.0 * C))) / Float64(t_1 - (B_m ^ 2.0)));
	elseif (B_m <= 2.9e-93)
		tmp = sqrt(Float64(F / Float64(-A)));
	elseif (B_m <= 3.6e-32)
		tmp = t_0;
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[N[(C * N[(F / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 1.95e-264], t$95$0, If[LessEqual[B$95$m, 7.6e-129], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$1 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.9e-93], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 3.6e-32], t$95$0, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\
t_1 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 1.95 \cdot 10^{-264}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;B\_m \leq 2.9 \cdot 10^{-93}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{elif}\;B\_m \leq 3.6 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 1.9499999999999999e-264 or 2.8999999999999998e-93 < B < 3.59999999999999993e-32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9499999999999999e-264 < B < 7.59999999999999969e-129

    1. Initial program 18.3%

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

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

    if 7.59999999999999969e-129 < B < 2.8999999999999998e-93

    1. Initial program 13.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. Simplified13.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 3.59999999999999993e-32 < B

    1. Initial program 21.5%

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

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in24.3%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/267.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.95 \cdot 10^{-264}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 7.6 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;B \leq 2.9 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B \leq 3.6 \cdot 10^{-32}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B, C\right)}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 49.3% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{if}\;B\_m \leq 1.45 \cdot 10^{-264}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B\_m \leq 1.32 \cdot 10^{-132}:\\ \;\;\;\;\frac{2 \cdot \sqrt{C \cdot \left(F \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right)}}{-\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B\_m \leq 2.85 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B\_m \leq 2.7 \cdot 10^{-33}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B\_m \leq 2.65 \cdot 10^{+174}:\\ \;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m + C}\right)\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (sqrt (* C (/ F (fma -4.0 (* A C) (pow B_m 2.0))))) (- 2.0))))
   (if (<= B_m 1.45e-264)
     t_0
     (if (<= B_m 1.32e-132)
       (/
        (* 2.0 (sqrt (* C (* F (+ (pow B_m 2.0) (* -4.0 (* A C)))))))
        (- (fma B_m B_m (* A (* C -4.0)))))
       (if (<= B_m 2.85e-93)
         (sqrt (/ F (- A)))
         (if (<= B_m 2.7e-33)
           t_0
           (if (<= B_m 2.65e+174)
             (* (sqrt (* F (+ C (hypot B_m C)))) (/ -1.0 (/ B_m (sqrt 2.0))))
             (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ B_m C))))))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt((C * (F / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -2.0;
	double tmp;
	if (B_m <= 1.45e-264) {
		tmp = t_0;
	} else if (B_m <= 1.32e-132) {
		tmp = (2.0 * sqrt((C * (F * (pow(B_m, 2.0) + (-4.0 * (A * C))))))) / -fma(B_m, B_m, (A * (C * -4.0)));
	} else if (B_m <= 2.85e-93) {
		tmp = sqrt((F / -A));
	} else if (B_m <= 2.7e-33) {
		tmp = t_0;
	} else if (B_m <= 2.65e+174) {
		tmp = sqrt((F * (C + hypot(B_m, C)))) * (-1.0 / (B_m / sqrt(2.0)));
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((B_m + C)));
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(sqrt(Float64(C * Float64(F / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-2.0))
	tmp = 0.0
	if (B_m <= 1.45e-264)
		tmp = t_0;
	elseif (B_m <= 1.32e-132)
		tmp = Float64(Float64(2.0 * sqrt(Float64(C * Float64(F * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C))))))) / Float64(-fma(B_m, B_m, Float64(A * Float64(C * -4.0)))));
	elseif (B_m <= 2.85e-93)
		tmp = sqrt(Float64(F / Float64(-A)));
	elseif (B_m <= 2.7e-33)
		tmp = t_0;
	elseif (B_m <= 2.65e+174)
		tmp = Float64(sqrt(Float64(F * Float64(C + hypot(B_m, C)))) * Float64(-1.0 / Float64(B_m / sqrt(2.0))));
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(B_m + C)))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[N[(C * N[(F / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision]}, If[LessEqual[B$95$m, 1.45e-264], t$95$0, If[LessEqual[B$95$m, 1.32e-132], N[(N[(2.0 * N[Sqrt[N[(C * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 2.85e-93], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 2.7e-33], t$95$0, If[LessEqual[B$95$m, 2.65e+174], N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\
\mathbf{if}\;B\_m \leq 1.45 \cdot 10^{-264}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;B\_m \leq 2.85 \cdot 10^{-93}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{elif}\;B\_m \leq 2.7 \cdot 10^{-33}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;B\_m \leq 2.65 \cdot 10^{+174}:\\
\;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.4499999999999999e-264 or 2.85000000000000013e-93 < B < 2.7000000000000001e-33

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4499999999999999e-264 < B < 1.32000000000000004e-132

    1. Initial program 18.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.32000000000000004e-132 < B < 2.85000000000000013e-93

    1. Initial program 13.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. Simplified13.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 2.7000000000000001e-33 < B < 2.6499999999999999e174

    1. Initial program 36.6%

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

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

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-commutative39.9%

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in39.9%

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    6. Step-by-step derivation
      1. clear-num45.5%

        \[\leadsto \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\color{blue}{\frac{1}{\frac{B}{\sqrt{2}}}}\right) \]
      2. inv-pow45.5%

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

      \[\leadsto \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\color{blue}{{\left(\frac{B}{\sqrt{2}}\right)}^{-1}}\right) \]
    8. Step-by-step derivation
      1. unpow-145.5%

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

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

    if 2.6499999999999999e174 < B

    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. Add Preprocessing
    3. Taylor expanded in A around 0 2.2%

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in2.2%

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(C + \mathsf{hypot}\left(B, C\right)\right) \cdot F\right)}}^{0.5} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      3. unpow-prod-down87.0%

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/287.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.45 \cdot 10^{-264}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 1.32 \cdot 10^{-132}:\\ \;\;\;\;\frac{2 \cdot \sqrt{C \cdot \left(F \cdot \left({B}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 2.85 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B \leq 2.7 \cdot 10^{-33}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 2.65 \cdot 10^{+174}:\\ \;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 49.4% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\ t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B\_m \leq 7 \cdot 10^{-260}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B\_m \leq 7.6 \cdot 10^{-129}:\\ \;\;\;\;\sqrt{\left(2 \cdot C\right) \cdot \left(F \cdot \left(2 \cdot t\_1\right)\right)} \cdot \frac{-1}{t\_1}\\ \mathbf{elif}\;B\_m \leq 3 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B\_m \leq 3 \cdot 10^{-36}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B\_m \leq 2.2 \cdot 10^{+174}:\\ \;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m + C}\right)\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (sqrt (* C (/ F (fma -4.0 (* A C) (pow B_m 2.0))))) (- 2.0)))
        (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= B_m 7e-260)
     t_0
     (if (<= B_m 7.6e-129)
       (* (sqrt (* (* 2.0 C) (* F (* 2.0 t_1)))) (/ -1.0 t_1))
       (if (<= B_m 3e-93)
         (sqrt (/ F (- A)))
         (if (<= B_m 3e-36)
           t_0
           (if (<= B_m 2.2e+174)
             (* (sqrt (* F (+ C (hypot B_m C)))) (/ -1.0 (/ B_m (sqrt 2.0))))
             (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ B_m C))))))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt((C * (F / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -2.0;
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (B_m <= 7e-260) {
		tmp = t_0;
	} else if (B_m <= 7.6e-129) {
		tmp = sqrt(((2.0 * C) * (F * (2.0 * t_1)))) * (-1.0 / t_1);
	} else if (B_m <= 3e-93) {
		tmp = sqrt((F / -A));
	} else if (B_m <= 3e-36) {
		tmp = t_0;
	} else if (B_m <= 2.2e+174) {
		tmp = sqrt((F * (C + hypot(B_m, C)))) * (-1.0 / (B_m / sqrt(2.0)));
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((B_m + C)));
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(sqrt(Float64(C * Float64(F / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-2.0))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (B_m <= 7e-260)
		tmp = t_0;
	elseif (B_m <= 7.6e-129)
		tmp = Float64(sqrt(Float64(Float64(2.0 * C) * Float64(F * Float64(2.0 * t_1)))) * Float64(-1.0 / t_1));
	elseif (B_m <= 3e-93)
		tmp = sqrt(Float64(F / Float64(-A)));
	elseif (B_m <= 3e-36)
		tmp = t_0;
	elseif (B_m <= 2.2e+174)
		tmp = Float64(sqrt(Float64(F * Float64(C + hypot(B_m, C)))) * Float64(-1.0 / Float64(B_m / sqrt(2.0))));
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(B_m + C)))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[N[(C * N[(F / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 7e-260], t$95$0, If[LessEqual[B$95$m, 7.6e-129], N[(N[Sqrt[N[(N[(2.0 * C), $MachinePrecision] * N[(F * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 3e-93], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 3e-36], t$95$0, If[LessEqual[B$95$m, 2.2e+174], N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B\_m \leq 7 \cdot 10^{-260}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;B\_m \leq 3 \cdot 10^{-93}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{elif}\;B\_m \leq 3 \cdot 10^{-36}:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 6.9999999999999999e-260 or 3.0000000000000001e-93 < B < 3.0000000000000002e-36

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999999e-260 < B < 7.59999999999999969e-129

    1. Initial program 18.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999969e-129 < B < 3.0000000000000001e-93

    1. Initial program 13.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. Simplified13.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 3.0000000000000002e-36 < B < 2.2000000000000002e174

    1. Initial program 36.6%

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

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

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-commutative39.9%

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in39.9%

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    6. Step-by-step derivation
      1. clear-num45.5%

        \[\leadsto \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\color{blue}{\frac{1}{\frac{B}{\sqrt{2}}}}\right) \]
      2. inv-pow45.5%

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

      \[\leadsto \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\color{blue}{{\left(\frac{B}{\sqrt{2}}\right)}^{-1}}\right) \]
    8. Step-by-step derivation
      1. unpow-145.5%

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

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

    if 2.2000000000000002e174 < B

    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. Add Preprocessing
    3. Taylor expanded in A around 0 2.2%

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in2.2%

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(C + \mathsf{hypot}\left(B, C\right)\right) \cdot F\right)}}^{0.5} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      3. unpow-prod-down87.0%

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/287.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 7 \cdot 10^{-260}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 7.6 \cdot 10^{-129}:\\ \;\;\;\;\sqrt{\left(2 \cdot C\right) \cdot \left(F \cdot \left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)\right)} \cdot \frac{-1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 3 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B \leq 3 \cdot 10^{-36}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 2.2 \cdot 10^{+174}:\\ \;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 49.6% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\ t_1 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;B\_m \leq 1.45 \cdot 10^{-264}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B\_m \leq 6.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_1 - {B\_m}^{2}}\\ \mathbf{elif}\;B\_m \leq 2.1 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B\_m \leq 7.6 \cdot 10^{-33}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B\_m \leq 1.8 \cdot 10^{+174}:\\ \;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B\_m + C}\right)\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (sqrt (* C (/ F (fma -4.0 (* A C) (pow B_m 2.0))))) (- 2.0)))
        (t_1 (* (* 4.0 A) C)))
   (if (<= B_m 1.45e-264)
     t_0
     (if (<= B_m 6.8e-129)
       (/
        (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_1) F)) (* 2.0 C)))
        (- t_1 (pow B_m 2.0)))
       (if (<= B_m 2.1e-93)
         (sqrt (/ F (- A)))
         (if (<= B_m 7.6e-33)
           t_0
           (if (<= B_m 1.8e+174)
             (* (sqrt (* F (+ C (hypot B_m C)))) (/ -1.0 (/ B_m (sqrt 2.0))))
             (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ B_m C))))))))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt((C * (F / fma(-4.0, (A * C), pow(B_m, 2.0))))) * -2.0;
	double t_1 = (4.0 * A) * C;
	double tmp;
	if (B_m <= 1.45e-264) {
		tmp = t_0;
	} else if (B_m <= 6.8e-129) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_1) * F)) * (2.0 * C))) / (t_1 - pow(B_m, 2.0));
	} else if (B_m <= 2.1e-93) {
		tmp = sqrt((F / -A));
	} else if (B_m <= 7.6e-33) {
		tmp = t_0;
	} else if (B_m <= 1.8e+174) {
		tmp = sqrt((F * (C + hypot(B_m, C)))) * (-1.0 / (B_m / sqrt(2.0)));
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((B_m + C)));
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(sqrt(Float64(C * Float64(F / fma(-4.0, Float64(A * C), (B_m ^ 2.0))))) * Float64(-2.0))
	t_1 = Float64(Float64(4.0 * A) * C)
	tmp = 0.0
	if (B_m <= 1.45e-264)
		tmp = t_0;
	elseif (B_m <= 6.8e-129)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_1) * F)) * Float64(2.0 * C))) / Float64(t_1 - (B_m ^ 2.0)));
	elseif (B_m <= 2.1e-93)
		tmp = sqrt(Float64(F / Float64(-A)));
	elseif (B_m <= 7.6e-33)
		tmp = t_0;
	elseif (B_m <= 1.8e+174)
		tmp = Float64(sqrt(Float64(F * Float64(C + hypot(B_m, C)))) * Float64(-1.0 / Float64(B_m / sqrt(2.0))));
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(B_m + C)))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[N[(C * N[(F / N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-2.0)), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 1.45e-264], t$95$0, If[LessEqual[B$95$m, 6.8e-129], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$1 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.1e-93], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 7.6e-33], t$95$0, If[LessEqual[B$95$m, 1.8e+174], N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}} \cdot \left(-2\right)\\
t_1 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 1.45 \cdot 10^{-264}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;B\_m \leq 2.1 \cdot 10^{-93}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{elif}\;B\_m \leq 7.6 \cdot 10^{-33}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;B\_m \leq 1.8 \cdot 10^{+174}:\\
\;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if B < 1.4499999999999999e-264 or 2.1000000000000001e-93 < B < 7.59999999999999988e-33

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4499999999999999e-264 < B < 6.80000000000000026e-129

    1. Initial program 18.3%

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

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

    if 6.80000000000000026e-129 < B < 2.1000000000000001e-93

    1. Initial program 13.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. Simplified13.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt13.2%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg55.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified55.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if 7.59999999999999988e-33 < B < 1.8000000000000001e174

    1. Initial program 36.6%

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

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

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-commutative39.9%

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in39.9%

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    6. Step-by-step derivation
      1. clear-num45.5%

        \[\leadsto \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\color{blue}{\frac{1}{\frac{B}{\sqrt{2}}}}\right) \]
      2. inv-pow45.5%

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

      \[\leadsto \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\color{blue}{{\left(\frac{B}{\sqrt{2}}\right)}^{-1}}\right) \]
    8. Step-by-step derivation
      1. unpow-145.5%

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

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

    if 1.8000000000000001e174 < B

    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. Add Preprocessing
    3. Taylor expanded in A around 0 2.2%

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

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

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in2.2%

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(C + \mathsf{hypot}\left(B, C\right)\right) \cdot F\right)}}^{0.5} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      3. unpow-prod-down87.0%

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

        \[\leadsto \left(\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. pow1/287.0%

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

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

      \[\leadsto \left(\sqrt{\color{blue}{B + C}} \cdot \sqrt{F}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
  3. Recombined 5 regimes into one program.
  4. Final simplification26.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.45 \cdot 10^{-264}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 6.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;B \leq 2.1 \cdot 10^{-93}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;B \leq 7.6 \cdot 10^{-33}:\\ \;\;\;\;\sqrt{C \cdot \frac{F}{\mathsf{fma}\left(-4, A \cdot C, {B}^{2}\right)}} \cdot \left(-2\right)\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{+174}:\\ \;\;\;\;\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \frac{-1}{\frac{B}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{B + C}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 38.1% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq -1.35 \cdot 10^{-199}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 1.85 \cdot 10^{+101}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\ \mathbf{elif}\;C \leq 8.4 \cdot 10^{+216}:\\ \;\;\;\;-2 \cdot \sqrt{\frac{C \cdot F}{{B\_m}^{2} + -4 \cdot \left(A \cdot C\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -1.35e-199)
   (/ (sqrt F) (sqrt (- A)))
   (if (<= C 1.85e+101)
     (- (pow (* 2.0 (/ F B_m)) 0.5))
     (if (<= C 8.4e+216)
       (* -2.0 (sqrt (/ (* C F) (+ (pow B_m 2.0) (* -4.0 (* A C))))))
       (sqrt (/ F (- A)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -1.35e-199) {
		tmp = sqrt(F) / sqrt(-A);
	} else if (C <= 1.85e+101) {
		tmp = -pow((2.0 * (F / B_m)), 0.5);
	} else if (C <= 8.4e+216) {
		tmp = -2.0 * sqrt(((C * F) / (pow(B_m, 2.0) + (-4.0 * (A * C)))));
	} else {
		tmp = sqrt((F / -A));
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= (-1.35d-199)) then
        tmp = sqrt(f) / sqrt(-a)
    else if (c <= 1.85d+101) then
        tmp = -((2.0d0 * (f / b_m)) ** 0.5d0)
    else if (c <= 8.4d+216) then
        tmp = (-2.0d0) * sqrt(((c * f) / ((b_m ** 2.0d0) + ((-4.0d0) * (a * c)))))
    else
        tmp = sqrt((f / -a))
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -1.35e-199) {
		tmp = Math.sqrt(F) / Math.sqrt(-A);
	} else if (C <= 1.85e+101) {
		tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
	} else if (C <= 8.4e+216) {
		tmp = -2.0 * Math.sqrt(((C * F) / (Math.pow(B_m, 2.0) + (-4.0 * (A * C)))));
	} else {
		tmp = Math.sqrt((F / -A));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if C <= -1.35e-199:
		tmp = math.sqrt(F) / math.sqrt(-A)
	elif C <= 1.85e+101:
		tmp = -math.pow((2.0 * (F / B_m)), 0.5)
	elif C <= 8.4e+216:
		tmp = -2.0 * math.sqrt(((C * F) / (math.pow(B_m, 2.0) + (-4.0 * (A * C)))))
	else:
		tmp = math.sqrt((F / -A))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -1.35e-199)
		tmp = Float64(sqrt(F) / sqrt(Float64(-A)));
	elseif (C <= 1.85e+101)
		tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5));
	elseif (C <= 8.4e+216)
		tmp = Float64(-2.0 * sqrt(Float64(Float64(C * F) / Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C))))));
	else
		tmp = sqrt(Float64(F / Float64(-A)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -1.35e-199)
		tmp = sqrt(F) / sqrt(-A);
	elseif (C <= 1.85e+101)
		tmp = -((2.0 * (F / B_m)) ^ 0.5);
	elseif (C <= 8.4e+216)
		tmp = -2.0 * sqrt(((C * F) / ((B_m ^ 2.0) + (-4.0 * (A * C)))));
	else
		tmp = sqrt((F / -A));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -1.35e-199], N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 1.85e+101], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), If[LessEqual[C, 8.4e+216], N[(-2.0 * N[Sqrt[N[(N[(C * F), $MachinePrecision] / N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq -1.35 \cdot 10^{-199}:\\
\;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\

\mathbf{elif}\;C \leq 1.85 \cdot 10^{+101}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\

\mathbf{elif}\;C \leq 8.4 \cdot 10^{+216}:\\
\;\;\;\;-2 \cdot \sqrt{\frac{C \cdot F}{{B\_m}^{2} + -4 \cdot \left(A \cdot C\right)}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if C < -1.34999999999999995e-199

    1. Initial program 9.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. Simplified15.3%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt2.6%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      2. sqrt-unprod2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      3. frac-times2.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
    5. Applied egg-rr2.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
    6. Taylor expanded in A around -inf 10.6%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/10.6%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg10.6%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified10.6%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]
    9. Step-by-step derivation
      1. frac-2neg10.6%

        \[\leadsto \sqrt{\color{blue}{\frac{-\left(-F\right)}{-A}}} \]
      2. sqrt-div10.2%

        \[\leadsto \color{blue}{\frac{\sqrt{-\left(-F\right)}}{\sqrt{-A}}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \frac{\sqrt{-\color{blue}{\sqrt{-F} \cdot \sqrt{-F}}}}{\sqrt{-A}} \]
      4. sqrt-unprod0.7%

        \[\leadsto \frac{\sqrt{-\color{blue}{\sqrt{\left(-F\right) \cdot \left(-F\right)}}}}{\sqrt{-A}} \]
      5. sqr-neg0.7%

        \[\leadsto \frac{\sqrt{-\sqrt{\color{blue}{F \cdot F}}}}{\sqrt{-A}} \]
      6. sqrt-unprod0.0%

        \[\leadsto \frac{\sqrt{-\color{blue}{\sqrt{F} \cdot \sqrt{F}}}}{\sqrt{-A}} \]
      7. add-sqr-sqrt0.0%

        \[\leadsto \frac{\sqrt{-\color{blue}{F}}}{\sqrt{-A}} \]
      8. add-sqr-sqrt0.0%

        \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{-F} \cdot \sqrt{-F}}}}{\sqrt{-A}} \]
      9. sqrt-unprod6.8%

        \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{\left(-F\right) \cdot \left(-F\right)}}}}{\sqrt{-A}} \]
      10. sqr-neg6.8%

        \[\leadsto \frac{\sqrt{\sqrt{\color{blue}{F \cdot F}}}}{\sqrt{-A}} \]
      11. sqrt-unprod10.2%

        \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{F} \cdot \sqrt{F}}}}{\sqrt{-A}} \]
      12. add-sqr-sqrt10.2%

        \[\leadsto \frac{\sqrt{\color{blue}{F}}}{\sqrt{-A}} \]
    10. Applied egg-rr10.2%

      \[\leadsto \color{blue}{\frac{\sqrt{F}}{\sqrt{-A}}} \]

    if -1.34999999999999995e-199 < C < 1.8499999999999999e101

    1. Initial program 26.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in B around inf 16.8%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg16.8%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. *-commutative16.8%

        \[\leadsto -\color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      3. distribute-rgt-neg-in16.8%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    5. Simplified16.8%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out16.8%

        \[\leadsto \color{blue}{-\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      2. pow1/216.8%

        \[\leadsto -\color{blue}{{2}^{0.5}} \cdot \sqrt{\frac{F}{B}} \]
      3. pow1/217.0%

        \[\leadsto -{2}^{0.5} \cdot \color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \]
      4. pow-prod-down17.1%

        \[\leadsto -\color{blue}{{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]
    7. Applied egg-rr17.1%

      \[\leadsto \color{blue}{-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]

    if 1.8499999999999999e101 < C < 8.40000000000000006e216

    1. Initial program 34.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. Simplified61.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r*61.5%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. associate-+r+61.5%

        \[\leadsto \frac{\sqrt{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. hypot-undefine34.9%

        \[\leadsto \frac{\sqrt{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \color{blue}{\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}}\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. unpow234.9%

        \[\leadsto \frac{\sqrt{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{{B}^{2}} + \left(A - C\right) \cdot \left(A - C\right)}\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. unpow234.9%

        \[\leadsto \frac{\sqrt{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + \color{blue}{{\left(A - C\right)}^{2}}}\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      6. +-commutative34.9%

        \[\leadsto \frac{\sqrt{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \cdot \left(\left(A + C\right) + \sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      7. sqrt-prod40.1%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2} \cdot \sqrt{\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      8. *-commutative40.1%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot 2} \cdot \sqrt{\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      9. associate-*r*40.1%

        \[\leadsto \frac{\sqrt{\left(F \cdot \mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)\right) \cdot 2} \cdot \sqrt{\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      10. associate-+l+40.1%

        \[\leadsto \frac{\sqrt{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2} \cdot \sqrt{\color{blue}{A + \left(C + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Applied egg-rr66.6%

      \[\leadsto \frac{\color{blue}{\sqrt{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    6. Taylor expanded in A around -inf 66.6%

      \[\leadsto \frac{\sqrt{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2} \cdot \sqrt{\color{blue}{2 \cdot C}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Step-by-step derivation
      1. pow166.6%

        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2} \cdot \sqrt{2 \cdot C}\right)}^{1}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. sqrt-unprod61.5%

        \[\leadsto \frac{{\color{blue}{\left(\sqrt{\left(\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2\right) \cdot \left(2 \cdot C\right)}\right)}}^{1}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*l*61.5%

        \[\leadsto \frac{{\left(\sqrt{\color{blue}{\left(F \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot 2\right)\right)} \cdot \left(2 \cdot C\right)}\right)}^{1}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-*r*61.5%

        \[\leadsto \frac{{\left(\sqrt{\left(F \cdot \left(\mathsf{fma}\left(B, B, \color{blue}{A \cdot \left(C \cdot -4\right)}\right) \cdot 2\right)\right) \cdot \left(2 \cdot C\right)}\right)}^{1}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. *-commutative61.5%

        \[\leadsto \frac{{\left(\sqrt{\left(F \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot 2\right)\right) \cdot \color{blue}{\left(C \cdot 2\right)}}\right)}^{1}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    8. Applied egg-rr61.5%

      \[\leadsto \frac{\color{blue}{{\left(\sqrt{\left(F \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot 2\right)\right) \cdot \left(C \cdot 2\right)}\right)}^{1}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    9. Step-by-step derivation
      1. unpow161.5%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(F \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot 2\right)\right) \cdot \left(C \cdot 2\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. associate-*l*50.7%

        \[\leadsto \frac{\sqrt{\color{blue}{F \cdot \left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot 2\right) \cdot \left(C \cdot 2\right)\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    10. Simplified50.7%

      \[\leadsto \frac{\color{blue}{\sqrt{F \cdot \left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot 2\right) \cdot \left(C \cdot 2\right)\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    11. Taylor expanded in F around 0 35.8%

      \[\leadsto \color{blue}{-2 \cdot \sqrt{\frac{C \cdot F}{-4 \cdot \left(A \cdot C\right) + {B}^{2}}}} \]

    if 8.40000000000000006e216 < C

    1. Initial program 1.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. Simplified9.0%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt4.5%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      2. sqrt-unprod4.7%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      3. frac-times0.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
    5. Applied egg-rr0.6%

      \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
    6. Taylor expanded in A around -inf 44.0%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/44.0%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg44.0%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified44.0%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification18.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -1.35 \cdot 10^{-199}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 1.85 \cdot 10^{+101}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}\\ \mathbf{elif}\;C \leq 8.4 \cdot 10^{+216}:\\ \;\;\;\;-2 \cdot \sqrt{\frac{C \cdot F}{{B}^{2} + -4 \cdot \left(A \cdot C\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 44.2% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{F}{-A}}\\ \mathbf{if}\;F \leq -7.5 \cdot 10^{-307}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-44}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{B\_m \cdot F}\right)\\ \mathbf{elif}\;F \leq 8 \cdot 10^{+182} \lor \neg \left(F \leq 1.25 \cdot 10^{+204}\right):\\ \;\;\;\;-\sqrt{2 \cdot \frac{F}{B\_m}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (sqrt (/ F (- A)))))
   (if (<= F -7.5e-307)
     t_0
     (if (<= F 5e-44)
       (* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F))))
       (if (or (<= F 8e+182) (not (<= F 1.25e+204)))
         (- (sqrt (* 2.0 (/ F B_m))))
         t_0)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt((F / -A));
	double tmp;
	if (F <= -7.5e-307) {
		tmp = t_0;
	} else if (F <= 5e-44) {
		tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
	} else if ((F <= 8e+182) || !(F <= 1.25e+204)) {
		tmp = -sqrt((2.0 * (F / B_m)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((f / -a))
    if (f <= (-7.5d-307)) then
        tmp = t_0
    else if (f <= 5d-44) then
        tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
    else if ((f <= 8d+182) .or. (.not. (f <= 1.25d+204))) then
        tmp = -sqrt((2.0d0 * (f / b_m)))
    else
        tmp = t_0
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.sqrt((F / -A));
	double tmp;
	if (F <= -7.5e-307) {
		tmp = t_0;
	} else if (F <= 5e-44) {
		tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
	} else if ((F <= 8e+182) || !(F <= 1.25e+204)) {
		tmp = -Math.sqrt((2.0 * (F / B_m)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = math.sqrt((F / -A))
	tmp = 0
	if F <= -7.5e-307:
		tmp = t_0
	elif F <= 5e-44:
		tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F))
	elif (F <= 8e+182) or not (F <= 1.25e+204):
		tmp = -math.sqrt((2.0 * (F / B_m)))
	else:
		tmp = t_0
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = sqrt(Float64(F / Float64(-A)))
	tmp = 0.0
	if (F <= -7.5e-307)
		tmp = t_0;
	elseif (F <= 5e-44)
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F))));
	elseif ((F <= 8e+182) || !(F <= 1.25e+204))
		tmp = Float64(-sqrt(Float64(2.0 * Float64(F / B_m))));
	else
		tmp = t_0;
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = sqrt((F / -A));
	tmp = 0.0;
	if (F <= -7.5e-307)
		tmp = t_0;
	elseif (F <= 5e-44)
		tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
	elseif ((F <= 8e+182) || ~((F <= 1.25e+204)))
		tmp = -sqrt((2.0 * (F / B_m)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -7.5e-307], t$95$0, If[LessEqual[F, 5e-44], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 8e+182], N[Not[LessEqual[F, 1.25e+204]], $MachinePrecision]], (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), t$95$0]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{F}{-A}}\\
\mathbf{if}\;F \leq -7.5 \cdot 10^{-307}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{B\_m \cdot F}\right)\\

\mathbf{elif}\;F \leq 8 \cdot 10^{+182} \lor \neg \left(F \leq 1.25 \cdot 10^{+204}\right):\\
\;\;\;\;-\sqrt{2 \cdot \frac{F}{B\_m}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -7.5000000000000006e-307 or 8.0000000000000005e182 < F < 1.25000000000000002e204

    1. Initial program 18.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. Simplified30.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt30.0%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      2. sqrt-unprod24.2%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      3. frac-times18.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
    5. Applied egg-rr18.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
    6. Taylor expanded in A around -inf 43.5%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/43.5%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg43.5%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified43.5%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if -7.5000000000000006e-307 < F < 5.00000000000000039e-44

    1. Initial program 22.6%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in A around 0 10.6%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg10.6%

        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-commutative10.6%

        \[\leadsto -\color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}} \]
      3. distribute-rgt-neg-in10.6%

        \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
      4. unpow210.6%

        \[\leadsto \sqrt{F \cdot \left(C + \sqrt{\color{blue}{B \cdot B} + {C}^{2}}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      5. unpow210.6%

        \[\leadsto \sqrt{F \cdot \left(C + \sqrt{B \cdot B + \color{blue}{C \cdot C}}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      6. hypot-define23.8%

        \[\leadsto \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(B, C\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    5. Simplified23.8%

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    6. Taylor expanded in C around 0 19.9%

      \[\leadsto \color{blue}{\sqrt{B \cdot F}} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]

    if 5.00000000000000039e-44 < F < 8.0000000000000005e182 or 1.25000000000000002e204 < F

    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. Add Preprocessing
    3. Taylor expanded in B around inf 18.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg18.9%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. *-commutative18.9%

        \[\leadsto -\color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      3. distribute-rgt-neg-in18.9%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    5. Simplified18.9%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    6. Step-by-step derivation
      1. pow118.9%

        \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\right)}^{1}} \]
      2. distribute-rgt-neg-out18.9%

        \[\leadsto {\color{blue}{\left(-\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)}}^{1} \]
      3. pow1/218.9%

        \[\leadsto {\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{\frac{F}{B}}\right)}^{1} \]
      4. pow1/219.3%

        \[\leadsto {\left(-{2}^{0.5} \cdot \color{blue}{{\left(\frac{F}{B}\right)}^{0.5}}\right)}^{1} \]
      5. pow-prod-down19.4%

        \[\leadsto {\left(-\color{blue}{{\left(2 \cdot \frac{F}{B}\right)}^{0.5}}\right)}^{1} \]
    7. Applied egg-rr19.4%

      \[\leadsto \color{blue}{{\left(-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow119.4%

        \[\leadsto \color{blue}{-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]
      2. unpow1/219.0%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot \frac{F}{B}}} \]
    9. Simplified19.0%

      \[\leadsto \color{blue}{-\sqrt{2 \cdot \frac{F}{B}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification23.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-307}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-44}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\ \mathbf{elif}\;F \leq 8 \cdot 10^{+182} \lor \neg \left(F \leq 1.25 \cdot 10^{+204}\right):\\ \;\;\;\;-\sqrt{2 \cdot \frac{F}{B}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 37.3% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-197}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.8 \cdot 10^{+126}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -4.6e-197)
   (/ (sqrt F) (sqrt (- A)))
   (if (<= C 2.8e+126) (- (pow (* 2.0 (/ F B_m)) 0.5)) (sqrt (/ F (- A))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -4.6e-197) {
		tmp = sqrt(F) / sqrt(-A);
	} else if (C <= 2.8e+126) {
		tmp = -pow((2.0 * (F / B_m)), 0.5);
	} else {
		tmp = sqrt((F / -A));
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= (-4.6d-197)) then
        tmp = sqrt(f) / sqrt(-a)
    else if (c <= 2.8d+126) then
        tmp = -((2.0d0 * (f / b_m)) ** 0.5d0)
    else
        tmp = sqrt((f / -a))
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -4.6e-197) {
		tmp = Math.sqrt(F) / Math.sqrt(-A);
	} else if (C <= 2.8e+126) {
		tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
	} else {
		tmp = Math.sqrt((F / -A));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if C <= -4.6e-197:
		tmp = math.sqrt(F) / math.sqrt(-A)
	elif C <= 2.8e+126:
		tmp = -math.pow((2.0 * (F / B_m)), 0.5)
	else:
		tmp = math.sqrt((F / -A))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -4.6e-197)
		tmp = Float64(sqrt(F) / sqrt(Float64(-A)));
	elseif (C <= 2.8e+126)
		tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5));
	else
		tmp = sqrt(Float64(F / Float64(-A)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -4.6e-197)
		tmp = sqrt(F) / sqrt(-A);
	elseif (C <= 2.8e+126)
		tmp = -((2.0 * (F / B_m)) ^ 0.5);
	else
		tmp = sqrt((F / -A));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -4.6e-197], N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.8e+126], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.6 \cdot 10^{-197}:\\
\;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\

\mathbf{elif}\;C \leq 2.8 \cdot 10^{+126}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -4.6000000000000001e-197

    1. Initial program 9.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. Simplified15.3%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt2.6%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      2. sqrt-unprod2.8%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      3. frac-times2.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
    5. Applied egg-rr2.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
    6. Taylor expanded in A around -inf 10.6%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/10.6%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg10.6%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified10.6%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]
    9. Step-by-step derivation
      1. frac-2neg10.6%

        \[\leadsto \sqrt{\color{blue}{\frac{-\left(-F\right)}{-A}}} \]
      2. sqrt-div10.2%

        \[\leadsto \color{blue}{\frac{\sqrt{-\left(-F\right)}}{\sqrt{-A}}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \frac{\sqrt{-\color{blue}{\sqrt{-F} \cdot \sqrt{-F}}}}{\sqrt{-A}} \]
      4. sqrt-unprod0.7%

        \[\leadsto \frac{\sqrt{-\color{blue}{\sqrt{\left(-F\right) \cdot \left(-F\right)}}}}{\sqrt{-A}} \]
      5. sqr-neg0.7%

        \[\leadsto \frac{\sqrt{-\sqrt{\color{blue}{F \cdot F}}}}{\sqrt{-A}} \]
      6. sqrt-unprod0.0%

        \[\leadsto \frac{\sqrt{-\color{blue}{\sqrt{F} \cdot \sqrt{F}}}}{\sqrt{-A}} \]
      7. add-sqr-sqrt0.0%

        \[\leadsto \frac{\sqrt{-\color{blue}{F}}}{\sqrt{-A}} \]
      8. add-sqr-sqrt0.0%

        \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{-F} \cdot \sqrt{-F}}}}{\sqrt{-A}} \]
      9. sqrt-unprod6.8%

        \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{\left(-F\right) \cdot \left(-F\right)}}}}{\sqrt{-A}} \]
      10. sqr-neg6.8%

        \[\leadsto \frac{\sqrt{\sqrt{\color{blue}{F \cdot F}}}}{\sqrt{-A}} \]
      11. sqrt-unprod10.2%

        \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{F} \cdot \sqrt{F}}}}{\sqrt{-A}} \]
      12. add-sqr-sqrt10.2%

        \[\leadsto \frac{\sqrt{\color{blue}{F}}}{\sqrt{-A}} \]
    10. Applied egg-rr10.2%

      \[\leadsto \color{blue}{\frac{\sqrt{F}}{\sqrt{-A}}} \]

    if -4.6000000000000001e-197 < C < 2.80000000000000009e126

    1. Initial program 27.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in B around inf 16.5%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg16.5%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. *-commutative16.5%

        \[\leadsto -\color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      3. distribute-rgt-neg-in16.5%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    5. Simplified16.5%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out16.5%

        \[\leadsto \color{blue}{-\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      2. pow1/216.5%

        \[\leadsto -\color{blue}{{2}^{0.5}} \cdot \sqrt{\frac{F}{B}} \]
      3. pow1/216.6%

        \[\leadsto -{2}^{0.5} \cdot \color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \]
      4. pow-prod-down16.8%

        \[\leadsto -\color{blue}{{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]
    7. Applied egg-rr16.8%

      \[\leadsto \color{blue}{-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]

    if 2.80000000000000009e126 < C

    1. Initial program 11.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. Simplified27.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt7.8%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      2. sqrt-unprod8.2%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      3. frac-times5.5%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
    5. Applied egg-rr5.5%

      \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
    6. Taylor expanded in A around -inf 35.6%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/35.6%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg35.6%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified35.6%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification17.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-197}:\\ \;\;\;\;\frac{\sqrt{F}}{\sqrt{-A}}\\ \mathbf{elif}\;C \leq 2.8 \cdot 10^{+126}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 34.8% accurate, 5.4× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq -2.15 \cdot 10^{-193} \lor \neg \left(C \leq 7.6 \cdot 10^{+122}\right):\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{else}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (or (<= C -2.15e-193) (not (<= C 7.6e+122)))
   (sqrt (/ F (- A)))
   (- (pow (* 2.0 (/ F B_m)) 0.5))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if ((C <= -2.15e-193) || !(C <= 7.6e+122)) {
		tmp = sqrt((F / -A));
	} else {
		tmp = -pow((2.0 * (F / B_m)), 0.5);
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if ((c <= (-2.15d-193)) .or. (.not. (c <= 7.6d+122))) then
        tmp = sqrt((f / -a))
    else
        tmp = -((2.0d0 * (f / b_m)) ** 0.5d0)
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if ((C <= -2.15e-193) || !(C <= 7.6e+122)) {
		tmp = Math.sqrt((F / -A));
	} else {
		tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if (C <= -2.15e-193) or not (C <= 7.6e+122):
		tmp = math.sqrt((F / -A))
	else:
		tmp = -math.pow((2.0 * (F / B_m)), 0.5)
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if ((C <= -2.15e-193) || !(C <= 7.6e+122))
		tmp = sqrt(Float64(F / Float64(-A)));
	else
		tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if ((C <= -2.15e-193) || ~((C <= 7.6e+122)))
		tmp = sqrt((F / -A));
	else
		tmp = -((2.0 * (F / B_m)) ^ 0.5);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[Or[LessEqual[C, -2.15e-193], N[Not[LessEqual[C, 7.6e+122]], $MachinePrecision]], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq -2.15 \cdot 10^{-193} \lor \neg \left(C \leq 7.6 \cdot 10^{+122}\right):\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{else}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -2.1500000000000001e-193 or 7.5999999999999996e122 < C

    1. Initial program 10.1%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified18.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt4.0%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      2. sqrt-unprod4.3%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      3. frac-times3.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
    5. Applied egg-rr3.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
    6. Taylor expanded in A around -inf 17.4%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/17.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg17.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified17.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if -2.1500000000000001e-193 < C < 7.5999999999999996e122

    1. Initial program 27.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in B around inf 16.5%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg16.5%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. *-commutative16.5%

        \[\leadsto -\color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      3. distribute-rgt-neg-in16.5%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    5. Simplified16.5%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out16.5%

        \[\leadsto \color{blue}{-\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      2. pow1/216.5%

        \[\leadsto -\color{blue}{{2}^{0.5}} \cdot \sqrt{\frac{F}{B}} \]
      3. pow1/216.6%

        \[\leadsto -{2}^{0.5} \cdot \color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \]
      4. pow-prod-down16.8%

        \[\leadsto -\color{blue}{{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]
    7. Applied egg-rr16.8%

      \[\leadsto \color{blue}{-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification17.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -2.15 \cdot 10^{-193} \lor \neg \left(C \leq 7.6 \cdot 10^{+122}\right):\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{else}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 34.7% accurate, 5.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq -9 \cdot 10^{-198} \lor \neg \left(C \leq 6.5 \cdot 10^{+121}\right):\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{2 \cdot \frac{F}{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (or (<= C -9e-198) (not (<= C 6.5e+121)))
   (sqrt (/ F (- A)))
   (- (sqrt (* 2.0 (/ F B_m))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if ((C <= -9e-198) || !(C <= 6.5e+121)) {
		tmp = sqrt((F / -A));
	} else {
		tmp = -sqrt((2.0 * (F / B_m)));
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if ((c <= (-9d-198)) .or. (.not. (c <= 6.5d+121))) then
        tmp = sqrt((f / -a))
    else
        tmp = -sqrt((2.0d0 * (f / b_m)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if ((C <= -9e-198) || !(C <= 6.5e+121)) {
		tmp = Math.sqrt((F / -A));
	} else {
		tmp = -Math.sqrt((2.0 * (F / B_m)));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if (C <= -9e-198) or not (C <= 6.5e+121):
		tmp = math.sqrt((F / -A))
	else:
		tmp = -math.sqrt((2.0 * (F / B_m)))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if ((C <= -9e-198) || !(C <= 6.5e+121))
		tmp = sqrt(Float64(F / Float64(-A)));
	else
		tmp = Float64(-sqrt(Float64(2.0 * Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if ((C <= -9e-198) || ~((C <= 6.5e+121)))
		tmp = sqrt((F / -A));
	else
		tmp = -sqrt((2.0 * (F / B_m)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[Or[LessEqual[C, -9e-198], N[Not[LessEqual[C, 6.5e+121]], $MachinePrecision]], N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision], (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;C \leq -9 \cdot 10^{-198} \lor \neg \left(C \leq 6.5 \cdot 10^{+121}\right):\\
\;\;\;\;\sqrt{\frac{F}{-A}}\\

\mathbf{else}:\\
\;\;\;\;-\sqrt{2 \cdot \frac{F}{B\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -8.9999999999999996e-198 or 6.50000000000000019e121 < C

    1. Initial program 10.1%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified18.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt4.0%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      2. sqrt-unprod4.3%

        \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
      3. frac-times3.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
    5. Applied egg-rr3.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
    6. Taylor expanded in A around -inf 17.4%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. associate-*r/17.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
      2. mul-1-neg17.4%

        \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
    8. Simplified17.4%

      \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]

    if -8.9999999999999996e-198 < C < 6.50000000000000019e121

    1. Initial program 27.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in B around inf 16.5%

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg16.5%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. *-commutative16.5%

        \[\leadsto -\color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      3. distribute-rgt-neg-in16.5%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    5. Simplified16.5%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)} \]
    6. Step-by-step derivation
      1. pow116.5%

        \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\right)}^{1}} \]
      2. distribute-rgt-neg-out16.5%

        \[\leadsto {\color{blue}{\left(-\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)}}^{1} \]
      3. pow1/216.5%

        \[\leadsto {\left(-\color{blue}{{2}^{0.5}} \cdot \sqrt{\frac{F}{B}}\right)}^{1} \]
      4. pow1/216.6%

        \[\leadsto {\left(-{2}^{0.5} \cdot \color{blue}{{\left(\frac{F}{B}\right)}^{0.5}}\right)}^{1} \]
      5. pow-prod-down16.8%

        \[\leadsto {\left(-\color{blue}{{\left(2 \cdot \frac{F}{B}\right)}^{0.5}}\right)}^{1} \]
    7. Applied egg-rr16.8%

      \[\leadsto \color{blue}{{\left(-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow116.8%

        \[\leadsto \color{blue}{-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}} \]
      2. unpow1/216.6%

        \[\leadsto -\color{blue}{\sqrt{2 \cdot \frac{F}{B}}} \]
    9. Simplified16.6%

      \[\leadsto \color{blue}{-\sqrt{2 \cdot \frac{F}{B}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification17.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -9 \cdot 10^{-198} \lor \neg \left(C \leq 6.5 \cdot 10^{+121}\right):\\ \;\;\;\;\sqrt{\frac{F}{-A}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{2 \cdot \frac{F}{B}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 20.9% accurate, 6.1× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \sqrt{\frac{F}{-A}} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F) :precision binary64 (sqrt (/ F (- A))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	return sqrt((F / -A));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = sqrt((f / -a))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	return Math.sqrt((F / -A));
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	return math.sqrt((F / -A))
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	return sqrt(Float64(F / Float64(-A)))
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
	tmp = sqrt((F / -A));
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := N[Sqrt[N[(F / (-A)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\sqrt{\frac{F}{-A}}
\end{array}
Derivation
  1. Initial program 17.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. Simplified25.2%

    \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. add-sqr-sqrt6.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
    2. sqrt-unprod6.0%

      \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
    3. frac-times4.8%

      \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
  5. Applied egg-rr4.8%

    \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
  6. Taylor expanded in A around -inf 13.1%

    \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
  7. Step-by-step derivation
    1. associate-*r/13.1%

      \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
    2. mul-1-neg13.1%

      \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
  8. Simplified13.1%

    \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]
  9. Final simplification13.1%

    \[\leadsto \sqrt{\frac{F}{-A}} \]
  10. Add Preprocessing

Alternative 21: 0.9% accurate, 6.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \sqrt{\frac{F}{A}} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F) :precision binary64 (sqrt (/ F A)))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	return sqrt((F / A));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = sqrt((f / a))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	return Math.sqrt((F / A));
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	return math.sqrt((F / A))
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	return sqrt(Float64(F / A))
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
	tmp = sqrt((F / A));
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := N[Sqrt[N[(F / A), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\sqrt{\frac{F}{A}}
\end{array}
Derivation
  1. Initial program 17.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. Simplified25.2%

    \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. add-sqr-sqrt6.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \cdot \sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
    2. sqrt-unprod6.0%

      \[\leadsto \color{blue}{\sqrt{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}} \]
    3. frac-times4.8%

      \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}} \]
  5. Applied egg-rr4.8%

    \[\leadsto \color{blue}{\sqrt{\frac{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}{{\left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}^{2}}}} \]
  6. Taylor expanded in A around -inf 13.1%

    \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
  7. Step-by-step derivation
    1. associate-*r/13.1%

      \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot F}{A}}} \]
    2. mul-1-neg13.1%

      \[\leadsto \sqrt{\frac{\color{blue}{-F}}{A}} \]
  8. Simplified13.1%

    \[\leadsto \sqrt{\color{blue}{\frac{-F}{A}}} \]
  9. Step-by-step derivation
    1. *-un-lft-identity13.1%

      \[\leadsto \color{blue}{1 \cdot \sqrt{\frac{-F}{A}}} \]
    2. add-sqr-sqrt6.8%

      \[\leadsto 1 \cdot \sqrt{\frac{\color{blue}{\sqrt{-F} \cdot \sqrt{-F}}}{A}} \]
    3. sqrt-unprod6.2%

      \[\leadsto 1 \cdot \sqrt{\frac{\color{blue}{\sqrt{\left(-F\right) \cdot \left(-F\right)}}}{A}} \]
    4. sqr-neg6.2%

      \[\leadsto 1 \cdot \sqrt{\frac{\sqrt{\color{blue}{F \cdot F}}}{A}} \]
    5. sqrt-unprod1.0%

      \[\leadsto 1 \cdot \sqrt{\frac{\color{blue}{\sqrt{F} \cdot \sqrt{F}}}{A}} \]
    6. add-sqr-sqrt1.1%

      \[\leadsto 1 \cdot \sqrt{\frac{\color{blue}{F}}{A}} \]
  10. Applied egg-rr1.1%

    \[\leadsto \color{blue}{1 \cdot \sqrt{\frac{F}{A}}} \]
  11. Step-by-step derivation
    1. *-lft-identity1.1%

      \[\leadsto \color{blue}{\sqrt{\frac{F}{A}}} \]
  12. Simplified1.1%

    \[\leadsto \color{blue}{\sqrt{\frac{F}{A}}} \]
  13. Final simplification1.1%

    \[\leadsto \sqrt{\frac{F}{A}} \]
  14. Add Preprocessing

Reproduce

?
herbie shell --seed 2024072 
(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))))