ABCF->ab-angle b

Percentage Accurate: 18.7% → 51.5%
Time: 25.5s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 18.7% accurate, 1.0× speedup?

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

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

Alternative 1: 51.5% accurate, 0.2× 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(A, C \cdot -4, {B}^{2}\right)\\ t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\ \mathbf{if}\;t_3 \leq -5 \cdot 10^{-197}:\\ \;\;\;\;\frac{{\left(2 \cdot t_0\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{t_0}\\ \mathbf{elif}\;t_3 \leq 4 \cdot 10^{+250}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_1\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{{A}^{2} + \left({B}^{2} - {\left(-A\right)}^{2}\right)}{C}\right)\right)\right)}}{t_1}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{-{\left(e^{0.25 \cdot \left(\log \left(-8 \cdot \left(C \cdot F\right)\right) + -2 \cdot \log \left(\frac{-1}{A}\right)\right)} \cdot \sqrt{\sqrt{2}}\right)}^{2}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-{\left(\sqrt{\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)}^{2}\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 A (* C -4.0) (pow B 2.0)))
        (t_2 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_3
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_2 F))
             (- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_2)))
   (if (<= t_3 -5e-197)
     (/
      (* (pow (* 2.0 t_0) 0.5) (- (sqrt (* F (+ A (- C (hypot B (- A C))))))))
      t_0)
     (if (<= t_3 4e+250)
       (/
        (-
         (sqrt
          (*
           2.0
           (*
            (* F t_1)
            (+
             A
             (+
              A
              (*
               -0.5
               (/ (+ (pow A 2.0) (- (pow B 2.0) (pow (- A) 2.0))) C))))))))
        t_1)
       (if (<= t_3 INFINITY)
         (/
          (-
           (pow
            (*
             (exp
              (* 0.25 (+ (log (* -8.0 (* C F))) (* -2.0 (log (/ -1.0 A))))))
             (sqrt (sqrt 2.0)))
            2.0))
          t_0)
         (*
          (/ (sqrt 2.0) B)
          (- (pow (sqrt (sqrt (* F (- A (hypot B A))))) 2.0))))))))
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(A, (C * -4.0), pow(B, 2.0));
	double t_2 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_3 = -sqrt(((2.0 * (t_2 * F)) * ((A + C) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= -5e-197) {
		tmp = (pow((2.0 * t_0), 0.5) * -sqrt((F * (A + (C - hypot(B, (A - C))))))) / t_0;
	} else if (t_3 <= 4e+250) {
		tmp = -sqrt((2.0 * ((F * t_1) * (A + (A + (-0.5 * ((pow(A, 2.0) + (pow(B, 2.0) - pow(-A, 2.0))) / C))))))) / t_1;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = -pow((exp((0.25 * (log((-8.0 * (C * F))) + (-2.0 * log((-1.0 / A)))))) * sqrt(sqrt(2.0))), 2.0) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * -pow(sqrt(sqrt((F * (A - hypot(B, A))))), 2.0);
	}
	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(A, Float64(C * -4.0), (B ^ 2.0))
	t_2 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2)
	tmp = 0.0
	if (t_3 <= -5e-197)
		tmp = Float64(Float64((Float64(2.0 * t_0) ^ 0.5) * Float64(-sqrt(Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C)))))))) / t_0);
	elseif (t_3 <= 4e+250)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_1) * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64((A ^ 2.0) + Float64((B ^ 2.0) - (Float64(-A) ^ 2.0))) / C)))))))) / t_1);
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(-(Float64(exp(Float64(0.25 * Float64(log(Float64(-8.0 * Float64(C * F))) + Float64(-2.0 * log(Float64(-1.0 / A)))))) * sqrt(sqrt(2.0))) ^ 2.0)) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-(sqrt(sqrt(Float64(F * Float64(A - hypot(B, A))))) ^ 2.0)));
	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[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-197], N[(N[(N[Power[N[(2.0 * t$95$0), $MachinePrecision], 0.5], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[t$95$3, 4e+250], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$1), $MachinePrecision] * N[(A + N[(A + N[(-0.5 * N[(N[(N[Power[A, 2.0], $MachinePrecision] + N[(N[Power[B, 2.0], $MachinePrecision] - N[Power[(-A), 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[((-N[Power[N[(N[Exp[N[(0.25 * N[(N[Log[N[(-8.0 * N[(C * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(-2.0 * N[Log[N[(-1.0 / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Power[N[Sqrt[N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 2.0], $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(A, C \cdot -4, {B}^{2}\right)\\
t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-197}:\\
\;\;\;\;\frac{{\left(2 \cdot t_0\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{t_0}\\

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

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{-{\left(e^{0.25 \cdot \left(\log \left(-8 \cdot \left(C \cdot F\right)\right) + -2 \cdot \log \left(\frac{-1}{A}\right)\right)} \cdot \sqrt{\sqrt{2}}\right)}^{2}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 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))) < -5.0000000000000002e-197

    1. Initial program 52.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. Simplified60.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. Step-by-step derivation
      1. pow1/260.5%

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

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

        \[\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/272.6%

        \[\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+74.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-rr74.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 -5.0000000000000002e-197 < (/.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))) < 3.9999999999999997e250

    1. Initial program 31.4%

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

      \[\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 36.2%

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

        \[\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+36.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}{{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-neg36.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{{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-neg36.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{{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. Simplified36.2%

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

    if 3.9999999999999997e250 < (/.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 3.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. Simplified30.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. Step-by-step derivation
      1. add-sqr-sqrt30.3%

        \[\leadsto \frac{-\color{blue}{\sqrt{\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)}} \cdot \sqrt{\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)} \]
      2. pow230.3%

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\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 1.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq -5 \cdot 10^{-197}:\\ \;\;\;\;\frac{{\left(2 \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq 4 \cdot 10^{+250}:\\ \;\;\;\;\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{{A}^{2} + \left({B}^{2} - {\left(-A\right)}^{2}\right)}{C}\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}\\ \mathbf{elif}\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq \infty:\\ \;\;\;\;\frac{-{\left(e^{0.25 \cdot \left(\log \left(-8 \cdot \left(C \cdot F\right)\right) + -2 \cdot \log \left(\frac{-1}{A}\right)\right)} \cdot \sqrt{\sqrt{2}}\right)}^{2}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-{\left(\sqrt{\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)}^{2}\right)\\ \end{array} \]

Alternative 2: 49.9% accurate, 0.2× 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 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{-197}:\\ \;\;\;\;\frac{{\left(2 \cdot t_0\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{t_0}\\ \mathbf{elif}\;t_2 \leq 4 \cdot 10^{+250}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;\frac{-{\left(e^{0.25 \cdot \left(\log \left(-8 \cdot \left(C \cdot F\right)\right) + -2 \cdot \log \left(\frac{-1}{A}\right)\right)} \cdot \sqrt{\sqrt{2}}\right)}^{2}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-{\left(\sqrt{\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)}^{2}\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 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_2
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_1 F))
             (- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_1)))
   (if (<= t_2 -5e-197)
     (/
      (* (pow (* 2.0 t_0) 0.5) (- (sqrt (* F (+ A (- C (hypot B (- A C))))))))
      t_0)
     (if (<= t_2 4e+250)
       (/ (- (sqrt (* 2.0 (* -4.0 (* (* A C) (* F (+ A A))))))) t_0)
       (if (<= t_2 INFINITY)
         (/
          (-
           (pow
            (*
             (exp
              (* 0.25 (+ (log (* -8.0 (* C F))) (* -2.0 (log (/ -1.0 A))))))
             (sqrt (sqrt 2.0)))
            2.0))
          t_0)
         (*
          (/ (sqrt 2.0) B)
          (- (pow (sqrt (sqrt (* F (- A (hypot B A))))) 2.0))))))))
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 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_1;
	double tmp;
	if (t_2 <= -5e-197) {
		tmp = (pow((2.0 * t_0), 0.5) * -sqrt((F * (A + (C - hypot(B, (A - C))))))) / t_0;
	} else if (t_2 <= 4e+250) {
		tmp = -sqrt((2.0 * (-4.0 * ((A * C) * (F * (A + A)))))) / t_0;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = -pow((exp((0.25 * (log((-8.0 * (C * F))) + (-2.0 * log((-1.0 / A)))))) * sqrt(sqrt(2.0))), 2.0) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * -pow(sqrt(sqrt((F * (A - hypot(B, A))))), 2.0);
	}
	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((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_1)
	tmp = 0.0
	if (t_2 <= -5e-197)
		tmp = Float64(Float64((Float64(2.0 * t_0) ^ 0.5) * Float64(-sqrt(Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C)))))))) / t_0);
	elseif (t_2 <= 4e+250)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))))) / t_0);
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(-(Float64(exp(Float64(0.25 * Float64(log(Float64(-8.0 * Float64(C * F))) + Float64(-2.0 * log(Float64(-1.0 / A)))))) * sqrt(sqrt(2.0))) ^ 2.0)) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-(sqrt(sqrt(Float64(F * Float64(A - hypot(B, A))))) ^ 2.0)));
	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[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-197], N[(N[(N[Power[N[(2.0 * t$95$0), $MachinePrecision], 0.5], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[t$95$2, 4e+250], N[((-N[Sqrt[N[(2.0 * N[(-4.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[((-N[Power[N[(N[Exp[N[(0.25 * N[(N[Log[N[(-8.0 * N[(C * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(-2.0 * N[Log[N[(-1.0 / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Power[N[Sqrt[N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 2.0], $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 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{-197}:\\
\;\;\;\;\frac{{\left(2 \cdot t_0\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{t_0}\\

\mathbf{elif}\;t_2 \leq 4 \cdot 10^{+250}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{t_0}\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{-{\left(e^{0.25 \cdot \left(\log \left(-8 \cdot \left(C \cdot F\right)\right) + -2 \cdot \log \left(\frac{-1}{A}\right)\right)} \cdot \sqrt{\sqrt{2}}\right)}^{2}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 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))) < -5.0000000000000002e-197

    1. Initial program 52.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. Simplified60.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. Step-by-step derivation
      1. pow1/260.5%

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

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

        \[\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/272.6%

        \[\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+74.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-rr74.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 -5.0000000000000002e-197 < (/.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))) < 3.9999999999999997e250

    1. Initial program 31.4%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv32.2%

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

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

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

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

    if 3.9999999999999997e250 < (/.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 3.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. Simplified30.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. Step-by-step derivation
      1. add-sqr-sqrt30.3%

        \[\leadsto \frac{-\color{blue}{\sqrt{\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)}} \cdot \sqrt{\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)} \]
      2. pow230.3%

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\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 1.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 48.5% accurate, 0.4× 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 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{-197}:\\ \;\;\;\;\frac{{\left(2 \cdot t_0\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{t_0}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-{\left(\sqrt{\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}}\right)}^{2}\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 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_2
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_1 F))
             (- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_1)))
   (if (<= t_2 -5e-197)
     (/
      (* (pow (* 2.0 t_0) 0.5) (- (sqrt (* F (+ A (- C (hypot B (- A C))))))))
      t_0)
     (if (<= t_2 INFINITY)
       (/ (- (sqrt (* 2.0 (* -4.0 (* (* A C) (* F (+ A A))))))) t_0)
       (*
        (/ (sqrt 2.0) B)
        (- (pow (sqrt (sqrt (* F (- A (hypot B A))))) 2.0)))))))
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 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_1;
	double tmp;
	if (t_2 <= -5e-197) {
		tmp = (pow((2.0 * t_0), 0.5) * -sqrt((F * (A + (C - hypot(B, (A - C))))))) / t_0;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = -sqrt((2.0 * (-4.0 * ((A * C) * (F * (A + A)))))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B) * -pow(sqrt(sqrt((F * (A - hypot(B, A))))), 2.0);
	}
	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((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_1)
	tmp = 0.0
	if (t_2 <= -5e-197)
		tmp = Float64(Float64((Float64(2.0 * t_0) ^ 0.5) * Float64(-sqrt(Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C)))))))) / t_0);
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-(sqrt(sqrt(Float64(F * Float64(A - hypot(B, A))))) ^ 2.0)));
	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[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-197], N[(N[(N[Power[N[(2.0 * t$95$0), $MachinePrecision], 0.5], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[((-N[Sqrt[N[(2.0 * N[(-4.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Power[N[Sqrt[N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 2.0], $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 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{-197}:\\
\;\;\;\;\frac{{\left(2 \cdot t_0\right)}^{0.5} \cdot \left(-\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}\right)}{t_0}\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{t_0}\\

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


\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))) < -5.0000000000000002e-197

    1. Initial program 52.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. Simplified60.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. Step-by-step derivation
      1. pow1/260.5%

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

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

        \[\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/272.6%

        \[\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+74.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-rr74.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 -5.0000000000000002e-197 < (/.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 22.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. Simplified31.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 inf 26.6%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\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 1.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 45.5% accurate, 0.9× 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)\\ \mathbf{if}\;{B}^{2} \leq 10^{-130}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{-90}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-B\right)}\right)\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{-35}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right) + 2 \cdot \left(A \cdot \left({B}^{2} \cdot F\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\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)))))
   (if (<= (pow B 2.0) 1e-130)
     (/ (- (sqrt (* 2.0 (* -4.0 (* (* A C) (* F (+ A A))))))) t_0)
     (if (<= (pow B 2.0) 5e-90)
       (* (/ (sqrt 2.0) B) (- (sqrt (* F (- B)))))
       (if (<= (pow B 2.0) 5e-35)
         (/
          (-
           (sqrt
            (*
             2.0
             (+
              (* -8.0 (* (pow A 2.0) (* C F)))
              (* 2.0 (* A (* (pow B 2.0) F)))))))
          t_0)
         (/ (* (sqrt 2.0) (- (sqrt (* F (- A (hypot B A)))))) 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 tmp;
	if (pow(B, 2.0) <= 1e-130) {
		tmp = -sqrt((2.0 * (-4.0 * ((A * C) * (F * (A + A)))))) / t_0;
	} else if (pow(B, 2.0) <= 5e-90) {
		tmp = (sqrt(2.0) / B) * -sqrt((F * -B));
	} else if (pow(B, 2.0) <= 5e-35) {
		tmp = -sqrt((2.0 * ((-8.0 * (pow(A, 2.0) * (C * F))) + (2.0 * (A * (pow(B, 2.0) * F)))))) / t_0;
	} else {
		tmp = (sqrt(2.0) * -sqrt((F * (A - hypot(B, A))))) / 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)))
	tmp = 0.0
	if ((B ^ 2.0) <= 1e-130)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))))) / t_0);
	elseif ((B ^ 2.0) <= 5e-90)
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(-B)))));
	elseif ((B ^ 2.0) <= 5e-35)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(-8.0 * Float64((A ^ 2.0) * Float64(C * F))) + Float64(2.0 * Float64(A * Float64((B ^ 2.0) * F))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A - hypot(B, A)))))) / 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]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e-130], N[((-N[Sqrt[N[(2.0 * N[(-4.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-90], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * (-B)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-35], N[((-N[Sqrt[N[(2.0 * N[(N[(-8.0 * N[(N[Power[A, 2.0], $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(A * N[(N[Power[B, 2.0], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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)\\
\mathbf{if}\;{B}^{2} \leq 10^{-130}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{t_0}\\

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

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

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


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

    1. Initial program 30.6%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv23.6%

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

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

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

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

    if 1.0000000000000001e-130 < (pow.f64 B 2) < 5.00000000000000019e-90

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000019e-90 < (pow.f64 B 2) < 4.99999999999999964e-35

    1. Initial program 55.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. Simplified55.7%

      \[\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 -inf 29.2%

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

    if 4.99999999999999964e-35 < (pow.f64 B 2)

    1. Initial program 17.6%

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

      \[\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 10.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 46.9% 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)\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-182}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+178}:\\ \;\;\;\;\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{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\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)))))
   (if (<= (pow B 2.0) 5e-182)
     (/ (- (sqrt (* 2.0 (* -4.0 (* (* A C) (* F (+ A A))))))) t_0)
     (if (<= (pow B 2.0) 2e+178)
       (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A (- C (hypot B (- A C))))))))) t_0)
       (/ (* (sqrt 2.0) (- (sqrt (* F (- A (hypot B A)))))) 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 tmp;
	if (pow(B, 2.0) <= 5e-182) {
		tmp = -sqrt((2.0 * (-4.0 * ((A * C) * (F * (A + A)))))) / t_0;
	} else if (pow(B, 2.0) <= 2e+178) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + (C - hypot(B, (A - C)))))))) / t_0;
	} else {
		tmp = (sqrt(2.0) * -sqrt((F * (A - hypot(B, A))))) / 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)))
	tmp = 0.0
	if ((B ^ 2.0) <= 5e-182)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))))) / t_0);
	elseif ((B ^ 2.0) <= 2e+178)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C))))))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A - hypot(B, A)))))) / 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]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-182], N[((-N[Sqrt[N[(2.0 * N[(-4.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+178], 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], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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)\\
\mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-182}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{t_0}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+178}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}\\


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

    1. Initial program 28.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. Simplified34.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 C around inf 22.2%

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv22.2%

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

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

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

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

    if 5.00000000000000024e-182 < (pow.f64 B 2) < 2.0000000000000001e178

    1. Initial program 40.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. Simplified48.7%

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

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

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

    1. Initial program 4.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. Simplified4.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. Taylor expanded in C around 0 7.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 47.2% 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 5 \cdot 10^{-182}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+178}:\\ \;\;\;\;\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{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\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 A (* C -4.0) (pow B 2.0))) (t_1 (fma B B (* A (* C -4.0)))))
   (if (<= (pow B 2.0) 5e-182)
     (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A A))))) t_0)
     (if (<= (pow B 2.0) 2e+178)
       (/ (- (sqrt (* 2.0 (* t_1 (* F (+ A (- C (hypot B (- A C))))))))) t_1)
       (/ (* (sqrt 2.0) (- (sqrt (* F (- A (hypot B A)))))) B)))))
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) <= 5e-182) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + A)))) / t_0;
	} else if (pow(B, 2.0) <= 2e+178) {
		tmp = -sqrt((2.0 * (t_1 * (F * (A + (C - hypot(B, (A - C)))))))) / t_1;
	} else {
		tmp = (sqrt(2.0) * -sqrt((F * (A - hypot(B, A))))) / B;
	}
	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) <= 5e-182)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + A))))) / t_0);
	elseif ((B ^ 2.0) <= 2e+178)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(F * Float64(A + Float64(C - hypot(B, Float64(A - C))))))))) / t_1);
	else
		tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A - hypot(B, A)))))) / 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[(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], 5e-182], 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], 2e+178], 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], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B), $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 5 \cdot 10^{-182}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + A\right)\right)}}{t_0}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+178}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}\\


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

    1. Initial program 28.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. Simplified35.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 24.2%

      \[\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. cancel-sign-sub-inv24.2%

        \[\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\right) \cdot A\right)}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      2. metadata-eval24.2%

        \[\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}{1} \cdot A\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      3. *-lft-identity24.2%

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

      \[\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 5.00000000000000024e-182 < (pow.f64 B 2) < 2.0000000000000001e178

    1. Initial program 40.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. Simplified48.7%

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

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

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

    1. Initial program 4.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. Simplified4.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. Taylor expanded in C around 0 7.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 45.8% accurate, 1.5× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-135}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{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
 (if (<= (pow B 2.0) 2e-135)
   (/
    (- (sqrt (* 2.0 (* -4.0 (* (* A C) (* F (+ A A)))))))
    (fma B B (* A (* C -4.0))))
   (* (/ (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 tmp;
	if (pow(B, 2.0) <= 2e-135) {
		tmp = -sqrt((2.0 * (-4.0 * ((A * C) * (F * (A + A)))))) / fma(B, B, (A * (C * -4.0)));
	} 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)
	tmp = 0.0
	if ((B ^ 2.0) <= 2e-135)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))))) / fma(B, B, Float64(A * Float64(C * -4.0))));
	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_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-135], N[((-N[Sqrt[N[(2.0 * N[(-4.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $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}
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-135}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\

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


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

    1. Initial program 31.1%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv23.7%

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

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

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

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

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

    1. Initial program 22.9%

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

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

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

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

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

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

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

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

Alternative 8: 45.7% accurate, 1.5× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-135}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)}\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
 (if (<= (pow B 2.0) 2e-135)
   (/
    (- (sqrt (* 2.0 (* -4.0 (* (* A C) (* F (+ A A)))))))
    (fma B B (* A (* C -4.0))))
   (/ (* (sqrt 2.0) (- (sqrt (* F (- A (hypot B A)))))) B)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 2e-135) {
		tmp = -sqrt((2.0 * (-4.0 * ((A * C) * (F * (A + A)))))) / fma(B, B, (A * (C * -4.0)));
	} else {
		tmp = (sqrt(2.0) * -sqrt((F * (A - hypot(B, A))))) / B;
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 2e-135)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))))) / fma(B, B, Float64(A * Float64(C * -4.0))));
	else
		tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A - hypot(B, A)))))) / 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_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e-135], N[((-N[Sqrt[N[(2.0 * N[(-4.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-135}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\

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


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

    1. Initial program 31.1%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv23.7%

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

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

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

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

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

    1. Initial program 22.9%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 41.8% accurate, 2.8× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 7.5 \cdot 10^{-64}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - B\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
 (if (<= B 7.5e-64)
   (/
    (- (sqrt (* 2.0 (* -4.0 (* (* A C) (* F (+ A A)))))))
    (fma B B (* A (* C -4.0))))
   (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A B)))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 7.5e-64) {
		tmp = -sqrt((2.0 * (-4.0 * ((A * C) * (F * (A + A)))))) / fma(B, B, (A * (C * -4.0)));
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - B)));
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 7.5e-64)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))))) / fma(B, B, Float64(A * Float64(C * -4.0))));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - 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_] := If[LessEqual[B, 7.5e-64], N[((-N[Sqrt[N[(2.0 * N[(-4.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 7.5 \cdot 10^{-64}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 7.49999999999999949e-64

    1. Initial program 28.8%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv17.4%

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

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

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

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

    if 7.49999999999999949e-64 < B

    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. Simplified25.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 C around 0 19.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 38.5% accurate, 2.8× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 1.1 \cdot 10^{-67}:\\ \;\;\;\;\sqrt{-8 \cdot \left(C \cdot \left(A \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right)} \cdot \frac{-1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - B\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
 (if (<= B 1.1e-67)
   (*
    (sqrt (* -8.0 (* C (* A (* F (* 2.0 A))))))
    (/ -1.0 (fma B B (* A (* C -4.0)))))
   (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A B)))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 1.1e-67) {
		tmp = sqrt((-8.0 * (C * (A * (F * (2.0 * A)))))) * (-1.0 / fma(B, B, (A * (C * -4.0))));
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - B)));
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 1.1e-67)
		tmp = Float64(sqrt(Float64(-8.0 * Float64(C * Float64(A * Float64(F * Float64(2.0 * A)))))) * Float64(-1.0 / fma(B, B, Float64(A * Float64(C * -4.0)))));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - 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_] := If[LessEqual[B, 1.1e-67], N[(N[Sqrt[N[(-8.0 * N[(C * N[(A * N[(F * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.1 \cdot 10^{-67}:\\
\;\;\;\;\sqrt{-8 \cdot \left(C \cdot \left(A \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)\right)} \cdot \frac{-1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.1000000000000001e-67

    1. Initial program 28.9%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv17.7%

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

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

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

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

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

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

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

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

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

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

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

    if 1.1000000000000001e-67 < B

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 38.6% accurate, 2.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 1.2 \cdot 10^{-67}:\\ \;\;\;\;\frac{-\sqrt{-8 \cdot \left(C \cdot \left(\left(2 \cdot A\right) \cdot \left(A \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - B\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
 (if (<= B 1.2e-67)
   (/
    (- (sqrt (* -8.0 (* C (* (* 2.0 A) (* A F))))))
    (fma B B (* A (* C -4.0))))
   (* (/ (sqrt 2.0) B) (- (sqrt (* F (- A B)))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 1.2e-67) {
		tmp = -sqrt((-8.0 * (C * ((2.0 * A) * (A * F))))) / fma(B, B, (A * (C * -4.0)));
	} else {
		tmp = (sqrt(2.0) / B) * -sqrt((F * (A - B)));
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 1.2e-67)
		tmp = Float64(Float64(-sqrt(Float64(-8.0 * Float64(C * Float64(Float64(2.0 * A) * Float64(A * F)))))) / fma(B, B, Float64(A * Float64(C * -4.0))));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(F * Float64(A - 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_] := If[LessEqual[B, 1.2e-67], N[((-N[Sqrt[N[(-8.0 * N[(C * N[(N[(2.0 * A), $MachinePrecision] * N[(A * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(F * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.2 \cdot 10^{-67}:\\
\;\;\;\;\frac{-\sqrt{-8 \cdot \left(C \cdot \left(\left(2 \cdot A\right) \cdot \left(A \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.2e-67

    1. Initial program 28.9%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \left(-4 \cdot \left(\color{blue}{\left(C \cdot A\right)} \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. cancel-sign-sub-inv17.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{-\left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{-8} \cdot \left(\left(C \cdot A\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}\right)} - 1\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. associate-*l*9.7%

        \[\leadsto \frac{-\left(e^{\mathsf{log1p}\left(\sqrt{-8 \cdot \color{blue}{\left(C \cdot \left(A \cdot \left(F \cdot \left(A + A\right)\right)\right)\right)}}\right)} - 1\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      6. count-29.7%

        \[\leadsto \frac{-\left(e^{\mathsf{log1p}\left(\sqrt{-8 \cdot \left(C \cdot \left(A \cdot \left(F \cdot \color{blue}{\left(2 \cdot A\right)}\right)\right)\right)}\right)} - 1\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    7. Applied egg-rr9.7%

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

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

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

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

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

    if 1.2e-67 < B

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 27.9% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;A \leq -2.9 \cdot 10^{+194}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{2 \cdot \left(A \cdot F\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(-B\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 (/ (sqrt 2.0) B)))
   (if (<= A -2.9e+194)
     (* t_0 (- (sqrt (* 2.0 (* A F)))))
     (* t_0 (- (sqrt (* F (- B))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = sqrt(2.0) / B;
	double tmp;
	if (A <= -2.9e+194) {
		tmp = t_0 * -sqrt((2.0 * (A * F)));
	} else {
		tmp = t_0 * -sqrt((F * -B));
	}
	return tmp;
}
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(2.0d0) / b
    if (a <= (-2.9d+194)) then
        tmp = t_0 * -sqrt((2.0d0 * (a * f)))
    else
        tmp = t_0 * -sqrt((f * -b))
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.sqrt(2.0) / B;
	double tmp;
	if (A <= -2.9e+194) {
		tmp = t_0 * -Math.sqrt((2.0 * (A * F)));
	} else {
		tmp = t_0 * -Math.sqrt((F * -B));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = math.sqrt(2.0) / B
	tmp = 0
	if A <= -2.9e+194:
		tmp = t_0 * -math.sqrt((2.0 * (A * F)))
	else:
		tmp = t_0 * -math.sqrt((F * -B))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(sqrt(2.0) / B)
	tmp = 0.0
	if (A <= -2.9e+194)
		tmp = Float64(t_0 * Float64(-sqrt(Float64(2.0 * Float64(A * F)))));
	else
		tmp = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(-B)))));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = sqrt(2.0) / B;
	tmp = 0.0;
	if (A <= -2.9e+194)
		tmp = t_0 * -sqrt((2.0 * (A * F)));
	else
		tmp = t_0 * -sqrt((F * -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_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[A, -2.9e+194], N[(t$95$0 * (-N[Sqrt[N[(2.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$0 * (-N[Sqrt[N[(F * (-B)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B}\\
\mathbf{if}\;A \leq -2.9 \cdot 10^{+194}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt{2 \cdot \left(A \cdot F\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -2.9000000000000001e194

    1. Initial program 2.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. Simplified24.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. Taylor expanded in C around 0 1.2%

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

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

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

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

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

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

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

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

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

    if -2.9000000000000001e194 < A

    1. Initial program 28.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. Simplified32.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. Taylor expanded in C around 0 9.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-neg9.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 28.0% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;A \leq -1.55 \cdot 10^{+195}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{2 \cdot \left(A \cdot F\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-\sqrt{F \cdot \left(A - B\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 (/ (sqrt 2.0) B)))
   (if (<= A -1.55e+195)
     (* t_0 (- (sqrt (* 2.0 (* A F)))))
     (* t_0 (- (sqrt (* F (- A B))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = sqrt(2.0) / B;
	double tmp;
	if (A <= -1.55e+195) {
		tmp = t_0 * -sqrt((2.0 * (A * F)));
	} else {
		tmp = t_0 * -sqrt((F * (A - B)));
	}
	return tmp;
}
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(2.0d0) / b
    if (a <= (-1.55d+195)) then
        tmp = t_0 * -sqrt((2.0d0 * (a * f)))
    else
        tmp = t_0 * -sqrt((f * (a - b)))
    end if
    code = tmp
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.sqrt(2.0) / B;
	double tmp;
	if (A <= -1.55e+195) {
		tmp = t_0 * -Math.sqrt((2.0 * (A * F)));
	} else {
		tmp = t_0 * -Math.sqrt((F * (A - B)));
	}
	return tmp;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	t_0 = math.sqrt(2.0) / B
	tmp = 0
	if A <= -1.55e+195:
		tmp = t_0 * -math.sqrt((2.0 * (A * F)))
	else:
		tmp = t_0 * -math.sqrt((F * (A - B)))
	return tmp
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(sqrt(2.0) / B)
	tmp = 0.0
	if (A <= -1.55e+195)
		tmp = Float64(t_0 * Float64(-sqrt(Float64(2.0 * Float64(A * F)))));
	else
		tmp = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(A - B)))));
	end
	return tmp
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	t_0 = sqrt(2.0) / B;
	tmp = 0.0;
	if (A <= -1.55e+195)
		tmp = t_0 * -sqrt((2.0 * (A * F)));
	else
		tmp = t_0 * -sqrt((F * (A - 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_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[A, -1.55e+195], N[(t$95$0 * (-N[Sqrt[N[(2.0 * N[(A * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$0 * (-N[Sqrt[N[(F * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B}\\
\mathbf{if}\;A \leq -1.55 \cdot 10^{+195}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt{2 \cdot \left(A \cdot F\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -1.5500000000000001e195

    1. Initial program 2.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. Simplified24.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. Taylor expanded in C around 0 1.2%

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

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

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

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

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

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

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

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

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

    if -1.5500000000000001e195 < A

    1. Initial program 28.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. Simplified32.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. Taylor expanded in C around 0 9.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-neg9.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 26.6% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-B\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 (- B))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return (sqrt(2.0) / B) * -sqrt((F * -B));
}
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((f * -b))
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((F * -B));
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return (math.sqrt(2.0) / B) * -math.sqrt((F * -B))
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(-B)))))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = (sqrt(2.0) / B) * -sqrt((F * -B));
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 * (-B)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(-B\right)}\right)
\end{array}
Derivation
  1. Initial program 26.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 1.0% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \sqrt{C \cdot F} \cdot \frac{-\sqrt{2}}{B} \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 (* C F)) (/ (- (sqrt 2.0)) B)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return sqrt((C * F)) * (-sqrt(2.0) / B);
}
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((c * f)) * (-sqrt(2.0d0) / b)
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return Math.sqrt((C * F)) * (-Math.sqrt(2.0) / B);
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return math.sqrt((C * F)) * (-math.sqrt(2.0) / B)
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(sqrt(Float64(C * F)) * Float64(Float64(-sqrt(2.0)) / B))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = sqrt((C * F)) * (-sqrt(2.0) / B);
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[(C * F), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\sqrt{C \cdot F} \cdot \frac{-\sqrt{2}}{B}
\end{array}
Derivation
  1. Initial program 26.1%

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

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

    \[\leadsto \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) - \color{blue}{A}\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
  4. Taylor expanded in B around inf 2.2%

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

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

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

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

Alternative 16: 0.8% 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 26.1%

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

    \[\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 7.9%

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

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

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

Reproduce

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