ABCF->ab-angle a

Percentage Accurate: 19.1% → 48.9%
Time: 1.0min
Alternatives: 20
Speedup: 3.0×

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

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

Initial Program: 19.1% accurate, 1.0× speedup?

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

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

Alternative 1: 48.9% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 40.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. Simplified40.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \left(-\sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\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. Simplified0.0%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 38.6% accurate, 1.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}\;A \leq -4.6 \cdot 10^{+170}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)}}{t_0}\\ \mathbf{elif}\;A \leq 1.62 \cdot 10^{-285}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\frac{1}{F}}{C + \mathsf{hypot}\left(C, B\right)}} \cdot \frac{-B}{\sqrt{2}}}\\ \mathbf{elif}\;A \leq 2.3 \cdot 10^{-145}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\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 (<= A -4.6e+170)
     (/
      (- (sqrt (* (* 2.0 (* F t_0)) (+ C (+ C (* -0.5 (/ (* B B) A)))))))
      t_0)
     (if (<= A 1.62e-285)
       (/ 1.0 (* (sqrt (/ (/ 1.0 F) (+ C (hypot C B)))) (/ (- B) (sqrt 2.0))))
       (if (<= A 2.3e-145)
         (* (sqrt (/ F B)) (- (sqrt 2.0)))
         (/
          (*
           (sqrt (* 2.0 (* F (+ (* B B) (* -4.0 (* A C))))))
           (- (sqrt (+ A (+ C (hypot B (- A C)))))))
          (- (* B B) (* 4.0 (* A C)))))))))
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 (A <= -4.6e+170) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
	} else if (A <= 1.62e-285) {
		tmp = 1.0 / (sqrt(((1.0 / F) / (C + hypot(C, B)))) * (-B / sqrt(2.0)));
	} else if (A <= 2.3e-145) {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	} else {
		tmp = (sqrt((2.0 * (F * ((B * B) + (-4.0 * (A * C)))))) * -sqrt((A + (C + hypot(B, (A - C)))))) / ((B * B) - (4.0 * (A * C)));
	}
	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 (A <= -4.6e+170)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0);
	elseif (A <= 1.62e-285)
		tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(1.0 / F) / Float64(C + hypot(C, B)))) * Float64(Float64(-B) / sqrt(2.0))));
	elseif (A <= 2.3e-145)
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	else
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(A + Float64(C + hypot(B, Float64(A - C))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
	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[A, -4.6e+170], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 1.62e-285], N[(1.0 / N[(N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-B) / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.3e-145], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $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}\;A \leq -4.6 \cdot 10^{+170}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)}}{t_0}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -4.6000000000000001e170

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

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

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

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

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

    if -4.6000000000000001e170 < A < 1.61999999999999994e-285

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.61999999999999994e-285 < A < 2.30000000000000007e-145

    1. Initial program 30.4%

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

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

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

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

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

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

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

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

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

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

    if 2.30000000000000007e-145 < A

    1. Initial program 35.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. Simplified35.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -4.6 \cdot 10^{+170}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;A \leq 1.62 \cdot 10^{-285}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\frac{1}{F}}{C + \mathsf{hypot}\left(C, B\right)}} \cdot \frac{-B}{\sqrt{2}}}\\ \mathbf{elif}\;A \leq 2.3 \cdot 10^{-145}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \end{array} \]

