ABCF->ab-angle a

Percentage Accurate: 19.2% → 52.2%
Time: 51.1s
Alternatives: 20
Speedup: 5.8×

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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 52.2% accurate, 1.2× speedup?

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

\mathbf{elif}\;B \leq 3 \cdot 10^{-249}:\\
\;\;\;\;-0.5 \cdot \left(\sqrt{\frac{F}{\frac{C}{\mathsf{fma}\left(0.5, \frac{B}{C} \cdot \frac{B}{C}, -2\right)}}} \cdot \sqrt{2}\right)\\

\mathbf{elif}\;B \leq 8.6 \cdot 10^{+92}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 1.15e-261 or 3.00000000000000004e-249 < B < 8.5999999999999996e92

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

      \[\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. Step-by-step derivation
      1. sqrt-prod31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \color{blue}{\left(A \cdot C\right) \cdot -4}\right)\right)} \cdot \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. *-commutative31.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{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. distribute-rgt-in31.7%

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

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

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

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

    if 1.15e-261 < B < 3.00000000000000004e-249

    1. Initial program 1.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. Simplified1.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 -inf 2.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}{\left(A + \left(-1 \cdot C + \left(-0.5 \cdot \frac{A \cdot {B}^{2}}{{C}^{2}} + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. associate-+r+2.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}{\left(\left(A + -1 \cdot C\right) + \left(-0.5 \cdot \frac{A \cdot {B}^{2}}{{C}^{2}} + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg2.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) + \left(\left(A + \color{blue}{\left(-C\right)}\right) + \left(-0.5 \cdot \frac{A \cdot {B}^{2}}{{C}^{2}} + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. sub-neg2.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) + \left(\color{blue}{\left(A - C\right)} + \left(-0.5 \cdot \frac{A \cdot {B}^{2}}{{C}^{2}} + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. distribute-lft-out2.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) + \left(\left(A - C\right) + \color{blue}{-0.5 \cdot \left(\frac{A \cdot {B}^{2}}{{C}^{2}} + \frac{{B}^{2}}{C}\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-/l*2.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) + \left(\left(A - C\right) + -0.5 \cdot \left(\color{blue}{\frac{A}{\frac{{C}^{2}}{{B}^{2}}}} + \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow22.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) + \left(\left(A - C\right) + -0.5 \cdot \left(\frac{A}{\frac{\color{blue}{C \cdot C}}{{B}^{2}}} + \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. unpow22.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) + \left(\left(A - C\right) + -0.5 \cdot \left(\frac{A}{\frac{C \cdot C}{\color{blue}{B \cdot B}}} + \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      8. unpow22.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) + \left(\left(A - C\right) + -0.5 \cdot \left(\frac{A}{\frac{C \cdot C}{B \cdot B}} + \frac{\color{blue}{B \cdot B}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified2.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}{\left(\left(A - C\right) + -0.5 \cdot \left(\frac{A}{\frac{C \cdot C}{B \cdot B}} + \frac{B \cdot B}{C}\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in A around -inf 52.1%

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

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

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

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

        \[\leadsto -0.5 \cdot \left(\sqrt{\frac{F}{\frac{C}{\mathsf{fma}\left(0.5, \frac{B \cdot B}{\color{blue}{C \cdot C}}, -2\right)}}} \cdot \sqrt{2}\right) \]
      5. times-frac52.1%

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

        \[\leadsto -0.5 \cdot \left(\sqrt{\frac{F}{\frac{C}{\mathsf{fma}\left(0.5, \frac{B}{C} \cdot \frac{B}{C}, \color{blue}{-2}\right)}}} \cdot \sqrt{2}\right) \]
    8. Simplified52.1%

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

    if 8.5999999999999996e92 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.15 \cdot 10^{-261}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B \cdot B\right) \cdot F + F \cdot \left(A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \left(-\sqrt{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)}\\ \mathbf{elif}\;B \leq 3 \cdot 10^{-249}:\\ \;\;\;\;-0.5 \cdot \left(\sqrt{\frac{F}{\frac{C}{\mathsf{fma}\left(0.5, \frac{B}{C} \cdot \frac{B}{C}, -2\right)}}} \cdot \sqrt{2}\right)\\ \mathbf{elif}\;B \leq 8.6 \cdot 10^{+92}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B \cdot B\right) \cdot F + F \cdot \left(A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \left(-\sqrt{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)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(C, B\right)}\right) \cdot \left(-{\left(\frac{B}{\sqrt{2}}\right)}^{-1}\right)\\ \end{array} \]

Alternative 2: 52.6% accurate, 1.0× speedup?

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

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


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

    1. Initial program 20.2%

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

      \[\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. Step-by-step derivation
      1. sqrt-prod37.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999998e185 < (pow.f64 B 2)

    1. Initial program 5.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified5.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 A around 0 8.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 52.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;B \leq 1.55 \cdot 10^{+93}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 1.1000000000000001e-261 or 4.00000000000000022e-249 < B < 1.5500000000000001e93

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

      \[\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. Step-by-step derivation
      1. sqrt-prod31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\sqrt{2 \cdot \left(F \cdot \left(B \cdot B + \color{blue}{\left(A \cdot C\right) \cdot -4}\right)\right)} \cdot \sqrt{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. *-commutative31.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{C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. distribute-rgt-in31.7%

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

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

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

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

    if 1.1000000000000001e-261 < B < 4.00000000000000022e-249

    1. Initial program 1.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. Simplified1.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 -inf 2.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}{\left(A + \left(-1 \cdot C + \left(-0.5 \cdot \frac{A \cdot {B}^{2}}{{C}^{2}} + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. associate-+r+2.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}{\left(\left(A + -1 \cdot C\right) + \left(-0.5 \cdot \frac{A \cdot {B}^{2}}{{C}^{2}} + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. mul-1-neg2.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) + \left(\left(A + \color{blue}{\left(-C\right)}\right) + \left(-0.5 \cdot \frac{A \cdot {B}^{2}}{{C}^{2}} + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. sub-neg2.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) + \left(\color{blue}{\left(A - C\right)} + \left(-0.5 \cdot \frac{A \cdot {B}^{2}}{{C}^{2}} + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      4. distribute-lft-out2.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) + \left(\left(A - C\right) + \color{blue}{-0.5 \cdot \left(\frac{A \cdot {B}^{2}}{{C}^{2}} + \frac{{B}^{2}}{C}\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. associate-/l*2.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) + \left(\left(A - C\right) + -0.5 \cdot \left(\color{blue}{\frac{A}{\frac{{C}^{2}}{{B}^{2}}}} + \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      6. unpow22.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) + \left(\left(A - C\right) + -0.5 \cdot \left(\frac{A}{\frac{\color{blue}{C \cdot C}}{{B}^{2}}} + \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      7. unpow22.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) + \left(\left(A - C\right) + -0.5 \cdot \left(\frac{A}{\frac{C \cdot C}{\color{blue}{B \cdot B}}} + \frac{{B}^{2}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      8. unpow22.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) + \left(\left(A - C\right) + -0.5 \cdot \left(\frac{A}{\frac{C \cdot C}{B \cdot B}} + \frac{\color{blue}{B \cdot B}}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified2.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}{\left(\left(A - C\right) + -0.5 \cdot \left(\frac{A}{\frac{C \cdot C}{B \cdot B}} + \frac{B \cdot B}{C}\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in A around -inf 52.1%

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

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

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

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

        \[\leadsto -0.5 \cdot \left(\sqrt{\frac{F}{\frac{C}{\mathsf{fma}\left(0.5, \frac{B \cdot B}{\color{blue}{C \cdot C}}, -2\right)}}} \cdot \sqrt{2}\right) \]
      5. times-frac52.1%

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

        \[\leadsto -0.5 \cdot \left(\sqrt{\frac{F}{\frac{C}{\mathsf{fma}\left(0.5, \frac{B}{C} \cdot \frac{B}{C}, \color{blue}{-2}\right)}}} \cdot \sqrt{2}\right) \]
    8. Simplified52.1%

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

    if 1.5500000000000001e93 < B

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 52.6% accurate, 1.5× speedup?

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

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


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

    1. Initial program 17.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified17.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-prod20.1%

        \[\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. *-commutative20.1%

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

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

        \[\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+20.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. unpow220.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-udef30.8%

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

      \[\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)} \]

    if 3.10000000000000019e93 < B

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 50.8% accurate, 1.9× speedup?

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

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


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

    1. Initial program 17.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified17.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-prod20.1%

        \[\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. *-commutative20.1%

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

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

        \[\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+20.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. unpow220.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-udef30.8%

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

      \[\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)} \]

    if 8.99999999999999944e94 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 40.7% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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 31.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. sqrt-prod43.9%

        \[\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. cancel-sign-sub-inv43.9%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left(B \cdot B + \left(-4\right) \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)} \]
      3. metadata-eval43.9%

        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-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)} \]
      4. *-commutative43.9%

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

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\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-rr43.9%

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

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

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

    if -1.000000000000002e-309 < F < 4.6000000000000001e-85

    1. Initial program 19.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified19.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 0 16.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.6000000000000001e-85 < F

    1. Initial program 10.1%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified10.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 0 7.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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-inv25.1%

        \[\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-rr41.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)}} \]

    if 2.6e-308 < F < 3.09999999999999989e-86

    1. Initial program 19.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified19.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 0 16.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.09999999999999989e-86 < F

    1. Initial program 10.1%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified10.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 0 7.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 41.6% 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}\;F \leq 1.8 \cdot 10^{-308}:\\ \;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \frac{-1}{t_0}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= F 1.8e-308)
     (*
      (sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))
      (/ -1.0 t_0))
     (if (<= F 3.5e-30)
       (/ (- (sqrt (* F (* 2.0 (+ C (hypot B C)))))) B)
       (* (sqrt 2.0) (- (sqrt (/ F 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 (F <= 1.8e-308) {
		tmp = sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_0);
	} else if (F <= 3.5e-30) {
		tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / 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 (F <= 1.8e-308) {
		tmp = Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) * (-1.0 / t_0);
	} else if (F <= 3.5e-30) {
		tmp = -Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / B;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if F <= 1.8e-308:
		tmp = math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) * (-1.0 / t_0)
	elif F <= 3.5e-30:
		tmp = -math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / B
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / 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 (F <= 1.8e-308)
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C))))))) * Float64(-1.0 / t_0));
	elseif (F <= 3.5e-30)
		tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C)))))) / B);
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (F <= 1.8e-308)
		tmp = sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) * (-1.0 / t_0);
	elseif (F <= 3.5e-30)
		tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
	else
		tmp = sqrt(2.0) * -sqrt((F / B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 1.8e-308], N[(N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-30], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $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}\;F \leq 1.8 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)} \cdot \frac{-1}{t_0}\\

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

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


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

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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-inv25.1%

        \[\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-rr41.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)}} \]

    if 1.7999999999999999e-308 < F < 3.5000000000000003e-30

    1. Initial program 19.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. Simplified19.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 0 15.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000003e-30 < F

    1. Initial program 9.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. Simplified9.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 0 7.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 41.6% 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}\;F \leq -1 \cdot 10^{-309}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (+ (* B B) (* -4.0 (* A C)))))
   (if (<= F -1e-309)
     (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (+ C (hypot B (- A C)))))))) t_0)
     (if (<= F 3.5e-30)
       (/ (- (sqrt (* F (* 2.0 (+ C (hypot B C)))))) B)
       (* (sqrt 2.0) (- (sqrt (/ F 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 (F <= -1e-309) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else if (F <= 3.5e-30) {
		tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / 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 (F <= -1e-309) {
		tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + (C + Math.hypot(B, (A - C))))))) / t_0;
	} else if (F <= 3.5e-30) {
		tmp = -Math.sqrt((F * (2.0 * (C + Math.hypot(B, C))))) / B;
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B));
	}
	return tmp;
}
B = abs(B)
def code(A, B, C, F):
	t_0 = (B * B) + (-4.0 * (A * C))
	tmp = 0
	if F <= -1e-309:
		tmp = -math.sqrt((2.0 * ((F * t_0) * (A + (C + math.hypot(B, (A - C))))))) / t_0
	elif F <= 3.5e-30:
		tmp = -math.sqrt((F * (2.0 * (C + math.hypot(B, C))))) / B
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / 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 (F <= -1e-309)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	elseif (F <= 3.5e-30)
		tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(C + hypot(B, C)))))) / B);
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))));
	end
	return tmp
