ABCF->ab-angle a

Percentage Accurate: 19.2% → 52.9%
Time: 27.3s
Alternatives: 13
Speedup: 6.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 19.2% accurate, 1.0× speedup?

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

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

Alternative 1: 52.9% accurate, 1.0× speedup?

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

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


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

    1. Initial program 23.8%

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

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

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

        \[\leadsto \frac{-\sqrt{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \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)} \]
      3. hypot-udef23.8%

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

        \[\leadsto \frac{-\sqrt{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \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)} \]
      5. unpow223.8%

        \[\leadsto \frac{-\sqrt{\left(\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot 2\right) \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)} \]
      6. +-commutative23.8%

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

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

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

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

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

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

    if 9.9999999999999992e180 < (pow.f64 B 2)

    1. Initial program 5.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 0 5.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 41.2% accurate, 1.2× speedup?

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

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


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

    1. Initial program 15.9%

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

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

      \[\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-in26.4%

        \[\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-eval26.4%

        \[\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-lft26.4%

        \[\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. Simplified26.4%

      \[\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 1.5e-139 < (pow.f64 B 2) < 1.0000000000000001e-18

    1. Initial program 36.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 43.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} \]

    if 1.0000000000000001e-18 < (pow.f64 B 2)

    1. Initial program 13.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -{\color{blue}{\left(F \cdot \frac{1}{B}\right)}}^{0.5} \cdot \sqrt{2} \]
      3. unpow-prod-down26.5%

        \[\leadsto -\color{blue}{\left({F}^{0.5} \cdot {\left(\frac{1}{B}\right)}^{0.5}\right)} \cdot \sqrt{2} \]
      4. pow1/226.5%

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

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

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

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

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

Alternative 3: 48.1% accurate, 1.2× speedup?

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

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


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

    1. Initial program 23.8%

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

        \[\leadsto \frac{\color{blue}{0 - \sqrt{\left(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. div-sub23.8%

        \[\leadsto \color{blue}{\frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \frac{\sqrt{\left(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}} \]
      3. associate-*l*23.8%

        \[\leadsto \frac{0}{{B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}} - \frac{\sqrt{\left(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} \]
    3. Applied egg-rr34.1%

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

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

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

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

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

    if 9.9999999999999992e180 < (pow.f64 B 2)

    1. Initial program 5.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 0 5.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 45.3% accurate, 1.5× speedup?

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

\mathbf{elif}\;B \leq 3.1 \cdot 10^{-22}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 3.90000000000000019e-70

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Taylor expanded in A around inf 18.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-in18.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-eval18.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-lft18.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. Simplified18.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 3.90000000000000019e-70 < B < 3.10000000000000013e-22

    1. Initial program 28.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 -inf 41.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(2 \cdot C\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 3.10000000000000013e-22 < B < 1.99999999999999983e29

    1. Initial program 21.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. Step-by-step derivation
      1. neg-sub021.9%

        \[\leadsto \frac{\color{blue}{0 - \sqrt{\left(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. div-sub21.9%

        \[\leadsto \color{blue}{\frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \frac{\sqrt{\left(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}} \]
      3. associate-*l*21.9%

        \[\leadsto \frac{0}{{B}^{2} - \color{blue}{4 \cdot \left(A \cdot C\right)}} - \frac{\sqrt{\left(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} \]
    3. Applied egg-rr40.8%

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

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

    if 1.99999999999999983e29 < B

    1. Initial program 8.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 0 12.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 44.6% accurate, 1.5× speedup?

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

\mathbf{elif}\;B \leq 8 \cdot 10^{-23}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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


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

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Taylor expanded in A around inf 18.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-in18.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-eval18.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-lft18.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. Simplified18.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 3.90000000000000019e-70 < B < 7.99999999999999968e-23

    1. Initial program 28.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 -inf 41.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(2 \cdot C\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 7.99999999999999968e-23 < B

    1. Initial program 10.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 0 14.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 39.8% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;B \leq 4.8 \cdot 10^{-7}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 1.35999999999999996e-155 or 3.49999999999999974e-70 < B < 4.79999999999999957e-7

    1. Initial program 19.1%

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

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

    if 1.35999999999999996e-155 < B < 3.49999999999999974e-70

    1. Initial program 14.0%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Taylor expanded in C around 0 25.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(A + \sqrt{{A}^{2} + {B}^{2}}\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Step-by-step derivation
      1. +-commutative25.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.79999999999999957e-7 < B

    1. Initial program 11.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \cdot \sqrt{2} \]
      2. div-inv41.0%

        \[\leadsto -{\color{blue}{\left(F \cdot \frac{1}{B}\right)}}^{0.5} \cdot \sqrt{2} \]
      3. unpow-prod-down59.4%

        \[\leadsto -\color{blue}{\left({F}^{0.5} \cdot {\left(\frac{1}{B}\right)}^{0.5}\right)} \cdot \sqrt{2} \]
      4. pow1/259.4%

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

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

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

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

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

Alternative 7: 39.5% accurate, 1.9× speedup?

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

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

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


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

    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 C around 0 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(A + \sqrt{{A}^{2} + {B}^{2}}\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Step-by-step derivation
      1. +-commutative20.1%

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

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

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(A + \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      4. hypot-def29.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(A + \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    4. Simplified29.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(A + \mathsf{hypot}\left(B, A\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    5. Taylor expanded in B around 0 28.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.89999999999999993e-307 < F < 2.6500000000000001e23

    1. Initial program 17.0%

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

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

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

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

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

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

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

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

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

    if 2.6500000000000001e23 < F

    1. Initial program 12.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -{\color{blue}{\left(F \cdot \frac{1}{B}\right)}}^{0.5} \cdot \sqrt{2} \]
      3. unpow-prod-down14.8%

        \[\leadsto -\color{blue}{\left({F}^{0.5} \cdot {\left(\frac{1}{B}\right)}^{0.5}\right)} \cdot \sqrt{2} \]
      4. pow1/214.8%

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

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

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

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

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

Alternative 8: 36.6% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

    if 1.5499999999999999e25 < F

    1. Initial program 12.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -{\color{blue}{\left(F \cdot \frac{1}{B}\right)}}^{0.5} \cdot \sqrt{2} \]
      3. unpow-prod-down14.8%

        \[\leadsto -\color{blue}{\left({F}^{0.5} \cdot {\left(\frac{1}{B}\right)}^{0.5}\right)} \cdot \sqrt{2} \]
      4. pow1/214.8%

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

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

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

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

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

Alternative 9: 35.4% accurate, 2.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 4.6999999999999998e190

    1. Initial program 18.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -{\color{blue}{\left(F \cdot \frac{1}{B}\right)}}^{0.5} \cdot \sqrt{2} \]
      3. unpow-prod-down16.3%

        \[\leadsto -\color{blue}{\left({F}^{0.5} \cdot {\left(\frac{1}{B}\right)}^{0.5}\right)} \cdot \sqrt{2} \]
      4. pow1/216.3%

        \[\leadsto -\left(\color{blue}{\sqrt{F}} \cdot {\left(\frac{1}{B}\right)}^{0.5}\right) \cdot \sqrt{2} \]
    9. Applied egg-rr16.3%

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

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

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

    if 4.6999999999999998e190 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-2} \cdot \sqrt{C \cdot F}}{B} \]
      10. *-commutative11.7%

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

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

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

Alternative 10: 35.4% accurate, 2.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 1.1999999999999999e192

    1. Initial program 18.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    9. Applied egg-rr16.3%

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

    if 1.1999999999999999e192 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-2} \cdot \sqrt{C \cdot F}}{B} \]
      10. *-commutative11.7%

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

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

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

Alternative 11: 34.3% accurate, 3.0× speedup?

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

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


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

    1. Initial program 19.6%

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

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

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

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

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

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

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

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

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

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

    if 4e5 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}}\right)} - 1\right) \]
      5. metadata-eval8.0%

        \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot {\color{blue}{\left({2}^{1}\right)}}^{0.5}\right)} - 1\right) \]
      6. metadata-eval8.0%

        \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot {\left({2}^{\color{blue}{\left(\frac{2}{2}\right)}}\right)}^{0.5}\right)} - 1\right) \]
      7. sqrt-pow28.0%

        \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot {\color{blue}{\left({\left(\sqrt{2}\right)}^{2}\right)}}^{0.5}\right)} - 1\right) \]
      8. pow-prod-down8.0%

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

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{F}{B} \cdot {\left(\sqrt{2}\right)}^{2}}}\right)} - 1\right) \]
      10. sqrt-pow27.4%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot \color{blue}{{2}^{\left(\frac{2}{2}\right)}}}\right)} - 1\right) \]
      11. metadata-eval7.4%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot {2}^{\color{blue}{1}}}\right)} - 1\right) \]
      12. metadata-eval7.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 400000:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{B \cdot F}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{2 \cdot F}{B}}\\ \end{array} \]