Alternative 3: 35.6% accurate, 1.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 := -4 \cdot \left(A \cdot C\right)\\ t_2 := B \cdot B + t_1\\ \mathbf{if}\;A \leq -4.6 \cdot 10^{+170}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + C\right)}}{t_0}\\ \mathbf{elif}\;A \leq 8.2 \cdot 10^{-284}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\frac{1}{F}}{C + \mathsf{hypot}\left(C, B\right)}} \cdot \frac{-B}{\sqrt{2}}}\\ \mathbf{elif}\;A \leq 5.9 \cdot 10^{-142}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;A \leq 0.00065:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_2\right)\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, t_1\right)} \cdot \left(-\sqrt{A + \left(A + C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\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 (* -4.0 (* A C)))
        (t_2 (+ (* B B) t_1)))
   (if (<= A -4.6e+170)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (+ C C)))) t_0)
     (if (<= A 8.2e-284)
       (/ 1.0 (* (sqrt (/ (/ 1.0 F) (+ C (hypot C B)))) (/ (- B) (sqrt 2.0))))
       (if (<= A 5.9e-142)
         (* (sqrt (/ F B)) (- (sqrt 2.0)))
         (if (<= A 0.00065)
           (/
            (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_2)))))
            t_2)
           (/
            (* (sqrt (* (* 2.0 F) (fma B B t_1))) (- (sqrt (+ A (+ A C)))))
            (- (* B B) (* 4.0 (* A C))))))))))
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 = -4.0 * (A * C);
	double t_2 = (B * B) + t_1;
	double tmp;
	if (A <= -4.6e+170) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (C + C))) / t_0;
	} else if (A <= 8.2e-284) {
		tmp = 1.0 / (sqrt(((1.0 / F) / (C + hypot(C, B)))) * (-B / sqrt(2.0)));
	} else if (A <= 5.9e-142) {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	} else if (A <= 0.00065) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_2)))) / t_2;
	} else {
		tmp = (sqrt(((2.0 * F) * fma(B, B, t_1))) * -sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C)));
	}
	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(-4.0 * Float64(A * C))
	t_2 = Float64(Float64(B * B) + t_1)
	tmp = 0.0
	if (A <= -4.6e+170)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(C + C)))) / t_0);
	elseif (A <= 8.2e-284)
		tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(1.0 / F) / Float64(C + hypot(C, B)))) * Float64(Float64(-B) / sqrt(2.0))));
	elseif (A <= 5.9e-142)
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	elseif (A <= 0.00065)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_2))))) / t_2);
	else
		tmp = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * fma(B, B, t_1))) * Float64(-sqrt(Float64(A + Float64(A + C))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
	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[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[A, -4.6e+170], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(C + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 8.2e-284], N[(1.0 / N[(N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-B) / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.9e-142], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], If[LessEqual[A, 0.00065], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(B * B + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $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)\\
t_1 := -4 \cdot \left(A \cdot C\right)\\
t_2 := B \cdot B + t_1\\
\mathbf{if}\;A \leq -4.6 \cdot 10^{+170}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + C\right)}}{t_0}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if A < -4.6000000000000001e170

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

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

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

    if -4.6000000000000001e170 < A < 8.19999999999999997e-284

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.19999999999999997e-284 < A < 5.89999999999999966e-142

    1. Initial program 30.4%

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

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

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

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

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

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

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

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

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

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

    if 5.89999999999999966e-142 < A < 6.4999999999999997e-4

    1. Initial program 52.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. Simplified52.6%

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

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

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

    if 6.4999999999999997e-4 < A

    1. Initial program 30.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -4.6 \cdot 10^{+170}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)\right) \cdot \left(C + C\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;A \leq 8.2 \cdot 10^{-284}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\frac{1}{F}}{C + \mathsf{hypot}\left(C, B\right)}} \cdot \frac{-B}{\sqrt{2}}}\\ \mathbf{elif}\;A \leq 5.9 \cdot 10^{-142}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;A \leq 0.00065:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)} \cdot \left(-\sqrt{A + \left(A + C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \end{array} \]

Alternative 4: 36.3% accurate, 1.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 := -4 \cdot \left(A \cdot C\right)\\ t_2 := B \cdot B + t_1\\ \mathbf{if}\;A \leq -4.8 \cdot 10^{+170}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)}}{t_0}\\ \mathbf{elif}\;A \leq 5.6 \cdot 10^{-284}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\frac{1}{F}}{C + \mathsf{hypot}\left(C, B\right)}} \cdot \frac{-B}{\sqrt{2}}}\\ \mathbf{elif}\;A \leq 2.5 \cdot 10^{-144}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;A \leq 0.00065:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_2\right)\right)}}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, t_1\right)} \cdot \left(-\sqrt{A + \left(A + C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\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 (* -4.0 (* A C)))
        (t_2 (+ (* B B) t_1)))
   (if (<= A -4.8e+170)
     (/
      (- (sqrt (* (* 2.0 (* F t_0)) (+ C (+ C (* -0.5 (/ (* B B) A)))))))
      t_0)
     (if (<= A 5.6e-284)
       (/ 1.0 (* (sqrt (/ (/ 1.0 F) (+ C (hypot C B)))) (/ (- B) (sqrt 2.0))))
       (if (<= A 2.5e-144)
         (* (sqrt (/ F B)) (- (sqrt 2.0)))
         (if (<= A 0.00065)
           (/
            (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_2)))))
            t_2)
           (/
            (* (sqrt (* (* 2.0 F) (fma B B t_1))) (- (sqrt (+ A (+ A C)))))
            (- (* B B) (* 4.0 (* A C))))))))))
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 = -4.0 * (A * C);
	double t_2 = (B * B) + t_1;
	double tmp;
	if (A <= -4.8e+170) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (C + (C + (-0.5 * ((B * B) / A)))))) / t_0;
	} else if (A <= 5.6e-284) {
		tmp = 1.0 / (sqrt(((1.0 / F) / (C + hypot(C, B)))) * (-B / sqrt(2.0)));
	} else if (A <= 2.5e-144) {
		tmp = sqrt((F / B)) * -sqrt(2.0);
	} else if (A <= 0.00065) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_2)))) / t_2;
	} else {
		tmp = (sqrt(((2.0 * F) * fma(B, B, t_1))) * -sqrt((A + (A + C)))) / ((B * B) - (4.0 * (A * C)));
	}
	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(-4.0 * Float64(A * C))
	t_2 = Float64(Float64(B * B) + t_1)
	tmp = 0.0
	if (A <= -4.8e+170)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(C + Float64(C + Float64(-0.5 * Float64(Float64(B * B) / A))))))) / t_0);
	elseif (A <= 5.6e-284)
		tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(1.0 / F) / Float64(C + hypot(C, B)))) * Float64(Float64(-B) / sqrt(2.0))));
	elseif (A <= 2.5e-144)
		tmp = Float64(sqrt(Float64(F / B)) * Float64(-sqrt(2.0)));
	elseif (A <= 0.00065)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_2))))) / t_2);
	else
		tmp = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * fma(B, B, t_1))) * Float64(-sqrt(Float64(A + Float64(A + C))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
	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[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B * B), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[A, -4.8e+170], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(C + N[(C + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[A, 5.6e-284], N[(1.0 / N[(N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-B) / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.5e-144], N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], If[LessEqual[A, 0.00065], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(B * B + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $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)\\
t_1 := -4 \cdot \left(A \cdot C\right)\\
t_2 := B \cdot B + t_1\\
\mathbf{if}\;A \leq -4.8 \cdot 10^{+170}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)}}{t_0}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if A < -4.8e170

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

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

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

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

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

    if -4.8e170 < A < 5.6000000000000006e-284

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.6000000000000006e-284 < A < 2.4999999999999999e-144

    1. Initial program 30.4%

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

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

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

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

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

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

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

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

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

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

    if 2.4999999999999999e-144 < A < 6.4999999999999997e-4

    1. Initial program 52.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. Simplified52.6%

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

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

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

    if 6.4999999999999997e-4 < A

    1. Initial program 30.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -4.8 \cdot 10^{+170}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)\right) \cdot \left(C + \left(C + -0.5 \cdot \frac{B \cdot B}{A}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;A \leq 5.6 \cdot 10^{-284}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\frac{1}{F}}{C + \mathsf{hypot}\left(C, B\right)}} \cdot \frac{-B}{\sqrt{2}}}\\ \mathbf{elif}\;A \leq 2.5 \cdot 10^{-144}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;A \leq 0.00065:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot \left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)} \cdot \left(-\sqrt{A + \left(A + C\right)}\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \end{array} \]

