ABCF->ab-angle a

Percentage Accurate: 18.7% → 54.5%
Time: 30.7s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 18.7% accurate, 1.0× speedup?

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

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

Alternative 1: 54.5% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{t_4}{t_0}\\

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


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

    1. Initial program 44.3%

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

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

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

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

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

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

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

        \[\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} \]
    4. Applied egg-rr65.3%

      \[\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} \]
    5. Step-by-step derivation
      1. associate-*l*65.3%

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e-196 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < 4.99999999999999964e-35

    1. Initial program 8.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. Add Preprocessing
    3. Taylor expanded in A around -inf 36.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(-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

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

    1. Initial program 34.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. Simplified61.1%

      \[\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. Add Preprocessing
    4. Step-by-step derivation
      1. add-cube-cbrt61.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(\sqrt[3]{C + \mathsf{hypot}\left(B, A - C\right)} \cdot \sqrt[3]{C + \mathsf{hypot}\left(B, A - C\right)}\right) \cdot \sqrt[3]{C + \mathsf{hypot}\left(B, A - C\right)}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. pow361.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(\sqrt[3]{C + \mathsf{hypot}\left(B, A - C\right)}\right)}^{3}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. hypot-udef34.4%

        \[\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(\sqrt[3]{C + \color{blue}{\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. unpow234.4%

        \[\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(\sqrt[3]{C + \sqrt{\color{blue}{{B}^{2}} + \left(A - C\right) \cdot \left(A - C\right)}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. unpow234.4%

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

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

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

        \[\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(\sqrt[3]{C + \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      9. hypot-def61.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(\sqrt[3]{C + \color{blue}{\mathsf{hypot}\left(A - C, B\right)}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Applied egg-rr61.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(\sqrt[3]{C + \mathsf{hypot}\left(A - C, B\right)}\right)}^{3}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    6. Step-by-step derivation
      1. pow1/261.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 43.1% accurate, 0.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ t_2 := \frac{-\sqrt{\left(t_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_1}\\ \mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-268}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{-225}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;{B_m}^{2} \leq 10^{-88}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B_m, A\right)\right)}\right)}{B_m}\\ \mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-54}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-47}:\\ \;\;\;\;t_2\\ \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) (* (* 4.0 A) C)))
        (t_1 (fma B_m B_m (* A (* C -4.0))))
        (t_2 (/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A A)))) t_1)))
   (if (<= (pow B_m 2.0) 5e-268)
     t_2
     (if (<= (pow B_m 2.0) 2e-225)
       (sqrt (- (/ F A)))
       (if (<= (pow B_m 2.0) 1e-88)
         (/ (* (sqrt 2.0) (- (sqrt (* F (+ A (hypot B_m A)))))) B_m)
         (if (<= (pow B_m 2.0) 5e-54)
           (/ (- (sqrt (* (* 2.0 (* t_0 F)) (* 2.0 C)))) t_0)
           (if (<= (pow B_m 2.0) 5e-47)
             t_2
             (*
              (/ (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) - ((4.0 * A) * C);
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_2 = -sqrt(((t_1 * (2.0 * F)) * (A + A))) / t_1;
	double tmp;
	if (pow(B_m, 2.0) <= 5e-268) {
		tmp = t_2;
	} else if (pow(B_m, 2.0) <= 2e-225) {
		tmp = sqrt(-(F / A));
	} else if (pow(B_m, 2.0) <= 1e-88) {
		tmp = (sqrt(2.0) * -sqrt((F * (A + hypot(B_m, A))))) / B_m;
	} else if (pow(B_m, 2.0) <= 5e-54) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
	} else if (pow(B_m, 2.0) <= 5e-47) {
		tmp = t_2;
	} 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(Float64(4.0 * A) * C))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_2 = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + A)))) / t_1)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e-268)
		tmp = t_2;
	elseif ((B_m ^ 2.0) <= 2e-225)
		tmp = sqrt(Float64(-Float64(F / A)));
	elseif ((B_m ^ 2.0) <= 1e-88)
		tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(A + hypot(B_m, A)))))) / B_m);
	elseif ((B_m ^ 2.0) <= 5e-54)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(2.0 * C)))) / t_0);
	elseif ((B_m ^ 2.0) <= 5e-47)
		tmp = t_2;
	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[(N[(4.0 * A), $MachinePrecision] * C), $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[Sqrt[N[(N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-268], t$95$2, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-225], N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-88], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-54], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-47], t$95$2, 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} - \left(4 \cdot A\right) \cdot C\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := \frac{-\sqrt{\left(t_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_1}\\
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-268}:\\
\;\;\;\;t_2\\

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

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

\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-54}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-47}:\\
\;\;\;\;t_2\\

