ABCF->ab-angle a

Percentage Accurate: 18.6% → 52.0%
Time: 31.8s
Alternatives: 17
Speedup: 3.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 18.6% accurate, 1.0× speedup?

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

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

Alternative 1: 52.0% accurate, 0.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+151}:\\ \;\;\;\;\frac{-{\left(\sqrt[3]{\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B_m\right)\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B_m, B_m, C \cdot \left(A \cdot -4\right)\right)}}\right)}^{3}}{{B_m}^{2} - C \cdot \left(A \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B_m, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= (pow B_m 2.0) 2e+151)
   (/
    (-
     (pow
      (cbrt
       (*
        (sqrt (+ A (+ C (hypot (- A C) B_m))))
        (sqrt (* (* 2.0 F) (fma B_m B_m (* C (* A -4.0)))))))
      3.0))
    (- (pow B_m 2.0) (* C (* A 4.0))))
   (* (* (sqrt (+ A (hypot B_m A))) (sqrt F)) (/ (- (sqrt 2.0)) B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (pow(B_m, 2.0) <= 2e+151) {
		tmp = -pow(cbrt((sqrt((A + (C + hypot((A - C), B_m)))) * sqrt(((2.0 * F) * fma(B_m, B_m, (C * (A * -4.0))))))), 3.0) / (pow(B_m, 2.0) - (C * (A * 4.0)));
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * (-sqrt(2.0) / B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e+151)
		tmp = Float64(Float64(-(cbrt(Float64(sqrt(Float64(A + Float64(C + hypot(Float64(A - C), B_m)))) * sqrt(Float64(Float64(2.0 * F) * fma(B_m, B_m, Float64(C * Float64(A * -4.0))))))) ^ 3.0)) / Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0))));
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+151], N[((-N[Power[N[Power[N[(N[Sqrt[N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(B$95$m * B$95$m + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]) / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

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

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


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

    1. Initial program 31.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. Step-by-step derivation
      1. add-sqr-sqrt31.0%

        \[\leadsto \frac{-\sqrt{\color{blue}{\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)} \cdot \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. sqr-neg31.0%

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

        \[\leadsto \frac{-\color{blue}{\sqrt{-\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)}} \cdot \sqrt{-\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} \]
      4. add-sqr-sqrt1.3%

        \[\leadsto \frac{-\color{blue}{\left(-\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      5. add-cube-cbrt1.3%

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

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

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

    if 2.00000000000000003e151 < (pow.f64 B 2)

    1. Initial program 8.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 47.3% accurate, 0.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\ t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ t_2 := \left(2 \cdot F\right) \cdot t_1\\ \mathbf{if}\;{B_m}^{2} \leq 1.7 \cdot 10^{-320}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;{B_m}^{2} \leq 10^{-214}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(A + A\right)}}{t_1}\\ \mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+100}:\\ \;\;\;\;\frac{-\sqrt{t_2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0))))
        (t_1 (fma B_m B_m (* A (* C -4.0))))
        (t_2 (* (* 2.0 F) t_1)))
   (if (<= (pow B_m 2.0) 1.7e-320)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
     (if (<= (pow B_m 2.0) 1e-214)
       (/ (- (sqrt (* t_2 (+ A A)))) t_1)
       (if (<= (pow B_m 2.0) 2e+100)
         (/ (- (sqrt (* t_2 (+ A (+ C (hypot B_m (- A C))))))) t_1)
         (*
          (* (sqrt F) (sqrt (+ C (hypot B_m C))))
          (* (sqrt 2.0) (/ -1.0 B_m))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_2 = (2.0 * F) * t_1;
	double tmp;
	if (pow(B_m, 2.0) <= 1.7e-320) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else if (pow(B_m, 2.0) <= 1e-214) {
		tmp = -sqrt((t_2 * (A + A))) / t_1;
	} else if (pow(B_m, 2.0) <= 2e+100) {
		tmp = -sqrt((t_2 * (A + (C + hypot(B_m, (A - C)))))) / t_1;
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) * (-1.0 / B_m));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_2 = Float64(Float64(2.0 * F) * t_1)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1.7e-320)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	elseif ((B_m ^ 2.0) <= 1e-214)
		tmp = Float64(Float64(-sqrt(Float64(t_2 * Float64(A + A)))) / t_1);
	elseif ((B_m ^ 2.0) <= 2e+100)
		tmp = Float64(Float64(-sqrt(Float64(t_2 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_1);
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) * Float64(-1.0 / B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * F), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1.7e-320], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-214], N[((-N[Sqrt[N[(t$95$2 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+100], N[((-N[Sqrt[N[(t$95$2 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := \left(2 \cdot F\right) \cdot t_1\\
\mathbf{if}\;{B_m}^{2} \leq 1.7 \cdot 10^{-320}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

\mathbf{elif}\;{B_m}^{2} \leq 10^{-214}:\\
\;\;\;\;\frac{-\sqrt{t_2 \cdot \left(A + A\right)}}{t_1}\\

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

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


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

    1. Initial program 13.3%

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

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

    if 1.70008e-320 < (pow.f64 B 2) < 9.99999999999999913e-215

    1. Initial program 21.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified32.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. Taylor expanded in A around inf 47.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(A + \left(C + -1 \cdot C\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. distribute-rgt1-in47.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 + \left(A + \color{blue}{\left(-1 + 1\right) \cdot C}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. metadata-eval47.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 + \left(A + \color{blue}{0} \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. mul0-lft47.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 + \left(A + \color{blue}{0}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Simplified47.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(A + 0\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 9.99999999999999913e-215 < (pow.f64 B 2) < 2.00000000000000003e100

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

    if 2.00000000000000003e100 < (pow.f64 B 2)

    1. Initial program 10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 46.5% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\ t_1 := \mathsf{fma}\left(B_m, B_m, C \cdot \left(A \cdot -4\right)\right)\\ \mathbf{if}\;{B_m}^{2} \leq 1.7 \cdot 10^{-320}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+100}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(\left(A + \left(C + \mathsf{hypot}\left(A - C, B_m\right)\right)\right) \cdot t_1\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0))))
        (t_1 (fma B_m B_m (* C (* A -4.0)))))
   (if (<= (pow B_m 2.0) 1.7e-320)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
     (if (<= (pow B_m 2.0) 2e+100)
       (/ (- (sqrt (* (* 2.0 F) (* (+ A (+ C (hypot (- A C) B_m))) t_1)))) t_1)
       (*
        (* (sqrt F) (sqrt (+ C (hypot B_m C))))
        (* (sqrt 2.0) (/ -1.0 B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
	double t_1 = fma(B_m, B_m, (C * (A * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 1.7e-320) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else if (pow(B_m, 2.0) <= 2e+100) {
		tmp = -sqrt(((2.0 * F) * ((A + (C + hypot((A - C), B_m))) * t_1))) / t_1;
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) * (-1.0 / B_m));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_1 = fma(B_m, B_m, Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1.7e-320)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	elseif ((B_m ^ 2.0) <= 2e+100)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * F) * Float64(Float64(A + Float64(C + hypot(Float64(A - C), B_m))) * t_1)))) / t_1);
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) * Float64(-1.0 / B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1.7e-320], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+100], N[((-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, C \cdot \left(A \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 1.7 \cdot 10^{-320}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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

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


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

    1. Initial program 13.3%

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

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

    if 1.70008e-320 < (pow.f64 B 2) < 2.00000000000000003e100

    1. Initial program 44.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. Step-by-step derivation
      1. add-sqr-sqrt44.1%

        \[\leadsto \frac{-\sqrt{\color{blue}{\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)} \cdot \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. sqr-neg44.1%

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

        \[\leadsto \frac{-\color{blue}{\sqrt{-\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)}} \cdot \sqrt{-\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} \]
      4. add-sqr-sqrt1.4%

        \[\leadsto \frac{-\color{blue}{\left(-\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      5. add-cube-cbrt1.4%

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

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

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

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

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

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

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

    if 2.00000000000000003e100 < (pow.f64 B 2)

    1. Initial program 10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 47.2% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B_m, B_m, -4 \cdot \left(A \cdot C\right)\right)\\ t_1 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\ \mathbf{if}\;{B_m}^{2} \leq 0:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\ \mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+100}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(\mathsf{hypot}\left(A - C, B_m\right) + \left(A + C\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (fma B_m B_m (* -4.0 (* A C))))
        (t_1 (- (pow B_m 2.0) (* C (* A 4.0)))))
   (if (<= (pow B_m 2.0) 0.0)
     (/ (- (sqrt (* (* 2.0 (* F t_1)) (* 2.0 C)))) t_1)
     (if (<= (pow B_m 2.0) 2e+100)
       (/ (- (sqrt (* (* 2.0 t_0) (* F (+ (hypot (- A C) B_m) (+ A C)))))) t_0)
       (*
        (* (sqrt F) (sqrt (+ C (hypot B_m C))))
        (* (sqrt 2.0) (/ -1.0 B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(B_m, B_m, (-4.0 * (A * C)));
	double t_1 = pow(B_m, 2.0) - (C * (A * 4.0));
	double tmp;
	if (pow(B_m, 2.0) <= 0.0) {
		tmp = -sqrt(((2.0 * (F * t_1)) * (2.0 * C))) / t_1;
	} else if (pow(B_m, 2.0) <= 2e+100) {
		tmp = -sqrt(((2.0 * t_0) * (F * (hypot((A - C), B_m) + (A + C))))) / t_0;
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) * (-1.0 / B_m));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(B_m, B_m, Float64(-4.0 * Float64(A * C)))
	t_1 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 0.0)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_1)) * Float64(2.0 * C)))) / t_1);
	elseif ((B_m ^ 2.0) <= 2e+100)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * t_0) * Float64(F * Float64(hypot(Float64(A - C), B_m) + Float64(A + C)))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) * Float64(-1.0 / B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+100], N[((-N[Sqrt[N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(F * N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, -4 \cdot \left(A \cdot C\right)\right)\\
t_1 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
\mathbf{if}\;{B_m}^{2} \leq 0:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_1\right)\right) \cdot \left(2 \cdot C\right)}}{t_1}\\

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

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


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

    1. Initial program 13.6%

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

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

    if 0.0 < (pow.f64 B 2) < 2.00000000000000003e100

    1. Initial program 43.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. Step-by-step derivation
      1. neg-sub043.2%

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

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

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

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

        \[\leadsto \color{blue}{0} - \frac{\sqrt{\left(\left(2 \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
      2. neg-sub050.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(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}} \]
      3. distribute-neg-frac50.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(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}} \]
    5. Simplified49.7%

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

    if 2.00000000000000003e100 < (pow.f64 B 2)

    1. Initial program 10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 51.7% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+151}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B_m, B_m, -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{\mathsf{hypot}\left(A - C, B_m\right) + \left(A + C\right)}\right)}{{B_m}^{2} - C \cdot \left(A \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B_m, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= (pow B_m 2.0) 2e+151)
   (/
    (*
     (sqrt (* 2.0 (* F (fma B_m B_m (* -4.0 (* A C))))))
     (- (sqrt (+ (hypot (- A C) B_m) (+ A C)))))
    (- (pow B_m 2.0) (* C (* A 4.0))))
   (* (* (sqrt (+ A (hypot B_m A))) (sqrt F)) (/ (- (sqrt 2.0)) B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (pow(B_m, 2.0) <= 2e+151) {
		tmp = (sqrt((2.0 * (F * fma(B_m, B_m, (-4.0 * (A * C)))))) * -sqrt((hypot((A - C), B_m) + (A + C)))) / (pow(B_m, 2.0) - (C * (A * 4.0)));
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * (-sqrt(2.0) / B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e+151)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * fma(B_m, B_m, Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(Float64(hypot(Float64(A - C), B_m) + Float64(A + C))))) / Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0))));
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+151], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * B$95$m + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+151}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B_m, B_m, -4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(-\sqrt{\mathsf{hypot}\left(A - C, B_m\right) + \left(A + C\right)}\right)}{{B_m}^{2} - C \cdot \left(A \cdot 4\right)}\\

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


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

    1. Initial program 31.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. Step-by-step derivation
      1. sqrt-prod33.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000003e151 < (pow.f64 B 2)

    1. Initial program 8.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 44.0% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\ t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B_m}^{2} \leq 1.7 \cdot 10^{-320}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;{B_m}^{2} \leq 4 \cdot 10^{-198}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_1\right) \cdot \left(A + A\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{F} \cdot \sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right) \cdot \left(\sqrt{2} \cdot \frac{-1}{B_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0))))
        (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 1.7e-320)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
     (if (<= (pow B_m 2.0) 4e-198)
       (/ (- (sqrt (* (* (* 2.0 F) t_1) (+ A A)))) t_1)
       (*
        (* (sqrt F) (sqrt (+ C (hypot B_m C))))
        (* (sqrt 2.0) (/ -1.0 B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 1.7e-320) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else if (pow(B_m, 2.0) <= 4e-198) {
		tmp = -sqrt((((2.0 * F) * t_1) * (A + A))) / t_1;
	} else {
		tmp = (sqrt(F) * sqrt((C + hypot(B_m, C)))) * (sqrt(2.0) * (-1.0 / B_m));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1.7e-320)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	elseif ((B_m ^ 2.0) <= 4e-198)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_1) * Float64(A + A)))) / t_1);
	else
		tmp = Float64(Float64(sqrt(F) * sqrt(Float64(C + hypot(B_m, C)))) * Float64(sqrt(2.0) * Float64(-1.0 / B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1.7e-320], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-198], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 1.7 \cdot 10^{-320}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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

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


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

    1. Initial program 13.3%

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

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

    if 1.70008e-320 < (pow.f64 B 2) < 3.9999999999999996e-198

    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. Simplified36.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. Taylor expanded in A around inf 51.1%

      \[\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 + \left(C + -1 \cdot C\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. distribute-rgt1-in51.1%

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

        \[\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}{0} \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. mul0-lft51.1%

        \[\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}{0}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Simplified51.1%

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

    if 3.9999999999999996e-198 < (pow.f64 B 2)

    1. Initial program 27.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 44.1% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\ t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B_m}^{2} \leq 1.7 \cdot 10^{-320}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;{B_m}^{2} \leq 4 \cdot 10^{-198}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_1\right) \cdot \left(A + A\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0))))
        (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 1.7e-320)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
     (if (<= (pow B_m 2.0) 4e-198)
       (/ (- (sqrt (* (* (* 2.0 F) t_1) (+ A A)))) t_1)
       (* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 1.7e-320) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else if (pow(B_m, 2.0) <= 4e-198) {
		tmp = -sqrt((((2.0 * F) * t_1) * (A + A))) / t_1;
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1.7e-320)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	elseif ((B_m ^ 2.0) <= 4e-198)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_1) * Float64(A + A)))) / t_1);
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F))));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1.7e-320], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-198], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 1.7 \cdot 10^{-320}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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

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


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

    1. Initial program 13.3%

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

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

    if 1.70008e-320 < (pow.f64 B 2) < 3.9999999999999996e-198

    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. Simplified36.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. Taylor expanded in A around inf 51.1%

      \[\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 + \left(C + -1 \cdot C\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. distribute-rgt1-in51.1%

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

        \[\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}{0} \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. mul0-lft51.1%

        \[\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}{0}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Simplified51.1%

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

    if 3.9999999999999996e-198 < (pow.f64 B 2)

    1. Initial program 27.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 44.6% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\ t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B_m \leq 1.15 \cdot 10^{-180}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;B_m \leq 1.45 \cdot 10^{-96}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_1\right) \cdot \left(A + A\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B_m, A\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0))))
        (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= B_m 1.15e-180)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
     (if (<= B_m 1.45e-96)
       (/ (- (sqrt (* (* (* 2.0 F) t_1) (+ A A)))) t_1)
       (* (* (sqrt (+ A (hypot B_m A))) (sqrt F)) (/ (- (sqrt 2.0)) B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (B_m <= 1.15e-180) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else if (B_m <= 1.45e-96) {
		tmp = -sqrt((((2.0 * F) * t_1) * (A + A))) / t_1;
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * (-sqrt(2.0) / B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (B_m <= 1.15e-180)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	elseif (B_m <= 1.45e-96)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_1) * Float64(A + A)))) / t_1);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / B_m));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.15e-180], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.45e-96], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B_m \leq 1.15 \cdot 10^{-180}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