end
B = abs(B)
function tmp_2 = code(A, B, C, F)
	t_0 = (B * B) + (-4.0 * (A * C));
	tmp = 0.0;
	if (F <= -1e-309)
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C + hypot(B, (A - C))))))) / t_0;
	elseif (F <= 3.5e-30)
		tmp = -sqrt((F * (2.0 * (C + hypot(B, C))))) / B;
	else
		tmp = sqrt(2.0) * -sqrt((F / B));
	end
	tmp_2 = tmp;
end
NOTE: B should be positive before calling this function
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-309], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[F, 3.5e-30], N[((-N[Sqrt[N[(F * N[(2.0 * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $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}\;F \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

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

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


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

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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-neg25.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-rr41.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 -1.000000000000002e-309 < F < 3.5000000000000003e-30

    1. Initial program 19.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. Simplified19.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 0 15.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000003e-30 < F

    1. Initial program 9.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. Simplified9.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 0 7.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 39.4% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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 31.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -1.000000000000002e-309 < F < 3.5000000000000003e-30

    1. Initial program 19.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. Simplified19.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 0 15.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000003e-30 < F

    1. Initial program 9.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. Simplified9.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 0 7.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 37.5% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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 31.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -1.000000000000002e-309 < F < 7.0999999999999999e-31

    1. Initial program 19.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. Simplified19.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 0 15.7%

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

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

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

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

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

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

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

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

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

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

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

    if 7.0999999999999999e-31 < F

    1. Initial program 9.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. Simplified9.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 0 7.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 37.5% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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 31.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -1.000000000000002e-309 < F < 3.2e-30

    1. Initial program 19.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. Simplified19.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 0 15.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2e-30 < F

    1. Initial program 9.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. Simplified9.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 0 7.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 37.3% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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 31.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -1.000000000000002e-309 < F < 3.4000000000000003e-30

    1. Initial program 19.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. Simplified19.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 0 15.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(-\frac{\sqrt{2}}{B} \cdot \color{blue}{\sqrt{F \cdot \left(B + C\right)}}\right)} - 1 \]
      6. associate-*l/2.2%

        \[\leadsto e^{\mathsf{log1p}\left(-\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}}\right)} - 1 \]
      7. pow1/22.2%

        \[\leadsto e^{\mathsf{log1p}\left(-\frac{\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}\right)} - 1 \]
      8. pow1/22.2%

        \[\leadsto e^{\mathsf{log1p}\left(-\frac{{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(B + C\right)\right)}^{0.5}}}{B}\right)} - 1 \]
      9. pow-prod-down2.2%

        \[\leadsto e^{\mathsf{log1p}\left(-\frac{\color{blue}{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}}{B}\right)} - 1 \]
    12. Applied egg-rr2.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)} - 1} \]
    13. Step-by-step derivation
      1. expm1-def20.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)\right)} \]
      2. expm1-log1p21.3%

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

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

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

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

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

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

    if 3.4000000000000003e-30 < F

    1. Initial program 9.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. Simplified9.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 0 7.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 29.5% accurate, 4.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -1.000000000000002e-309

    1. Initial program 25.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified25.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 31.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if -1.000000000000002e-309 < F

    1. Initial program 13.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified13.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 0 11.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{\color{blue}{B + C}} \cdot \sqrt{F}\right) \]
    10. Applied egg-rr19.3%

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(-\frac{\sqrt{2}}{B} \cdot \color{blue}{\sqrt{F \cdot \left(B + C\right)}}\right)} - 1 \]
      6. associate-*l/1.2%

        \[\leadsto e^{\mathsf{log1p}\left(-\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}}\right)} - 1 \]
      7. pow1/21.2%

        \[\leadsto e^{\mathsf{log1p}\left(-\frac{\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}\right)} - 1 \]
      8. pow1/21.3%

        \[\leadsto e^{\mathsf{log1p}\left(-\frac{{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(B + C\right)\right)}^{0.5}}}{B}\right)} - 1 \]
      9. pow-prod-down1.3%

        \[\leadsto e^{\mathsf{log1p}\left(-\frac{\color{blue}{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}}{B}\right)} - 1 \]
    12. Applied egg-rr1.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)} - 1} \]
    13. Step-by-step derivation
      1. expm1-def10.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)\right)} \]
      2. expm1-log1p14.2%

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

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

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

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

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

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

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