Alternative 5: 41.7% accurate, 1.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.39999999999999991e-126 < B < 2.99999999999999989e31

    1. Initial program 50.7%

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

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

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

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

    if 2.99999999999999989e31 < B

    1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 40.0% accurate, 1.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 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 1.35 \cdot 10^{-144}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + A\right)}}{t_0}\\ \mathbf{elif}\;B \leq 3.2 \cdot 10^{+31}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_1\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\frac{1}{F}}{C + \mathsf{hypot}\left(C, B\right)}} \cdot \frac{-B}{\sqrt{2}}}\\ \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 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 1.35e-144)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (+ A A)))) t_0)
     (if (<= B 3.2e+31)
       (/ (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_1))))) t_1)
       (/
        1.0
        (* (sqrt (/ (/ 1.0 F) (+ C (hypot C B)))) (/ (- B) (sqrt 2.0))))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (A * (C * -4.0)));
	double t_1 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 1.35e-144) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (A + A))) / t_0;
	} else if (B <= 3.2e+31) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_1)))) / t_1;
	} else {
		tmp = 1.0 / (sqrt(((1.0 / F) / (C + hypot(C, B)))) * (-B / sqrt(2.0)));
	}
	return tmp;
}
B = abs(B)
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 1.35e-144)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(A + A)))) / t_0);
	elseif (B <= 3.2e+31)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_1))))) / t_1);
	else
		tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(1.0 / F) / Float64(C + hypot(C, B)))) * Float64(Float64(-B) / sqrt(2.0))));
	end
	return tmp
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.35e-144], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 3.2e+31], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(N[(1.0 / F), $MachinePrecision] / N[(C + N[Sqrt[C ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-B) / N[Sqrt[2.0], $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)\\
t_1 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 1.35 \cdot 10^{-144}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(A + A\right)}}{t_0}\\

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

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


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

    1. Initial program 22.9%

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

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

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

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

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

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

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

    if 1.34999999999999988e-144 < B < 3.2000000000000001e31

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

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

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

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

    if 3.2000000000000001e31 < B

    1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 40.5% accurate, 2.0× speedup?

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

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


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

    1. Initial program 27.2%

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

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

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

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

    if 3.35000000000000008e31 < B

    1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 39.9% accurate, 2.0× speedup?

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

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


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

    1. Initial program 27.2%

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

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

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

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

    if 3.1000000000000002e31 < B

    1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 39.3% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 1800000:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= B 1800000.0)
     (/ (- (sqrt (* 2.0 (* (+ A (+ C (hypot B (- A C)))) (* F t_0))))) t_0)
     (* (sqrt (* F (+ A (hypot B A)))) (/ (- (sqrt 2.0)) B)))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 1800000.0) {
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else {
		tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / B);
	}
	return tmp;
}
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	double t_0 = (B * B) + (-4.0 * (A * C));
	double tmp;
	if (B <= 1800000.0) {
		tmp = -Math.sqrt((2.0 * ((A + (C + Math.hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	} else {
		tmp = Math.sqrt((F * (A + Math.hypot(B, A)))) * (-Math.sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if B <= 1800000.0:
		tmp = -math.sqrt((2.0 * ((A + (C + math.hypot(B, (A - C)))) * (F * t_0)))) / t_0
	else:
		tmp = math.sqrt((F * (A + math.hypot(B, A)))) * (-math.sqrt(2.0) / B)
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 1800000.0)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + hypot(B, Float64(A - C)))) * Float64(F * t_0))))) / t_0);
	else
		tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B, A)))) * Float64(Float64(-sqrt(2.0)) / B));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (B <= 1800000.0)
		tmp = -sqrt((2.0 * ((A + (C + hypot(B, (A - C)))) * (F * t_0)))) / t_0;
	else
		tmp = sqrt((F * (A + hypot(B, A)))) * (-sqrt(2.0) / 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[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1800000.0], N[((-N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B + -4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 1800000:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\

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


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

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

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

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

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

    if 1.8e6 < B

    1. Initial program 25.2%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A + \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}\right) \]
      5. unpow236.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-def61.3%

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

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

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

Alternative 10: 34.5% accurate, 2.7× speedup?

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

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

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


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

    1. Initial program 22.8%

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

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

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

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

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

    if 1e-99 < B < 2.44999999999999998e119

    1. Initial program 48.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. Simplified48.5%

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

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

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

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

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

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

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

    if 2.44999999999999998e119 < B

    1. Initial program 4.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 38.5% accurate, 2.7× speedup?

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

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


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

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

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

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

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

    if 1.55000000000000009e110 < B

    1. Initial program 4.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 34.6% accurate, 2.7× speedup?

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

\mathbf{elif}\;B \leq 1.06 \cdot 10^{+110}:\\
\;\;\;\;t_1 \cdot \frac{-1}{B \cdot B}\\

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


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

    1. Initial program 22.5%

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

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

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

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

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

    if 3.0500000000000001e-89 < B < 1.06000000000000005e110

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

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

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

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

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

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

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

    if 1.06000000000000005e110 < B

    1. Initial program 4.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 28.4% accurate, 3.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.10000000000000021e-280 < A < 2.70000000000000016e-25

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

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

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

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

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

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

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

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

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

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

    if 2.70000000000000016e-25 < A

    1. Initial program 34.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. Simplified34.0%

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

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

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

Alternative 14: 28.8% accurate, 3.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < 4.20000000000000005e-25

    1. Initial program 22.5%

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000005e-25 < A

    1. Initial program 34.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. Simplified34.0%

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

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

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

Alternative 15: 17.8% accurate, 4.7× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_1 := 2 \cdot \left(F \cdot t_0\right)\\ \mathbf{if}\;A \leq -4.4 \cdot 10^{-47}:\\ \;\;\;\;\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)\right)} \cdot \frac{-1}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;A \leq 6.1 \cdot 10^{-34}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{t_1 \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (* B B) (* 4.0 (* A C)))) (t_1 (* 2.0 (* F t_0))))
   (if (<= A -4.4e-47)
     (*
      (sqrt (* 2.0 (* -8.0 (* F (* A (* C C))))))
      (/ -1.0 (+ (* B B) (* -4.0 (* A C)))))
     (if (<= A 6.1e-34)
       (/ (- (sqrt (* t_1 (+ (+ A C) (- C A))))) t_0)
       (- (/ (sqrt (* t_1 (+ A (+ A C)))) t_0))))))
