ABCF->ab-angle a

Percentage Accurate: 18.4% → 57.3%
Time: 31.2s
Alternatives: 19
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 19 alternatives:

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

Initial Program: 18.4% 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: 57.3% accurate, 0.3× speedup?

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

\mathbf{elif}\;t_4 \leq 5 \cdot 10^{-90}:\\
\;\;\;\;\frac{-\sqrt{t_2 \cdot \left(2 \cdot \left(A + \left(A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{t_1}\\

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\frac{\sqrt{t_2} \cdot \left(-\sqrt{2 \cdot t_0}\right)}{t_1}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999998e-179 < (/.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))) < 5.00000000000000019e-90

    1. Initial program 8.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. Simplified11.6%

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

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

    if 5.00000000000000019e-90 < (/.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 31.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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 2.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    6. Applied egg-rr20.3%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    7. Step-by-step derivation
      1. exp-to-pow21.6%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{\sqrt{F}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)}\right) \]
      6. pow1/229.3%

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{\color{blue}{0.25}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      9. pow1/229.3%

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{0.25} \cdot \left(\color{blue}{{F}^{\left(\frac{0.5}{2}\right)}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      11. metadata-eval29.3%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{0.25} \cdot \left({F}^{\color{blue}{0.25}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
    8. Applied egg-rr29.3%

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

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

Alternative 2: 45.6% accurate, 0.9× 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 := F \cdot t_0\\ \mathbf{if}\;{B}^{2} \leq 0:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-78}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 5000000:\\ \;\;\;\;\frac{{\left(2 \cdot t_1\right)}^{0.5} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\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 (* F t_0)))
   (if (<= (pow B 2.0) 0.0)
     (/ (- (sqrt (* t_1 (* 2.0 (+ A A))))) t_0)
     (if (<= (pow B 2.0) 2e-78)
       (/ (- (sqrt (* 2.0 (* t_0 (* F (+ (+ A C) (hypot (- A C) B))))))) t_0)
       (if (<= (pow B 2.0) 5000000.0)
         (/ (* (pow (* 2.0 t_1) 0.5) (- (sqrt (* 2.0 C)))) t_0)
         (* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F)))))))))
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 = F * t_0;
	double tmp;
	if (pow(B, 2.0) <= 0.0) {
		tmp = -sqrt((t_1 * (2.0 * (A + A)))) / t_0;
	} else if (pow(B, 2.0) <= 2e-78) {
		tmp = -sqrt((2.0 * (t_0 * (F * ((A + C) + hypot((A - C), B)))))) / t_0;
	} else if (pow(B, 2.0) <= 5000000.0) {
		tmp = (pow((2.0 * t_1), 0.5) * -sqrt((2.0 * C))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(F * t_0)
	tmp = 0.0
	if ((B ^ 2.0) <= 0.0)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * Float64(A + A))))) / t_0);
	elseif ((B ^ 2.0) <= 2e-78)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(Float64(A + C) + hypot(Float64(A - C), B))))))) / t_0);
	elseif ((B ^ 2.0) <= 5000000.0)
		tmp = Float64(Float64((Float64(2.0 * t_1) ^ 0.5) * Float64(-sqrt(Float64(2.0 * C)))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F))));
	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[(F * t$95$0), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 0.0], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-78], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5000000.0], N[(N[(N[Power[N[(2.0 * t$95$1), $MachinePrecision], 0.5], $MachinePrecision] * (-N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $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 := F \cdot t_0\\
\mathbf{if}\;{B}^{2} \leq 0:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\

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

\mathbf{elif}\;{B}^{2} \leq 5000000:\\
\;\;\;\;\frac{{\left(2 \cdot t_1\right)}^{0.5} \cdot \left(-\sqrt{2 \cdot C}\right)}{t_0}\\

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


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

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

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

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

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

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

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

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

    if 0.0 < (pow.f64 B 2) < 2e-78

    1. Initial program 26.3%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. expm1-log1p-u12.9%

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

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

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

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

    if 2e-78 < (pow.f64 B 2) < 5e6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e6 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 48.7% accurate, 0.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-96}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{+197}:\\ \;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)} \cdot \left(\sqrt{F} \cdot \left(B \cdot \left(-\sqrt{2}\right)\right)\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left({F}^{0.25} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-{F}^{0.25}\right)\right)\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)))))
   (if (<= (pow B 2.0) 2e-96)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (+ C (hypot B (- A C)))))))) t_0)
     (if (<= (pow B 2.0) 4e+197)
       (/
        (*
         (sqrt (+ (+ A C) (hypot (- A C) B)))
         (* (sqrt F) (* B (- (sqrt 2.0)))))
        t_0)
       (*
        (/ (sqrt 2.0) B)
        (* (pow F 0.25) (* (sqrt (+ A (hypot B A))) (- (pow F 0.25)))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 2e-96) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else if (pow(B, 2.0) <= 4e+197) {
		tmp = (sqrt(((A + C) + hypot((A - C), B))) * (sqrt(F) * (B * -sqrt(2.0)))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (pow(F, 0.25) * (sqrt((A + hypot(B, A))) * -pow(F, 0.25)));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 2e-96)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	elseif ((B ^ 2.0) <= 4e+197)
		tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B))) * Float64(sqrt(F) * Float64(B * Float64(-sqrt(2.0))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64((F ^ 0.25) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-(F ^ 0.25)))));
	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]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-96], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 4e+197], N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[(B * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Power[F, 0.25], $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Power[F, 0.25], $MachinePrecision])), $MachinePrecision]), $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)\\
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-96}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

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

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


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

    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. Simplified27.5%

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

    if 1.9999999999999998e-96 < (pow.f64 B 2) < 3.9999999999999998e197

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999998e197 < (pow.f64 B 2)

    1. Initial program 4.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 C around 0 4.2%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{{\left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right)}^{0.5}}\right) \]
      2. pow-to-exp26.7%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    6. Applied egg-rr26.7%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    7. Step-by-step derivation
      1. exp-to-pow28.5%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{\sqrt{F}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)}\right) \]
      6. pow1/240.6%

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{\color{blue}{0.25}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      9. pow1/240.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{0.25} \cdot \left(\sqrt{\color{blue}{{F}^{0.5}}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      10. sqrt-pow140.6%

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{0.25} \cdot \left(\color{blue}{{F}^{\left(\frac{0.5}{2}\right)}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      11. metadata-eval40.6%

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

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

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

Alternative 4: 52.0% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 10^{+183}:\\ \;\;\;\;\frac{-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)} \cdot {\left(2 \cdot \left(F \cdot t_0\right)\right)}^{0.5}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left({F}^{0.25} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-{F}^{0.25}\right)\right)\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)))))
   (if (<= (pow B 2.0) 1e+183)
     (/
      (- (* (sqrt (+ (+ A C) (hypot (- A C) B))) (pow (* 2.0 (* F t_0)) 0.5)))
      t_0)
     (*
      (/ (sqrt 2.0) B)
      (* (pow F 0.25) (* (sqrt (+ A (hypot B A))) (- (pow F 0.25))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 1e+183) {
		tmp = -(sqrt(((A + C) + hypot((A - C), B))) * pow((2.0 * (F * t_0)), 0.5)) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (pow(F, 0.25) * (sqrt((A + hypot(B, A))) * -pow(F, 0.25)));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 1e+183)
		tmp = Float64(Float64(-Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B))) * (Float64(2.0 * Float64(F * t_0)) ^ 0.5))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64((F ^ 0.25) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-(F ^ 0.25)))));
	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]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+183], N[((-N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Power[F, 0.25], $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Power[F, 0.25], $MachinePrecision])), $MachinePrecision]), $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)\\
