ABCF->ab-angle b

Percentage Accurate: 19.3% → 39.3%
Time: 30.9s
Alternatives: 15
Speedup: 2.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 15 alternatives:

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

Initial Program: 19.3% 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: 39.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -2.39999999999999979e-180

    1. Initial program 21.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{A \cdot -8} \cdot \sqrt{C \cdot \left(F \cdot \left(\frac{2}{2} \cdot A - \color{blue}{-1 \cdot A}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      7. distribute-rgt-out--9.5%

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

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

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

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

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

    if -2.39999999999999979e-180 < C < 3.9999999999999997e-40

    1. Initial program 26.9%

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

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

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

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

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

    if 3.9999999999999997e-40 < C

    1. Initial program 8.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 40.7% accurate, 0.2× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)\\ t_1 := {B}^{2} - \left(C \cdot A\right) \cdot 4\\ t_2 := {B}^{2} - C \cdot \left(A \cdot 4\right)\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(F \cdot t_2\right)\right) \cdot \left(\left(C + A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\ t_4 := F \cdot \left(A \cdot 2\right)\\ t_5 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\frac{\sqrt{2 \cdot t_0} \cdot \left(-\sqrt{t_4}\right)}{t_1}\\ \mathbf{elif}\;t_3 \leq -2 \cdot 10^{-101}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\frac{-\sqrt{\left(t_5 \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \frac{2 \cdot \left(C \cdot A\right) - {B}^{2}}{C + \mathsf{hypot}\left(B, A - C\right)}\right)}}{t_5}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{\sqrt{A \cdot -8} \cdot \left(-\sqrt{C \cdot t_4}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot 2\right)\right)} \cdot \left(-\sqrt{A}\right)}{t_1}\\ \end{array} \end{array} \]
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 (- (pow B 2.0) (* (* C A) 4.0)))
        (t_2 (- (pow B 2.0) (* C (* A 4.0))))
        (t_3
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* F t_2))
             (- (+ C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_2))
        (t_4 (* F (* A 2.0)))
        (t_5 (fma B B (* A (* C -4.0)))))
   (if (<= t_3 (- INFINITY))
     (/ (* (sqrt (* 2.0 t_0)) (- (sqrt t_4))) t_1)
     (if (<= t_3 -2e-101)
       t_3
       (if (<= t_3 0.0)
         (/
          (-
           (sqrt
            (*
             (* t_5 (* F 2.0))
             (+
              A
              (/ (- (* 2.0 (* C A)) (pow B 2.0)) (+ C (hypot B (- A C))))))))
          t_5)
         (if (<= t_3 INFINITY)
           (/ (* (sqrt (* A -8.0)) (- (sqrt (* C t_4)))) t_0)
           (/ (* (sqrt (* 2.0 (* t_0 (* F 2.0)))) (- (sqrt A))) t_1)))))))
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 = pow(B, 2.0) - ((C * A) * 4.0);
	double t_2 = pow(B, 2.0) - (C * (A * 4.0));
	double t_3 = -sqrt(((2.0 * (F * t_2)) * ((C + A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double t_4 = F * (A * 2.0);
	double t_5 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = (sqrt((2.0 * t_0)) * -sqrt(t_4)) / t_1;
	} else if (t_3 <= -2e-101) {
		tmp = t_3;
	} else if (t_3 <= 0.0) {
		tmp = -sqrt(((t_5 * (F * 2.0)) * (A + (((2.0 * (C * A)) - pow(B, 2.0)) / (C + hypot(B, (A - C))))))) / t_5;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = (sqrt((A * -8.0)) * -sqrt((C * t_4))) / t_0;
	} else {
		tmp = (sqrt((2.0 * (t_0 * (F * 2.0)))) * -sqrt(A)) / t_1;
	}
	return tmp;
}
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = fma(A, Float64(C * -4.0), (B ^ 2.0))
	t_1 = Float64((B ^ 2.0) - Float64(Float64(C * A) * 4.0))
	t_2 = Float64((B ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_2)) * Float64(Float64(C + A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2)
	t_4 = Float64(F * Float64(A * 2.0))
	t_5 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(Float64(sqrt(Float64(2.0 * t_0)) * Float64(-sqrt(t_4))) / t_1);
	elseif (t_3 <= -2e-101)
		tmp = t_3;
	elseif (t_3 <= 0.0)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_5 * Float64(F * 2.0)) * Float64(A + Float64(Float64(Float64(2.0 * Float64(C * A)) - (B ^ 2.0)) / Float64(C + hypot(B, Float64(A - C)))))))) / t_5);
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(sqrt(Float64(A * -8.0)) * Float64(-sqrt(Float64(C * t_4)))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(t_0 * Float64(F * 2.0)))) * Float64(-sqrt(A))) / t_1);
	end
	return tmp