Alternative 12: 27.2% accurate, 5.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 9.4999999999999996e188

    1. Initial program 18.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u11.9%

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

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

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

        \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}}\right)} - 1\right) \]
      5. metadata-eval5.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot {\color{blue}{\left({2}^{1}\right)}}^{0.5}\right)} - 1\right) \]
      6. metadata-eval5.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot {\left({2}^{\color{blue}{\left(\frac{2}{2}\right)}}\right)}^{0.5}\right)} - 1\right) \]
      7. sqrt-pow25.6%

        \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot {\color{blue}{\left({\left(\sqrt{2}\right)}^{2}\right)}}^{0.5}\right)} - 1\right) \]
      8. pow-prod-down5.6%

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

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{F}{B} \cdot {\left(\sqrt{2}\right)}^{2}}}\right)} - 1\right) \]
      10. sqrt-pow25.4%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot \color{blue}{{2}^{\left(\frac{2}{2}\right)}}}\right)} - 1\right) \]
      11. metadata-eval5.4%

        \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot {2}^{\color{blue}{1}}}\right)} - 1\right) \]
      12. metadata-eval5.4%

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

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

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

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

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

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

    if 9.4999999999999996e188 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-2} \cdot \sqrt{C \cdot F}}{B} \]
      10. *-commutative11.7%

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

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

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

Alternative 13: 26.8% accurate, 6.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  8. Step-by-step derivation
    1. expm1-log1p-u11.2%

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

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

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

      \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}}\right)} - 1\right) \]
    5. metadata-eval5.2%

      \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot {\color{blue}{\left({2}^{1}\right)}}^{0.5}\right)} - 1\right) \]
    6. metadata-eval5.2%

      \[\leadsto -\left(e^{\mathsf{log1p}\left({\left(\frac{F}{B}\right)}^{0.5} \cdot {\left({2}^{\color{blue}{\left(\frac{2}{2}\right)}}\right)}^{0.5}\right)} - 1\right) \]
    7. sqrt-pow25.2%

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

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

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

      \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot \color{blue}{{2}^{\left(\frac{2}{2}\right)}}}\right)} - 1\right) \]
    11. metadata-eval4.9%

      \[\leadsto -\left(e^{\mathsf{log1p}\left(\sqrt{\frac{F}{B} \cdot {2}^{\color{blue}{1}}}\right)} - 1\right) \]
    12. metadata-eval4.9%

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

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

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

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

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

    \[\leadsto -\color{blue}{\sqrt{\frac{F \cdot 2}{B}}} \]
  12. Final simplification11.4%

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

Reproduce

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