\mathbf{elif}\;B_m \leq 1.45 \cdot 10^{-96}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_1\right) \cdot \left(A + A\right)}}{t_1}\\

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


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

    1. Initial program 25.3%

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

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

    if 1.14999999999999998e-180 < B < 1.44999999999999997e-96

    1. Initial program 11.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. Simplified25.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. Taylor expanded in A around inf 28.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}{\left(A + \left(C + -1 \cdot C\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. distribute-rgt1-in28.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 + \left(A + \color{blue}{\left(-1 + 1\right) \cdot C}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. metadata-eval28.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 + \left(A + \color{blue}{0} \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. mul0-lft28.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 + \left(A + \color{blue}{0}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Simplified28.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}{\left(A + 0\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 1.44999999999999997e-96 < B

    1. Initial program 21.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 40.6% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\ t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B_m \leq 2.95 \cdot 10^{-180}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;B_m \leq 9.5 \cdot 10^{-99}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_1\right) \cdot \left(A + A\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \sqrt{B_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0))))
        (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= B_m 2.95e-180)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
     (if (<= B_m 9.5e-99)
       (/ (- (sqrt (* (* (* 2.0 F) t_1) (+ A A)))) t_1)
       (* (/ (- (sqrt 2.0)) B_m) (* (sqrt F) (sqrt B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (B_m <= 2.95e-180) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else if (B_m <= 9.5e-99) {
		tmp = -sqrt((((2.0 * F) * t_1) * (A + A))) / t_1;
	} else {
		tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt(B_m));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (B_m <= 2.95e-180)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	elseif (B_m <= 9.5e-99)
		tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_1) * Float64(A + A)))) / t_1);
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * Float64(sqrt(F) * sqrt(B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.95e-180], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 9.5e-99], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B_m \leq 2.95 \cdot 10^{-180}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

\mathbf{elif}\;B_m \leq 9.5 \cdot 10^{-99}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_1\right) \cdot \left(A + A\right)}}{t_1}\\

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


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

    1. Initial program 25.3%

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

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

    if 2.9500000000000001e-180 < B < 9.5000000000000008e-99

    1. Initial program 11.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. Simplified25.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. Taylor expanded in A around inf 28.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}{\left(A + \left(C + -1 \cdot C\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    4. Step-by-step derivation
      1. distribute-rgt1-in28.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 + \left(A + \color{blue}{\left(-1 + 1\right) \cdot C}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. metadata-eval28.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 + \left(A + \color{blue}{0} \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. mul0-lft28.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 + \left(A + \color{blue}{0}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Simplified28.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}{\left(A + 0\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 9.5000000000000008e-99 < B

    1. Initial program 21.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 39.5% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\ \mathbf{if}\;B_m \leq 2.9 \cdot 10^{-180}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;B_m \leq 1.8 \cdot 10^{-138}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \sqrt{B_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0)))))
   (if (<= B_m 2.9e-180)
     (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
     (if (<= B_m 1.8e-138)
       (sqrt (- (/ F C)))
       (* (/ (- (sqrt 2.0)) B_m) (* (sqrt F) (sqrt B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
	double tmp;
	if (B_m <= 2.9e-180) {
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else if (B_m <= 1.8e-138) {
		tmp = sqrt(-(F / C));
	} else {
		tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt(B_m));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (b_m ** 2.0d0) - (c * (a * 4.0d0))
    if (b_m <= 2.9d-180) then
        tmp = -sqrt(((2.0d0 * (f * t_0)) * (2.0d0 * c))) / t_0
    else if (b_m <= 1.8d-138) then
        tmp = sqrt(-(f / c))
    else
        tmp = (-sqrt(2.0d0) / b_m) * (sqrt(f) * sqrt(b_m))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.pow(B_m, 2.0) - (C * (A * 4.0));
	double tmp;
	if (B_m <= 2.9e-180) {
		tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	} else if (B_m <= 1.8e-138) {
		tmp = Math.sqrt(-(F / C));
	} else {
		tmp = (-Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * Math.sqrt(B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.pow(B_m, 2.0) - (C * (A * 4.0))
	tmp = 0
	if B_m <= 2.9e-180:
		tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0
	elif B_m <= 1.8e-138:
		tmp = math.sqrt(-(F / C))
	else:
		tmp = (-math.sqrt(2.0) / B_m) * (math.sqrt(F) * math.sqrt(B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))
	tmp = 0.0
	if (B_m <= 2.9e-180)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0);
	elseif (B_m <= 1.8e-138)
		tmp = sqrt(Float64(-Float64(F / C)));
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * Float64(sqrt(F) * sqrt(B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (B_m ^ 2.0) - (C * (A * 4.0));
	tmp = 0.0;
	if (B_m <= 2.9e-180)
		tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
	elseif (B_m <= 1.8e-138)
		tmp = sqrt(-(F / C));
	else
		tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt(B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.9e-180], N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.8e-138], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
\mathbf{if}\;B_m \leq 2.9 \cdot 10^{-180}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

\mathbf{elif}\;B_m \leq 1.8 \cdot 10^{-138}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\

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


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

    1. Initial program 25.3%

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

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

    if 2.8999999999999998e-180 < B < 1.80000000000000009e-138

    1. Initial program 4.9%

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

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod4.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{C}}} \]
    7. Step-by-step derivation
      1. mul-1-neg38.1%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]
    8. Simplified38.1%

      \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]

    if 1.80000000000000009e-138 < B

    1. Initial program 21.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.9 \cdot 10^{-180}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot \left({B}^{2} - C \cdot \left(A \cdot 4\right)\right)\right)\right) \cdot \left(2 \cdot C\right)}}{{B}^{2} - C \cdot \left(A \cdot 4\right)}\\ \mathbf{elif}\;B \leq 1.8 \cdot 10^{-138}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \left(\sqrt{F} \cdot \sqrt{B}\right)\\ \end{array} \]

Alternative 11: 39.0% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B_m \leq 1.9 \cdot 10^{-180}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \mathbf{elif}\;B_m \leq 1.9 \cdot 10^{-138}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \sqrt{B_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 1.9e-180)
   (sqrt (/ (- F) A))
   (if (<= B_m 1.9e-138)
     (sqrt (- (/ F C)))
     (* (/ (- (sqrt 2.0)) B_m) (* (sqrt F) (sqrt B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.9e-180) {
		tmp = sqrt((-F / A));
	} else if (B_m <= 1.9e-138) {
		tmp = sqrt(-(F / C));
	} else {
		tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt(B_m));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 1.9d-180) then
        tmp = sqrt((-f / a))
    else if (b_m <= 1.9d-138) then
        tmp = sqrt(-(f / c))
    else
        tmp = (-sqrt(2.0d0) / b_m) * (sqrt(f) * sqrt(b_m))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 1.9e-180) {
		tmp = Math.sqrt((-F / A));
	} else if (B_m <= 1.9e-138) {
		tmp = Math.sqrt(-(F / C));
	} else {
		tmp = (-Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * Math.sqrt(B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 1.9e-180:
		tmp = math.sqrt((-F / A))
	elif B_m <= 1.9e-138:
		tmp = math.sqrt(-(F / C))
	else:
		tmp = (-math.sqrt(2.0) / B_m) * (math.sqrt(F) * math.sqrt(B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 1.9e-180)
		tmp = sqrt(Float64(Float64(-F) / A));
	elseif (B_m <= 1.9e-138)
		tmp = sqrt(Float64(-Float64(F / C)));
	else
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * Float64(sqrt(F) * sqrt(B_m)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 1.9e-180)
		tmp = sqrt((-F / A));
	elseif (B_m <= 1.9e-138)
		tmp = sqrt(-(F / C));
	else
		tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt(B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 1.9e-180], N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 1.9e-138], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B_m \leq 1.9 \cdot 10^{-180}:\\
\;\;\;\;\sqrt{\frac{-F}{A}}\\

\mathbf{elif}\;B_m \leq 1.9 \cdot 10^{-138}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\

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


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

    1. Initial program 25.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. Step-by-step derivation
      1. add-sqr-sqrt5.3%

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod4.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. mul-1-neg11.8%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
    8. Simplified11.8%

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

    if 1.9e-180 < B < 1.9000000000000001e-138

    1. Initial program 4.9%

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

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod4.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{C}}} \]
    7. Step-by-step derivation
      1. mul-1-neg38.1%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]
    8. Simplified38.1%

      \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]

    if 1.9000000000000001e-138 < B

    1. Initial program 21.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 38.7% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{-290}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{B_m \cdot F}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -2e-290)
   (sqrt (- (/ F C)))
   (if (<= F 1.1e-56)
     (* (/ (- (sqrt 2.0)) B_m) (sqrt (* B_m F)))
     (* (sqrt 2.0) (- (sqrt (/ F B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2e-290) {
		tmp = sqrt(-(F / C));
	} else if (F <= 1.1e-56) {
		tmp = (-sqrt(2.0) / B_m) * sqrt((B_m * F));
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= (-2d-290)) then
        tmp = sqrt(-(f / c))
    else if (f <= 1.1d-56) then
        tmp = (-sqrt(2.0d0) / b_m) * sqrt((b_m * f))
    else
        tmp = sqrt(2.0d0) * -sqrt((f / b_m))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2e-290) {
		tmp = Math.sqrt(-(F / C));
	} else if (F <= 1.1e-56) {
		tmp = (-Math.sqrt(2.0) / B_m) * Math.sqrt((B_m * F));
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= -2e-290:
		tmp = math.sqrt(-(F / C))
	elif F <= 1.1e-56:
		tmp = (-math.sqrt(2.0) / B_m) * math.sqrt((B_m * F))
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -2e-290)
		tmp = sqrt(Float64(-Float64(F / C)));
	elseif (F <= 1.1e-56)
		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(B_m * F)));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= -2e-290)
		tmp = sqrt(-(F / C));
	elseif (F <= 1.1e-56)
		tmp = (-sqrt(2.0) / B_m) * sqrt((B_m * F));
	else
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2e-290], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], If[LessEqual[F, 1.1e-56], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{-290}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{-56}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{B_m \cdot F}\\

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


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

    1. Initial program 41.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. Step-by-step derivation
      1. add-sqr-sqrt40.8%

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod29.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{C}}} \]
    7. Step-by-step derivation
      1. mul-1-neg50.9%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]
    8. Simplified50.9%

      \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]

    if -2.0000000000000001e-290 < F < 1.10000000000000002e-56

    1. Initial program 23.0%

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

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

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

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

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

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

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

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

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

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

    if 1.10000000000000002e-56 < F

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 32.2% accurate, 3.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B_m}}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -2e-310) (sqrt (- (/ F C))) (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2e-310) {
		tmp = sqrt(-(F / C));
	} else {
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= (-2d-310)) then
        tmp = sqrt(-(f / c))
    else
        tmp = sqrt(2.0d0) * -sqrt((f / b_m))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2e-310) {
		tmp = Math.sqrt(-(F / C));
	} else {
		tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= -2e-310:
		tmp = math.sqrt(-(F / C))
	else:
		tmp = math.sqrt(2.0) * -math.sqrt((F / B_m))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -2e-310)
		tmp = sqrt(Float64(-Float64(F / C)));
	else
		tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= -2e-310)
		tmp = sqrt(-(F / C));
	else
		tmp = sqrt(2.0) * -sqrt((F / B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2e-310], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\

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


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

    1. Initial program 39.6%

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

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod28.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{C}}} \]
    7. Step-by-step derivation
      1. mul-1-neg49.1%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]
    8. Simplified49.1%

      \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]

    if -1.999999999999994e-310 < F

    1. Initial program 21.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 13.7% accurate, 5.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \sqrt{-\frac{F}{C}}\\ \mathbf{if}\;C \leq -2.2 \cdot 10^{+42}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 6.5 \cdot 10^{-293}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \mathbf{elif}\;C \leq 26000000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{B_m} \cdot \left(-\sqrt{C \cdot F}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (sqrt (- (/ F C)))))
   (if (<= C -2.2e+42)
     t_0
     (if (<= C 6.5e-293)
       (sqrt (/ (- F) A))
       (if (<= C 26000000000000.0) t_0 (* (/ 2.0 B_m) (- (sqrt (* C F)))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt(-(F / C));
	double tmp;
	if (C <= -2.2e+42) {
		tmp = t_0;
	} else if (C <= 6.5e-293) {
		tmp = sqrt((-F / A));
	} else if (C <= 26000000000000.0) {
		tmp = t_0;
	} else {
		tmp = (2.0 / B_m) * -sqrt((C * F));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(-(f / c))
    if (c <= (-2.2d+42)) then
        tmp = t_0
    else if (c <= 6.5d-293) then
        tmp = sqrt((-f / a))
    else if (c <= 26000000000000.0d0) then
        tmp = t_0
    else
        tmp = (2.0d0 / b_m) * -sqrt((c * f))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.sqrt(-(F / C));
	double tmp;
	if (C <= -2.2e+42) {
		tmp = t_0;
	} else if (C <= 6.5e-293) {
		tmp = Math.sqrt((-F / A));
	} else if (C <= 26000000000000.0) {
		tmp = t_0;
	} else {
		tmp = (2.0 / B_m) * -Math.sqrt((C * F));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.sqrt(-(F / C))
	tmp = 0
	if C <= -2.2e+42:
		tmp = t_0
	elif C <= 6.5e-293:
		tmp = math.sqrt((-F / A))
	elif C <= 26000000000000.0:
		tmp = t_0
	else:
		tmp = (2.0 / B_m) * -math.sqrt((C * F))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = sqrt(Float64(-Float64(F / C)))
	tmp = 0.0
	if (C <= -2.2e+42)
		tmp = t_0;
	elseif (C <= 6.5e-293)
		tmp = sqrt(Float64(Float64(-F) / A));
	elseif (C <= 26000000000000.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(2.0 / B_m) * Float64(-sqrt(Float64(C * F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = sqrt(-(F / C));
	tmp = 0.0;
	if (C <= -2.2e+42)
		tmp = t_0;
	elseif (C <= 6.5e-293)
		tmp = sqrt((-F / A));
	elseif (C <= 26000000000000.0)
		tmp = t_0;
	else
		tmp = (2.0 / B_m) * -sqrt((C * F));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision]}, If[LessEqual[C, -2.2e+42], t$95$0, If[LessEqual[C, 6.5e-293], N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision], If[LessEqual[C, 26000000000000.0], t$95$0, N[(N[(2.0 / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \sqrt{-\frac{F}{C}}\\
\mathbf{if}\;C \leq -2.2 \cdot 10^{+42}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;C \leq 6.5 \cdot 10^{-293}:\\
\;\;\;\;\sqrt{\frac{-F}{A}}\\

\mathbf{elif}\;C \leq 26000000000000:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if C < -2.2000000000000001e42 or 6.50000000000000033e-293 < C < 2.6e13

    1. Initial program 21.2%

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

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod5.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{C}}} \]
    7. Step-by-step derivation
      1. mul-1-neg15.4%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]
    8. Simplified15.4%

      \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]

    if -2.2000000000000001e42 < C < 6.50000000000000033e-293

    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. Step-by-step derivation
      1. add-sqr-sqrt1.1%

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod1.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. mul-1-neg17.6%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
    8. Simplified17.6%

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

    if 2.6e13 < C

    1. Initial program 24.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -2.2 \cdot 10^{+42}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{elif}\;C \leq 6.5 \cdot 10^{-293}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \mathbf{elif}\;C \leq 26000000000000:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{B} \cdot \left(-\sqrt{C \cdot F}\right)\\ \end{array} \]

Alternative 15: 15.2% accurate, 5.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;A \leq -1.35 \cdot 10^{-51} \lor \neg \left(A \leq 5.2 \cdot 10^{-242}\right) \land A \leq 3.4 \cdot 10^{+15}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (or (<= A -1.35e-51) (and (not (<= A 5.2e-242)) (<= A 3.4e+15)))
   (sqrt (/ (- F) A))
   (sqrt (- (/ F C)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if ((A <= -1.35e-51) || (!(A <= 5.2e-242) && (A <= 3.4e+15))) {
		tmp = sqrt((-F / A));
	} else {
		tmp = sqrt(-(F / C));
	}
	return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if ((a <= (-1.35d-51)) .or. (.not. (a <= 5.2d-242)) .and. (a <= 3.4d+15)) then
        tmp = sqrt((-f / a))
    else
        tmp = sqrt(-(f / c))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if ((A <= -1.35e-51) || (!(A <= 5.2e-242) && (A <= 3.4e+15))) {
		tmp = Math.sqrt((-F / A));
	} else {
		tmp = Math.sqrt(-(F / C));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if (A <= -1.35e-51) or (not (A <= 5.2e-242) and (A <= 3.4e+15)):
		tmp = math.sqrt((-F / A))
	else:
		tmp = math.sqrt(-(F / C))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((A <= -1.35e-51) || (!(A <= 5.2e-242) && (A <= 3.4e+15)))
		tmp = sqrt(Float64(Float64(-F) / A));
	else
		tmp = sqrt(Float64(-Float64(F / C)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if ((A <= -1.35e-51) || (~((A <= 5.2e-242)) && (A <= 3.4e+15)))
		tmp = sqrt((-F / A));
	else
		tmp = sqrt(-(F / C));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[Or[LessEqual[A, -1.35e-51], And[N[Not[LessEqual[A, 5.2e-242]], $MachinePrecision], LessEqual[A, 3.4e+15]]], N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.35 \cdot 10^{-51} \lor \neg \left(A \leq 5.2 \cdot 10^{-242}\right) \land A \leq 3.4 \cdot 10^{+15}:\\
\;\;\;\;\sqrt{\frac{-F}{A}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -1.3499999999999999e-51 or 5.20000000000000034e-242 < A < 3.4e15

    1. Initial program 19.8%

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

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod3.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
    7. Step-by-step derivation
      1. mul-1-neg19.7%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
    8. Simplified19.7%

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

    if -1.3499999999999999e-51 < A < 5.20000000000000034e-242 or 3.4e15 < A

    1. Initial program 26.6%

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

        \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod4.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{C}}} \]
    7. Step-by-step derivation
      1. mul-1-neg14.0%

        \[\leadsto \sqrt{\color{blue}{-\frac{F}{C}}} \]
    8. Simplified14.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -1.35 \cdot 10^{-51} \lor \neg \left(A \leq 5.2 \cdot 10^{-242}\right) \land A \leq 3.4 \cdot 10^{+15}:\\ \;\;\;\;\sqrt{\frac{-F}{A}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \end{array} \]

Alternative 16: 11.4% accurate, 6.1× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \sqrt{\frac{-F}{A}} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (sqrt (/ (- F) A)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return sqrt((-F / A));
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = sqrt((-f / a))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return Math.sqrt((-F / A));
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return math.sqrt((-F / A))
B_m = abs(B)
function code(A, B_m, C, F)
	return sqrt(Float64(Float64(-F) / A))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = sqrt((-F / A));
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[Sqrt[N[((-F) / A), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\sqrt{\frac{-F}{A}}
\end{array}
Derivation
  1. Initial program 23.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. Step-by-step derivation
    1. add-sqr-sqrt4.6%

      \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod4.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
  7. Step-by-step derivation
    1. mul-1-neg10.9%

      \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
  8. Simplified10.9%

    \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
  9. Final simplification10.9%

    \[\leadsto \sqrt{\frac{-F}{A}} \]

Alternative 17: 1.2% accurate, 6.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \sqrt{\frac{F}{A}} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (sqrt (/ F A)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return sqrt((F / A));
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = sqrt((f / a))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return Math.sqrt((F / A));
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return math.sqrt((F / A))
B_m = abs(B)
function code(A, B_m, C, F)
	return sqrt(Float64(F / A))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = sqrt((F / A));
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[Sqrt[N[(F / A), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\sqrt{\frac{F}{A}}
\end{array}
Derivation
  1. Initial program 23.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. Step-by-step derivation
    1. add-sqr-sqrt4.6%

      \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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. sqrt-unprod4.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt{\color{blue}{-1 \cdot \frac{F}{A}}} \]
  7. Step-by-step derivation
    1. mul-1-neg10.9%

      \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
  8. Simplified10.9%

    \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
  9. Step-by-step derivation
    1. expm1-log1p-u10.7%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{-\frac{F}{A}}\right)\right)} \]
    2. expm1-udef6.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{-\frac{F}{A}}\right)} - 1} \]
    3. add-sqr-sqrt6.8%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\sqrt{-\frac{F}{A}} \cdot \sqrt{-\frac{F}{A}}}}\right)} - 1 \]
    4. sqrt-unprod6.8%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\sqrt{\left(-\frac{F}{A}\right) \cdot \left(-\frac{F}{A}\right)}}}\right)} - 1 \]
    5. sqr-neg6.8%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\sqrt{\color{blue}{\frac{F}{A} \cdot \frac{F}{A}}}}\right)} - 1 \]
    6. sqrt-unprod1.4%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\sqrt{\frac{F}{A}} \cdot \sqrt{\frac{F}{A}}}}\right)} - 1 \]
    7. add-sqr-sqrt1.4%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\frac{F}{A}}}\right)} - 1 \]
  10. Applied egg-rr1.4%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{F}{A}}} \]
  12. Simplified1.2%

    \[\leadsto \color{blue}{\sqrt{\frac{F}{A}}} \]
  13. Final simplification1.2%

    \[\leadsto \sqrt{\frac{F}{A}} \]

Reproduce

?
herbie shell --seed 2023334 
(FPCore (A B C F)
  :name "ABCF->ab-angle a"
  :precision binary64
  (/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))