\mathbf{if}\;{B}^{2} \leq 10^{+183}:\\
\;\;\;\;\frac{-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)} \cdot {\left(2 \cdot \left(F \cdot t_0\right)\right)}^{0.5}}{t_0}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999947e182 < (pow.f64 B 2)

    1. Initial program 4.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 C around 0 5.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    6. Applied egg-rr27.1%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    7. Step-by-step derivation
      1. exp-to-pow29.0%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{\sqrt{F}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)}\right) \]
      6. pow1/240.8%

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{\color{blue}{0.25}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      9. pow1/240.8%

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{0.25} \cdot \left(\color{blue}{{F}^{\left(\frac{0.5}{2}\right)}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      11. metadata-eval40.8%

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

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

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

Alternative 5: 52.0% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 10^{+183}:\\ \;\;\;\;\frac{\sqrt{F \cdot t_0} \cdot \left(-\sqrt{2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left({F}^{0.25} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-{F}^{0.25}\right)\right)\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)))))
   (if (<= (pow B 2.0) 1e+183)
     (/
      (* (sqrt (* F t_0)) (- (sqrt (* 2.0 (+ (+ A C) (hypot (- A C) B))))))
      t_0)
     (*
      (/ (sqrt 2.0) B)
      (* (pow F 0.25) (* (sqrt (+ A (hypot B A))) (- (pow F 0.25))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 1e+183) {
		tmp = (sqrt((F * t_0)) * -sqrt((2.0 * ((A + C) + hypot((A - C), B))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (pow(F, 0.25) * (sqrt((A + hypot(B, A))) * -pow(F, 0.25)));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 1e+183)
		tmp = Float64(Float64(sqrt(Float64(F * t_0)) * Float64(-sqrt(Float64(2.0 * Float64(Float64(A + C) + hypot(Float64(A - C), B)))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64((F ^ 0.25) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-(F ^ 0.25)))));
	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]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+183], N[(N[(N[Sqrt[N[(F * t$95$0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Power[F, 0.25], $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Power[F, 0.25], $MachinePrecision])), $MachinePrecision]), $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)\\
\mathbf{if}\;{B}^{2} \leq 10^{+183}:\\
\;\;\;\;\frac{\sqrt{F \cdot t_0} \cdot \left(-\sqrt{2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)}\right)}{t_0}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999947e182 < (pow.f64 B 2)

    1. Initial program 4.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 C around 0 5.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    6. Applied egg-rr27.1%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    7. Step-by-step derivation
      1. exp-to-pow29.0%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{\sqrt{F}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)}\right) \]
      6. pow1/240.8%

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{\color{blue}{0.25}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      9. pow1/240.8%

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{0.25} \cdot \left(\color{blue}{{F}^{\left(\frac{0.5}{2}\right)}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      11. metadata-eval40.8%

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

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

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

Alternative 6: 48.9% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+33}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left({F}^{0.25} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-{F}^{0.25}\right)\right)\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)))))
   (if (<= (pow B 2.0) 2e+33)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (+ C (hypot B (- A C)))))))) t_0)
     (*
      (/ (sqrt 2.0) B)
      (* (pow F 0.25) (* (sqrt (+ A (hypot B A))) (- (pow F 0.25))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 2e+33) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (pow(F, 0.25) * (sqrt((A + hypot(B, A))) * -pow(F, 0.25)));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 2e+33)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64((F ^ 0.25) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-(F ^ 0.25)))));
	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]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+33], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Power[F, 0.25], $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Power[F, 0.25], $MachinePrecision])), $MachinePrecision]), $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)\\
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+33}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

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


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

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

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

    if 1.9999999999999999e33 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    6. Applied egg-rr26.9%

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{e^{\log \left(F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)\right) \cdot 0.5}}\right) \]
    7. Step-by-step derivation
      1. exp-to-pow28.7%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{\sqrt{F}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)}\right) \]
      6. pow1/237.8%

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{\color{blue}{0.25}} \cdot \left(\sqrt{\sqrt{F}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      9. pow1/237.8%

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-{F}^{0.25} \cdot \left(\color{blue}{{F}^{\left(\frac{0.5}{2}\right)}} \cdot \sqrt{A + \mathsf{hypot}\left(B, A\right)}\right)\right) \]
      11. metadata-eval37.8%

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

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

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

