ABCF->ab-angle a

Percentage Accurate: 18.8% → 52.1%
Time: 31.5s
Alternatives: 22
Speedup: 3.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 18.8% 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.1% accurate, 0.5× speedup?

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


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

    1. Initial program 32.4%

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

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

        \[\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+38.6%

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

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

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

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

        \[\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-prod38.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. *-commutative38.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*38.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+38.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-rr59.1%

      \[\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 +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 46.8% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-167}:\\ \;\;\;\;\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^{+64}:\\ \;\;\;\;\frac{-\sqrt{F \cdot \left(t_0 \cdot \left(2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\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) 5e-167)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A A))))) t_0)
     (if (<= (pow B 2.0) 1e+64)
       (/ (- (sqrt (* F (* t_0 (* 2.0 (+ (+ A C) (hypot (- A C) B))))))) t_0)
       (* (* (sqrt (+ A (hypot B A))) (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) <= 5e-167) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + A)))) / t_0;
	} else if (pow(B, 2.0) <= 1e+64) {
		tmp = -sqrt((F * (t_0 * (2.0 * ((A + C) + hypot((A - C), B)))))) / t_0;
	} else {
		tmp = (sqrt((A + hypot(B, A))) * 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) <= 5e-167)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + A))))) / t_0);
	elseif ((B ^ 2.0) <= 1e+64)
		tmp = Float64(Float64(-sqrt(Float64(F * Float64(t_0 * Float64(2.0 * Float64(Float64(A + C) + hypot(Float64(A - C), B))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * 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], 5e-167], 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+64], N[((-N[Sqrt[N[(F * N[(t$95$0 * N[(2.0 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 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 5 \cdot 10^{-167}:\\
\;\;\;\;\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^{+64}:\\
\;\;\;\;\frac{-\sqrt{F \cdot \left(t_0 \cdot \left(2 \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\right)\right)\right)\right)}}{t_0}\\

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


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

    1. Initial program 20.4%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Taylor expanded in A around inf 27.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-in27.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-eval27.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-lft27.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. Simplified27.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 5.0000000000000002e-167 < (pow.f64 B 2) < 1.00000000000000002e64

    1. Initial program 42.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. Step-by-step derivation
      1. neg-sub042.5%

        \[\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-sub42.5%

        \[\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*42.5%

        \[\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-rr46.9%

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

      \[\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.00000000000000002e64 < (pow.f64 B 2)

    1. Initial program 7.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 49.4% accurate, 1.0× speedup?

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

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


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

    1. Initial program 29.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. Simplified36.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)}} \]

    if 1.00000000000000002e64 < (pow.f64 B 2)

    1. Initial program 7.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 49.4% accurate, 1.2× speedup?

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

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\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) < 1.00000000000000002e64

    1. Initial program 29.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. Simplified36.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)}} \]

    if 1.00000000000000002e64 < (pow.f64 B 2)

    1. Initial program 7.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 49.3% 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 \leq 8.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\right)} \cdot \sqrt{F}\right) \cdot \left({2}^{0.25} \cdot \left(-\frac{{2}^{0.25}}{B}\right)\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* A (* C -4.0)))))
   (if (<= B 8.5e+32)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A (+ C (hypot B (- A C)))))))) t_0)
     (*
      (* (sqrt (+ A (hypot B A))) (sqrt F))
      (* (pow 2.0 0.25) (- (/ (pow 2.0 0.25) 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 (B <= 8.5e+32) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + (C + hypot(B, (A - C))))))) / t_0;
	} else {
		tmp = (sqrt((A + hypot(B, A))) * sqrt(F)) * (pow(2.0, 0.25) * -(pow(2.0, 0.25) / 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 <= 8.5e+32)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + Float64(C + hypot(B, Float64(A - C)))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * sqrt(F)) * Float64((2.0 ^ 0.25) * Float64(-Float64((2.0 ^ 0.25) / 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[B, 8.5e+32], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * (-N[(N[Power[2.0, 0.25], $MachinePrecision] / B), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B \leq 8.5 \cdot 10^{+32}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{t_0}\\

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


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

    1. Initial program 22.9%

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

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

    if 8.4999999999999998e32 < B

    1. Initial program 6.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 45.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)\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-143}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\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) 5e-143)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A A))))) t_0)
     (* (* (sqrt (+ A (hypot B A))) (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) <= 5e-143) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + A)))) / t_0;
	} else {
		tmp = (sqrt((A + hypot(B, A))) * 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) <= 5e-143)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + A))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B, A))) * 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], 5e-143], N[((-N[Sqrt[N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B ^ 2 + A ^ 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 5 \cdot 10^{-143}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B, A\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) < 5.0000000000000002e-143

    1. Initial program 23.4%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot F\right) \cdot \left(2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Taylor expanded in A around inf 27.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-in27.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-eval27.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-lft27.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. Simplified27.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 5.0000000000000002e-143 < (pow.f64 B 2)

    1. Initial program 15.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 42.5% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -4.50000000000000003e207

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

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

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

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

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

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

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

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

    if -4.50000000000000003e207 < C < 4.8000000000000005e-100

    1. Initial program 19.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.8000000000000005e-100 < C

    1. Initial program 22.7%

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

      \[\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-neg9.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 42.5% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -3.50000000000000028e207

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

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

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

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

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

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

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

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

    if -3.50000000000000028e207 < C < 6.79999999999999953e-100

    1. Initial program 19.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.79999999999999953e-100 < C

    1. Initial program 22.7%

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

      \[\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-neg9.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 37.7% accurate, 1.9× speedup?

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

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

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


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

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

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

    if 2.9e-275 < F < 1.5e105

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5e105 < F

    1. Initial program 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 38.8% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.05e-296

    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 0 13.9%

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

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

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

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

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

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

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

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

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

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

    if -1.05e-296 < F < 9.40000000000000007e-94

    1. Initial program 18.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.40000000000000007e-94 < F < 5.20000000000000039e106

    1. Initial program 19.4%

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

      \[\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-neg11.0%

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

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

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

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

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

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

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

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

    if 5.20000000000000039e106 < F

    1. Initial program 12.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 38.5% accurate, 1.9× speedup?

\[\begin{array}{l} B = |B|\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;F \leq 7.5 \cdot 10^{-301}:\\ \;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;F \leq 10^{-93}:\\ \;\;\;\;\frac{\sqrt{2}}{\frac{-B}{\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}}}\\ \mathbf{elif}\;F \leq 4.9 \cdot 10^{+106}:\\ \;\;\;\;\frac{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)} \cdot \left(-\sqrt{2}\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* A (* C -4.0)))))
   (if (<= F 7.5e-301)
     (/ (- (sqrt (* (* F t_0) (* 2.0 (+ A A))))) t_0)
     (if (<= F 1e-93)
       (/ (sqrt 2.0) (/ (- B) (sqrt (* F (+ A (hypot B A))))))
       (if (<= F 4.9e+106)
         (/ (* (sqrt (* F (+ C (hypot B C)))) (- (sqrt 2.0))) B)
         (* (sqrt 2.0) (- (sqrt (/ F 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 (F <= 7.5e-301) {
		tmp = -sqrt(((F * t_0) * (2.0 * (A + A)))) / t_0;
	} else if (F <= 1e-93) {
		tmp = sqrt(2.0) / (-B / sqrt((F * (A + hypot(B, A)))));
	} else if (F <= 4.9e+106) {
		tmp = (sqrt((F * (C + hypot(B, C)))) * -sqrt(2.0)) / B;
	} else {
		tmp = sqrt(2.0) * -sqrt((F / 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 (F <= 7.5e-301)
		tmp = Float64(Float64(-sqrt(Float64(Float64(F * t_0) * Float64(2.0 * Float64(A + A))))) / t_0);
	elseif (F <= 1e-93)
		tmp = Float64(sqrt(2.0) / Float64(Float64(-B) / sqrt(Float64(F * Float64(A + hypot(B, A))))));
	elseif (F <= 4.9e+106)
		tmp = Float64(Float64(sqrt(Float64(F * Float64(C + hypot(B, C)))) * Float64(-sqrt(2.0))) / B);
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / 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[F, 7.5e-301], 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[F, 1e-93], N[(N[Sqrt[2.0], $MachinePrecision] / N[((-B) / N[Sqrt[N[(F * N[(A + N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.9e+106], N[(N[(N[Sqrt[N[(F * N[(C + N[Sqrt[B ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B = |B|\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;F \leq 7.5 \cdot 10^{-301}:\\
\;\;\;\;\frac{-\sqrt{\left(F \cdot t_0\right) \cdot \left(2 \cdot \left(A + A\right)\right)}}{t_0}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < 7.5000000000000006e-301

    1. Initial program 27.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. Simplified39.5%

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

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

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

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

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

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

    if 7.5000000000000006e-301 < F < 9.999999999999999e-94

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.999999999999999e-94 < F < 4.89999999999999998e106

    1. Initial program 19.4%

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

      \[\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-neg11.0%

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

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

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

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

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

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

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

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

    if 4.89999999999999998e106 < F

    1. Initial program 12.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 35.8% accurate, 2.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.50000000000000003e-94 < F < 4.89999999999999998e106

    1. Initial program 19.4%

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

      \[\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-neg11.0%

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

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

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

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

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

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

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

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

    if 4.89999999999999998e106 < F

    1. Initial program 12.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 36.0% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 21.2%

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

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

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

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

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

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

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

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

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

    if 2.0999999999999999e-117 < F < 3.99999999999999999e98

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999999e98 < F

    1. Initial program 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 36.0% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 21.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999993e-119 < F < 3.7999999999999999e98

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999999e98 < F

    1. Initial program 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 36.0% accurate, 3.0× speedup?

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

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


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

    1. Initial program 21.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.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-neg7.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2000000000000001e99 < F

    1. Initial program 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 28.7% accurate, 3.0× speedup?

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

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


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

    1. Initial program 20.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.45e169 < A

    1. Initial program 2.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 34.8% accurate, 3.0× speedup?

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

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


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

    1. Initial program 23.3%

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999936e-50 < F

    1. Initial program 13.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 27.4% accurate, 3.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 7.9% accurate, 5.7× speedup?

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

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


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

    1. Initial program 15.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8999999999999999e-126 < C

    1. Initial program 22.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 7.8% accurate, 5.8× speedup?

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

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


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

    1. Initial program 15.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7e-126 < C

    1. Initial program 22.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 7.8% accurate, 5.8× speedup?

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

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


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

    1. Initial program 15.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25000000000000001e-126 < C

    1. Initial program 22.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 22: 4.8% accurate, 5.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2023320 
(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))))