B = abs(B);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) - (4.0 * (A * C));
	double t_1 = 2.0 * (F * t_0);
	double tmp;
	if (A <= -4.4e-47) {
		tmp = sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) * (-1.0 / ((B * B) + (-4.0 * (A * C))));
	} else if (A <= 6.1e-34) {
		tmp = -sqrt((t_1 * ((A + C) + (C - A)))) / t_0;
	} else {
		tmp = -(sqrt((t_1 * (A + (A + C)))) / t_0);
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = (b * b) - (4.0d0 * (a * c))
    t_1 = 2.0d0 * (f * t_0)
    if (a <= (-4.4d-47)) then
        tmp = sqrt((2.0d0 * ((-8.0d0) * (f * (a * (c * c)))))) * ((-1.0d0) / ((b * b) + ((-4.0d0) * (a * c))))
    else if (a <= 6.1d-34) then
        tmp = -sqrt((t_1 * ((a + c) + (c - a)))) / t_0
    else
        tmp = -(sqrt((t_1 * (a + (a + c)))) / t_0)
    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 = (B * B) - (4.0 * (A * C));
	double t_1 = 2.0 * (F * t_0);
	double tmp;
	if (A <= -4.4e-47) {
		tmp = Math.sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) * (-1.0 / ((B * B) + (-4.0 * (A * C))));
	} else if (A <= 6.1e-34) {
		tmp = -Math.sqrt((t_1 * ((A + C) + (C - A)))) / t_0;
	} else {
		tmp = -(Math.sqrt((t_1 * (A + (A + C)))) / t_0);
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) - (4.0 * (A * C))
	t_1 = 2.0 * (F * t_0)
	tmp = 0
	if A <= -4.4e-47:
		tmp = math.sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) * (-1.0 / ((B * B) + (-4.0 * (A * C))))
	elif A <= 6.1e-34:
		tmp = -math.sqrt((t_1 * ((A + C) + (C - A)))) / t_0
	else:
		tmp = -(math.sqrt((t_1 * (A + (A + C)))) / t_0)
	return tmp