end
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[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(N[(C + A), $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]}, Block[{t$95$4 = N[(F * N[(A * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[t$95$4], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, -2e-101], t$95$3, If[LessEqual[t$95$3, 0.0], N[((-N[Sqrt[N[(N[(t$95$5 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(N[(N[(2.0 * N[(C * A), $MachinePrecision]), $MachinePrecision] - N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision] / N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$5), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(N[Sqrt[N[(A * -8.0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C * t$95$4), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[A], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)\\
t_1 := {B}^{2} - \left(C \cdot A\right) \cdot 4\\
t_2 := {B}^{2} - C \cdot \left(A \cdot 4\right)\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(F \cdot t_2\right)\right) \cdot \left(\left(C + A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
t_4 := F \cdot \left(A \cdot 2\right)\\
t_5 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;\frac{\sqrt{2 \cdot t_0} \cdot \left(-\sqrt{t_4}\right)}{t_1}\\

\mathbf{elif}\;t_3 \leq -2 \cdot 10^{-101}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{A \cdot -8} \cdot \left(-\sqrt{C \cdot t_4}\right)}{t_0}\\

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


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

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

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

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

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

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

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

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

    if -2.0000000000000001e-101 < (/.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))) < 0.0

    1. Initial program 13.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. Simplified17.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.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))) < +inf.0

    1. Initial program 52.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. Simplified43.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{A \cdot -8} \cdot \sqrt{C \cdot \left(F \cdot \left(\frac{2}{2} \cdot A - \color{blue}{-1 \cdot A}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      7. distribute-rgt-out--36.2%

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 41.0% accurate, 0.2× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)\\ t_1 := {B}^{2} - \left(C \cdot A\right) \cdot 4\\ t_2 := {B}^{2} - C \cdot \left(A \cdot 4\right)\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(F \cdot t_2\right)\right) \cdot \left(\left(C + A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\ t_4 := F \cdot \left(A \cdot 2\right)\\ t_5 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\frac{\sqrt{2 \cdot t_0} \cdot \left(-\sqrt{t_4}\right)}{t_1}\\ \mathbf{elif}\;t_3 \leq -2 \cdot 10^{-189}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+87}:\\ \;\;\;\;\frac{-\sqrt{\left(t_5 \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \left(A + \frac{-0.5 \cdot \left(\left({B}^{2} + {A}^{2}\right) - {\left(-A\right)}^{2}\right)}{C}\right)\right)}}{t_5}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{\sqrt{A \cdot -8} \cdot \left(-\sqrt{C \cdot t_4}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot 2\right)\right)} \cdot \left(-\sqrt{A}\right)}{t_1}\\ \end{array} \end{array} \]
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 (- (pow B 2.0) (* (* C A) 4.0)))
        (t_2 (- (pow B 2.0) (* C (* A 4.0))))
        (t_3
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* F t_2))
             (- (+ C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_2))
        (t_4 (* F (* A 2.0)))
        (t_5 (fma B B (* A (* C -4.0)))))
   (if (<= t_3 (- INFINITY))
     (/ (* (sqrt (* 2.0 t_0)) (- (sqrt t_4))) t_1)
     (if (<= t_3 -2e-189)
       t_3
       (if (<= t_3 5e+87)
         (/
          (-
           (sqrt
            (*
             (* t_5 (* F 2.0))
             (+
              A
              (+
               A
               (/
                (* -0.5 (- (+ (pow B 2.0) (pow A 2.0)) (pow (- A) 2.0)))
                C))))))
          t_5)
         (if (<= t_3 INFINITY)
           (/ (* (sqrt (* A -8.0)) (- (sqrt (* C t_4)))) t_0)
           (/ (* (sqrt (* 2.0 (* t_0 (* F 2.0)))) (- (sqrt A))) t_1)))))))
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 = pow(B, 2.0) - ((C * A) * 4.0);
	double t_2 = pow(B, 2.0) - (C * (A * 4.0));
	double t_3 = -sqrt(((2.0 * (F * t_2)) * ((C + A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double t_4 = F * (A * 2.0);
	double t_5 = fma(B, B, (A * (C * -4.0)));
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = (sqrt((2.0 * t_0)) * -sqrt(t_4)) / t_1;
	} else if (t_3 <= -2e-189) {
		tmp = t_3;
	} else if (t_3 <= 5e+87) {
		tmp = -sqrt(((t_5 * (F * 2.0)) * (A + (A + ((-0.5 * ((pow(B, 2.0) + pow(A, 2.0)) - pow(-A, 2.0))) / C))))) / t_5;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = (sqrt((A * -8.0)) * -sqrt((C * t_4))) / t_0;
	} else {
		tmp = (sqrt((2.0 * (t_0 * (F * 2.0)))) * -sqrt(A)) / t_1;
	}
	return tmp;
}
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = fma(A, Float64(C * -4.0), (B ^ 2.0))
	t_1 = Float64((B ^ 2.0) - Float64(Float64(C * A) * 4.0))
	t_2 = Float64((B ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_2)) * Float64(Float64(C + A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2)
	t_4 = Float64(F * Float64(A * 2.0))
	t_5 = fma(B, B, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(Float64(sqrt(Float64(2.0 * t_0)) * Float64(-sqrt(t_4))) / t_1);
	elseif (t_3 <= -2e-189)
		tmp = t_3;
	elseif (t_3 <= 5e+87)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_5 * Float64(F * 2.0)) * Float64(A + Float64(A + Float64(Float64(-0.5 * Float64(Float64((B ^ 2.0) + (A ^ 2.0)) - (Float64(-A) ^ 2.0))) / C)))))) / t_5);
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(sqrt(Float64(A * -8.0)) * Float64(-sqrt(Float64(C * t_4)))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(t_0 * Float64(F * 2.0)))) * Float64(-sqrt(A))) / t_1);
	end
	return tmp
end
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[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(N[(C + A), $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]}, Block[{t$95$4 = N[(F * N[(A * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[t$95$4], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, -2e-189], t$95$3, If[LessEqual[t$95$3, 5e+87], N[((-N[Sqrt[N[(N[(t$95$5 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(A + N[(N[(-0.5 * N[(N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[A, 2.0], $MachinePrecision]), $MachinePrecision] - N[Power[(-A), 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$5), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(N[Sqrt[N[(A * -8.0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C * t$95$4), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[A], $MachinePrecision])), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)\\
t_1 := {B}^{2} - \left(C \cdot A\right) \cdot 4\\
t_2 := {B}^{2} - C \cdot \left(A \cdot 4\right)\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(F \cdot t_2\right)\right) \cdot \left(\left(C + A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_2}\\
t_4 := F \cdot \left(A \cdot 2\right)\\
t_5 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;\frac{\sqrt{2 \cdot t_0} \cdot \left(-\sqrt{t_4}\right)}{t_1}\\

\mathbf{elif}\;t_3 \leq -2 \cdot 10^{-189}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{A \cdot -8} \cdot \left(-\sqrt{C \cdot t_4}\right)}{t_0}\\

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


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

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

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

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

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

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

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

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

    if -2.00000000000000014e-189 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < 4.9999999999999998e87

    1. Initial program 24.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. Simplified28.3%

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

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

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

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

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

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

    if 4.9999999999999998e87 < (/.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 12.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{A \cdot -8} \cdot \sqrt{C \cdot \left(F \cdot \left(\frac{2}{2} \cdot A - \color{blue}{-1 \cdot A}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      7. distribute-rgt-out--29.5%

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 41.6% accurate, 0.3× speedup?

\[\begin{array}{l} [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)\\ t_2 := F \cdot \left(A \cdot 2\right)\\ t_3 := {B}^{2} - \left(C \cdot A\right) \cdot 4\\ t_4 := {B}^{2} - C \cdot \left(A \cdot 4\right)\\ t_5 := \frac{-\sqrt{\left(2 \cdot \left(F \cdot t_4\right)\right) \cdot \left(\left(C + A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_4}\\ \mathbf{if}\;t_5 \leq -\infty:\\ \;\;\;\;\frac{\sqrt{2 \cdot t_0} \cdot \left(-\sqrt{t_2}\right)}{t_3}\\ \mathbf{elif}\;t_5 \leq 5 \cdot 10^{+87}:\\ \;\;\;\;\frac{-\sqrt{\left(t_1 \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \frac{2 \cdot \left(C \cdot A\right) - \left({B}^{2} + {A}^{2}\right)}{C + \mathsf{hypot}\left(B, A - C\right)}\right)}}{t_1}\\ \mathbf{elif}\;t_5 \leq \infty:\\ \;\;\;\;\frac{\sqrt{A \cdot -8} \cdot \left(-\sqrt{C \cdot t_2}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot 2\right)\right)} \cdot \left(-\sqrt{A}\right)}{t_3}\\ \end{array} \end{array} \]
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))))
        (t_2 (* F (* A 2.0)))
        (t_3 (- (pow B 2.0) (* (* C A) 4.0)))
        (t_4 (- (pow B 2.0) (* C (* A 4.0))))
        (t_5
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* F t_4))
             (- (+ C A) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_4)))
   (if (<= t_5 (- INFINITY))
     (/ (* (sqrt (* 2.0 t_0)) (- (sqrt t_2))) t_3)
     (if (<= t_5 5e+87)
       (/
        (-
         (sqrt
          (*
           (* t_1 (* F 2.0))
           (+
            A
            (/
             (- (* 2.0 (* C A)) (+ (pow B 2.0) (pow A 2.0)))
             (+ C (hypot B (- A C))))))))
        t_1)
       (if (<= t_5 INFINITY)
         (/ (* (sqrt (* A -8.0)) (- (sqrt (* C t_2)))) t_0)
         (/ (* (sqrt (* 2.0 (* t_0 (* F 2.0)))) (- (sqrt A))) t_3))))))
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 t_2 = F * (A * 2.0);
	double t_3 = pow(B, 2.0) - ((C * A) * 4.0);
	double t_4 = pow(B, 2.0) - (C * (A * 4.0));
	double t_5 = -sqrt(((2.0 * (F * t_4)) * ((C + A) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_4;
	double tmp;
	if (t_5 <= -((double) INFINITY)) {
		tmp = (sqrt((2.0 * t_0)) * -sqrt(t_2)) / t_3;
	} else if (t_5 <= 5e+87) {
		tmp = -sqrt(((t_1 * (F * 2.0)) * (A + (((2.0 * (C * A)) - (pow(B, 2.0) + pow(A, 2.0))) / (C + hypot(B, (A - C))))))) / t_1;
	} else if (t_5 <= ((double) INFINITY)) {
		tmp = (sqrt((A * -8.0)) * -sqrt((C * t_2))) / t_0;
	} else {
		tmp = (sqrt((2.0 * (t_0 * (F * 2.0)))) * -sqrt(A)) / t_3;
	}
	return tmp;
}
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)))
	t_2 = Float64(F * Float64(A * 2.0))
	t_3 = Float64((B ^ 2.0) - Float64(Float64(C * A) * 4.0))
	t_4 = Float64((B ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_5 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_4)) * Float64(Float64(C + A) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_4)
	tmp = 0.0
	if (t_5 <= Float64(-Inf))
		tmp = Float64(Float64(sqrt(Float64(2.0 * t_0)) * Float64(-sqrt(t_2))) / t_3);
	elseif (t_5 <= 5e+87)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(F * 2.0)) * Float64(A + Float64(Float64(Float64(2.0 * Float64(C * A)) - Float64((B ^ 2.0) + (A ^ 2.0))) / Float64(C + hypot(B, Float64(A - C)))))))) / t_1);
	elseif (t_5 <= Inf)
		tmp = Float64(Float64(sqrt(Float64(A * -8.0)) * Float64(-sqrt(Float64(C * t_2)))) / t_0);
	else
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(t_0 * Float64(F * 2.0)))) * Float64(-sqrt(A))) / t_3);
	end
	return tmp
end
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]}, Block[{t$95$2 = N[(F * N[(A * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$4), $MachinePrecision]), $MachinePrecision] * N[(N[(C + A), $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$4), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], N[(N[(N[Sqrt[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[t$95$2], $MachinePrecision])), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$5, 5e+87], N[((-N[Sqrt[N[(N[(t$95$1 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(A + N[(N[(N[(2.0 * N[(C * A), $MachinePrecision]), $MachinePrecision] - N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[A, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(C + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(N[(N[Sqrt[N[(A * -8.0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(C * t$95$2), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[A], $MachinePrecision])), $MachinePrecision] / t$95$3), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[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)\\
t_2 := F \cdot \left(A \cdot 2\right)\\
t_3 := {B}^{2} - \left(C \cdot A\right) \cdot 4\\
t_4 := {B}^{2} - C \cdot \left(A \cdot 4\right)\\
t_5 := \frac{-\sqrt{\left(2 \cdot \left(F \cdot t_4\right)\right) \cdot \left(\left(C + A\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_4}\\
\mathbf{if}\;t_5 \leq -\infty:\\
\;\;\;\;\frac{\sqrt{2 \cdot t_0} \cdot \left(-\sqrt{t_2}\right)}{t_3}\\

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

\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\frac{\sqrt{A \cdot -8} \cdot \left(-\sqrt{C \cdot t_2}\right)}{t_0}\\

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


\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))) < -inf.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e87 < (/.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 12.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{A \cdot -8} \cdot \sqrt{C \cdot \left(F \cdot \left(\frac{2}{2} \cdot A - \color{blue}{-1 \cdot A}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      7. distribute-rgt-out--29.5%

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 35.2% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -1.1e-23

    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. Simplified22.9%

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

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

    if -1.1e-23 < A < -2.59999999999999997e-304 or 5.0000000000000002e-220 < A

    1. Initial program 19.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.59999999999999997e-304 < A < 5.0000000000000002e-220

    1. Initial program 13.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. Simplified13.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 28.9% accurate, 1.2× speedup?

\[\begin{array}{l} [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 := t_0 \cdot \left(F \cdot 2\right)\\ \mathbf{if}\;{B}^{2} \leq 10^{+69}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + A\right)}}{t_0}\\ \mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{+258}:\\ \;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A - B\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)\\ \end{array} \end{array} \]
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 (* t_0 (* F 2.0))))
   (if (<= (pow B 2.0) 1e+69)
     (/ (- (sqrt (* t_1 (+ A A)))) t_0)
     (if (<= (pow B 2.0) 4e+258)
       (/ (- (sqrt (* t_1 (- A B)))) t_0)
       (* -2.0 (* (sqrt (* A F)) (/ 1.0 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 = t_0 * (F * 2.0);
	double tmp;
	if (pow(B, 2.0) <= 1e+69) {
		tmp = -sqrt((t_1 * (A + A))) / t_0;
	} else if (pow(B, 2.0) <= 4e+258) {
		tmp = -sqrt((t_1 * (A - B))) / t_0;
	} else {
		tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
	}
	return tmp;
}
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(t_0 * Float64(F * 2.0))
	tmp = 0.0
	if ((B ^ 2.0) <= 1e+69)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + A)))) / t_0);
	elseif ((B ^ 2.0) <= 4e+258)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A - B)))) / t_0);
	else
		tmp = Float64(-2.0 * Float64(sqrt(Float64(A * F)) * Float64(1.0 / B)));
	end
	return tmp
end
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[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+69], N[((-N[Sqrt[N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 4e+258], N[((-N[Sqrt[N[(t$95$1 * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[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 := t_0 \cdot \left(F \cdot 2\right)\\
\mathbf{if}\;{B}^{2} \leq 10^{+69}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + A\right)}}{t_0}\\

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

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


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

    1. Initial program 24.3%

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

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

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

    if 1.0000000000000001e69 < (pow.f64 B 2) < 4.00000000000000023e258

    1. Initial program 36.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. Simplified43.7%

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

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

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

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

    if 4.00000000000000023e258 < (pow.f64 B 2)

    1. Initial program 0.3%

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

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

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

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

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

Alternative 7: 28.9% accurate, 1.2× speedup?

\[\begin{array}{l} [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(C \cdot A\right) \cdot 4\\ \mathbf{if}\;{B}^{2} \leq 10^{+69}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot 2\right) \cdot \left(F \cdot \left(2 \cdot t_1\right)\right)}}{t_1}\\ \mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{+258}:\\ \;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(F \cdot 2\right)\right) \cdot \left(A - B\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)\\ \end{array} \end{array} \]
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) (* (* C A) 4.0))))
   (if (<= (pow B 2.0) 1e+69)
     (/ (- (sqrt (* (* A 2.0) (* F (* 2.0 t_1))))) t_1)
     (if (<= (pow B 2.0) 4e+258)
       (/ (- (sqrt (* (* t_0 (* F 2.0)) (- A B)))) t_0)
       (* -2.0 (* (sqrt (* A F)) (/ 1.0 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) - ((C * A) * 4.0);
	double tmp;
	if (pow(B, 2.0) <= 1e+69) {
		tmp = -sqrt(((A * 2.0) * (F * (2.0 * t_1)))) / t_1;
	} else if (pow(B, 2.0) <= 4e+258) {
		tmp = -sqrt(((t_0 * (F * 2.0)) * (A - B))) / t_0;
	} else {
		tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
	}
	return tmp;
}
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(C * A) * 4.0))
	tmp = 0.0
	if ((B ^ 2.0) <= 1e+69)
		tmp = Float64(Float64(-sqrt(Float64(Float64(A * 2.0) * Float64(F * Float64(2.0 * t_1))))) / t_1);
	elseif ((B ^ 2.0) <= 4e+258)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(F * 2.0)) * Float64(A - B)))) / t_0);
	else
		tmp = Float64(-2.0 * Float64(sqrt(Float64(A * F)) * Float64(1.0 / B)));
	end
	return tmp
end
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[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+69], N[((-N[Sqrt[N[(N[(A * 2.0), $MachinePrecision] * N[(F * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 4e+258], N[((-N[Sqrt[N[(N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[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(C \cdot A\right) \cdot 4\\
\mathbf{if}\;{B}^{2} \leq 10^{+69}:\\
\;\;\;\;\frac{-\sqrt{\left(A \cdot 2\right) \cdot \left(F \cdot \left(2 \cdot t_1\right)\right)}}{t_1}\\

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

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


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

    1. Initial program 24.3%

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

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

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

    if 1.0000000000000001e69 < (pow.f64 B 2) < 4.00000000000000023e258

    1. Initial program 36.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. Simplified43.7%

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

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

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

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

    if 4.00000000000000023e258 < (pow.f64 B 2)

    1. Initial program 0.3%

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

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

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

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

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

Alternative 8: 30.9% accurate, 1.2× speedup?

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

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


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

    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. Simplified22.5%

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

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

    if 4.9999999999999997e32 < (pow.f64 B 2)

    1. Initial program 16.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. Simplified20.2%

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

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

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

Alternative 9: 31.4% accurate, 1.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(t_0 \cdot \left(C \cdot A\right)\right)}}{-t_2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if C < -1.84999999999999992e-181

    1. Initial program 21.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{A \cdot -8} \cdot \sqrt{C \cdot \left(F \cdot \left(\frac{2}{2} \cdot A - \color{blue}{-1 \cdot A}\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
      7. distribute-rgt-out--9.5%

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

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

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

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

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

    if -1.84999999999999992e-181 < C < -2.8999999999999998e-286

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

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

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

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

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

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

    if -2.8999999999999998e-286 < C < 9e21

    1. Initial program 30.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. Simplified33.5%

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

    if 9e21 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 33.7% accurate, 1.5× speedup?

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

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


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

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

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

    if 1.2499999999999999e22 < C

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 28.9% accurate, 1.9× speedup?

\[\begin{array}{l} [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 \leq 6.8 \cdot 10^{+92}:\\ \;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(F \cdot 2\right)\right) \cdot \left(A + A\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)\\ \end{array} \end{array} \]
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 (<= B 6.8e+92)
     (/ (- (sqrt (* (* t_0 (* F 2.0)) (+ A A)))) t_0)
     (* -2.0 (* (sqrt (* A F)) (/ 1.0 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 (B <= 6.8e+92) {
		tmp = -sqrt(((t_0 * (F * 2.0)) * (A + A))) / t_0;
	} else {
		tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
	}
	return tmp;
}
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 <= 6.8e+92)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(F * 2.0)) * Float64(A + A)))) / t_0);
	else
		tmp = Float64(-2.0 * Float64(sqrt(Float64(A * F)) * Float64(1.0 / B)));
	end
	return tmp
end
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[B, 6.8e+92], N[((-N[Sqrt[N[(N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[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 \leq 6.8 \cdot 10^{+92}:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(F \cdot 2\right)\right) \cdot \left(A + A\right)}}{t_0}\\

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


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

    1. Initial program 22.4%

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

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

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

    if 6.7999999999999996e92 < B

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

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

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

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

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

Alternative 12: 21.8% accurate, 2.0× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{+54}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot 2\right) \cdot \left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{{B}^{2} - \left(C \cdot A\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)\\ \end{array} \end{array} \]
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) 4e+54)
   (/
    (- (sqrt (* (* A 2.0) (* -8.0 (* A (* C F))))))
    (- (pow B 2.0) (* (* C A) 4.0)))
   (* -2.0 (* (sqrt (* A F)) (/ 1.0 B)))))
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 4e+54) {
		tmp = -sqrt(((A * 2.0) * (-8.0 * (A * (C * F))))) / (pow(B, 2.0) - ((C * A) * 4.0));
	} else {
		tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
	}
	return tmp;
}
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) :: tmp
    if ((b ** 2.0d0) <= 4d+54) then
        tmp = -sqrt(((a * 2.0d0) * ((-8.0d0) * (a * (c * f))))) / ((b ** 2.0d0) - ((c * a) * 4.0d0))
    else
        tmp = (-2.0d0) * (sqrt((a * f)) * (1.0d0 / b))
    end if
    code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.pow(B, 2.0) <= 4e+54) {
		tmp = -Math.sqrt(((A * 2.0) * (-8.0 * (A * (C * F))))) / (Math.pow(B, 2.0) - ((C * A) * 4.0));
	} else {
		tmp = -2.0 * (Math.sqrt((A * F)) * (1.0 / B));
	}
	return tmp;
}
[A, C] = sort([A, C])
def code(A, B, C, F):
	tmp = 0
	if math.pow(B, 2.0) <= 4e+54:
		tmp = -math.sqrt(((A * 2.0) * (-8.0 * (A * (C * F))))) / (math.pow(B, 2.0) - ((C * A) * 4.0))
	else:
		tmp = -2.0 * (math.sqrt((A * F)) * (1.0 / B))
	return tmp
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 4e+54)
		tmp = Float64(Float64(-sqrt(Float64(Float64(A * 2.0) * Float64(-8.0 * Float64(A * Float64(C * F)))))) / Float64((B ^ 2.0) - Float64(Float64(C * A) * 4.0)));
	else
		tmp = Float64(-2.0 * Float64(sqrt(Float64(A * F)) * Float64(1.0 / B)));
	end
	return tmp
end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if ((B ^ 2.0) <= 4e+54)
		tmp = -sqrt(((A * 2.0) * (-8.0 * (A * (C * F))))) / ((B ^ 2.0) - ((C * A) * 4.0));
	else
		tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
	end
	tmp_2 = tmp;
end
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], 4e+54], N[((-N[Sqrt[N[(N[(A * 2.0), $MachinePrecision] * N[(-8.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{+54}:\\
\;\;\;\;\frac{-\sqrt{\left(A \cdot 2\right) \cdot \left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{{B}^{2} - \left(C \cdot A\right) \cdot 4}\\

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


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

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

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

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

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

    if 4.0000000000000003e54 < (pow.f64 B 2)

    1. Initial program 17.0%

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

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

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

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

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

Alternative 13: 25.8% accurate, 2.0× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{+54}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot 2\right) \cdot \left(-8 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)}}{{B}^{2} - \left(C \cdot A\right) \cdot 4}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)\\ \end{array} \end{array} \]
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) 4e+54)
   (/
    (- (sqrt (* (* A 2.0) (* -8.0 (* F (* C A))))))
    (- (pow B 2.0) (* (* C A) 4.0)))
   (* -2.0 (* (sqrt (* A F)) (/ 1.0 B)))))
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (pow(B, 2.0) <= 4e+54) {
		tmp = -sqrt(((A * 2.0) * (-8.0 * (F * (C * A))))) / (pow(B, 2.0) - ((C * A) * 4.0));
	} else {
		tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
	}
	return tmp;
}
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) :: tmp
    if ((b ** 2.0d0) <= 4d+54) then
        tmp = -sqrt(((a * 2.0d0) * ((-8.0d0) * (f * (c * a))))) / ((b ** 2.0d0) - ((c * a) * 4.0d0))
    else
        tmp = (-2.0d0) * (sqrt((a * f)) * (1.0d0 / b))
    end if
    code = tmp
end function
assert A < C;
public static double code(double A, double B, double C, double F) {
	double tmp;
	if (Math.pow(B, 2.0) <= 4e+54) {
		tmp = -Math.sqrt(((A * 2.0) * (-8.0 * (F * (C * A))))) / (Math.pow(B, 2.0) - ((C * A) * 4.0));
	} else {
		tmp = -2.0 * (Math.sqrt((A * F)) * (1.0 / B));
	}
	return tmp;
}
[A, C] = sort([A, C])
def code(A, B, C, F):
	tmp = 0
	if math.pow(B, 2.0) <= 4e+54:
		tmp = -math.sqrt(((A * 2.0) * (-8.0 * (F * (C * A))))) / (math.pow(B, 2.0) - ((C * A) * 4.0))
	else:
		tmp = -2.0 * (math.sqrt((A * F)) * (1.0 / B))
	return tmp
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if ((B ^ 2.0) <= 4e+54)
		tmp = Float64(Float64(-sqrt(Float64(Float64(A * 2.0) * Float64(-8.0 * Float64(F * Float64(C * A)))))) / Float64((B ^ 2.0) - Float64(Float64(C * A) * 4.0)));
	else
		tmp = Float64(-2.0 * Float64(sqrt(Float64(A * F)) * Float64(1.0 / B)));
	end
	return tmp
end
A, C = num2cell(sort([A, C])){:}
function tmp_2 = code(A, B, C, F)
	tmp = 0.0;
	if ((B ^ 2.0) <= 4e+54)
		tmp = -sqrt(((A * 2.0) * (-8.0 * (F * (C * A))))) / ((B ^ 2.0) - ((C * A) * 4.0));
	else
		tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
	end
	tmp_2 = tmp;
end
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], 4e+54], N[((-N[Sqrt[N[(N[(A * 2.0), $MachinePrecision] * N[(-8.0 * N[(F * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(C * A), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;{B}^{2} \leq 4 \cdot 10^{+54}:\\
\;\;\;\;\frac{-\sqrt{\left(A \cdot 2\right) \cdot \left(-8 \cdot \left(F \cdot \left(C \cdot A\right)\right)\right)}}{{B}^{2} - \left(C \cdot A\right) \cdot 4}\\

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


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

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

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

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

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

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

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

    if 4.0000000000000003e54 < (pow.f64 B 2)

    1. Initial program 17.0%

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

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

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

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

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

Alternative 14: 26.2% accurate, 2.0× speedup?

\[\begin{array}{l} [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 3 \cdot 10^{+29}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(F \cdot \left(A \cdot 2\right)\right) \cdot \left(C \cdot A\right)\right)}}{-\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)\\ \end{array} \end{array} \]
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (if (<= B 3e+29)
   (/
    (sqrt (* -8.0 (* (* F (* A 2.0)) (* C A))))
    (- (fma A (* C -4.0) (pow B 2.0))))
   (* -2.0 (* (sqrt (* A F)) (/ 1.0 B)))))
assert(A < C);
double code(double A, double B, double C, double F) {
	double tmp;
	if (B <= 3e+29) {
		tmp = sqrt((-8.0 * ((F * (A * 2.0)) * (C * A)))) / -fma(A, (C * -4.0), pow(B, 2.0));
	} else {
		tmp = -2.0 * (sqrt((A * F)) * (1.0 / B));
	}
	return tmp;
}
A, C = sort([A, C])
function code(A, B, C, F)
	tmp = 0.0
	if (B <= 3e+29)
		tmp = Float64(sqrt(Float64(-8.0 * Float64(Float64(F * Float64(A * 2.0)) * Float64(C * A)))) / Float64(-fma(A, Float64(C * -4.0), (B ^ 2.0))));
	else
		tmp = Float64(-2.0 * Float64(sqrt(Float64(A * F)) * Float64(1.0 / B)));
	end
	return tmp
end
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := If[LessEqual[B, 3e+29], N[(N[Sqrt[N[(-8.0 * N[(N[(F * N[(A * 2.0), $MachinePrecision]), $MachinePrecision] * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3 \cdot 10^{+29}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(\left(F \cdot \left(A \cdot 2\right)\right) \cdot \left(C \cdot A\right)\right)}}{-\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}\\

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


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

    1. Initial program 20.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9999999999999999e29 < B

    1. Initial program 18.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. Simplified18.5%

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

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

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

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

Alternative 15: 5.5% accurate, 5.8× speedup?

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

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

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

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

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

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

Reproduce

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