\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 5 regimes
  2. if (pow.f64 B 2) < 4.9999999999999999e-268 or 5.00000000000000015e-54 < (pow.f64 B 2) < 5.00000000000000011e-47

    1. Initial program 19.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. Simplified27.7%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in A around inf 34.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)} \]
    5. Step-by-step derivation
      1. distribute-rgt1-in34.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-eval34.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-lft34.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)} \]
    6. Simplified34.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 4.9999999999999999e-268 < (pow.f64 B 2) < 1.9999999999999999e-225

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt2.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 \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-unprod2.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-times1.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)}}} \]
    4. Applied egg-rr1.6%

      \[\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}}}} \]
    5. Step-by-step derivation
      1. associate-/l*1.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*1.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. *-commutative1.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. unpow21.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-neg1.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-in1.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-eval1.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. *-commutative1.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. *-commutative1.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)}}} \]
    6. Simplified1.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)}}}} \]
    7. Taylor expanded in C around inf 55.9%

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

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

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

    if 1.9999999999999999e-225 < (pow.f64 B 2) < 9.99999999999999934e-89

    1. Initial program 22.0%

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999934e-89 < (pow.f64 B 2) < 5.00000000000000015e-54

    1. Initial program 26.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. Add Preprocessing
    3. Taylor expanded in A around -inf 45.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 5.00000000000000011e-47 < (pow.f64 B 2)

    1. Initial program 17.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. Add Preprocessing
    3. Taylor expanded in A around 0 14.0%

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

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

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

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

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

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

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

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

        \[\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-down27.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/227.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/227.9%

        \[\leadsto \left(\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \color{blue}{\sqrt{F}}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    7. Applied egg-rr27.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 5 regimes into one program.
  4. Final simplification31.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-268}:\\ \;\;\;\;\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\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^{-225}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;{B}^{2} \leq 10^{-88}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)}\right)}{B}\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{-54}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\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} \]
  5. Add Preprocessing

Alternative 3: 52.5% accurate, 0.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ t_1 := \frac{\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B_m\right)\right)} \cdot \left(-\sqrt{2 \cdot \left(F \cdot t_0\right)}\right)}{t_0}\\ \mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_0}\\ \mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+170}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B_m, A\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 (fma B_m B_m (* A (* C -4.0))))
        (t_1
         (/
          (*
           (sqrt (+ A (+ C (hypot (- A C) B_m))))
           (- (sqrt (* 2.0 (* F t_0)))))
          t_0)))
   (if (<= (pow B_m 2.0) 5e-56)
     t_1
     (if (<= (pow B_m 2.0) 5e-47)
       (/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A A)))) t_0)
       (if (<= (pow B_m 2.0) 2e+170)
         t_1
         (*
          (/ (sqrt 2.0) B_m)
          (* (sqrt (+ A (hypot B_m A))) (- (sqrt F)))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
	double t_1 = (sqrt((A + (C + hypot((A - C), B_m)))) * -sqrt((2.0 * (F * t_0)))) / t_0;
	double tmp;
	if (pow(B_m, 2.0) <= 5e-56) {
		tmp = t_1;
	} else if (pow(B_m, 2.0) <= 5e-47) {
		tmp = -sqrt(((t_0 * (2.0 * F)) * (A + A))) / t_0;
	} else if (pow(B_m, 2.0) <= 2e+170) {
		tmp = t_1;
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt((A + hypot(B_m, A))) * -sqrt(F));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	t_1 = Float64(Float64(sqrt(Float64(A + Float64(C + hypot(Float64(A - C), B_m)))) * Float64(-sqrt(Float64(2.0 * Float64(F * t_0))))) / t_0)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e-56)
		tmp = t_1;
	elseif ((B_m ^ 2.0) <= 5e-47)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + A)))) / t_0);
	elseif ((B_m ^ 2.0) <= 2e+170)
		tmp = t_1;
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(A + hypot(B_m, A))) * 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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(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[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-56], t$95$1, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-47], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+170], t$95$1, N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|

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

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