B = abs(B)
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	t_1 = Float64(2.0 * Float64(F * t_0))
	tmp = 0.0
	if (A <= -4.4e-47)
		tmp = Float64(sqrt(Float64(2.0 * Float64(-8.0 * Float64(F * Float64(A * Float64(C * C)))))) * Float64(-1.0 / Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C)))));
	elseif (A <= 6.1e-34)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(Float64(A + C) + Float64(C - A))))) / t_0);
	else
		tmp = Float64(-Float64(sqrt(Float64(t_1 * Float64(A + Float64(A + C)))) / t_0));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) - (4.0 * (A * C));
	t_1 = 2.0 * (F * t_0);
	tmp = 0.0;
	if (A <= -4.4e-47)
		tmp = sqrt((2.0 * (-8.0 * (F * (A * (C * C)))))) * (-1.0 / ((B * B) + (-4.0 * (A * C))));
	elseif (A <= 6.1e-34)
		tmp = -sqrt((t_1 * ((A + C) + (C - A)))) / t_0;
	else
		tmp = -(sqrt((t_1 * (A + (A + C)))) / t_0);
	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[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[A, -4.4e-47], N[(N[Sqrt[N[(2.0 * N[(-8.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 6.1e-34], N[((-N[Sqrt[N[(t$95$1 * N[(N[(A + C), $MachinePrecision] + N[(C - A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], (-N[(N[Sqrt[N[(t$95$1 * N[(A + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision])]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := 2 \cdot \left(F \cdot t_0\right)\\
\mathbf{if}\;A \leq -4.4 \cdot 10^{-47}:\\
\;\;\;\;\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)\right)} \cdot \frac{-1}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\

\mathbf{elif}\;A \leq 6.1 \cdot 10^{-34}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{t_1 \cdot \left(A + \left(A + C\right)\right)}}{t_0}\\


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

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

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

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

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

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

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

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

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

    if -4.40000000000000037e-47 < A < 6.0999999999999998e-34

    1. Initial program 31.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. Simplified31.6%

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

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

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

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

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

    if 6.0999999999999998e-34 < A

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -4.4 \cdot 10^{-47}:\\ \;\;\;\;\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)\right)} \cdot \frac{-1}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;A \leq 6.1 \cdot 10^{-34}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(\left(A + C\right) + \left(C - A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{\left(2 \cdot \left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right)\right) \cdot \left(A + \left(A + C\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \end{array} \]

Alternative 16: 14.7% accurate, 4.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -4.19999999999999984e-176

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

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

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

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

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

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

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

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

    if -4.19999999999999984e-176 < A

    1. Initial program 34.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. Simplified34.4%

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

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

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

Alternative 17: 13.7% accurate, 4.8× speedup?

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

\mathbf{elif}\;A \leq 1.3 \cdot 10^{+25}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;A \leq 2.35 \cdot 10^{+106}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if A < -6.6000000000000005e-42

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

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

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

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

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

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

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

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

    if -6.6000000000000005e-42 < A < 1.2999999999999999e25 or 3.30000000000000023e48 < A < 2.35000000000000012e106

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

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

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

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

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

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

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

    if 1.2999999999999999e25 < A < 3.30000000000000023e48

    1. Initial program 82.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. Simplified82.8%

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

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

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

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

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

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

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

    if 2.35000000000000012e106 < A

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -6.6 \cdot 10^{-42}:\\ \;\;\;\;\sqrt{2 \cdot \left(-8 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)\right)} \cdot \frac{-1}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;A \leq 1.3 \cdot 10^{+25}:\\ \;\;\;\;\sqrt{2 \cdot \left(-8 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)\right)} \cdot \frac{-1}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;A \leq 3.3 \cdot 10^{+48}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \left(-\frac{2}{B}\right)\\ \mathbf{elif}\;A \leq 2.35 \cdot 10^{+106}:\\ \;\;\;\;\sqrt{2 \cdot \left(-8 \cdot \left(\left(A \cdot A\right) \cdot \left(C \cdot F\right)\right)\right)} \cdot \frac{-1}{B \cdot B + -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{B} \cdot \left(-{\left(A \cdot F\right)}^{0.5}\right)\\ \end{array} \]

Alternative 18: 10.1% accurate, 5.1× speedup?

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

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


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

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

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

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

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

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

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

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

    if 3.7000000000000002e-87 < B

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 4.9% 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 25.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 4.8% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \sqrt{A \cdot F} \cdot \left(-\frac{2}{B}\right) \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F) :precision binary64 (* (sqrt (* A F)) (- (/ 2.0 B))))
B = abs(B);
double code(double A, double B, double C, double F) {
	return sqrt((A * F)) * -(2.0 / B);
}
NOTE: B should be positive before calling this function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = sqrt((a * f)) * -(2.0d0 / b)
end function
B = Math.abs(B);
public static double code(double A, double B, double C, double F) {
	return Math.sqrt((A * F)) * -(2.0 / B);
}
B = abs(B)
def code(A, B, C, F):
	return math.sqrt((A * F)) * -(2.0 / B)
B = abs(B)
function code(A, B, C, F)
	return Float64(sqrt(Float64(A * F)) * Float64(-Float64(2.0 / B)))
end
B = abs(B)
function tmp = code(A, B, C, F)
	tmp = sqrt((A * F)) * -(2.0 / B);
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * (-N[(2.0 / B), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
\\
\sqrt{A \cdot F} \cdot \left(-\frac{2}{B}\right)
\end{array}
Derivation
  1. Initial program 25.9%

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

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

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

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

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

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

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

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

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

Reproduce

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