ABCF->ab-angle a

Percentage Accurate: 19.1% → 49.1%
Time: 37.8s
Alternatives: 18
Speedup: 3.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 19.1% 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: 49.1% accurate, 0.4× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := \mathsf{hypot}\left(B, A - C\right)\\ t_2 := {B}^{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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\ \mathbf{if}\;t_3 \leq 0:\\ \;\;\;\;\frac{\sqrt{t_0} \cdot \left(\sqrt{A + \left(C + t_1\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{t_2}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{C + \left(A + t_1\right)} \cdot \sqrt{2 \cdot \left(F \cdot t_0\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* A (* C -4.0))))
        (t_1 (hypot B (- A C)))
        (t_2 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_3
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_2 F))
             (+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_2)))
   (if (<= t_3 0.0)
     (/ (* (sqrt t_0) (* (sqrt (+ A (+ C t_1))) (- (sqrt (* 2.0 F))))) t_2)
     (if (<= t_3 INFINITY)
       (/ (- (* (sqrt (+ C (+ A t_1))) (sqrt (* 2.0 (* F t_0))))) t_2)
       (* (sqrt (/ F B)) (- (sqrt 2.0)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double t_1 = hypot(B, (A - C));
	double t_2 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_3 = -sqrt(((2.0 * (t_2 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= 0.0) {
		tmp = (sqrt(t_0) * (sqrt((A + (C + t_1))) * -sqrt((2.0 * F)))) / t_2;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = -(sqrt((C + (A + t_1))) * sqrt((2.0 * (F * t_0)))) / t_2;
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = hypot(B, Float64(A - C))
	t_2 = Float64((B ^ 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((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2)
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(Float64(sqrt(t_0) * Float64(sqrt(Float64(A + Float64(C + t_1))) * Float64(-sqrt(Float64(2.0 * F))))) / t_2);
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(-Float64(sqrt(Float64(C + Float64(A + t_1))) * sqrt(Float64(2.0 * Float64(F * t_0))))) / t_2);
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B, 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[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[(N[Sqrt[t$95$0], $MachinePrecision] * N[(N[Sqrt[N[(A + N[(C + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[((-N[(N[Sqrt[N[(C + N[(A + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]) / t$95$2), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \mathsf{hypot}\left(B, A - C\right)\\
t_2 := {B}^{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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
\mathbf{if}\;t_3 \leq 0:\\
\;\;\;\;\frac{\sqrt{t_0} \cdot \left(\sqrt{A + \left(C + t_1\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{t_2}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{-\sqrt{C + \left(A + t_1\right)} \cdot \sqrt{2 \cdot \left(F \cdot t_0\right)}}{t_2}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 29.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. Applied egg-rr71.7%

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

    if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 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. Taylor expanded in C around 0 0.5%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified12.4%

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

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

Alternative 2: 37.2% accurate, 0.7× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := \sqrt{2 \cdot F}\\ t_2 := A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\\ t_3 := \sqrt{t_2}\\ t_4 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-307}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot t_2}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-259}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \left(t_1 \cdot \left(-\sqrt{A + A}\right)\right)}{t_4}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\ \;\;\;\;\frac{B \cdot \left(t_3 \cdot \left(-t_1\right)\right)}{t_4}\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;\frac{\left(t_3 \cdot t_1\right) \cdot \left(\left(-B\right) - -2 \cdot \frac{A \cdot C}{B}\right)}{t_4}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* C (* A -4.0))))
        (t_1 (sqrt (* 2.0 F)))
        (t_2 (+ A (+ C (hypot B (- A C)))))
        (t_3 (sqrt t_2))
        (t_4 (- (pow B 2.0) (* (* 4.0 A) C))))
   (if (<= (pow B 2.0) 5e-307)
     (/ (- (sqrt (* (* (* 2.0 F) t_0) t_2))) t_0)
     (if (<= (pow B 2.0) 2e-259)
       (/ (* (sqrt (fma B B (* A (* C -4.0)))) (* t_1 (- (sqrt (+ A A))))) t_4)
       (if (<= (pow B 2.0) 2e-92)
         (/ (* B (* t_3 (- t_1))) t_4)
         (if (<= (pow B 2.0) 0.005)
           (/
            (* (sqrt (+ (* A 0.0) (* 2.0 C))) (- (sqrt (* 2.0 (* F t_0)))))
            t_0)
           (if (<= (pow B 2.0) 1e+271)
             (/ (* (* t_3 t_1) (- (- B) (* -2.0 (/ (* A C) B)))) t_4)
             (* (sqrt (/ F B)) (- (sqrt 2.0))))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (C * (A * -4.0)));
	double t_1 = sqrt((2.0 * F));
	double t_2 = A + (C + hypot(B, (A - C)));
	double t_3 = sqrt(t_2);
	double t_4 = pow(B, 2.0) - ((4.0 * A) * C);
	double tmp;
	if (pow(B, 2.0) <= 5e-307) {
		tmp = -sqrt((((2.0 * F) * t_0) * t_2)) / t_0;
	} else if (pow(B, 2.0) <= 2e-259) {
		tmp = (sqrt(fma(B, B, (A * (C * -4.0)))) * (t_1 * -sqrt((A + A)))) / t_4;
	} else if (pow(B, 2.0) <= 2e-92) {
		tmp = (B * (t_3 * -t_1)) / t_4;
	} else if (pow(B, 2.0) <= 0.005) {
		tmp = (sqrt(((A * 0.0) + (2.0 * C))) * -sqrt((2.0 * (F * t_0)))) / t_0;
	} else if (pow(B, 2.0) <= 1e+271) {
		tmp = ((t_3 * t_1) * (-B - (-2.0 * ((A * C) / B)))) / t_4;
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(C * Float64(A * -4.0)))
	t_1 = sqrt(Float64(2.0 * F))
	t_2 = Float64(A + Float64(C + hypot(B, Float64(A - C))))
	t_3 = sqrt(t_2)
	t_4 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	tmp = 0.0
	if ((B ^ 2.0) <= 5e-307)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * t_2))) / t_0);
	elseif ((B ^ 2.0) <= 2e-259)
		tmp = Float64(Float64(sqrt(fma(B, B, Float64(A * Float64(C * -4.0)))) * Float64(t_1 * Float64(-sqrt(Float64(A + A))))) / t_4);
	elseif ((B ^ 2.0) <= 2e-92)
		tmp = Float64(Float64(B * Float64(t_3 * Float64(-t_1))) / t_4);
	elseif ((B ^ 2.0) <= 0.005)
		tmp = Float64(Float64(sqrt(Float64(Float64(A * 0.0) + Float64(2.0 * C))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0);
	elseif ((B ^ 2.0) <= 1e+271)
		tmp = Float64(Float64(Float64(t_3 * t_1) * Float64(Float64(-B) - Float64(-2.0 * Float64(Float64(A * C) / B)))) / t_4);
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-307], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-259], N[(N[(N[Sqrt[N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * (-N[Sqrt[N[(A + A), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-92], N[(N[(B * N[(t$95$3 * (-t$95$1)), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 0.005], N[(N[(N[Sqrt[N[(N[(A * 0.0), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+271], N[(N[(N[(t$95$3 * t$95$1), $MachinePrecision] * N[((-B) - N[(-2.0 * N[(N[(A * C), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_1 := \sqrt{2 \cdot F}\\
t_2 := A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\\
t_3 := \sqrt{t_2}\\
t_4 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-307}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot t_2}}{t_0}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-259}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \left(t_1 \cdot \left(-\sqrt{A + A}\right)\right)}{t_4}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\
\;\;\;\;\frac{B \cdot \left(t_3 \cdot \left(-t_1\right)\right)}{t_4}\\

\mathbf{elif}\;{B}^{2} \leq 0.005:\\
\;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\

\mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\
\;\;\;\;\frac{\left(t_3 \cdot t_1\right) \cdot \left(\left(-B\right) - -2 \cdot \frac{A \cdot C}{B}\right)}{t_4}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (pow.f64 B 2) < 5.00000000000000014e-307

    1. Initial program 16.3%

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

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

    if 5.00000000000000014e-307 < (pow.f64 B 2) < 2.0000000000000001e-259

    1. Initial program 11.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. Applied egg-rr7.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-259 < (pow.f64 B 2) < 1.99999999999999998e-92

    1. Initial program 24.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999998e-92 < (pow.f64 B 2) < 0.0050000000000000001

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0050000000000000001 < (pow.f64 B 2) < 9.99999999999999953e270

    1. Initial program 26.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999953e270 < (pow.f64 B 2)

    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. Taylor expanded in C around 0 3.1%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified21.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-307}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-259}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \left(\sqrt{2 \cdot F} \cdot \left(-\sqrt{A + A}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\ \;\;\;\;\frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;\frac{\left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot F}\right) \cdot \left(\left(-B\right) - -2 \cdot \frac{A \cdot C}{B}\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 3: 37.4% accurate, 0.8× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \sqrt{2 \cdot F}\\ t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_2 := A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\\ t_3 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_4 := \sqrt{t_2}\\ \mathbf{if}\;{B}^{2} \leq 10^{-270}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_3\right) \cdot t_2}}{t_3}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\ \;\;\;\;\frac{B \cdot \left(t_4 \cdot \left(-t_0\right)\right)}{t_1}\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_3\right)}\right)}{t_3}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;\frac{\left(t_4 \cdot t_0\right) \cdot \left(\left(-B\right) - -2 \cdot \frac{A \cdot C}{B}\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (sqrt (* 2.0 F)))
        (t_1 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_2 (+ A (+ C (hypot B (- A C)))))
        (t_3 (fma B B (* C (* A -4.0))))
        (t_4 (sqrt t_2)))
   (if (<= (pow B 2.0) 1e-270)
     (/ (- (sqrt (* (* (* 2.0 F) t_3) t_2))) t_3)
     (if (<= (pow B 2.0) 2e-92)
       (/ (* B (* t_4 (- t_0))) t_1)
       (if (<= (pow B 2.0) 0.005)
         (/
          (* (sqrt (+ (* A 0.0) (* 2.0 C))) (- (sqrt (* 2.0 (* F t_3)))))
          t_3)
         (if (<= (pow B 2.0) 1e+271)
           (/ (* (* t_4 t_0) (- (- B) (* -2.0 (/ (* A C) B)))) t_1)
           (* (sqrt (/ F B)) (- (sqrt 2.0)))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = sqrt((2.0 * F));
	double t_1 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_2 = A + (C + hypot(B, (A - C)));
	double t_3 = fma(B, B, (C * (A * -4.0)));
	double t_4 = sqrt(t_2);
	double tmp;
	if (pow(B, 2.0) <= 1e-270) {
		tmp = -sqrt((((2.0 * F) * t_3) * t_2)) / t_3;
	} else if (pow(B, 2.0) <= 2e-92) {
		tmp = (B * (t_4 * -t_0)) / t_1;
	} else if (pow(B, 2.0) <= 0.005) {
		tmp = (sqrt(((A * 0.0) + (2.0 * C))) * -sqrt((2.0 * (F * t_3)))) / t_3;
	} else if (pow(B, 2.0) <= 1e+271) {
		tmp = ((t_4 * t_0) * (-B - (-2.0 * ((A * C) / B)))) / t_1;
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = sqrt(Float64(2.0 * F))
	t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_2 = Float64(A + Float64(C + hypot(B, Float64(A - C))))
	t_3 = fma(B, B, Float64(C * Float64(A * -4.0)))
	t_4 = sqrt(t_2)
	tmp = 0.0
	if ((B ^ 2.0) <= 1e-270)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_3) * t_2))) / t_3);
	elseif ((B ^ 2.0) <= 2e-92)
		tmp = Float64(Float64(B * Float64(t_4 * Float64(-t_0))) / t_1);
	elseif ((B ^ 2.0) <= 0.005)
		tmp = Float64(Float64(sqrt(Float64(Float64(A * 0.0) + Float64(2.0 * C))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_3))))) / t_3);
	elseif ((B ^ 2.0) <= 1e+271)
		tmp = Float64(Float64(Float64(t_4 * t_0) * Float64(Float64(-B) - Float64(-2.0 * Float64(Float64(A * C) / B)))) / t_1);
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[t$95$2], $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e-270], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$3), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-92], N[(N[(B * N[(t$95$4 * (-t$95$0)), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 0.005], N[(N[(N[Sqrt[N[(N[(A * 0.0), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+271], N[(N[(N[(t$95$4 * t$95$0), $MachinePrecision] * N[((-B) - N[(-2.0 * N[(N[(A * C), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \sqrt{2 \cdot F}\\
t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\\
t_3 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_4 := \sqrt{t_2}\\
\mathbf{if}\;{B}^{2} \leq 10^{-270}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_3\right) \cdot t_2}}{t_3}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\
\;\;\;\;\frac{B \cdot \left(t_4 \cdot \left(-t_0\right)\right)}{t_1}\\

\mathbf{elif}\;{B}^{2} \leq 0.005:\\
\;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_3\right)}\right)}{t_3}\\

\mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\
\;\;\;\;\frac{\left(t_4 \cdot t_0\right) \cdot \left(\left(-B\right) - -2 \cdot \frac{A \cdot C}{B}\right)}{t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (pow.f64 B 2) < 1e-270

    1. Initial program 15.7%

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

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

    if 1e-270 < (pow.f64 B 2) < 1.99999999999999998e-92

    1. Initial program 23.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. Applied egg-rr35.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999998e-92 < (pow.f64 B 2) < 0.0050000000000000001

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0050000000000000001 < (pow.f64 B 2) < 9.99999999999999953e270

    1. Initial program 26.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999953e270 < (pow.f64 B 2)

    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. Taylor expanded in C around 0 3.1%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified21.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 10^{-270}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\ \;\;\;\;\frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;\frac{\left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot F}\right) \cdot \left(\left(-B\right) - -2 \cdot \frac{A \cdot C}{B}\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 4: 36.3% accurate, 0.8× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := \frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\ t_2 := \frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{-289}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;t_1\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* C (* A -4.0))))
        (t_1
         (/
          (* (sqrt (+ (* A 0.0) (* 2.0 C))) (- (sqrt (* 2.0 (* F t_0)))))
          t_0))
        (t_2
         (/
          (* B (* (sqrt (+ A (+ C (hypot B (- A C))))) (- (sqrt (* 2.0 F)))))
          (- (pow B 2.0) (* (* 4.0 A) C)))))
   (if (<= (pow B 2.0) 4e-289)
     t_1
     (if (<= (pow B 2.0) 2e-92)
       t_2
       (if (<= (pow B 2.0) 0.005)
         t_1
         (if (<= (pow B 2.0) 1e+271)
           t_2
           (* (sqrt (/ F B)) (- (sqrt 2.0)))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (C * (A * -4.0)));
	double t_1 = (sqrt(((A * 0.0) + (2.0 * C))) * -sqrt((2.0 * (F * t_0)))) / t_0;
	double t_2 = (B * (sqrt((A + (C + hypot(B, (A - C))))) * -sqrt((2.0 * F)))) / (pow(B, 2.0) - ((4.0 * A) * C));
	double tmp;
	if (pow(B, 2.0) <= 4e-289) {
		tmp = t_1;
	} else if (pow(B, 2.0) <= 2e-92) {
		tmp = t_2;
	} else if (pow(B, 2.0) <= 0.005) {
		tmp = t_1;
	} else if (pow(B, 2.0) <= 1e+271) {
		tmp = t_2;
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(C * Float64(A * -4.0)))
	t_1 = Float64(Float64(sqrt(Float64(Float64(A * 0.0) + Float64(2.0 * C))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0)
	t_2 = Float64(Float64(B * Float64(sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * F))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)))
	tmp = 0.0
	if ((B ^ 2.0) <= 4e-289)
		tmp = t_1;
	elseif ((B ^ 2.0) <= 2e-92)
		tmp = t_2;
	elseif ((B ^ 2.0) <= 0.005)
		tmp = t_1;
	elseif ((B ^ 2.0) <= 1e+271)
		tmp = t_2;
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(N[(A * 0.0), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * N[(N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 4e-289], t$95$1, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-92], t$95$2, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 0.005], t$95$1, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+271], t$95$2, N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_1 := \frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\
t_2 := \frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\
\mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{-289}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;{B}^{2} \leq 0.005:\\
\;\;\;\;t_1\\

\mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B 2) < 4e-289 or 1.99999999999999998e-92 < (pow.f64 B 2) < 0.0050000000000000001

    1. Initial program 15.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e-289 < (pow.f64 B 2) < 1.99999999999999998e-92 or 0.0050000000000000001 < (pow.f64 B 2) < 9.99999999999999953e270

    1. Initial program 25.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999953e270 < (pow.f64 B 2)

    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. Taylor expanded in C around 0 3.1%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified21.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{-289}:\\ \;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\ \;\;\;\;\frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;\frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 5: 37.5% accurate, 0.8× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\\ t_2 := \frac{B \cdot \left(\sqrt{t_1} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{if}\;{B}^{2} \leq 10^{-270}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot t_1}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* C (* A -4.0))))
        (t_1 (+ A (+ C (hypot B (- A C)))))
        (t_2
         (/
          (* B (* (sqrt t_1) (- (sqrt (* 2.0 F)))))
          (- (pow B 2.0) (* (* 4.0 A) C)))))
   (if (<= (pow B 2.0) 1e-270)
     (/ (- (sqrt (* (* (* 2.0 F) t_0) t_1))) t_0)
     (if (<= (pow B 2.0) 2e-92)
       t_2
       (if (<= (pow B 2.0) 0.005)
         (/
          (* (sqrt (+ (* A 0.0) (* 2.0 C))) (- (sqrt (* 2.0 (* F t_0)))))
          t_0)
         (if (<= (pow B 2.0) 1e+271)
           t_2
           (* (sqrt (/ F B)) (- (sqrt 2.0)))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (C * (A * -4.0)));
	double t_1 = A + (C + hypot(B, (A - C)));
	double t_2 = (B * (sqrt(t_1) * -sqrt((2.0 * F)))) / (pow(B, 2.0) - ((4.0 * A) * C));
	double tmp;
	if (pow(B, 2.0) <= 1e-270) {
		tmp = -sqrt((((2.0 * F) * t_0) * t_1)) / t_0;
	} else if (pow(B, 2.0) <= 2e-92) {
		tmp = t_2;
	} else if (pow(B, 2.0) <= 0.005) {
		tmp = (sqrt(((A * 0.0) + (2.0 * C))) * -sqrt((2.0 * (F * t_0)))) / t_0;
	} else if (pow(B, 2.0) <= 1e+271) {
		tmp = t_2;
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(C * Float64(A * -4.0)))
	t_1 = Float64(A + Float64(C + hypot(B, Float64(A - C))))
	t_2 = Float64(Float64(B * Float64(sqrt(t_1) * Float64(-sqrt(Float64(2.0 * F))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)))
	tmp = 0.0
	if ((B ^ 2.0) <= 1e-270)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * t_1))) / t_0);
	elseif ((B ^ 2.0) <= 2e-92)
		tmp = t_2;
	elseif ((B ^ 2.0) <= 0.005)
		tmp = Float64(Float64(sqrt(Float64(Float64(A * 0.0) + Float64(2.0 * C))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0);
	elseif ((B ^ 2.0) <= 1e+271)
		tmp = t_2;
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * N[(N[Sqrt[t$95$1], $MachinePrecision] * (-N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e-270], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-92], t$95$2, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 0.005], N[(N[(N[Sqrt[N[(N[(A * 0.0), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+271], t$95$2, N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_1 := A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\\
t_2 := \frac{B \cdot \left(\sqrt{t_1} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\
\mathbf{if}\;{B}^{2} \leq 10^{-270}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot t_1}}{t_0}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;{B}^{2} \leq 0.005:\\
\;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\

\mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (pow.f64 B 2) < 1e-270

    1. Initial program 15.7%

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

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

    if 1e-270 < (pow.f64 B 2) < 1.99999999999999998e-92 or 0.0050000000000000001 < (pow.f64 B 2) < 9.99999999999999953e270

    1. Initial program 25.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. Applied egg-rr43.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999998e-92 < (pow.f64 B 2) < 0.0050000000000000001

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999953e270 < (pow.f64 B 2)

    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. Taylor expanded in C around 0 3.1%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified21.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 10^{-270}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-92}:\\ \;\;\;\;\frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;\frac{\sqrt{A \cdot 0 + 2 \cdot C} \cdot \left(-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right)}\right)}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;\frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 6: 32.7% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-211} \lor \neg \left({B}^{2} \leq 2 \cdot 10^{-58}\right) \land {B}^{2} \leq 0.005:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* C (* A -4.0)))))
   (if (or (<= (pow B 2.0) 5e-211)
           (and (not (<= (pow B 2.0) 2e-58)) (<= (pow B 2.0) 0.005)))
     (/ (- (sqrt (* (* (* 2.0 F) t_0) (* 2.0 C)))) t_0)
     (* (sqrt (/ F B)) (- (sqrt 2.0))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (C * (A * -4.0)));
	double tmp;
	if ((pow(B, 2.0) <= 5e-211) || (!(pow(B, 2.0) <= 2e-58) && (pow(B, 2.0) <= 0.005))) {
		tmp = -sqrt((((2.0 * F) * t_0) * (2.0 * C))) / t_0;
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (((B ^ 2.0) <= 5e-211) || (!((B ^ 2.0) <= 2e-58) && ((B ^ 2.0) <= 0.005)))
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * Float64(2.0 * C)))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-211], And[N[Not[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-58]], $MachinePrecision], LessEqual[N[Power[B, 2.0], $MachinePrecision], 0.005]]], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-211} \lor \neg \left({B}^{2} \leq 2 \cdot 10^{-58}\right) \land {B}^{2} \leq 0.005:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 5.0000000000000002e-211 or 2.0000000000000001e-58 < (pow.f64 B 2) < 0.0050000000000000001

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

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

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

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

    if 5.0000000000000002e-211 < (pow.f64 B 2) < 2.0000000000000001e-58 or 0.0050000000000000001 < (pow.f64 B 2)

    1. Initial program 14.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. Taylor expanded in C around 0 12.2%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified19.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-211} \lor \neg \left({B}^{2} \leq 2 \cdot 10^{-58}\right) \land {B}^{2} \leq 0.005:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right) \cdot \left(2 \cdot C\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 7: 32.9% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ t_1 := \frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-272}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{-72}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(-B\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;{B}^{2} \leq 0.005:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* C (* A -4.0))))
        (t_1 (/ (- (sqrt (* (* (* 2.0 F) t_0) (* 2.0 C)))) t_0)))
   (if (<= (pow B 2.0) 2e-272)
     t_1
     (if (<= (pow B 2.0) 5e-72)
       (/
        (* (sqrt (* (* 2.0 F) (+ C (+ A (hypot B (- A C)))))) (- B))
        (- (pow B 2.0) (* (* 4.0 A) C)))
       (if (<= (pow B 2.0) 0.005) t_1 (* (sqrt (/ F B)) (- (sqrt 2.0))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (C * (A * -4.0)));
	double t_1 = -sqrt((((2.0 * F) * t_0) * (2.0 * C))) / t_0;
	double tmp;
	if (pow(B, 2.0) <= 2e-272) {
		tmp = t_1;
	} else if (pow(B, 2.0) <= 5e-72) {
		tmp = (sqrt(((2.0 * F) * (C + (A + hypot(B, (A - C)))))) * -B) / (pow(B, 2.0) - ((4.0 * A) * C));
	} else if (pow(B, 2.0) <= 0.005) {
		tmp = t_1;
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(C * Float64(A * -4.0)))
	t_1 = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * Float64(2.0 * C)))) / t_0)
	tmp = 0.0
	if ((B ^ 2.0) <= 2e-272)
		tmp = t_1;
	elseif ((B ^ 2.0) <= 5e-72)
		tmp = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * Float64(C + Float64(A + hypot(B, Float64(A - C)))))) * Float64(-B)) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)));
	elseif ((B ^ 2.0) <= 0.005)
		tmp = t_1;
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-272], t$95$1, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-72], N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-B)), $MachinePrecision] / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 0.005], t$95$1, N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_1 := \frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-272}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;{B}^{2} \leq 0.005:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B 2) < 1.99999999999999986e-272 or 4.9999999999999996e-72 < (pow.f64 B 2) < 0.0050000000000000001

    1. Initial program 14.6%

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

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

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

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

    if 1.99999999999999986e-272 < (pow.f64 B 2) < 4.9999999999999996e-72

    1. Initial program 23.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. Applied egg-rr36.5%

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

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

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

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

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

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

    if 0.0050000000000000001 < (pow.f64 B 2)

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

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

Alternative 8: 43.5% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 10^{+195}:\\ \;\;\;\;\frac{-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= (pow B 2.0) 1e+195)
   (/
    (-
     (*
      (sqrt (+ C (+ A (hypot B (- A C)))))
      (sqrt (* 2.0 (* F (fma B B (* A (* C -4.0))))))))
    (- (pow B 2.0) (* (* 4.0 A) C)))
   (* (sqrt (/ F B)) (- (sqrt 2.0)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 1e+195) {
		tmp = -(sqrt((C + (A + hypot(B, (A - C))))) * sqrt((2.0 * (F * fma(B, B, (A * (C * -4.0))))))) / (pow(B, 2.0) - ((4.0 * A) * C));
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 1e+195)
		tmp = Float64(Float64(-Float64(sqrt(Float64(C + Float64(A + hypot(B, Float64(A - C))))) * sqrt(Float64(2.0 * Float64(F * fma(B, B, Float64(A * Float64(C * -4.0)))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)));
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+195], N[((-N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 10^{+195}:\\
\;\;\;\;\frac{-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 9.99999999999999977e194

    1. Initial program 20.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. Applied egg-rr36.7%

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

    if 9.99999999999999977e194 < (pow.f64 B 2)

    1. Initial program 5.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. Taylor expanded in C around 0 8.8%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified24.4%

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

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

Alternative 9: 37.6% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{-289}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;\frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* C (* A -4.0)))))
   (if (<= (pow B 2.0) 4e-289)
     (/ (- (sqrt (* (* (* 2.0 F) t_0) (* 2.0 C)))) t_0)
     (if (<= (pow B 2.0) 1e+271)
       (/
        (* B (* (sqrt (+ A (+ C (hypot B (- A C))))) (- (sqrt (* 2.0 F)))))
        (- (pow B 2.0) (* (* 4.0 A) C)))
       (* (sqrt (/ F B)) (- (sqrt 2.0)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (C * (A * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 4e-289) {
		tmp = -sqrt((((2.0 * F) * t_0) * (2.0 * C))) / t_0;
	} else if (pow(B, 2.0) <= 1e+271) {
		tmp = (B * (sqrt((A + (C + hypot(B, (A - C))))) * -sqrt((2.0 * F)))) / (pow(B, 2.0) - ((4.0 * A) * C));
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 4e-289)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * Float64(2.0 * C)))) / t_0);
	elseif ((B ^ 2.0) <= 1e+271)
		tmp = Float64(Float64(B * Float64(sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))) * Float64(-sqrt(Float64(2.0 * F))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)));
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 4e-289], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+271], N[(N[(B * N[(N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{-289}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B 2) < 4e-289

    1. Initial program 16.2%

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

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

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

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

    if 4e-289 < (pow.f64 B 2) < 9.99999999999999953e270

    1. Initial program 22.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. Applied egg-rr38.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999953e270 < (pow.f64 B 2)

    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. Taylor expanded in C around 0 3.1%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified21.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{-289}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\right) \cdot \left(2 \cdot C\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;{B}^{2} \leq 10^{+271}:\\ \;\;\;\;\frac{B \cdot \left(\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 10: 37.0% accurate, 1.2× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+214}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= (pow B 2.0) 2e+214)
   (-
    (/
     (sqrt (* 2.0 (* F (+ A (+ C (hypot B (- A C)))))))
     (sqrt (fma B B (* -4.0 (* A C))))))
   (* (sqrt (/ F B)) (- (sqrt 2.0)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 2e+214) {
		tmp = -(sqrt((2.0 * (F * (A + (C + hypot(B, (A - C))))))) / sqrt(fma(B, B, (-4.0 * (A * C)))));
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 2e+214)
		tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(F * Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / sqrt(fma(B, B, Float64(-4.0 * Float64(A * C))))));
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+214], (-N[(N[Sqrt[N[(2.0 * N[(F * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+214}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(F \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 1.9999999999999999e214

    1. Initial program 19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e214 < (pow.f64 B 2)

    1. Initial program 5.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. Taylor expanded in C around 0 7.9%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified24.2%

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

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

Alternative 11: 37.0% accurate, 1.2× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+214}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= (pow B 2.0) 2e+214)
   (/
    (- (sqrt (* (* 2.0 F) (+ C (+ A (hypot B (- A C)))))))
    (sqrt (fma B B (* A (* C -4.0)))))
   (* (sqrt (/ F B)) (- (sqrt 2.0)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 2e+214) {
		tmp = -sqrt(((2.0 * F) * (C + (A + hypot(B, (A - C)))))) / sqrt(fma(B, B, (A * (C * -4.0))));
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 2e+214)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * F) * Float64(C + Float64(A + hypot(B, Float64(A - C))))))) / sqrt(fma(B, B, Float64(A * Float64(C * -4.0)))));
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+214], N[((-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[Sqrt[N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+214}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 1.9999999999999999e214

    1. Initial program 19.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e214 < (pow.f64 B 2)

    1. Initial program 5.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. Taylor expanded in C around 0 7.9%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified24.2%

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

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

Alternative 12: 35.4% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := -\sqrt{2}\\ \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{\left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right) \cdot \left(A + \left(2 \cdot C - A\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-37}:\\ \;\;\;\;\sqrt{F \cdot \left(A + \left(B + 0.5 \cdot \frac{{A}^{2}}{B}\right)\right)} \cdot \frac{t_0}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot t_0\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (sqrt 2.0))))
   (if (<= F -5e-310)
     (/
      (- (sqrt (* (* -8.0 (* A (* C F))) (+ A (- (* 2.0 C) A)))))
      (fma B B (* C (* A -4.0))))
     (if (<= F 4.2e-37)
       (* (sqrt (* F (+ A (+ B (* 0.5 (/ (pow A 2.0) B)))))) (/ t_0 B))
       (* (sqrt (/ F B)) t_0)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = -sqrt(2.0);
	double tmp;
	if (F <= -5e-310) {
		tmp = -sqrt(((-8.0 * (A * (C * F))) * (A + ((2.0 * C) - A)))) / fma(B, B, (C * (A * -4.0)));
	} else if (F <= 4.2e-37) {
		tmp = sqrt((F * (A + (B + (0.5 * (pow(A, 2.0) / B)))))) * (t_0 / B);
	} else {
		tmp = sqrt((F / B)) * t_0;
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(-sqrt(2.0))
	tmp = 0.0
	if (F <= -5e-310)
		tmp = Float64(Float64(-sqrt(Float64(Float64(-8.0 * Float64(A * Float64(C * F))) * Float64(A + Float64(Float64(2.0 * C) - A))))) / fma(B, B, Float64(C * Float64(A * -4.0))));
	elseif (F <= 4.2e-37)
		tmp = Float64(sqrt(Float64(F * Float64(A + Float64(B + Float64(0.5 * Float64((A ^ 2.0) / B)))))) * Float64(t_0 / B));
	else
		tmp = Float64(sqrt(Float64(F / B)) * t_0);
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = (-N[Sqrt[2.0], $MachinePrecision])}, If[LessEqual[F, -5e-310], N[((-N[Sqrt[N[(N[(-8.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(A + N[(N[(2.0 * C), $MachinePrecision] - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e-37], N[(N[Sqrt[N[(F * N[(A + N[(B + N[(0.5 * N[(N[Power[A, 2.0], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := -\sqrt{2}\\
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{\left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right) \cdot \left(A + \left(2 \cdot C - A\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\

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

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.999999999999985e-310

    1. Initial program 18.9%

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

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

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

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

    if -4.999999999999985e-310 < F < 4.2000000000000002e-37

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000002e-37 < F

    1. Initial program 15.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified15.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-\sqrt{\left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right) \cdot \left(A + \left(2 \cdot C - A\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-37}:\\ \;\;\;\;\sqrt{F \cdot \left(A + \left(B + 0.5 \cdot \frac{{A}^{2}}{B}\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 13: 32.7% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-211}:\\ \;\;\;\;\frac{\sqrt{A \cdot \left(-16 \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}}{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= (pow B 2.0) 5e-211)
   (/ (sqrt (* A (* -16.0 (* F (* A C))))) (- (fma B B (* -4.0 (* A C)))))
   (* (sqrt (/ F B)) (- (sqrt 2.0)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 5e-211) {
		tmp = sqrt((A * (-16.0 * (F * (A * C))))) / -fma(B, B, (-4.0 * (A * C)));
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 5e-211)
		tmp = Float64(sqrt(Float64(A * Float64(-16.0 * Float64(F * Float64(A * C))))) / Float64(-fma(B, B, Float64(-4.0 * Float64(A * C)))));
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-211], N[(N[Sqrt[N[(A * N[(-16.0 * N[(F * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-211}:\\
\;\;\;\;\frac{\sqrt{A \cdot \left(-16 \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}}{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 5.0000000000000002e-211

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e-211 < (pow.f64 B 2)

    1. Initial program 14.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. Taylor expanded in C around 0 12.0%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified18.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-211}:\\ \;\;\;\;\frac{\sqrt{A \cdot \left(-16 \cdot \left(F \cdot \left(A \cdot C\right)\right)\right)}}{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 14: 31.5% accurate, 2.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 1.75 \cdot 10^{-105}:\\ \;\;\;\;\frac{\sqrt{A \cdot \left(\left(A \cdot \left(C \cdot F\right)\right) \cdot -16\right)}}{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= B 1.75e-105)
   (/ (sqrt (* A (* (* A (* C F)) -16.0))) (- (fma B B (* -4.0 (* A C)))))
   (* (sqrt (/ F B)) (- (sqrt 2.0)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 1.75e-105) {
		tmp = sqrt((A * ((A * (C * F)) * -16.0))) / -fma(B, B, (-4.0 * (A * C)));
	} else {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 1.75e-105)
		tmp = Float64(sqrt(Float64(A * Float64(Float64(A * Float64(C * F)) * -16.0))) / Float64(-fma(B, B, Float64(-4.0 * Float64(A * C)))));
	else
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[B, 1.75e-105], N[(N[Sqrt[N[(A * N[(N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision] * -16.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.75 \cdot 10^{-105}:\\
\;\;\;\;\frac{\sqrt{A \cdot \left(\left(A \cdot \left(C \cdot F\right)\right) \cdot -16\right)}}{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.75e-105 < B

    1. Initial program 18.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. Taylor expanded in C around 0 24.4%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified37.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.75 \cdot 10^{-105}:\\ \;\;\;\;\frac{\sqrt{A \cdot \left(\left(A \cdot \left(C \cdot F\right)\right) \cdot -16\right)}}{-\mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]

Alternative 15: 27.5% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;A \leq 1.95 \cdot 10^{+95}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{A}}{\frac{B}{\sqrt{F}}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (if (<= A 1.95e+95)
   (* (sqrt (/ F B)) (- (sqrt 2.0)))
   (* -2.0 (/ (sqrt A) (/ B (sqrt F))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (A <= 1.95e+95) {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	} else {
		tmp = -2.0 * (sqrt(A) / (B / sqrt(F)));
	}
	return tmp;
}
NOTE: B should be positive before calling this function
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) :: tmp
    if (a <= 1.95d+95) then
        tmp = sqrt((f / b)) * -sqrt(2.0d0)
    else
        tmp = (-2.0d0) * (sqrt(a) / (b / sqrt(f)))
    end if
    code = tmp
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (A <= 1.95e+95) {
		tmp = Math.sqrt((F / B)) * -Math.sqrt(2.0);
	} else {
		tmp = -2.0 * (Math.sqrt(A) / (B / Math.sqrt(F)));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if A <= 1.95e+95:
		tmp = math.sqrt((F / B)) * -math.sqrt(2.0)
	else:
		tmp = -2.0 * (math.sqrt(A) / (B / math.sqrt(F)))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if (A <= 1.95e+95)
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	else
		tmp = Float64(-2.0 * Float64(sqrt(A) / Float64(B / sqrt(F))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if (A <= 1.95e+95)
		tmp = sqrt((F / B)) * -sqrt(2.0);
	else
		tmp = -2.0 * (sqrt(A) / (B / sqrt(F)));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := If[LessEqual[A, 1.95e+95], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[A], $MachinePrecision] / N[(B / N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq 1.95 \cdot 10^{+95}:\\
\;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < 1.9499999999999999e95

    1. Initial program 16.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. Taylor expanded in C around 0 9.7%

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

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    7. Simplified14.2%

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

    if 1.9499999999999999e95 < A

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

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(2 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Taylor expanded in B around inf 5.3%

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F}}{B}} \]
      2. sqrt-prod13.8%

        \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A} \cdot \sqrt{F}}}{B} \]
      3. associate-/l*13.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq 1.95 \cdot 10^{+95}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{A}}{\frac{B}{\sqrt{F}}}\\ \end{array} \]

Alternative 16: 26.7% accurate, 3.1× speedup?

\[\begin{array}{l} B = |B|\\ \\ \sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right) \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F) :precision binary64 (* (sqrt (/ F B)) (- (sqrt 2.0))))
B = abs(B);
double code(double A, double B, double C, double F) {
	return sqrt((F / B)) * -sqrt(2.0);
}
NOTE: B should be positive before calling this function
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
    code = sqrt((f / b)) * -sqrt(2.0d0)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	return Math.sqrt((F / B)) * -Math.sqrt(2.0);
}
B = abs(B)
def code(A, B, C, F):
	return math.sqrt((F / B)) * -math.sqrt(2.0)
B = abs(B)
function code(A, B, C, F)
	return Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)))
end
B = abs(B)
function tmp = code(A, B, C, F)
	tmp = sqrt((F / B)) * -sqrt(2.0);
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)
\end{array}
Derivation
  1. Initial program 15.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. Taylor expanded in C around 0 9.0%

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  7. Simplified12.9%

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  8. Final simplification12.9%

    \[\leadsto \sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right) \]

Alternative 17: 5.1% accurate, 5.8× speedup?

\[\begin{array}{l} B = |B|\\ \\ -2 \cdot \left({\left(A \cdot F\right)}^{0.5} \cdot \frac{1}{B}\right) \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F) :precision binary64 (* -2.0 (* (pow (* A F) 0.5) (/ 1.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
	return -2.0 * (pow((A * F), 0.5) * (1.0 / B));
}
NOTE: B should be positive before calling this function
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
    code = (-2.0d0) * (((a * f) ** 0.5d0) * (1.0d0 / b))
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	return -2.0 * (Math.pow((A * F), 0.5) * (1.0 / B));
}
B = abs(B)
def code(A, B, C, F):
	return -2.0 * (math.pow((A * F), 0.5) * (1.0 / B))
B = abs(B)
function code(A, B, C, F)
	return Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) * Float64(1.0 / B)))
end
B = abs(B)
function tmp = code(A, B, C, F)
	tmp = -2.0 * (((A * F) ^ 0.5) * (1.0 / B));
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
-2 \cdot \left({\left(A \cdot F\right)}^{0.5} \cdot \frac{1}{B}\right)
\end{array}
Derivation
  1. Initial program 15.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. Taylor expanded in A around inf 9.6%

    \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(2 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
  3. Taylor expanded in B around inf 2.5%

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

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

    \[\leadsto -2 \cdot \left(\color{blue}{{\left(A \cdot F\right)}^{0.5}} \cdot \frac{1}{B}\right) \]
  6. Final simplification2.7%

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

Alternative 18: 4.9% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ -2 \cdot \frac{\sqrt{A \cdot F}}{B} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F) :precision binary64 (* -2.0 (/ (sqrt (* A F)) B)))
B = abs(B);
double code(double A, double B, double C, double F) {
	return -2.0 * (sqrt((A * F)) / B);
}
NOTE: B should be positive before calling this function
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
    code = (-2.0d0) * (sqrt((a * f)) / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	return -2.0 * (Math.sqrt((A * F)) / B);
}
B = abs(B)
def code(A, B, C, F):
	return -2.0 * (math.sqrt((A * F)) / B)
B = abs(B)
function code(A, B, C, F)
	return Float64(-2.0 * Float64(sqrt(Float64(A * F)) / B))
end
B = abs(B)
function tmp = code(A, B, C, F)
	tmp = -2.0 * (sqrt((A * F)) / B);
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
-2 \cdot \frac{\sqrt{A \cdot F}}{B}
\end{array}
Derivation
  1. Initial program 15.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. Taylor expanded in A around inf 9.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
    2. *-rgt-identity2.5%

      \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
  9. Simplified2.5%

    \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{A \cdot F}}{B}} \]
  10. Final simplification2.5%

    \[\leadsto -2 \cdot \frac{\sqrt{A \cdot F}}{B} \]

Reproduce

?
herbie shell --seed 2023301 
(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))))