ABCF->ab-angle a

Percentage Accurate: 19.7% → 52.8%
Time: 29.1s
Alternatives: 18
Speedup: 3.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 19.7% 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.8% accurate, 0.7× speedup?

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

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


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

    1. Initial program 22.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e52 < (pow.f64 B 2)

    1. Initial program 10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 44.6% accurate, 0.8× speedup?

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

\mathbf{elif}\;{B}^{2} \leq 10^{-258}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(A \cdot \left(F \cdot {C}^{2}\right)\right)}}{t_1}\\

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

\mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (pow.f64 B 2) < 9.99989e-321 or 9.99999999999999954e-259 < (pow.f64 B 2) < 2.0000000000000001e-135

    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. Simplified25.1%

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

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

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

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

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

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

    if 9.99989e-321 < (pow.f64 B 2) < 9.99999999999999954e-259

    1. Initial program 31.4%

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

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

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

    if 2.0000000000000001e-135 < (pow.f64 B 2) < 5.0000000000000002e-62

    1. Initial program 26.8%

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

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

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

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

    1. Initial program 14.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 41.3% accurate, 0.9× speedup?

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

\mathbf{elif}\;{B}^{2} \leq 10^{-258}:\\
\;\;\;\;\frac{-\sqrt{-16 \cdot \left(A \cdot \left(F \cdot {C}^{2}\right)\right)}}{t_1}\\

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

\mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (pow.f64 B 2) < 9.99989e-321 or 9.99999999999999954e-259 < (pow.f64 B 2) < 2.0000000000000001e-135

    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. Simplified25.1%

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

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

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

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

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

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

    if 9.99989e-321 < (pow.f64 B 2) < 9.99999999999999954e-259

    1. Initial program 31.4%

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

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

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

    if 2.0000000000000001e-135 < (pow.f64 B 2) < 5.0000000000000002e-62

    1. Initial program 26.8%

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

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

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

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

    1. Initial program 14.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 45.1% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 17.9%

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

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

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

        \[\leadsto \frac{-{\color{blue}{\left(\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot 2\right) \cdot C\right)}}^{0.5}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      3. unpow-prod-down26.8%

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

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

        \[\leadsto \frac{-{\left(\left(2 \cdot \left(F \cdot \left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\right)\right)\right) \cdot 2\right)}^{0.5} \cdot {C}^{0.5}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      6. pow1/226.8%

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

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

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

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

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

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

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

    if 4.0000000000000003e-259 < (pow.f64 B 2) < 2.0000000000000001e-135

    1. Initial program 20.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. Simplified29.5%

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

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

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

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

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

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

    if 2.0000000000000001e-135 < (pow.f64 B 2) < 1e-22

    1. Initial program 30.3%

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

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

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

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

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

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

    if 1e-22 < (pow.f64 B 2)

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 44.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-\sqrt{4 \cdot \left(C \cdot \left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)}}{t_1}\\

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


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

    1. Initial program 17.9%

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

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

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

        \[\leadsto \frac{-{\color{blue}{\left(\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot 2\right) \cdot C\right)}}^{0.5}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      3. unpow-prod-down26.8%

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

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

        \[\leadsto \frac{-{\left(\left(2 \cdot \left(F \cdot \left({B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}\right)\right)\right) \cdot 2\right)}^{0.5} \cdot {C}^{0.5}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      6. pow1/226.8%

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

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

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

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

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

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

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

    if 4.0000000000000003e-259 < (pow.f64 B 2) < 2.0000000000000001e-135

    1. Initial program 20.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. Simplified29.5%

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

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

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

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

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

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

    if 2.0000000000000001e-135 < (pow.f64 B 2) < 5.0000000000000002e-62

    1. Initial program 26.8%

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

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

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

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

    1. Initial program 14.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 52.9% accurate, 1.0× speedup?

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

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


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

    1. Initial program 22.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e52 < (pow.f64 B 2)

    1. Initial program 10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 52.3% accurate, 1.0× speedup?

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

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


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

    1. Initial program 22.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e52 < (pow.f64 B 2)

    1. Initial program 10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 48.4% accurate, 1.2× speedup?

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

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


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

    1. Initial program 22.8%

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

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

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

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

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

    if 4e52 < (pow.f64 B 2)

    1. Initial program 10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 49.5% accurate, 1.2× speedup?

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

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


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

    1. Initial program 22.8%

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

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

    if 4e52 < (pow.f64 B 2)

    1. Initial program 10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 41.6% accurate, 1.5× speedup?

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

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


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

    1. Initial program 19.7%

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

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

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

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

    1. Initial program 14.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 40.9% accurate, 1.5× speedup?

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

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


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

    1. Initial program 19.2%

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

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

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

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

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

    if 4.9999999999999998e-73 < (pow.f64 B 2)

    1. Initial program 14.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 40.9% accurate, 1.5× speedup?

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

\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 2 regimes
  2. if (pow.f64 B 2) < 4.9999999999999998e-73

    1. Initial program 19.2%

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

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

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

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

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

    if 4.9999999999999998e-73 < (pow.f64 B 2)

    1. Initial program 14.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 36.6% accurate, 2.8× speedup?

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

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

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


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

    1. Initial program 21.8%

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

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

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

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

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

    if -3.5999999999999999e-210 < F < 2.5499999999999999e39

    1. Initial program 19.9%

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

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

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

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

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

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

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

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

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

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

    if 2.5499999999999999e39 < F

    1. Initial program 11.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 34.4% accurate, 3.0× speedup?

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

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


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

    1. Initial program 20.3%

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

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

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

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

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

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

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

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

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

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

    if 1.40000000000000001e39 < F

    1. Initial program 11.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 27.3% accurate, 3.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 7.7% accurate, 5.7× speedup?

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

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


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

    1. Initial program 15.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.39999999999999993e-286 < C

    1. Initial program 17.5%

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

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

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

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

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

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

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

Alternative 17: 7.7% accurate, 5.8× speedup?

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

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


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

    1. Initial program 15.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.20000000000000027e-286 < C

    1. Initial program 17.5%

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

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

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

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

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

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

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

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

      \[\leadsto -2 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{F \cdot C}}{B}\right)} - 1\right)} \]
    6. Step-by-step derivation
      1. expm1-def6.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq 7.2 \cdot 10^{-286}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{\sqrt{C \cdot F}}{B}\\ \end{array} \]

Alternative 18: 5.0% accurate, 5.9× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto -2 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{F \cdot C}}{B}\right)} - 1\right)} \]
  6. Step-by-step derivation
    1. expm1-def3.7%

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

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

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

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

Reproduce

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