ABCF->ab-angle a

Percentage Accurate: 18.9% → 62.1%
Time: 28.2s
Alternatives: 16
Speedup: 5.9×

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 16 alternatives:

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

Initial Program: 18.9% accurate, 1.0× speedup?

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

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

Alternative 1: 62.1% 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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := -t\_0\\ t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t\_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_2}\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;-1 \cdot \left(\left(\sqrt{F} \cdot \sqrt{\frac{\mathsf{fma}\left(-0.5, \frac{{B\_m}^{2}}{A}, 2 \cdot C\right)}{\mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right)}}\right) \cdot \sqrt{2}\right)\\ \mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-197}:\\ \;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_1}\\ \mathbf{elif}\;t\_3 \leq 0:\\ \;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_1}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{F \cdot \left(t\_0 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (fma B_m B_m (* A (* C -4.0))))
        (t_1 (- t_0))
        (t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
        (t_3
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_2 F))
             (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0)))))))
          t_2)))
   (if (<= t_3 (- INFINITY))
     (*
      -1.0
      (*
       (*
        (sqrt F)
        (sqrt
         (/
          (fma -0.5 (/ (pow B_m 2.0) A) (* 2.0 C))
          (fma A (* C -4.0) (pow B_m 2.0)))))
       (sqrt 2.0)))
     (if (<= t_3 -1e-197)
       (/ (sqrt (* (* t_0 F) (* 2.0 (+ A (+ C (hypot B_m (- A C))))))) t_1)
       (if (<= t_3 0.0)
         (/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_1)
         (if (<= t_3 INFINITY)
           (* (sqrt (* F (* t_0 2.0))) (/ (sqrt (* 2.0 C)) t_1))
           (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = -t_0;
	double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_3 = -sqrt(((2.0 * (t_2 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = -1.0 * ((sqrt(F) * sqrt((fma(-0.5, (pow(B_m, 2.0) / A), (2.0 * C)) / fma(A, (C * -4.0), pow(B_m, 2.0))))) * sqrt(2.0));
	} else if (t_3 <= -1e-197) {
		tmp = sqrt(((t_0 * F) * (2.0 * (A + (C + hypot(B_m, (A - C))))))) / t_1;
	} else if (t_3 <= 0.0) {
		tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_1;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((F * (t_0 * 2.0))) * (sqrt((2.0 * C)) / t_1);
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(-t_0)
	t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0))))))) / t_2)
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(-1.0 * Float64(Float64(sqrt(F) * sqrt(Float64(fma(-0.5, Float64((B_m ^ 2.0) / A), Float64(2.0 * C)) / fma(A, Float64(C * -4.0), (B_m ^ 2.0))))) * sqrt(2.0)));
	elseif (t_3 <= -1e-197)
		tmp = Float64(sqrt(Float64(Float64(t_0 * F) * Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_1);
	elseif (t_3 <= 0.0)
		tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_1);
	elseif (t_3 <= Inf)
		tmp = Float64(sqrt(Float64(F * Float64(t_0 * 2.0))) * Float64(sqrt(Float64(2.0 * C)) / t_1));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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 = (-t$95$0)}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(-1.0 * N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision] / N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -1e-197], N[(N[Sqrt[N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[Sqrt[N[(F * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := -t\_0\\
t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t\_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;-1 \cdot \left(\left(\sqrt{F} \cdot \sqrt{\frac{\mathsf{fma}\left(-0.5, \frac{{B\_m}^{2}}{A}, 2 \cdot C\right)}{\mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right)}}\right) \cdot \sqrt{2}\right)\\

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

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_1}\\

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

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


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

    1. Initial program 3.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. Simplified17.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. Taylor expanded in A around -inf 18.6%

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

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

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

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

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

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

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

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

      \[\leadsto -1 \cdot \left(\color{blue}{\left(\sqrt{F} \cdot \sqrt{\frac{\mathsf{fma}\left(-0.5, \frac{{B}^{2}}{A}, 2 \cdot C\right)}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}}\right)} \cdot \sqrt{2}\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))) < -9.9999999999999999e-198

    1. Initial program 98.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. Simplified98.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

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

    1. Initial program 3.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. Simplified5.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. Taylor expanded in A around -inf 37.9%

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

      \[\leadsto \frac{\color{blue}{\sqrt{F \cdot \left(\left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right) \cdot \left(-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C\right)\right)} \cdot \sqrt{2}}}{-\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{\color{blue}{-8 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)}} \cdot \sqrt{2}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt27.3%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 58.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. Simplified85.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. associate-*r*85.7%

        \[\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+85.7%

        \[\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-undefine58.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. unpow258.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. unpow258.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. +-commutative58.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-prod65.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. *-commutative65.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*65.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+65.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-rr99.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. Step-by-step derivation
      1. associate-/l*99.3%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*99.3%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*99.3%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+99.3%

        \[\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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr99.3%

      \[\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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    8. Taylor expanded in A around -inf 38.5%

      \[\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}{2 \cdot C}}}{-\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)))

    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 B around inf 14.0%

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv14.0%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/14.1%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div22.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr22.0%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv21.9%

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

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}}\right) \]
      3. pow-flip22.0%

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \color{blue}{{B}^{\left(-0.5\right)}}\right) \]
      4. metadata-eval22.0%

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 2: 59.2% 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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := t\_0 \cdot F\\ t_2 := -t\_0\\ t_3 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_4 := \frac{-\sqrt{\left(2 \cdot \left(t\_3 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_3}\\ \mathbf{if}\;t\_4 \leq -\infty:\\ \;\;\;\;\frac{\sqrt{t\_1} \cdot \sqrt{2 \cdot \mathsf{fma}\left(C, 2, -0.5 \cdot \frac{{B\_m}^{2}}{A}\right)}}{t\_2}\\ \mathbf{elif}\;t\_4 \leq -1 \cdot 10^{-197}:\\ \;\;\;\;\frac{\sqrt{t\_1 \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_2}\\ \mathbf{elif}\;t\_4 \leq 0:\\ \;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;\sqrt{F \cdot \left(t\_0 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (fma B_m B_m (* A (* C -4.0))))
        (t_1 (* t_0 F))
        (t_2 (- t_0))
        (t_3 (- (pow B_m 2.0) (* (* 4.0 A) C)))
        (t_4
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_3 F))
             (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0)))))))
          t_3)))
   (if (<= t_4 (- INFINITY))
     (/
      (* (sqrt t_1) (sqrt (* 2.0 (fma C 2.0 (* -0.5 (/ (pow B_m 2.0) A))))))
      t_2)
     (if (<= t_4 -1e-197)
       (/ (sqrt (* t_1 (* 2.0 (+ A (+ C (hypot B_m (- A C))))))) t_2)
       (if (<= t_4 0.0)
         (/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_2)
         (if (<= t_4 INFINITY)
           (* (sqrt (* F (* t_0 2.0))) (/ (sqrt (* 2.0 C)) t_2))
           (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = t_0 * F;
	double t_2 = -t_0;
	double t_3 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_4 = -sqrt(((2.0 * (t_3 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / t_3;
	double tmp;
	if (t_4 <= -((double) INFINITY)) {
		tmp = (sqrt(t_1) * sqrt((2.0 * fma(C, 2.0, (-0.5 * (pow(B_m, 2.0) / A)))))) / t_2;
	} else if (t_4 <= -1e-197) {
		tmp = sqrt((t_1 * (2.0 * (A + (C + hypot(B_m, (A - C))))))) / t_2;
	} else if (t_4 <= 0.0) {
		tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_2;
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = sqrt((F * (t_0 * 2.0))) * (sqrt((2.0 * C)) / t_2);
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(t_0 * F)
	t_2 = Float64(-t_0)
	t_3 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_4 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_3 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0))))))) / t_3)
	tmp = 0.0
	if (t_4 <= Float64(-Inf))
		tmp = Float64(Float64(sqrt(t_1) * sqrt(Float64(2.0 * fma(C, 2.0, Float64(-0.5 * Float64((B_m ^ 2.0) / A)))))) / t_2);
	elseif (t_4 <= -1e-197)
		tmp = Float64(sqrt(Float64(t_1 * Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_2);
	elseif (t_4 <= 0.0)
		tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_2);
	elseif (t_4 <= Inf)
		tmp = Float64(sqrt(Float64(F * Float64(t_0 * 2.0))) * Float64(sqrt(Float64(2.0 * C)) / t_2));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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[(t$95$0 * F), $MachinePrecision]}, Block[{t$95$2 = (-t$95$0)}, Block[{t$95$3 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$3 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(N[Sqrt[t$95$1], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(C * 2.0 + N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, -1e-197], N[(N[Sqrt[N[(t$95$1 * N[(2.0 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, 0.0], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[Sqrt[N[(F * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := t\_0 \cdot F\\
t_2 := -t\_0\\
t_3 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_4 := \frac{-\sqrt{\left(2 \cdot \left(t\_3 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_3}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;\frac{\sqrt{t\_1} \cdot \sqrt{2 \cdot \mathsf{fma}\left(C, 2, -0.5 \cdot \frac{{B\_m}^{2}}{A}\right)}}{t\_2}\\

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

\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\

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

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


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

    1. Initial program 3.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. Simplified17.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. Taylor expanded in A around -inf 18.6%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F} \cdot \sqrt{2 \cdot \mathsf{fma}\left(C, 2, -0.5 \cdot \frac{{B}^{2}}{A}\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))) < -9.9999999999999999e-198

    1. Initial program 98.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. Simplified98.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

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

    1. Initial program 3.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. Simplified5.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. Taylor expanded in A around -inf 37.9%

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

      \[\leadsto \frac{\color{blue}{\sqrt{F \cdot \left(\left(-4 \cdot \left(A \cdot C\right) + {B}^{2}\right) \cdot \left(-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C\right)\right)} \cdot \sqrt{2}}}{-\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{\color{blue}{-8 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)}} \cdot \sqrt{2}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt27.3%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 58.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. Simplified85.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. associate-*r*85.7%

        \[\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+85.7%

        \[\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-undefine58.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. unpow258.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. unpow258.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. +-commutative58.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-prod65.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. *-commutative65.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*65.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+65.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-rr99.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. Step-by-step derivation
      1. associate-/l*99.3%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*99.3%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*99.3%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+99.3%

        \[\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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr99.3%

      \[\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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    8. Taylor expanded in A around -inf 38.5%

      \[\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}{2 \cdot C}}}{-\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)))

    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 B around inf 14.0%

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv14.0%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/14.1%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div22.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr22.0%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv21.9%

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

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}}\right) \]
      3. pow-flip22.0%

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \color{blue}{{B}^{\left(-0.5\right)}}\right) \]
      4. metadata-eval22.0%

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 3: 50.9% accurate, 0.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 := -1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\ t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_2 := -t\_1\\ t_3 := t\_1 \cdot F\\ t_4 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\ t_5 := 2 \cdot t\_4\\ t_6 := \frac{\sqrt{t\_3 \cdot t\_5}}{t\_2}\\ t_7 := \sqrt{F \cdot \left(t\_1 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_2}\\ \mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\ \;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-205}:\\ \;\;\;\;t\_7\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-100}:\\ \;\;\;\;t\_6\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-72}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;{B\_m}^{2} \leq 5000000:\\ \;\;\;\;t\_7\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\ \;\;\;\;-1 \cdot \left(\sqrt{\frac{F \cdot t\_4}{-4 \cdot \left(A \cdot C\right) + {B\_m}^{2}}} \cdot \sqrt{2}\right)\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+139}:\\ \;\;\;\;\frac{\sqrt{t\_3 \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_2}\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+195}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+220}:\\ \;\;\;\;t\_6\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+235}:\\ \;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(C + \sqrt{{B\_m}^{2} + {C}^{2}}\right)}\right)\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+261}:\\ \;\;\;\;\frac{\sqrt{\left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right) + {B\_m}^{2} \cdot F\right) \cdot t\_5}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0))))
        (t_1 (fma B_m B_m (* A (* C -4.0))))
        (t_2 (- t_1))
        (t_3 (* t_1 F))
        (t_4 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))
        (t_5 (* 2.0 t_4))
        (t_6 (/ (sqrt (* t_3 t_5)) t_2))
        (t_7 (* (sqrt (* F (* t_1 2.0))) (/ (sqrt (* 2.0 C)) t_2))))
   (if (<= (pow B_m 2.0) 2e-303)
     (/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_2)
     (if (<= (pow B_m 2.0) 2e-205)
       t_7
       (if (<= (pow B_m 2.0) 1e-100)
         t_6
         (if (<= (pow B_m 2.0) 1e-72)
           t_0
           (if (<= (pow B_m 2.0) 5000000.0)
             t_7
             (if (<= (pow B_m 2.0) 5e+24)
               (*
                -1.0
                (*
                 (sqrt (/ (* F t_4) (+ (* -4.0 (* A C)) (pow B_m 2.0))))
                 (sqrt 2.0)))
               (if (<= (pow B_m 2.0) 5e+139)
                 (/ (sqrt (* t_3 (* 2.0 (+ A (+ C (hypot B_m (- A C))))))) t_2)
                 (if (<= (pow B_m 2.0) 2e+195)
                   t_0
                   (if (<= (pow B_m 2.0) 4e+220)
                     t_6
                     (if (<= (pow B_m 2.0) 2e+235)
                       (*
                        -1.0
                        (*
                         (/ (sqrt 2.0) B_m)
                         (sqrt
                          (* F (+ C (sqrt (+ (pow B_m 2.0) (pow C 2.0))))))))
                       (if (<= (pow B_m 2.0) 2e+261)
                         (/
                          (sqrt
                           (*
                            (+ (* -4.0 (* A (* C F))) (* (pow B_m 2.0) F))
                            t_5))
                          t_2)
                         (*
                          -1.0
                          (* (sqrt (* F 2.0)) (pow 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 t_0 = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_2 = -t_1;
	double t_3 = t_1 * F;
	double t_4 = (-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C);
	double t_5 = 2.0 * t_4;
	double t_6 = sqrt((t_3 * t_5)) / t_2;
	double t_7 = sqrt((F * (t_1 * 2.0))) * (sqrt((2.0 * C)) / t_2);
	double tmp;
	if (pow(B_m, 2.0) <= 2e-303) {
		tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_2;
	} else if (pow(B_m, 2.0) <= 2e-205) {
		tmp = t_7;
	} else if (pow(B_m, 2.0) <= 1e-100) {
		tmp = t_6;
	} else if (pow(B_m, 2.0) <= 1e-72) {
		tmp = t_0;
	} else if (pow(B_m, 2.0) <= 5000000.0) {
		tmp = t_7;
	} else if (pow(B_m, 2.0) <= 5e+24) {
		tmp = -1.0 * (sqrt(((F * t_4) / ((-4.0 * (A * C)) + pow(B_m, 2.0)))) * sqrt(2.0));
	} else if (pow(B_m, 2.0) <= 5e+139) {
		tmp = sqrt((t_3 * (2.0 * (A + (C + hypot(B_m, (A - C))))))) / t_2;
	} else if (pow(B_m, 2.0) <= 2e+195) {
		tmp = t_0;
	} else if (pow(B_m, 2.0) <= 4e+220) {
		tmp = t_6;
	} else if (pow(B_m, 2.0) <= 2e+235) {
		tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (C + sqrt((pow(B_m, 2.0) + pow(C, 2.0)))))));
	} else if (pow(B_m, 2.0) <= 2e+261) {
		tmp = sqrt((((-4.0 * (A * (C * F))) + (pow(B_m, 2.0) * F)) * t_5)) / t_2;
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0)))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_2 = Float64(-t_1)
	t_3 = Float64(t_1 * F)
	t_4 = Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))
	t_5 = Float64(2.0 * t_4)
	t_6 = Float64(sqrt(Float64(t_3 * t_5)) / t_2)
	t_7 = Float64(sqrt(Float64(F * Float64(t_1 * 2.0))) * Float64(sqrt(Float64(2.0 * C)) / t_2))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e-303)
		tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_2);
	elseif ((B_m ^ 2.0) <= 2e-205)
		tmp = t_7;
	elseif ((B_m ^ 2.0) <= 1e-100)
		tmp = t_6;
	elseif ((B_m ^ 2.0) <= 1e-72)
		tmp = t_0;
	elseif ((B_m ^ 2.0) <= 5000000.0)
		tmp = t_7;
	elseif ((B_m ^ 2.0) <= 5e+24)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(Float64(F * t_4) / Float64(Float64(-4.0 * Float64(A * C)) + (B_m ^ 2.0)))) * sqrt(2.0)));
	elseif ((B_m ^ 2.0) <= 5e+139)
		tmp = Float64(sqrt(Float64(t_3 * Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_2);
	elseif ((B_m ^ 2.0) <= 2e+195)
		tmp = t_0;
	elseif ((B_m ^ 2.0) <= 4e+220)
		tmp = t_6;
	elseif ((B_m ^ 2.0) <= 2e+235)
		tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(C + sqrt(Float64((B_m ^ 2.0) + (C ^ 2.0))))))));
	elseif ((B_m ^ 2.0) <= 2e+261)
		tmp = Float64(sqrt(Float64(Float64(Float64(-4.0 * Float64(A * Float64(C * F))) + Float64((B_m ^ 2.0) * F)) * t_5)) / t_2);
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-t$95$1)}, Block[{t$95$3 = N[(t$95$1 * F), $MachinePrecision]}, Block[{t$95$4 = N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(2.0 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[Sqrt[N[(t$95$3 * t$95$5), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$7 = N[(N[Sqrt[N[(F * N[(t$95$1 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-303], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-205], t$95$7, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], t$95$6, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-72], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5000000.0], t$95$7, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+24], N[(-1.0 * N[(N[Sqrt[N[(N[(F * t$95$4), $MachinePrecision] / N[(N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+139], N[(N[Sqrt[N[(t$95$3 * N[(2.0 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+195], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+220], t$95$6, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+235], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(C + N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[C, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+261], N[(N[Sqrt[N[(N[(N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[B$95$m, 2.0], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * t$95$5), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := -1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := -t\_1\\
t_3 := t\_1 \cdot F\\
t_4 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\
t_5 := 2 \cdot t\_4\\
t_6 := \frac{\sqrt{t\_3 \cdot t\_5}}{t\_2}\\
t_7 := \sqrt{F \cdot \left(t\_1 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_2}\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\

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

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;t\_6\\

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

\mathbf{elif}\;{B\_m}^{2} \leq 5000000:\\
\;\;\;\;t\_7\\

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

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

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

\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+220}:\\
\;\;\;\;t\_6\\

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

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

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


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

    1. Initial program 13.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. Simplified23.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. Taylor expanded in A around -inf 25.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999986e-303 < (pow.f64 B #s(literal 2 binary64)) < 2e-205 or 9.9999999999999997e-73 < (pow.f64 B #s(literal 2 binary64)) < 5e6

    1. Initial program 37.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. Simplified45.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. associate-*r*45.9%

        \[\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+45.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 \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-undefine37.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. unpow237.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. unpow237.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. +-commutative37.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-prod42.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. *-commutative42.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*42.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+42.9%

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

      \[\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. Step-by-step derivation
      1. associate-/l*65.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*65.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*65.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+64.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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr64.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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    8. Taylor expanded in A around -inf 24.5%

      \[\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}{2 \cdot C}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 2e-205 < (pow.f64 B #s(literal 2 binary64)) < 1e-100 or 1.99999999999999995e195 < (pow.f64 B #s(literal 2 binary64)) < 4e220

    1. Initial program 42.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. Simplified46.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. Taylor expanded in A around -inf 36.3%

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

    if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999997e-73 or 5.0000000000000003e139 < (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999995e195

    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.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. Taylor expanded in A around -inf 18.1%

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

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

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

    if 5e6 < (pow.f64 B #s(literal 2 binary64)) < 5.00000000000000045e24

    1. Initial program 3.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. Simplified0.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. Taylor expanded in A around -inf 3.9%

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

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

    if 5.00000000000000045e24 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e139

    1. Initial program 43.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. Simplified50.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

    if 4e220 < (pow.f64 B #s(literal 2 binary64)) < 2.0000000000000001e235

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

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

    if 2.0000000000000001e235 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e261

    1. Initial program 0.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. Simplified4.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. Taylor expanded in A around -inf 20.1%

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

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

    if 1.9999999999999999e261 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/26.1%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr40.1%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv39.9%

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 9 regimes into one program.
  4. Add Preprocessing

Alternative 4: 55.0% accurate, 0.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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := -t\_0\\ t_2 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\ t_3 := \sqrt{F \cdot \left(t\_0 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_1}\\ \mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\ \;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-205}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-100}:\\ \;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot t\_2\right)}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-72}:\\ \;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\ \mathbf{elif}\;{B\_m}^{2} \leq 5000000:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\ \;\;\;\;-1 \cdot \left(\sqrt{\frac{F \cdot t\_2}{-4 \cdot \left(A \cdot C\right) + {B\_m}^{2}}} \cdot \sqrt{2}\right)\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+234}:\\ \;\;\;\;\left(\left(B\_m \cdot \sqrt{2}\right) \cdot \sqrt{F}\right) \cdot \frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (fma B_m B_m (* A (* C -4.0))))
        (t_1 (- t_0))
        (t_2 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))
        (t_3 (* (sqrt (* F (* t_0 2.0))) (/ (sqrt (* 2.0 C)) t_1))))
   (if (<= (pow B_m 2.0) 2e-303)
     (/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_1)
     (if (<= (pow B_m 2.0) 2e-205)
       t_3
       (if (<= (pow B_m 2.0) 1e-100)
         (/ (sqrt (* (* t_0 F) (* 2.0 t_2))) t_1)
         (if (<= (pow B_m 2.0) 1e-72)
           (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
           (if (<= (pow B_m 2.0) 5000000.0)
             t_3
             (if (<= (pow B_m 2.0) 5e+24)
               (*
                -1.0
                (*
                 (sqrt (/ (* F t_2) (+ (* -4.0 (* A C)) (pow B_m 2.0))))
                 (sqrt 2.0)))
               (if (<= (pow B_m 2.0) 5e+234)
                 (*
                  (* (* B_m (sqrt 2.0)) (sqrt F))
                  (/ (sqrt (+ (+ A C) (hypot (- A C) B_m))) t_1))
                 (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = -t_0;
	double t_2 = (-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C);
	double t_3 = sqrt((F * (t_0 * 2.0))) * (sqrt((2.0 * C)) / t_1);
	double tmp;
	if (pow(B_m, 2.0) <= 2e-303) {
		tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_1;
	} else if (pow(B_m, 2.0) <= 2e-205) {
		tmp = t_3;
	} else if (pow(B_m, 2.0) <= 1e-100) {
		tmp = sqrt(((t_0 * F) * (2.0 * t_2))) / t_1;
	} else if (pow(B_m, 2.0) <= 1e-72) {
		tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	} else if (pow(B_m, 2.0) <= 5000000.0) {
		tmp = t_3;
	} else if (pow(B_m, 2.0) <= 5e+24) {
		tmp = -1.0 * (sqrt(((F * t_2) / ((-4.0 * (A * C)) + pow(B_m, 2.0)))) * sqrt(2.0));
	} else if (pow(B_m, 2.0) <= 5e+234) {
		tmp = ((B_m * sqrt(2.0)) * sqrt(F)) * (sqrt(((A + C) + hypot((A - C), B_m))) / t_1);
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(-t_0)
	t_2 = Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))
	t_3 = Float64(sqrt(Float64(F * Float64(t_0 * 2.0))) * Float64(sqrt(Float64(2.0 * C)) / t_1))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e-303)
		tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_1);
	elseif ((B_m ^ 2.0) <= 2e-205)
		tmp = t_3;
	elseif ((B_m ^ 2.0) <= 1e-100)
		tmp = Float64(sqrt(Float64(Float64(t_0 * F) * Float64(2.0 * t_2))) / t_1);
	elseif ((B_m ^ 2.0) <= 1e-72)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0)));
	elseif ((B_m ^ 2.0) <= 5000000.0)
		tmp = t_3;
	elseif ((B_m ^ 2.0) <= 5e+24)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(Float64(F * t_2) / Float64(Float64(-4.0 * Float64(A * C)) + (B_m ^ 2.0)))) * sqrt(2.0)));
	elseif ((B_m ^ 2.0) <= 5e+234)
		tmp = Float64(Float64(Float64(B_m * sqrt(2.0)) * sqrt(F)) * Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) / t_1));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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 = (-t$95$0)}, Block[{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]}, Block[{t$95$3 = N[(N[Sqrt[N[(F * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-303], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-205], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-72], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5000000.0], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+24], N[(-1.0 * N[(N[Sqrt[N[(N[(F * t$95$2), $MachinePrecision] / N[(N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+234], N[(N[(N[(B$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := -t\_0\\
t_2 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\
t_3 := \sqrt{F \cdot \left(t\_0 \cdot 2\right)} \cdot \frac{\sqrt{2 \cdot C}}{t\_1}\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_1}\\

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

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

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

\mathbf{elif}\;{B\_m}^{2} \leq 5000000:\\
\;\;\;\;t\_3\\

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

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

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


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

    1. Initial program 13.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. Simplified23.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. Taylor expanded in A around -inf 25.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999986e-303 < (pow.f64 B #s(literal 2 binary64)) < 2e-205 or 9.9999999999999997e-73 < (pow.f64 B #s(literal 2 binary64)) < 5e6

    1. Initial program 37.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. Simplified45.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. associate-*r*45.9%

        \[\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+45.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 \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-undefine37.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. unpow237.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. unpow237.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. +-commutative37.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-prod42.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. *-commutative42.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*42.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+42.9%

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

      \[\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. Step-by-step derivation
      1. associate-/l*65.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*65.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*65.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+64.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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr64.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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    8. Taylor expanded in A around -inf 24.5%

      \[\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}{2 \cdot C}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 2e-205 < (pow.f64 B #s(literal 2 binary64)) < 1e-100

    1. Initial program 47.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. Simplified50.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. Taylor expanded in A around -inf 38.9%

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

    if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999997e-73

    1. Initial program 35.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. Simplified35.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. Taylor expanded in A around -inf 17.2%

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

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

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

    if 5e6 < (pow.f64 B #s(literal 2 binary64)) < 5.00000000000000045e24

    1. Initial program 3.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. Simplified0.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. Taylor expanded in A around -inf 3.9%

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

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

    if 5.00000000000000045e24 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e234

    1. Initial program 33.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. Simplified39.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. associate-*r*39.7%

        \[\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+38.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-undefine33.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. unpow233.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. unpow233.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. +-commutative33.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-prod36.8%

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

        \[\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*36.8%

        \[\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+36.9%

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

      \[\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. Step-by-step derivation
      1. associate-/l*45.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*45.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*45.6%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+45.3%

        \[\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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr45.3%

      \[\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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    8. Taylor expanded in B around inf 27.6%

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

    if 5.0000000000000003e234 < (pow.f64 B #s(literal 2 binary64))

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv24.0%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/24.2%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div37.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr37.0%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv36.9%

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 7 regimes into one program.
  4. Add Preprocessing

Alternative 5: 56.0% accurate, 0.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_1 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\ t_2 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_3 := -t\_2\\ t_4 := \mathsf{hypot}\left(A - C, B\_m\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\ \;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_3}\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-170}:\\ \;\;\;\;\sqrt{F \cdot \left(t\_2 \cdot 2\right)} \cdot \frac{\sqrt{t\_1}}{t\_3}\\ \mathbf{elif}\;{B\_m}^{2} \leq 5000000:\\ \;\;\;\;\frac{\sqrt{\left(F \cdot \mathsf{fma}\left(B\_m, B\_m, \left(A \cdot C\right) \cdot -4\right)\right) \cdot 2} \cdot \sqrt{A + \left(C + t\_4\right)}}{t\_3}\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+46}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot t\_1}}{t\_0}\\ \mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+189}:\\ \;\;\;\;\left(\left(B\_m \cdot \sqrt{2}\right) \cdot \sqrt{F}\right) \cdot \frac{\sqrt{\left(A + C\right) + t\_4}}{t\_3}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (- (pow B_m 2.0) (* (* 4.0 A) C)))
        (t_1 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))
        (t_2 (fma B_m B_m (* A (* C -4.0))))
        (t_3 (- t_2))
        (t_4 (hypot (- A C) B_m)))
   (if (<= (pow B_m 2.0) 2e-303)
     (/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_3)
     (if (<= (pow B_m 2.0) 2e-170)
       (* (sqrt (* F (* t_2 2.0))) (/ (sqrt t_1) t_3))
       (if (<= (pow B_m 2.0) 5000000.0)
         (/
          (*
           (sqrt (* (* F (fma B_m B_m (* (* A C) -4.0))) 2.0))
           (sqrt (+ A (+ C t_4))))
          t_3)
         (if (<= (pow B_m 2.0) 5e+46)
           (/ (- (sqrt (* (* 2.0 (* t_0 F)) t_1))) t_0)
           (if (<= (pow B_m 2.0) 4e+189)
             (* (* (* B_m (sqrt 2.0)) (sqrt F)) (/ (sqrt (+ (+ A C) t_4)) t_3))
             (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_1 = (-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C);
	double t_2 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_3 = -t_2;
	double t_4 = hypot((A - C), B_m);
	double tmp;
	if (pow(B_m, 2.0) <= 2e-303) {
		tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_3;
	} else if (pow(B_m, 2.0) <= 2e-170) {
		tmp = sqrt((F * (t_2 * 2.0))) * (sqrt(t_1) / t_3);
	} else if (pow(B_m, 2.0) <= 5000000.0) {
		tmp = (sqrt(((F * fma(B_m, B_m, ((A * C) * -4.0))) * 2.0)) * sqrt((A + (C + t_4)))) / t_3;
	} else if (pow(B_m, 2.0) <= 5e+46) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * t_1)) / t_0;
	} else if (pow(B_m, 2.0) <= 4e+189) {
		tmp = ((B_m * sqrt(2.0)) * sqrt(F)) * (sqrt(((A + C) + t_4)) / t_3);
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_1 = Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))
	t_2 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_3 = Float64(-t_2)
	t_4 = hypot(Float64(A - C), B_m)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e-303)
		tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_3);
	elseif ((B_m ^ 2.0) <= 2e-170)
		tmp = Float64(sqrt(Float64(F * Float64(t_2 * 2.0))) * Float64(sqrt(t_1) / t_3));
	elseif ((B_m ^ 2.0) <= 5000000.0)
		tmp = Float64(Float64(sqrt(Float64(Float64(F * fma(B_m, B_m, Float64(Float64(A * C) * -4.0))) * 2.0)) * sqrt(Float64(A + Float64(C + t_4)))) / t_3);
	elseif ((B_m ^ 2.0) <= 5e+46)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * t_1))) / t_0);
	elseif ((B_m ^ 2.0) <= 4e+189)
		tmp = Float64(Float64(Float64(B_m * sqrt(2.0)) * sqrt(F)) * Float64(sqrt(Float64(Float64(A + C) + t_4)) / t_3));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = (-t$95$2)}, Block[{t$95$4 = N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-303], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-170], N[(N[Sqrt[N[(F * N[(t$95$2 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[t$95$1], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5000000.0], N[(N[(N[Sqrt[N[(N[(F * N[(B$95$m * B$95$m + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A + N[(C + t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+46], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+189], N[(N[(N[(B$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_1 := -0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\\
t_2 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_3 := -t\_2\\
t_4 := \mathsf{hypot}\left(A - C, B\_m\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_3}\\

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

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

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

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

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


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

    1. Initial program 13.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. Simplified23.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. Taylor expanded in A around -inf 25.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999986e-303 < (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999997e-170

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

      \[\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*49.1%

        \[\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+47.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 \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-undefine37.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. unpow237.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. unpow237.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. +-commutative37.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-prod40.6%

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

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

        \[\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+42.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-rr55.9%

      \[\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. Step-by-step derivation
      1. associate-/l*56.2%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*56.2%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*56.2%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+54.2%

        \[\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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr54.2%

      \[\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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    8. Taylor expanded in A around -inf 25.1%

      \[\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}{-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 1.99999999999999997e-170 < (pow.f64 B #s(literal 2 binary64)) < 5e6

    1. Initial program 41.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. Simplified42.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. associate-*r*42.9%

        \[\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+41.7%

        \[\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-undefine41.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. unpow241.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. unpow241.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. +-commutative41.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-prod44.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. *-commutative44.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*44.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+44.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-rr61.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)} \]

    if 5e6 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000002e46

    1. Initial program 29.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 A around -inf 23.8%

      \[\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 5.0000000000000002e46 < (pow.f64 B #s(literal 2 binary64)) < 4.0000000000000001e189

    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. Simplified42.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*42.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+42.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-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-prod39.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. *-commutative39.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*39.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+39.8%

        \[\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. Step-by-step derivation
      1. associate-/l*52.2%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*52.2%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*52.2%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+52.1%

        \[\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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr52.1%

      \[\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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    8. Taylor expanded in B around inf 29.8%

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

    if 4.0000000000000001e189 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 5.3%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv23.5%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/23.6%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div35.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr35.0%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv34.9%

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 6 regimes into one program.
  4. Add Preprocessing

Alternative 6: 50.3% accurate, 0.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := -1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\ t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_2 := -t\_1\\ \mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\ \;\;\;\;\frac{\sqrt{\left(t\_1 \cdot F\right) \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{t\_2}\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+139}:\\ \;\;\;\;-\frac{\sqrt{{B\_m}^{2} \cdot \left(F \cdot \left(2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+195}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+220}:\\ \;\;\;\;\frac{\sqrt{\left({B\_m}^{2} \cdot F\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)\right)}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0))))
        (t_1 (fma B_m B_m (* A (* C -4.0))))
        (t_2 (- t_1)))
   (if (<= (pow B_m 2.0) 1e-100)
     (/ (sqrt (* (* t_1 F) (* 2.0 (* 2.0 C)))) t_2)
     (if (<= (pow B_m 2.0) 5e+24)
       t_0
       (if (<= (pow B_m 2.0) 5e+139)
         (-
          (/
           (sqrt
            (* (pow B_m 2.0) (* F (* 2.0 (+ (+ A C) (hypot B_m (- A C)))))))
           t_1))
         (if (<= (pow B_m 2.0) 2e+195)
           t_0
           (if (<= (pow B_m 2.0) 4e+220)
             (/
              (sqrt
               (*
                (* (pow B_m 2.0) F)
                (* 2.0 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))))
              t_2)
             (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_2 = -t_1;
	double tmp;
	if (pow(B_m, 2.0) <= 1e-100) {
		tmp = sqrt(((t_1 * F) * (2.0 * (2.0 * C)))) / t_2;
	} else if (pow(B_m, 2.0) <= 5e+24) {
		tmp = t_0;
	} else if (pow(B_m, 2.0) <= 5e+139) {
		tmp = -(sqrt((pow(B_m, 2.0) * (F * (2.0 * ((A + C) + hypot(B_m, (A - C))))))) / t_1);
	} else if (pow(B_m, 2.0) <= 2e+195) {
		tmp = t_0;
	} else if (pow(B_m, 2.0) <= 4e+220) {
		tmp = sqrt(((pow(B_m, 2.0) * F) * (2.0 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C))))) / t_2;
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0)))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_2 = Float64(-t_1)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-100)
		tmp = Float64(sqrt(Float64(Float64(t_1 * F) * Float64(2.0 * Float64(2.0 * C)))) / t_2);
	elseif ((B_m ^ 2.0) <= 5e+24)
		tmp = t_0;
	elseif ((B_m ^ 2.0) <= 5e+139)
		tmp = Float64(-Float64(sqrt(Float64((B_m ^ 2.0) * Float64(F * Float64(2.0 * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))))) / t_1));
	elseif ((B_m ^ 2.0) <= 2e+195)
		tmp = t_0;
	elseif ((B_m ^ 2.0) <= 4e+220)
		tmp = Float64(sqrt(Float64(Float64((B_m ^ 2.0) * F) * Float64(2.0 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))))) / t_2);
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-t$95$1)}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(N[(t$95$1 * F), $MachinePrecision] * N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+24], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+139], (-N[(N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] * N[(F * N[(2.0 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+195], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+220], N[(N[Sqrt[N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] * F), $MachinePrecision] * N[(2.0 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := -1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := -t\_1\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{\left(t\_1 \cdot F\right) \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{t\_2}\\

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\

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

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

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

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


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

    1. Initial program 23.7%

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

      \[\leadsto \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \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)} \]

    if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 5.00000000000000045e24 or 5.0000000000000003e139 < (pow.f64 B #s(literal 2 binary64)) < 1.99999999999999995e195

    1. Initial program 24.8%

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

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

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

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

    if 5.00000000000000045e24 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e139

    1. Initial program 43.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. Simplified50.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. Taylor expanded in B around inf 47.3%

      \[\leadsto \frac{\sqrt{\color{blue}{\left({B}^{2} \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)} \]
    5. Step-by-step derivation
      1. distribute-frac-neg247.3%

        \[\leadsto \color{blue}{-\frac{\sqrt{\left({B}^{2} \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. associate-*l*47.0%

        \[\leadsto -\frac{\sqrt{\color{blue}{{B}^{2} \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)} \]
      3. associate-+r+47.4%

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

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

    if 1.99999999999999995e195 < (pow.f64 B #s(literal 2 binary64)) < 4e220

    1. Initial program 26.7%

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

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

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

    if 4e220 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 4.2%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv25.0%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/25.1%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div37.4%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr37.4%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv37.3%

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

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}}\right) \]
      3. pow-flip37.5%

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \color{blue}{{B}^{\left(-0.5\right)}}\right) \]
      4. metadata-eval37.5%

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 7: 55.3% accurate, 0.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := \sqrt{F \cdot \left(t\_0 \cdot 2\right)}\\ t_2 := -t\_0\\ \mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\ \;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{-272}:\\ \;\;\;\;t\_1 \cdot \left(0.25 \cdot \left(\frac{\sqrt{2}}{A} \cdot \sqrt{\frac{1}{C}}\right)\right)\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-245}:\\ \;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\ \mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+82}:\\ \;\;\;\;t\_1 \cdot \frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (fma B_m B_m (* A (* C -4.0))))
        (t_1 (sqrt (* F (* t_0 2.0))))
        (t_2 (- t_0)))
   (if (<= (pow B_m 2.0) 2e-303)
     (/ (* (fabs (* (sqrt (* -8.0 A)) (* C (sqrt F)))) (sqrt 2.0)) t_2)
     (if (<= (pow B_m 2.0) 1e-272)
       (* t_1 (* 0.25 (* (/ (sqrt 2.0) A) (sqrt (/ 1.0 C)))))
       (if (<= (pow B_m 2.0) 2e-245)
         (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
         (if (<= (pow B_m 2.0) 4e+82)
           (* t_1 (/ (sqrt (+ (+ A C) (hypot (- A C) B_m))) t_2))
           (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = sqrt((F * (t_0 * 2.0)));
	double t_2 = -t_0;
	double tmp;
	if (pow(B_m, 2.0) <= 2e-303) {
		tmp = (fabs((sqrt((-8.0 * A)) * (C * sqrt(F)))) * sqrt(2.0)) / t_2;
	} else if (pow(B_m, 2.0) <= 1e-272) {
		tmp = t_1 * (0.25 * ((sqrt(2.0) / A) * sqrt((1.0 / C))));
	} else if (pow(B_m, 2.0) <= 2e-245) {
		tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	} else if (pow(B_m, 2.0) <= 4e+82) {
		tmp = t_1 * (sqrt(((A + C) + hypot((A - C), B_m))) / t_2);
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = sqrt(Float64(F * Float64(t_0 * 2.0)))
	t_2 = Float64(-t_0)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e-303)
		tmp = Float64(Float64(abs(Float64(sqrt(Float64(-8.0 * A)) * Float64(C * sqrt(F)))) * sqrt(2.0)) / t_2);
	elseif ((B_m ^ 2.0) <= 1e-272)
		tmp = Float64(t_1 * Float64(0.25 * Float64(Float64(sqrt(2.0) / A) * sqrt(Float64(1.0 / C)))));
	elseif ((B_m ^ 2.0) <= 2e-245)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0)));
	elseif ((B_m ^ 2.0) <= 4e+82)
		tmp = Float64(t_1 * Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) / t_2));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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[Sqrt[N[(F * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = (-t$95$0)}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-303], N[(N[(N[Abs[N[(N[Sqrt[N[(-8.0 * A), $MachinePrecision]], $MachinePrecision] * N[(C * N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-272], N[(t$95$1 * N[(0.25 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / A), $MachinePrecision] * N[Sqrt[N[(1.0 / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-245], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+82], N[(t$95$1 * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \sqrt{F \cdot \left(t\_0 \cdot 2\right)}\\
t_2 := -t\_0\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\frac{\left|\sqrt{-8 \cdot A} \cdot \left(C \cdot \sqrt{F}\right)\right| \cdot \sqrt{2}}{t\_2}\\

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-272}:\\
\;\;\;\;t\_1 \cdot \left(0.25 \cdot \left(\frac{\sqrt{2}}{A} \cdot \sqrt{\frac{1}{C}}\right)\right)\\

\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-245}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\

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

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


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

    1. Initial program 13.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. Simplified23.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. Taylor expanded in A around -inf 25.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999986e-303 < (pow.f64 B #s(literal 2 binary64)) < 9.9999999999999993e-273

    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. Simplified53.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*53.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+52.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 \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-prod42.6%

        \[\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. *-commutative42.6%

        \[\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*42.6%

        \[\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+44.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-rr69.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. Step-by-step derivation
      1. associate-/l*70.0%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*70.0%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*70.0%

        \[\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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+67.2%

        \[\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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr67.2%

      \[\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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    8. Taylor expanded in A around -inf 17.9%

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

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

    1. Initial program 1.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. Simplified5.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. Taylor expanded in A around -inf 24.6%

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

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

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

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

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

      \[\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*47.1%

        \[\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+46.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-undefine41.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. unpow241.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. unpow241.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. +-commutative41.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-prod43.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. *-commutative43.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*43.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+43.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-rr57.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. Step-by-step derivation
      1. associate-/l*57.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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*57.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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. associate-*r*57.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{A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. associate-+r+57.0%

        \[\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}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr57.0%

      \[\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{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]

    if 3.9999999999999999e82 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 10.9%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv23.5%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/23.7%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div32.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr32.3%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv32.2%

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 8: 51.8% accurate, 0.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := -t\_0\\ t_2 := t\_0 \cdot F\\ \mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\ \;\;\;\;\frac{\sqrt{t\_2 \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\ \;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+139}:\\ \;\;\;\;\frac{\sqrt{t\_2 \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+171}:\\ \;\;\;\;-1 \cdot \left(\sqrt{\frac{F \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}{-4 \cdot \left(A \cdot C\right) + {B\_m}^{2}}} \cdot \sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (fma B_m B_m (* A (* C -4.0)))) (t_1 (- t_0)) (t_2 (* t_0 F)))
   (if (<= (pow B_m 2.0) 1e-100)
     (/ (sqrt (* t_2 (* 2.0 (* 2.0 C)))) t_1)
     (if (<= (pow B_m 2.0) 5e+24)
       (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
       (if (<= (pow B_m 2.0) 5e+139)
         (/ (sqrt (* t_2 (* 2.0 (+ A (+ C (hypot B_m (- A C))))))) t_1)
         (if (<= (pow B_m 2.0) 5e+171)
           (*
            -1.0
            (*
             (sqrt
              (/
               (* F (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))
               (+ (* -4.0 (* A C)) (pow B_m 2.0))))
             (sqrt 2.0)))
           (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = -t_0;
	double t_2 = t_0 * F;
	double tmp;
	if (pow(B_m, 2.0) <= 1e-100) {
		tmp = sqrt((t_2 * (2.0 * (2.0 * C)))) / t_1;
	} else if (pow(B_m, 2.0) <= 5e+24) {
		tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	} else if (pow(B_m, 2.0) <= 5e+139) {
		tmp = sqrt((t_2 * (2.0 * (A + (C + hypot(B_m, (A - C))))))) / t_1;
	} else if (pow(B_m, 2.0) <= 5e+171) {
		tmp = -1.0 * (sqrt(((F * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C))) / ((-4.0 * (A * C)) + pow(B_m, 2.0)))) * sqrt(2.0));
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(-t_0)
	t_2 = Float64(t_0 * F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-100)
		tmp = Float64(sqrt(Float64(t_2 * Float64(2.0 * Float64(2.0 * C)))) / t_1);
	elseif ((B_m ^ 2.0) <= 5e+24)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0)));
	elseif ((B_m ^ 2.0) <= 5e+139)
		tmp = Float64(sqrt(Float64(t_2 * Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_1);
	elseif ((B_m ^ 2.0) <= 5e+171)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(Float64(F * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))) / Float64(Float64(-4.0 * Float64(A * C)) + (B_m ^ 2.0)))) * sqrt(2.0)));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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 = (-t$95$0)}, Block[{t$95$2 = N[(t$95$0 * F), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(t$95$2 * N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+24], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+139], N[(N[Sqrt[N[(t$95$2 * N[(2.0 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+171], N[(-1.0 * N[(N[Sqrt[N[(N[(F * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := -t\_0\\
t_2 := t\_0 \cdot F\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{t\_1}\\

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+24}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\

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

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

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


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

    1. Initial program 23.7%

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

      \[\leadsto \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \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)} \]

    if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 5.00000000000000045e24

    1. Initial program 32.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. Simplified32.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. Taylor expanded in A around -inf 10.6%

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

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

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

    if 5.00000000000000045e24 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000003e139

    1. Initial program 43.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. Simplified50.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

    if 5.0000000000000003e139 < (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000004e171

    1. Initial program 3.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. Simplified3.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. Taylor expanded in A around -inf 29.3%

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

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

    if 5.0000000000000004e171 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 7.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/24.0%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div34.4%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr34.4%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv34.3%

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 9: 51.0% 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)\\ \mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\ \;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)\right)}}{-t\_0}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{+49}:\\ \;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 1e-100)
     (/
      (sqrt (* (* t_0 F) (* 2.0 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))))
      (- t_0))
     (if (<= (pow B_m 2.0) 1e+49)
       (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
       (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 1e-100) {
		tmp = sqrt(((t_0 * F) * (2.0 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C))))) / -t_0;
	} else if (pow(B_m, 2.0) <= 1e+49) {
		tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-100)
		tmp = Float64(sqrt(Float64(Float64(t_0 * F) * Float64(2.0 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))))) / Float64(-t_0));
	elseif ((B_m ^ 2.0) <= 1e+49)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0)));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+49], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)\right)}}{-t\_0}\\

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

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


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

    1. Initial program 23.7%

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

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

    if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999946e48

    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. Simplified35.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. Taylor expanded in A around -inf 18.6%

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

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

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

    if 9.99999999999999946e48 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 14.2%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv21.8%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/21.9%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div30.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr30.3%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv30.2%

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

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

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \color{blue}{{B}^{\left(-0.5\right)}}\right) \]
      4. metadata-eval30.3%

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 51.5% 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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\ \;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{-t\_0}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{+49}:\\ \;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 1e-100)
     (/ (sqrt (* (* t_0 F) (* 2.0 (* 2.0 C)))) (- t_0))
     (if (<= (pow B_m 2.0) 1e+49)
       (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
       (* -1.0 (* (sqrt (* F 2.0)) (pow 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 t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 1e-100) {
		tmp = sqrt(((t_0 * F) * (2.0 * (2.0 * C)))) / -t_0;
	} else if (pow(B_m, 2.0) <= 1e+49) {
		tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-100)
		tmp = Float64(sqrt(Float64(Float64(t_0 * F) * Float64(2.0 * Float64(2.0 * C)))) / Float64(-t_0));
	elseif ((B_m ^ 2.0) <= 1e+49)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0)));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	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]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-100], N[(N[Sqrt[N[(N[(t$95$0 * F), $MachinePrecision] * N[(2.0 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+49], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-100}:\\
\;\;\;\;\frac{\sqrt{\left(t\_0 \cdot F\right) \cdot \left(2 \cdot \left(2 \cdot C\right)\right)}}{-t\_0}\\

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

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


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

    1. Initial program 23.7%

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

      \[\leadsto \frac{\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \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)} \]

    if 1e-100 < (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999946e48

    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. Simplified35.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. Taylor expanded in A around -inf 18.6%

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

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

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

    if 9.99999999999999946e48 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 14.2%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv21.8%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/21.9%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div30.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr30.3%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv30.2%

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

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

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \color{blue}{{B}^{\left(-0.5\right)}}\right) \]
      4. metadata-eval30.3%

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 11: 47.6% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;{B\_m}^{2} \leq 10^{+49}:\\ \;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\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+49)
   (* -1.0 (* (sqrt (* -0.5 (/ F A))) (sqrt 2.0)))
   (* -1.0 (* (sqrt (* F 2.0)) (pow 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 (pow(B_m, 2.0) <= 1e+49) {
		tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	} else {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(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 ((b_m ** 2.0d0) <= 1d+49) then
        tmp = (-1.0d0) * (sqrt(((-0.5d0) * (f / a))) * sqrt(2.0d0))
    else
        tmp = (-1.0d0) * (sqrt((f * 2.0d0)) * (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 (Math.pow(B_m, 2.0) <= 1e+49) {
		tmp = -1.0 * (Math.sqrt((-0.5 * (F / A))) * Math.sqrt(2.0));
	} else {
		tmp = -1.0 * (Math.sqrt((F * 2.0)) * Math.pow(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 math.pow(B_m, 2.0) <= 1e+49:
		tmp = -1.0 * (math.sqrt((-0.5 * (F / A))) * math.sqrt(2.0))
	else:
		tmp = -1.0 * (math.sqrt((F * 2.0)) * math.pow(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 ((B_m ^ 2.0) <= 1e+49)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(-0.5 * Float64(F / A))) * sqrt(2.0)));
	else
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (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 ((B_m ^ 2.0) <= 1e+49)
		tmp = -1.0 * (sqrt((-0.5 * (F / A))) * sqrt(2.0));
	else
		tmp = -1.0 * (sqrt((F * 2.0)) * (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[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+49], N[(-1.0 * N[(N[Sqrt[N[(-0.5 * N[(F / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $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^{+49}:\\
\;\;\;\;-1 \cdot \left(\sqrt{-0.5 \cdot \frac{F}{A}} \cdot \sqrt{2}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999946e48

    1. Initial program 26.7%

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

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

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

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

    if 9.99999999999999946e48 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 14.2%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\color{blue}{\sqrt{F \cdot \frac{1}{B}}} \cdot \sqrt{2}\right) \]
      3. div-inv21.8%

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/21.9%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\frac{F \cdot 2}{B}}} \]
      6. sqrt-div30.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr30.3%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv30.2%

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

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

        \[\leadsto -1 \cdot \left(\sqrt{F \cdot 2} \cdot \color{blue}{{B}^{\left(-0.5\right)}}\right) \]
      4. metadata-eval30.3%

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 36.1% 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 9.6 \cdot 10^{+202}:\\ \;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\frac{1}{B\_m} \cdot \sqrt{C \cdot F}\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 (<= C 9.6e+202)
   (* -1.0 (* (sqrt (* F 2.0)) (pow B_m -0.5)))
   (* -2.0 (* (/ 1.0 B_m) (sqrt (* C F))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= 9.6e+202) {
		tmp = -1.0 * (sqrt((F * 2.0)) * pow(B_m, -0.5));
	} else {
		tmp = -2.0 * ((1.0 / B_m) * sqrt((C * F)));
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= 9.6d+202) then
        tmp = (-1.0d0) * (sqrt((f * 2.0d0)) * (b_m ** (-0.5d0)))
    else
        tmp = (-2.0d0) * ((1.0d0 / b_m) * sqrt((c * f)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= 9.6e+202) {
		tmp = -1.0 * (Math.sqrt((F * 2.0)) * Math.pow(B_m, -0.5));
	} else {
		tmp = -2.0 * ((1.0 / B_m) * Math.sqrt((C * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if C <= 9.6e+202:
		tmp = -1.0 * (math.sqrt((F * 2.0)) * math.pow(B_m, -0.5))
	else:
		tmp = -2.0 * ((1.0 / B_m) * math.sqrt((C * F)))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= 9.6e+202)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) * (B_m ^ -0.5)));
	else
		tmp = Float64(-2.0 * Float64(Float64(1.0 / B_m) * sqrt(Float64(C * F))));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= 9.6e+202)
		tmp = -1.0 * (sqrt((F * 2.0)) * (B_m ^ -0.5));
	else
		tmp = -2.0 * ((1.0 / B_m) * sqrt((C * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, 9.6e+202], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(C * F), $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}\;C \leq 9.6 \cdot 10^{+202}:\\
\;\;\;\;-1 \cdot \left(\sqrt{F \cdot 2} \cdot {B\_m}^{-0.5}\right)\\

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


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

    1. Initial program 22.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/13.3%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr18.2%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    8. Step-by-step derivation
      1. div-inv18.2%

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{F \cdot 2} \cdot {B}^{-0.5}\right)} \]

    if 9.6000000000000008e202 < C

    1. Initial program 1.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. Simplified13.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. Taylor expanded in B around inf 6.1%

      \[\leadsto \frac{\sqrt{\color{blue}{\left({B}^{2} \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)} \]
    5. Taylor expanded in A around -inf 6.1%

      \[\leadsto \frac{\sqrt{\left({B}^{2} \cdot F\right) \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)} \]
    6. Taylor expanded in B around inf 14.8%

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

Alternative 13: 36.1% 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 1.16 \cdot 10^{+203}:\\ \;\;\;\;-1 \cdot \frac{\sqrt{F \cdot 2}}{\sqrt{B\_m}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\frac{1}{B\_m} \cdot \sqrt{C \cdot F}\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 (<= C 1.16e+203)
   (* -1.0 (/ (sqrt (* F 2.0)) (sqrt B_m)))
   (* -2.0 (* (/ 1.0 B_m) (sqrt (* C F))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= 1.16e+203) {
		tmp = -1.0 * (sqrt((F * 2.0)) / sqrt(B_m));
	} else {
		tmp = -2.0 * ((1.0 / B_m) * sqrt((C * F)));
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= 1.16d+203) then
        tmp = (-1.0d0) * (sqrt((f * 2.0d0)) / sqrt(b_m))
    else
        tmp = (-2.0d0) * ((1.0d0 / b_m) * sqrt((c * f)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= 1.16e+203) {
		tmp = -1.0 * (Math.sqrt((F * 2.0)) / Math.sqrt(B_m));
	} else {
		tmp = -2.0 * ((1.0 / B_m) * Math.sqrt((C * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if C <= 1.16e+203:
		tmp = -1.0 * (math.sqrt((F * 2.0)) / math.sqrt(B_m))
	else:
		tmp = -2.0 * ((1.0 / B_m) * math.sqrt((C * F)))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= 1.16e+203)
		tmp = Float64(-1.0 * Float64(sqrt(Float64(F * 2.0)) / sqrt(B_m)));
	else
		tmp = Float64(-2.0 * Float64(Float64(1.0 / B_m) * sqrt(Float64(C * F))));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= 1.16e+203)
		tmp = -1.0 * (sqrt((F * 2.0)) / sqrt(B_m));
	else
		tmp = -2.0 * ((1.0 / B_m) * sqrt((C * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, 1.16e+203], N[(-1.0 * N[(N[Sqrt[N[(F * 2.0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(C * F), $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}\;C \leq 1.16 \cdot 10^{+203}:\\
\;\;\;\;-1 \cdot \frac{\sqrt{F \cdot 2}}{\sqrt{B\_m}}\\

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


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

    1. Initial program 22.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      5. associate-*l/13.3%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    7. Applied egg-rr18.2%

      \[\leadsto -1 \cdot \color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]

    if 1.16e203 < C

    1. Initial program 1.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. Simplified13.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. Taylor expanded in B around inf 6.1%

      \[\leadsto \frac{\sqrt{\color{blue}{\left({B}^{2} \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)} \]
    5. Taylor expanded in A around -inf 6.1%

      \[\leadsto \frac{\sqrt{\left({B}^{2} \cdot F\right) \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)} \]
    6. Taylor expanded in B around inf 14.8%

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

Alternative 14: 28.4% accurate, 5.6× speedup?

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

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


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

    1. Initial program 22.8%

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

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

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      2. pow1/213.5%

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

      \[\leadsto -1 \cdot \color{blue}{{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]

    if 3.75e202 < C

    1. Initial program 1.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. Simplified13.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. Taylor expanded in B around inf 6.1%

      \[\leadsto \frac{\sqrt{\color{blue}{\left({B}^{2} \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)} \]
    5. Taylor expanded in A around -inf 6.1%

      \[\leadsto \frac{\sqrt{\left({B}^{2} \cdot F\right) \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)} \]
    6. Taylor expanded in B around inf 14.8%

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

Alternative 15: 27.1% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ -1 \cdot {\left(\frac{F}{B\_m} \cdot 2\right)}^{0.5} \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 (* -1.0 (pow (* (/ F B_m) 2.0) 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) {
	return -1.0 * pow(((F / B_m) * 2.0), 0.5);
}
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 = (-1.0d0) * (((f / b_m) * 2.0d0) ** 0.5d0)
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 -1.0 * Math.pow(((F / B_m) * 2.0), 0.5);
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	return -1.0 * math.pow(((F / B_m) * 2.0), 0.5)
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	return Float64(-1.0 * (Float64(Float64(F / B_m) * 2.0) ^ 0.5))
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 = -1.0 * (((F / B_m) * 2.0) ^ 0.5);
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[(-1.0 * N[Power[N[(N[(F / B$95$m), $MachinePrecision] * 2.0), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-1 \cdot {\left(\frac{F}{B\_m} \cdot 2\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 20.9%

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

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

      \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    2. pow1/212.5%

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

    \[\leadsto -1 \cdot \color{blue}{{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]
  6. Add Preprocessing

Alternative 16: 27.1% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ -1 \cdot \sqrt{\frac{F}{B\_m} \cdot 2} \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 (* -1.0 (sqrt (* (/ F B_m) 2.0))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	return -1.0 * sqrt(((F / B_m) * 2.0));
}
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 = (-1.0d0) * sqrt(((f / b_m) * 2.0d0))
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 -1.0 * Math.sqrt(((F / B_m) * 2.0));
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	return -1.0 * math.sqrt(((F / B_m) * 2.0))
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	return Float64(-1.0 * sqrt(Float64(Float64(F / B_m) * 2.0)))
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 = -1.0 * sqrt(((F / B_m) * 2.0));
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[(-1.0 * N[Sqrt[N[(N[(F / B$95$m), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-1 \cdot \sqrt{\frac{F}{B\_m} \cdot 2}
\end{array}
Derivation
  1. Initial program 20.9%

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

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

      \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  5. Applied egg-rr12.4%

    \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  6. Add Preprocessing

Reproduce

?
herbie shell --seed 2024077 -o generate:simplify
(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))))