\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+170}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B 2) < 4.99999999999999997e-56 or 5.00000000000000011e-47 < (pow.f64 B 2) < 2.00000000000000007e170

    1. Initial program 26.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. Simplified33.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. Add Preprocessing
    4. Step-by-step derivation
      1. add-cube-cbrt33.0%

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

        \[\leadsto \frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \color{blue}{{\left(\sqrt[3]{C + \mathsf{hypot}\left(B, A - C\right)}\right)}^{3}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. hypot-udef26.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(\sqrt[3]{C + \color{blue}{\sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      4. unpow226.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(\sqrt[3]{C + \sqrt{\color{blue}{{B}^{2}} + \left(A - C\right) \cdot \left(A - C\right)}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      5. unpow226.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(\sqrt[3]{C + \sqrt{{B}^{2} + \color{blue}{{\left(A - C\right)}^{2}}}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      6. +-commutative26.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(\sqrt[3]{C + \sqrt{\color{blue}{{\left(A - C\right)}^{2} + {B}^{2}}}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      7. unpow226.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(\sqrt[3]{C + \sqrt{\color{blue}{\left(A - C\right) \cdot \left(A - C\right)} + {B}^{2}}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      8. unpow226.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(\sqrt[3]{C + \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}}\right)}^{3}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      9. hypot-def33.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999997e-56 < (pow.f64 B 2) < 5.00000000000000011e-47

    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. Simplified31.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. Add Preprocessing
    4. Taylor expanded in A around inf 69.7%

      \[\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)} \]
    5. Step-by-step derivation
      1. distribute-rgt1-in69.7%

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

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

        \[\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)} \]
    6. Simplified69.7%

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

    1. Initial program 3.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. Add Preprocessing
    3. Taylor expanded in C around 0 6.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 46.6% accurate, 0.8× speedup?

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

\mathbf{elif}\;{B_m}^{2} \leq 10^{-195}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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

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


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

    1. Initial program 18.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. 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. Add Preprocessing
    4. Taylor expanded in C around -inf 29.7%

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

    if 2.0000000000000001e-253 < (pow.f64 B 2) < 1.0000000000000001e-195

    1. Initial program 11.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. Add Preprocessing
    3. Taylor expanded in A around -inf 43.1%

      \[\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.0000000000000001e-195 < (pow.f64 B 2) < 2.00000000000000007e170

    1. Initial program 33.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. Add Preprocessing
    3. Step-by-step derivation
      1. neg-sub033.7%

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

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

        \[\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} \]
    4. Applied egg-rr42.0%

      \[\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)}} \]
    5. Step-by-step derivation
      1. div042.0%

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

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

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

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

    if 2.00000000000000007e170 < (pow.f64 B 2)

    1. Initial program 3.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. Add Preprocessing
    3. Taylor expanded in C around 0 6.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 46.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 20.0%

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

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

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

    if 3.99999999999999983e-268 < (pow.f64 B 2) < 1.0000000000000001e-195

    1. Initial program 8.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. Add Preprocessing
    3. Taylor expanded in A around -inf 37.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(-0.5 \cdot \frac{{B}^{2}}{A} + 2 \cdot C\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if 1.0000000000000001e-195 < (pow.f64 B 2) < 2.00000000000000007e170

    1. Initial program 33.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. Add Preprocessing
    3. Step-by-step derivation
      1. neg-sub033.7%

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

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

        \[\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} \]
    4. Applied egg-rr42.0%

      \[\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)}} \]
    5. Step-by-step derivation
      1. div042.0%

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

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

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

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

    if 2.00000000000000007e170 < (pow.f64 B 2)

    1. Initial program 3.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. Add Preprocessing
    3. Taylor expanded in C around 0 6.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 41.8% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;C \leq -3.3 \cdot 10^{+143}:\\ \;\;\;\;\frac{-\sqrt{\left(t_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_1}\\ \mathbf{elif}\;C \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B_m, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\ \mathbf{elif}\;C \leq 2.4 \cdot 10^{+203}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \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) (* (* 4.0 A) C)))
        (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= C -3.3e+143)
     (/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A A)))) t_1)
     (if (<= C 5e-10)
       (* (/ (sqrt 2.0) B_m) (* (sqrt (+ A (hypot B_m A))) (- (sqrt F))))
       (if (<= C 2.4e+203)
         (/ (- (sqrt (* (* 2.0 (* t_0 F)) (* 2.0 C)))) t_0)
         (sqrt (- (/ F A))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (C <= -3.3e+143) {
		tmp = -sqrt(((t_1 * (2.0 * F)) * (A + A))) / t_1;
	} else if (C <= 5e-10) {
		tmp = (sqrt(2.0) / B_m) * (sqrt((A + hypot(B_m, A))) * -sqrt(F));
	} else if (C <= 2.4e+203) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
	} else {
		tmp = sqrt(-(F / A));
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (C <= -3.3e+143)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + A)))) / t_1);
	elseif (C <= 5e-10)
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(A + hypot(B_m, A))) * Float64(-sqrt(F))));
	elseif (C <= 2.4e+203)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(2.0 * C)))) / t_0);
	else
		tmp = sqrt(Float64(-Float64(F / A)));
	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[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -3.3e+143], N[((-N[Sqrt[N[(N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[C, 5e-10], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 2.4e+203], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|

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

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

\mathbf{elif}\;C \leq 2.4 \cdot 10^{+203}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if C < -3.3e143

    1. Initial program 0.8%

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

      \[\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. Add Preprocessing
    4. Taylor expanded in A around inf 40.6%

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

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

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

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

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

    if -3.3e143 < C < 5.00000000000000031e-10

    1. Initial program 22.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000031e-10 < C < 2.4000000000000001e203

    1. Initial program 27.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. Add Preprocessing
    3. Taylor expanded in A around -inf 43.0%

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

    if 2.4000000000000001e203 < C

    1. Initial program 1.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt0.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-unprod0.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.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)}}} \]
    4. Applied egg-rr0.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}}}} \]
    5. Step-by-step derivation
      1. associate-/l*0.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*0.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. *-commutative0.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. unpow20.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-neg0.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-in0.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-eval0.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. *-commutative0.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. *-commutative0.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)}}} \]
    6. Simplified0.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)}}}} \]
    7. Taylor expanded in C around inf 45.1%

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

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

      \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification31.5%

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

