ABCF->ab-angle b

Percentage Accurate: 19.0% → 49.0%
Time: 23.4s
Alternatives: 13
Speedup: 3.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 19.0% 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: 49.0% accurate, 0.3× speedup?

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

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_3\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{t_3}\\

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


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

    1. Initial program 46.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. Simplified49.8%

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

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

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

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

        \[\leadsto \frac{-{\left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{0.5} \cdot \color{blue}{\sqrt{F \cdot \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)} \]
      5. associate--l+66.2%

        \[\leadsto \frac{-{\left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{0.5} \cdot \sqrt{F \cdot \color{blue}{\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)} \]
    4. Applied egg-rr66.2%

      \[\leadsto \frac{-\color{blue}{{\left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{0.5} \cdot \sqrt{F \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)} \]

    if -4.9999999999999996e-199 < (/.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 15.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. Simplified22.4%

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 2: 46.7% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

    if 2.00000000000000013e-158 < (pow.f64 B 2) < 3.99999999999999993e67

    1. Initial program 44.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. Simplified44.3%

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

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

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

    if 3.99999999999999993e67 < (pow.f64 B 2) < 9.9999999999999994e174

    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. Simplified24.3%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}\right)}\right) \]
      4. unpow213.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-def14.5%

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

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

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

    if 9.9999999999999994e174 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 46.7% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

    if 2.00000000000000013e-158 < (pow.f64 B 2) < 3.99999999999999993e67

    1. Initial program 44.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. Simplified50.2%

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

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

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

    if 3.99999999999999993e67 < (pow.f64 B 2) < 9.9999999999999994e174

    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. Simplified24.3%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}\right)}\right) \]
      4. unpow213.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-def14.5%

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

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

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

    if 9.9999999999999994e174 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 46.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 17.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. Simplified21.3%

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

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

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

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

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

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

    if 2.00000000000000013e-158 < (pow.f64 B 2) < 3.99999999999999993e67

    1. Initial program 44.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. Simplified50.2%

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

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

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

    if 3.99999999999999993e67 < (pow.f64 B 2) < 9.9999999999999994e174

    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. Simplified24.3%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C - \sqrt{\color{blue}{B \cdot B} + {C}^{2}}\right)}\right) \]
      4. unpow213.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-def14.5%

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

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

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

    if 9.9999999999999994e174 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 46.4% accurate, 1.0× speedup?

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

\mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{+110}:\\
\;\;\;\;\frac{t_1 \cdot \left(\sqrt{2} \cdot \left(-B\right)\right)}{t_0}\\

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

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


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

    1. Initial program 22.8%

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

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

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

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

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

    if 1.99999999999999989e-20 < (pow.f64 B 2) < 4.99999999999999978e110

    1. Initial program 39.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(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}} \]
    3. Step-by-step derivation
      1. distribute-frac-neg39.4%

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999978e110 < (pow.f64 B 2) < 9.9999999999999994e174

    1. Initial program 23.0%

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999994e174 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 46.3% accurate, 1.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)\\ \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\frac{-\sqrt{\left(A + A\right) \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{+110} \lor \neg \left({B}^{2} \leq 10^{+175}\right):\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(-0.5 \cdot \frac{{B}^{2}}{C}\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (fma B B (* -4.0 (* A C)))))
   (if (<= (pow B 2.0) 2e-20)
     (/ (- (sqrt (* (+ A A) (* 2.0 (* F t_0))))) t_0)
     (if (or (<= (pow B 2.0) 5e+110) (not (<= (pow B 2.0) 1e+175)))
       (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A (hypot B A))))))
       (* (sqrt (* F (* -0.5 (/ (pow B 2.0) C)))) (/ (- (sqrt 2.0)) B))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = fma(B, B, (-4.0 * (A * C)));
	double tmp;
	if (pow(B, 2.0) <= 2e-20) {
		tmp = -sqrt(((A + A) * (2.0 * (F * t_0)))) / t_0;
	} else if ((pow(B, 2.0) <= 5e+110) || !(pow(B, 2.0) <= 1e+175)) {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(B, A))));
	} else {
		tmp = sqrt((F * (-0.5 * (pow(B, 2.0) / C)))) * (-sqrt(2.0) / B);
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = fma(B, B, Float64(-4.0 * Float64(A * C)))
	tmp = 0.0
	if ((B ^ 2.0) <= 2e-20)
		tmp = Float64(Float64(-sqrt(Float64(Float64(A + A) * Float64(2.0 * Float64(F * t_0))))) / t_0);
	elseif (((B ^ 2.0) <= 5e+110) || !((B ^ 2.0) <= 1e+175))
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - hypot(B, A))))));
	else
		tmp = Float64(sqrt(Float64(F * Float64(-0.5 * Float64((B ^ 2.0) / C)))) * Float64(Float64(-sqrt(2.0)) / B));
	end
	return tmp
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-20], N[((-N[Sqrt[N[(N[(A + A), $MachinePrecision] * N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[Or[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e+110], N[Not[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+175]], $MachinePrecision]], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(F * N[(-0.5 * N[(N[Power[B, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)\\
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-20}:\\
\;\;\;\;\frac{-\sqrt{\left(A + A\right) \cdot \left(2 \cdot \left(F \cdot t_0\right)\right)}}{t_0}\\

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

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


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

    1. Initial program 22.8%

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

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

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

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

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

    if 1.99999999999999989e-20 < (pow.f64 B 2) < 4.99999999999999978e110 or 9.9999999999999994e174 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999978e110 < (pow.f64 B 2) < 9.9999999999999994e174

    1. Initial program 23.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 34.1% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1199999999999999e68 < C

    1. Initial program 2.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. Simplified3.5%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 34.1% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if 2.85e65 < C

    1. Initial program 2.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. Simplified3.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 34.2% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5999999999999997e58 < C

    1. Initial program 2.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. Simplified3.5%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 31.7% accurate, 2.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right) \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A (hypot B A)))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return (sqrt(2.0) / B) * -sqrt((F * (A - hypot(B, A))));
}
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return (Math.sqrt(2.0) / B) * -Math.sqrt((F * (A - Math.hypot(B, A))));
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return (math.sqrt(2.0) / B) * -math.sqrt((F * (A - math.hypot(B, A))))
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - hypot(B, A))))))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = (sqrt(2.0) / B) * -sqrt((F * (A - hypot(B, A))));
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)
\end{array}
Derivation
  1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 26.4% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 0.6% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 0.0% accurate, 3.1× speedup?

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2023306 
(FPCore (A B C F)
  :name "ABCF->ab-angle b"
  :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))))