Alternative 7: 48.9% accurate, 1.2× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+33}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\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)))))
   (if (<= (pow B 2.0) 2e+33)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (+ C (hypot B (- A C)))))))) t_0)
     (* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 2e+33) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 2e+33)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F))));
	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]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+33], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $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)\\
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{+33}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

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


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

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

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

    if 1.9999999999999999e33 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 41.6% accurate, 1.2× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-30}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{+216}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F} \cdot \sqrt{B}\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) B)))
   (if (<= (pow B 2.0) 5e-30)
     (/
      (- (sqrt (* (* 2.0 C) (* 2.0 (* -4.0 (* A (* C F)))))))
      (- (pow B 2.0) (* (* 4.0 A) C)))
     (if (<= (pow B 2.0) 5e+216)
       (* t_0 (- (sqrt (* F (+ C (hypot B C))))))
       (* t_0 (- (* (sqrt F) (sqrt B))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = sqrt(2.0) / B;
	double tmp;
	if (pow(B, 2.0) <= 5e-30) {
		tmp = -sqrt(((2.0 * C) * (2.0 * (-4.0 * (A * (C * F)))))) / (pow(B, 2.0) - ((4.0 * A) * C));
	} else if (pow(B, 2.0) <= 5e+216) {
		tmp = t_0 * -sqrt((F * (C + hypot(B, C))));
	} else {
		tmp = t_0 * -(sqrt(F) * sqrt(B));
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.sqrt(2.0) / B;
	double tmp;
	if (Math.pow(B, 2.0) <= 5e-30) {
		tmp = -Math.sqrt(((2.0 * C) * (2.0 * (-4.0 * (A * (C * F)))))) / (Math.pow(B, 2.0) - ((4.0 * A) * C));
	} else if (Math.pow(B, 2.0) <= 5e+216) {
		tmp = t_0 * -Math.sqrt((F * (C + Math.hypot(B, C))));
	} else {
		tmp = t_0 * -(Math.sqrt(F) * Math.sqrt(B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = math.sqrt(2.0) / B
	tmp = 0
	if math.pow(B, 2.0) <= 5e-30:
		tmp = -math.sqrt(((2.0 * C) * (2.0 * (-4.0 * (A * (C * F)))))) / (math.pow(B, 2.0) - ((4.0 * A) * C))
	elif math.pow(B, 2.0) <= 5e+216:
		tmp = t_0 * -math.sqrt((F * (C + math.hypot(B, C))))
	else:
		tmp = t_0 * -(math.sqrt(F) * math.sqrt(B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(sqrt(2.0) / B)
	tmp = 0.0
	if ((B ^ 2.0) <= 5e-30)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * C) * Float64(2.0 * Float64(-4.0 * Float64(A * Float64(C * F))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)));
	elseif ((B ^ 2.0) <= 5e+216)
		tmp = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(C + hypot(B, C))))));
	else
		tmp = Float64(t_0 * Float64(-Float64(sqrt(F) * sqrt(B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = sqrt(2.0) / B;
	tmp = 0.0;
	if ((B ^ 2.0) <= 5e-30)
		tmp = -sqrt(((2.0 * C) * (2.0 * (-4.0 * (A * (C * F)))))) / ((B ^ 2.0) - ((4.0 * A) * C));
	elseif ((B ^ 2.0) <= 5e+216)
		tmp = t_0 * -sqrt((F * (C + hypot(B, C))));
	else
		tmp = t_0 * -(sqrt(F) * sqrt(B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-30], N[((-N[Sqrt[N[(N[(2.0 * C), $MachinePrecision] * N[(2.0 * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $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], 5e+216], N[(t$95$0 * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$0 * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B}\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\

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

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


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

    1. Initial program 15.9%

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

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

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

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

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

    if 4.99999999999999972e-30 < (pow.f64 B 2) < 4.9999999999999998e216

    1. Initial program 30.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. Taylor expanded in A around 0 26.9%

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

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

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

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

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

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

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

    if 4.9999999999999998e216 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 42.1% accurate, 1.2× 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 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{+216}:\\ \;\;\;\;t_1 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(-\sqrt{F} \cdot \sqrt{B}\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 (/ (sqrt 2.0) B)))
   (if (<= (pow B 2.0) 5e-36)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A A))))) t_0)
     (if (<= (pow B 2.0) 5e+216)
       (* t_1 (- (sqrt (* F (+ C (hypot B C))))))
       (* t_1 (- (* (sqrt F) (sqrt B))))))))
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 = sqrt(2.0) / B;
	double tmp;
	if (pow(B, 2.0) <= 5e-36) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + A)))) / t_0;
	} else if (pow(B, 2.0) <= 5e+216) {
		tmp = t_1 * -sqrt((F * (C + hypot(B, C))));
	} else {
		tmp = t_1 * -(sqrt(F) * sqrt(B));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(sqrt(2.0) / B)
	tmp = 0.0
	if ((B ^ 2.0) <= 5e-36)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + A))))) / t_0);
	elseif ((B ^ 2.0) <= 5e+216)
		tmp = Float64(t_1 * Float64(-sqrt(Float64(F * Float64(C + hypot(B, C))))));
	else
		tmp = Float64(t_1 * Float64(-Float64(sqrt(F) * sqrt(B))));
	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[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-36], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e+216], N[(t$95$1 * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$1 * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B], $MachinePrecision]), $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 := \frac{\sqrt{2}}{B}\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-36}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\

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

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


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

    1. Initial program 16.0%

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

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

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

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

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

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

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

    if 5.00000000000000004e-36 < (pow.f64 B 2) < 4.9999999999999998e216

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

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

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

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

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

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

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

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

    if 4.9999999999999998e216 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 44.7% accurate, 1.2× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \left(-\sqrt{F}\right)\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)))))
   (if (<= (pow B 2.0) 5e-36)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A A))))) t_0)
     (* (/ (sqrt 2.0) B) (* (sqrt (+ A (hypot B A))) (- (sqrt F)))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (pow(B, 2.0) <= 5e-36) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + A)))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * (sqrt((A + hypot(B, A))) * -sqrt(F));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B ^ 2.0) <= 5e-36)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + A))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(sqrt(Float64(A + hypot(B, A))) * Float64(-sqrt(F))));
	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]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-36], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $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)\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-36}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\

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


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

    1. Initial program 16.0%

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

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

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

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

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

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

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

    if 5.00000000000000004e-36 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 42.0% accurate, 1.5× speedup?

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

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


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

    1. Initial program 16.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 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 C\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Step-by-step derivation
      1. distribute-frac-neg19.7%

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

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

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

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

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

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

    if 5e6 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 41.3% accurate, 1.5× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-30}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F} \cdot \sqrt{B}\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-30)
   (/
    (- (sqrt (* (* 2.0 C) (* 2.0 (* -4.0 (* A (* C F)))))))
    (- (pow B 2.0) (* (* 4.0 A) C)))
   (* (/ (sqrt 2.0) B) (- (* (sqrt F) (sqrt B))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 5e-30) {
		tmp = -sqrt(((2.0 * C) * (2.0 * (-4.0 * (A * (C * F)))))) / (pow(B, 2.0) - ((4.0 * A) * C));
	} else {
		tmp = (sqrt(2.0) / B) * -(sqrt(F) * sqrt(B));
	}
	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 ((b ** 2.0d0) <= 5d-30) then
        tmp = -sqrt(((2.0d0 * c) * (2.0d0 * ((-4.0d0) * (a * (c * f)))))) / ((b ** 2.0d0) - ((4.0d0 * a) * c))
    else
        tmp = (sqrt(2.0d0) / b) * -(sqrt(f) * sqrt(b))
    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 (Math.pow(B, 2.0) <= 5e-30) {
		tmp = -Math.sqrt(((2.0 * C) * (2.0 * (-4.0 * (A * (C * F)))))) / (Math.pow(B, 2.0) - ((4.0 * A) * C));
	} else {
		tmp = (Math.sqrt(2.0) / B) * -(Math.sqrt(F) * Math.sqrt(B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	tmp = 0
	if math.pow(B, 2.0) <= 5e-30:
		tmp = -math.sqrt(((2.0 * C) * (2.0 * (-4.0 * (A * (C * F)))))) / (math.pow(B, 2.0) - ((4.0 * A) * C))
	else:
		tmp = (math.sqrt(2.0) / B) * -(math.sqrt(F) * math.sqrt(B))
	return tmp
B = abs(B)
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 5e-30)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * C) * Float64(2.0 * Float64(-4.0 * Float64(A * Float64(C * F))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-Float64(sqrt(F) * sqrt(B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if ((B ^ 2.0) <= 5e-30)
		tmp = -sqrt(((2.0 * C) * (2.0 * (-4.0 * (A * (C * F)))))) / ((B ^ 2.0) - ((4.0 * A) * C));
	else
		tmp = (sqrt(2.0) / B) * -(sqrt(F) * sqrt(B));
	end
	tmp_2 = 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-30], N[((-N[Sqrt[N[(N[(2.0 * C), $MachinePrecision] * N[(2.0 * N[(-4.0 * N[(A * N[(C * F), $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[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\

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


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

    1. Initial program 15.9%

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

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

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

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

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

    if 4.99999999999999972e-30 < (pow.f64 B 2)

    1. Initial program 13.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 37.3% accurate, 2.8× speedup?

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

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

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


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

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

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

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

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

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

    if -3.20000000000000004e-261 < F < 1e30

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

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

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

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

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

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

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

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

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

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

    if 1e30 < F

    1. Initial program 11.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 C around 0 8.4%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-261}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;F \leq 10^{+30}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]

Alternative 14: 28.4% accurate, 3.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e230 < A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\sqrt{F \cdot A} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{B} \]
      4. rem-square-sqrt9.7%

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

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

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

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

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

Alternative 15: 34.8% accurate, 3.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 3.19999999999999973e30

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999973e30 < F

    1. Initial program 11.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 C around 0 8.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 27.5% accurate, 3.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 7.0% accurate, 5.7× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\sqrt{F \cdot A} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{B} \]
      4. rem-square-sqrt2.9%

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

      \[\leadsto \color{blue}{-\sqrt{F \cdot A} \cdot \frac{2}{B}} \]
    8. Step-by-step derivation
      1. pow1/23.0%

        \[\leadsto -\color{blue}{{\left(F \cdot A\right)}^{0.5}} \cdot \frac{2}{B} \]
      2. *-commutative3.0%

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

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

    if 8.19999999999999965e-308 < C

    1. Initial program 17.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 A around -inf 19.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 C\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Taylor expanded in B around inf 6.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq 8.2 \cdot 10^{-308}:\\ \;\;\;\;\frac{2}{B} \cdot \left(-{\left(A \cdot F\right)}^{0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \frac{1}{B}\right) \cdot \sqrt{C \cdot F}\\ \end{array} \]

Alternative 18: 5.0% accurate, 5.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\sqrt{F \cdot A} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{B} \]
    4. rem-square-sqrt2.2%

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

    \[\leadsto \color{blue}{-\sqrt{F \cdot A} \cdot \frac{2}{B}} \]
  8. Step-by-step derivation
    1. pow1/22.4%

      \[\leadsto -\color{blue}{{\left(F \cdot A\right)}^{0.5}} \cdot \frac{2}{B} \]
    2. *-commutative2.4%

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

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

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

Alternative 19: 4.8% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \frac{-2 \cdot \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(Float64(-2.0 * 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[(N[(-2.0 * N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\frac{-2 \cdot \sqrt{A \cdot F}}{B}
\end{array}
Derivation
  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. Taylor expanded in C around 0 8.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{A \cdot F} \cdot \frac{{\left(\sqrt{2}\right)}^{2}}{B}} \]
    2. associate-*r/2.2%

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

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

      \[\leadsto \frac{-\sqrt{A \cdot F} \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}}{B} \]
    5. rem-square-sqrt2.2%

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

      \[\leadsto \frac{\color{blue}{\sqrt{A \cdot F} \cdot \left(-2\right)}}{B} \]
    7. metadata-eval2.2%

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

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

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

Reproduce

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