Alternative 7: 41.5% accurate, 2.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B_m}} \cdot t_0\\


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

    1. Initial program 25.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.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 \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-unprod20.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-times19.4%

        \[\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)}}} \]
    4. Applied egg-rr23.0%

      \[\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}}}} \]
    5. Step-by-step derivation
      1. associate-/l*25.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*25.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. *-commutative25.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. unpow225.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-neg25.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-in25.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-eval25.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. *-commutative25.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. *-commutative25.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)}}} \]
    6. Simplified25.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)}}}} \]
    7. Taylor expanded in C around inf 53.4%

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

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

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

    if -4.999999999999985e-310 < F < 8.9999999999999996e22

    1. Initial program 18.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. Add Preprocessing
    3. 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)} \]
    4. 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.3%

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

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

    if 8.9999999999999996e22 < F

    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in C around 0 14.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+22}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 41.2% accurate, 2.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{F}{B_m}} \cdot t_0\\


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

    1. Initial program 25.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.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 \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-unprod20.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-times19.4%

        \[\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)}}} \]
    4. Applied egg-rr23.0%

      \[\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}}}} \]
    5. Step-by-step derivation
      1. associate-/l*25.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*25.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. *-commutative25.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. unpow225.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-neg25.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-in25.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-eval25.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. *-commutative25.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. *-commutative25.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)}}} \]
    6. Simplified25.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)}}}} \]
    7. Taylor expanded in C around inf 53.4%

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

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

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

    if -4.999999999999985e-310 < F < 4.50000000000000017e95

    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. Add Preprocessing
    3. Taylor expanded in C around 0 10.6%

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

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

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

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

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

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

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

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

    if 4.50000000000000017e95 < F

    1. Initial program 14.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. Add Preprocessing
    3. Taylor expanded in C around 0 17.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+95}:\\ \;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 38.9% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;F \leq 1.6 \cdot 10^{+88}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{B_m \cdot F}\right)\\

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


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

    1. Initial program 25.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.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 \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-unprod20.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-times19.4%

        \[\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)}}} \]
    4. Applied egg-rr23.0%

      \[\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}}}} \]
    5. Step-by-step derivation
      1. associate-/l*25.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*25.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. *-commutative25.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. unpow225.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-neg25.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-in25.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-eval25.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. *-commutative25.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. *-commutative25.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)}}} \]
    6. Simplified25.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)}}}} \]
    7. Taylor expanded in C around inf 53.4%

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

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

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

    if -4.999999999999985e-310 < F < 1.5999999999999999e88

    1. Initial program 20.3%

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

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

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

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

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

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

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

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

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

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

    if 1.5999999999999999e88 < F

    1. Initial program 14.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. Add Preprocessing
    3. Taylor expanded in C around 0 16.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{+88}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot F}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 31.8% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.9 \cdot 10^{-249}:\\