Alternative 15: 8.4% accurate, 5.7× speedup?

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

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


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

    1. Initial program 10.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. Simplified10.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 3.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in C around 0 2.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-neg2.7%

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

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

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

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

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

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

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

    if 1.3499999999999999e-229 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{C \cdot F} \cdot \left(-1 \cdot \frac{\color{blue}{2}}{B}\right) \]
      7. associate-*r/5.5%

        \[\leadsto \sqrt{C \cdot F} \cdot \color{blue}{\frac{-1 \cdot 2}{B}} \]
      8. metadata-eval5.5%

        \[\leadsto \sqrt{C \cdot F} \cdot \frac{\color{blue}{-2}}{B} \]
    10. Simplified5.5%

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

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

        \[\leadsto {\color{blue}{\left(F \cdot C\right)}}^{0.5} \cdot \frac{-2}{B} \]
    12. Applied egg-rr5.6%

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

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

Alternative 16: 8.3% accurate, 5.8× speedup?

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

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


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

    1. Initial program 10.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. Simplified10.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 3.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in C around 0 2.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-neg2.7%

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

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

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

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

    if 1.3000000000000001e-230 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{C \cdot F} \cdot \left(-1 \cdot \frac{\color{blue}{2}}{B}\right) \]
      7. associate-*r/5.5%

        \[\leadsto \sqrt{C \cdot F} \cdot \color{blue}{\frac{-1 \cdot 2}{B}} \]
      8. metadata-eval5.5%

        \[\leadsto \sqrt{C \cdot F} \cdot \frac{\color{blue}{-2}}{B} \]
    10. Simplified5.5%

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

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