\;\;\;\;\sqrt{-\frac{F}{A}}\\

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


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

    1. Initial program 20.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt16.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-unprod13.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-times13.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)}}} \]
    4. Applied egg-rr15.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}}}} \]
    5. Step-by-step derivation
      1. associate-/l*17.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*17.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. *-commutative17.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. unpow217.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-neg17.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-in17.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-eval17.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. *-commutative17.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. *-commutative17.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)}}} \]
    6. Simplified17.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)}}}} \]
    7. Taylor expanded in C around inf 37.5%

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

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

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

    if 3.8999999999999999e-249 < F

    1. Initial program 18.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. Add Preprocessing
    3. Taylor expanded in C around 0 13.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 3.9 \cdot 10^{-249}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 16.1% accurate, 5.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -3.6 \cdot 10^{-7} \lor \neg \left(C \leq 7.8 \cdot 10^{-209}\right) \land C \leq 3.5 \cdot 10^{-7}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (or (<= C -3.6e-7) (and (not (<= C 7.8e-209)) (<= C 3.5e-7)))
   (sqrt (- (/ F C)))
   (sqrt (- (/ F A)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if ((C <= -3.6e-7) || (!(C <= 7.8e-209) && (C <= 3.5e-7))) {
		tmp = sqrt(-(F / C));
	} else {
		tmp = sqrt(-(F / A));
	}
	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 ((c <= (-3.6d-7)) .or. (.not. (c <= 7.8d-209)) .and. (c <= 3.5d-7)) then
        tmp = sqrt(-(f / c))
    else
        tmp = sqrt(-(f / a))
    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 ((C <= -3.6e-7) || (!(C <= 7.8e-209) && (C <= 3.5e-7))) {
		tmp = Math.sqrt(-(F / C));
	} else {
		tmp = Math.sqrt(-(F / A));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if (C <= -3.6e-7) or (not (C <= 7.8e-209) and (C <= 3.5e-7)):
		tmp = math.sqrt(-(F / C))
	else:
		tmp = math.sqrt(-(F / A))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if ((C <= -3.6e-7) || (!(C <= 7.8e-209) && (C <= 3.5e-7)))
		tmp = sqrt(Float64(-Float64(F / C)));
	else
		tmp = sqrt(Float64(-Float64(F / A)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if ((C <= -3.6e-7) || (~((C <= 7.8e-209)) && (C <= 3.5e-7)))
		tmp = sqrt(-(F / C));
	else
		tmp = sqrt(-(F / A));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[Or[LessEqual[C, -3.6e-7], And[N[Not[LessEqual[C, 7.8e-209]], $MachinePrecision], LessEqual[C, 3.5e-7]]], N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision], N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;C \leq -3.6 \cdot 10^{-7} \lor \neg \left(C \leq 7.8 \cdot 10^{-209}\right) \land C \leq 3.5 \cdot 10^{-7}:\\
\;\;\;\;\sqrt{-\frac{F}{C}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -3.59999999999999994e-7 or 7.8000000000000001e-209 < C < 3.49999999999999984e-7

    1. Initial program 15.6%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt4.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.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-times4.4%

        \[\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)}}} \]
    4. Applied egg-rr6.3%

      \[\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}}}} \]
    5. Step-by-step derivation
      1. associate-/l*7.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*7.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. *-commutative7.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. unpow27.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-neg7.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-in7.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-eval7.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. *-commutative7.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. *-commutative7.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)}}} \]
    6. Simplified6.7%

      \[\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)}}}} \]
    7. Taylor expanded in B around 0 20.3%

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

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

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

    if -3.59999999999999994e-7 < C < 7.8000000000000001e-209 or 3.49999999999999984e-7 < C

    1. Initial program 21.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt3.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-unprod2.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 \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \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.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)}}} \]
    4. Applied egg-rr2.5%

      \[\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}}}} \]
    5. Step-by-step derivation
      1. associate-/l*2.7%

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

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

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

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

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

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

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

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

        \[\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)}}} \]
    6. Simplified2.7%

      \[\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)}}}} \]
    7. Taylor expanded in C around inf 17.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -3.6 \cdot 10^{-7} \lor \neg \left(C \leq 7.8 \cdot 10^{-209}\right) \land C \leq 3.5 \cdot 10^{-7}:\\ \;\;\;\;\sqrt{-\frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 12.0% 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 18.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. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt3.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 \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.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-times3.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)}}} \]
  4. 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}}}} \]
  5. Step-by-step derivation
    1. associate-/l*4.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*4.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. *-commutative4.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. unpow24.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-neg4.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-in4.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-eval4.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. *-commutative4.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. *-commutative4.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)}}} \]
  6. Simplified4.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)}}}} \]
  7. Taylor expanded in C around inf 12.4%

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

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

    \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
  10. Final simplification12.4%

    \[\leadsto \sqrt{-\frac{F}{A}} \]
  11. Add Preprocessing

Reproduce

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