Alternative 17: 8.3% accurate, 5.8× speedup?

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

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


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

    1. Initial program 10.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. Simplified10.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 3.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in C around 0 2.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-neg2.7%

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

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

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

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

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

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

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

    if 3.3e-233 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{C \cdot F} \cdot \left(-1 \cdot \frac{\color{blue}{2}}{B}\right) \]
      7. associate-*r/5.5%

        \[\leadsto \sqrt{C \cdot F} \cdot \color{blue}{\frac{-1 \cdot 2}{B}} \]
      8. metadata-eval5.5%

        \[\leadsto \sqrt{C \cdot F} \cdot \frac{\color{blue}{-2}}{B} \]
    10. Simplified5.5%

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

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

Alternative 18: 8.3% accurate, 5.8× speedup?

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

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


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

    1. Initial program 10.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. Simplified10.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 3.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}{A}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Taylor expanded in C around 0 2.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-neg2.7%

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

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

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

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

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

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

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

    if 8.3999999999999999e-227 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{C \cdot F} \cdot \left(-1 \cdot \frac{\color{blue}{2}}{B}\right) \]
      7. associate-*r/5.5%

        \[\leadsto \sqrt{C \cdot F} \cdot \color{blue}{\frac{-1 \cdot 2}{B}} \]
      8. metadata-eval5.5%

        \[\leadsto \sqrt{C \cdot F} \cdot \frac{\color{blue}{-2}}{B} \]
    10. Simplified5.5%

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

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

        \[\leadsto {\color{blue}{\left(F \cdot C\right)}}^{0.5} \cdot \frac{-2}{B} \]
    12. Applied egg-rr5.6%

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

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

Alternative 19: 25.7% accurate, 5.8× speedup?

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

    \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
  2. Simplified15.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 0 9.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B + C} \cdot \sqrt{F}\right)\right)\right)} \]
    2. expm1-udef1.7%

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

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

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

      \[\leadsto e^{\mathsf{log1p}\left(-\frac{\sqrt{2}}{B} \cdot \color{blue}{\sqrt{F \cdot \left(B + C\right)}}\right)} - 1 \]
    6. associate-*l/1.1%

      \[\leadsto e^{\mathsf{log1p}\left(-\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}}\right)} - 1 \]
    7. pow1/21.1%

      \[\leadsto e^{\mathsf{log1p}\left(-\frac{\color{blue}{{2}^{0.5}} \cdot \sqrt{F \cdot \left(B + C\right)}}{B}\right)} - 1 \]
    8. pow1/21.2%

      \[\leadsto e^{\mathsf{log1p}\left(-\frac{{2}^{0.5} \cdot \color{blue}{{\left(F \cdot \left(B + C\right)\right)}^{0.5}}}{B}\right)} - 1 \]
    9. pow-prod-down1.2%

      \[\leadsto e^{\mathsf{log1p}\left(-\frac{\color{blue}{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}}{B}\right)} - 1 \]
  12. Applied egg-rr1.2%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\frac{{\left(2 \cdot \left(F \cdot \left(B + C\right)\right)\right)}^{0.5}}{B}\right)} - 1} \]
  13. Step-by-step derivation
    1. expm1-def9.4%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(B + C\right)\right) \cdot F}}{B}} \]
  15. Final simplification12.2%

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

Alternative 20: 5.4% accurate, 5.9× speedup?

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

    \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
  2. Simplified15.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 0 9.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{C \cdot F} \cdot \left(-1 \cdot \frac{\color{blue}{2}}{B}\right) \]
    7. associate-*r/2.9%

      \[\leadsto \sqrt{C \cdot F} \cdot \color{blue}{\frac{-1 \cdot 2}{B}} \]
    8. metadata-eval2.9%

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

    \[\leadsto \color{blue}{\sqrt{C \cdot F} \cdot \frac{-2}{B}} \]
  11. Final simplification2.9%

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

Reproduce

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