ABCF->ab-angle a

Percentage Accurate: 19.4% → 55.7%
Time: 41.5s
Alternatives: 17
Speedup: 2.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 19.4% 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: 55.7% accurate, 0.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \mathsf{hypot}\left(A - C, B\_m\right)\\ t_1 := \left(A \cdot C\right) \cdot -4\\ t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := 2 \cdot \left(t\_2 \cdot F\right)\\ t_4 := \frac{-\sqrt{t\_3 \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2}\\ t_5 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;t\_4 \leq -\infty:\\ \;\;\;\;\frac{\sqrt{A + \left(C + t\_0\right)} \cdot \left(\mathsf{hypot}\left(B\_m, \sqrt{t\_1}\right) \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{t\_5}\\ \mathbf{elif}\;t\_4 \leq -2 \cdot 10^{-189}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B\_m, B\_m, t\_1\right) \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{\left(A + C\right) + t\_0}\right)}{t\_5}\\ \mathbf{elif}\;t\_4 \leq 0:\\ \;\;\;\;\frac{-\sqrt{t\_3 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_2}\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;\sqrt{2 \cdot \frac{F}{\frac{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \sqrt{F}\right) \cdot \left(-\frac{\sqrt{2}}{B\_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (hypot (- A C) B_m))
        (t_1 (* (* A C) -4.0))
        (t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
        (t_3 (* 2.0 (* t_2 F)))
        (t_4
         (/
          (-
           (sqrt
            (* t_3 (+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0)))))))
          t_2))
        (t_5 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= t_4 (- INFINITY))
     (/
      (*
       (sqrt (+ A (+ C t_0)))
       (* (hypot B_m (sqrt t_1)) (- (sqrt (* 2.0 F)))))
      t_5)
     (if (<= t_4 -2e-189)
       (/
        (* (sqrt (* (fma B_m B_m t_1) (* 2.0 F))) (- (sqrt (+ (+ A C) t_0))))
        t_5)
       (if (<= t_4 0.0)
         (/ (- (sqrt (* t_3 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C))))) t_2)
         (if (<= t_4 INFINITY)
           (sqrt
            (*
             2.0
             (/
              F
              (/
               (fma -4.0 (* A C) (pow B_m 2.0))
               (+ (+ A C) (hypot B_m (- A C)))))))
           (*
            (* (sqrt (+ A (hypot B_m A))) (sqrt F))
            (- (/ (sqrt 2.0) B_m)))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = hypot((A - C), B_m);
	double t_1 = (A * C) * -4.0;
	double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_3 = 2.0 * (t_2 * F);
	double t_4 = -sqrt((t_3 * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double t_5 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (t_4 <= -((double) INFINITY)) {
		tmp = (sqrt((A + (C + t_0))) * (hypot(B_m, sqrt(t_1)) * -sqrt((2.0 * F)))) / t_5;
	} else if (t_4 <= -2e-189) {
		tmp = (sqrt((fma(B_m, B_m, t_1) * (2.0 * F))) * -sqrt(((A + C) + t_0))) / t_5;
	} else if (t_4 <= 0.0) {
		tmp = -sqrt((t_3 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_2;
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = sqrt((2.0 * (F / (fma(-4.0, (A * C), pow(B_m, 2.0)) / ((A + C) + hypot(B_m, (A - C)))))));
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * -(sqrt(2.0) / B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = hypot(Float64(A - C), B_m)
	t_1 = Float64(Float64(A * C) * -4.0)
	t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_3 = Float64(2.0 * Float64(t_2 * F))
	t_4 = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_2)
	t_5 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (t_4 <= Float64(-Inf))
		tmp = Float64(Float64(sqrt(Float64(A + Float64(C + t_0))) * Float64(hypot(B_m, sqrt(t_1)) * Float64(-sqrt(Float64(2.0 * F))))) / t_5);
	elseif (t_4 <= -2e-189)
		tmp = Float64(Float64(sqrt(Float64(fma(B_m, B_m, t_1) * Float64(2.0 * F))) * Float64(-sqrt(Float64(Float64(A + C) + t_0)))) / t_5);
	elseif (t_4 <= 0.0)
		tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C))))) / t_2);
	elseif (t_4 <= Inf)
		tmp = sqrt(Float64(2.0 * Float64(F / Float64(fma(-4.0, Float64(A * C), (B_m ^ 2.0)) / Float64(Float64(A + C) + hypot(B_m, Float64(A - C)))))));
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * sqrt(F)) * Float64(-Float64(sqrt(2.0) / B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[((-N[Sqrt[N[(t$95$3 * 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$2), $MachinePrecision]}, Block[{t$95$5 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(N[Sqrt[N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[B$95$m ^ 2 + N[Sqrt[t$95$1], $MachinePrecision] ^ 2], $MachinePrecision] * (-N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$5), $MachinePrecision], If[LessEqual[t$95$4, -2e-189], N[(N[(N[Sqrt[N[(N[(B$95$m * B$95$m + t$95$1), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$5), $MachinePrecision], If[LessEqual[t$95$4, 0.0], N[((-N[Sqrt[N[(t$95$3 * 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$2), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(2.0 * N[(F / N[(N[(-4.0 * N[(A * C), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * (-N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision])), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(A - C, B\_m\right)\\
t_1 := \left(A \cdot C\right) \cdot -4\\
t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := 2 \cdot \left(t\_2 \cdot F\right)\\
t_4 := \frac{-\sqrt{t\_3 \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2}\\
t_5 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;\frac{\sqrt{A + \left(C + t\_0\right)} \cdot \left(\mathsf{hypot}\left(B\_m, \sqrt{t\_1}\right) \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{t\_5}\\

\mathbf{elif}\;t\_4 \leq -2 \cdot 10^{-189}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B\_m, B\_m, t\_1\right) \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{\left(A + C\right) + t\_0}\right)}{t\_5}\\

\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\frac{-\sqrt{t\_3 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_2}\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{2 \cdot \frac{F}{\frac{\mathsf{fma}\left(-4, A \cdot C, {B\_m}^{2}\right)}{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)}}}\\

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


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

    1. Initial program 3.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. Simplified12.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. Step-by-step derivation
      1. sqrt-prod25.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 + e^{\log \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}\right)\right)}^{0.5}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. *-commutative92.8%

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

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

        \[\leadsto \frac{-\color{blue}{{\left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\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)} \]
      5. pow1/297.9%

        \[\leadsto \frac{-\color{blue}{\sqrt{A + \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. associate-+r+97.9%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\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)} \]
      7. pow1/297.9%

        \[\leadsto \frac{-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\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)} \]
      8. associate-*r*97.9%

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

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

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

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

    1. Initial program 3.7%

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

      \[\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 -0.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 41.2% 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)\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\ t_3 := \frac{\sqrt{2}}{B\_m}\\ t_4 := t\_3 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-273}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-175}:\\ \;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-39}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+46}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+218}:\\ \;\;\;\;t\_4\\ \mathbf{else}:\\ \;\;\;\;t\_3 \cdot \left(\sqrt{B\_m + C} \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 (* (* 2.0 (* t_0 F)) (* 2.0 C)))) t_0))
        (t_3 (/ (sqrt 2.0) B_m))
        (t_4 (* t_3 (- (sqrt (* F (+ C (hypot B_m C))))))))
   (if (<= (pow B_m 2.0) 5e-273)
     t_2
     (if (<= (pow B_m 2.0) 5e-175)
       (/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A A)))) t_1)
       (if (<= (pow B_m 2.0) 5e-39)
         t_4
         (if (<= (pow B_m 2.0) 4e+46)
           t_2
           (if (<= (pow B_m 2.0) 5e+218)
             t_4
             (* t_3 (* (sqrt (+ 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(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
	double t_3 = sqrt(2.0) / B_m;
	double t_4 = t_3 * -sqrt((F * (C + hypot(B_m, C))));
	double tmp;
	if (pow(B_m, 2.0) <= 5e-273) {
		tmp = t_2;
	} else if (pow(B_m, 2.0) <= 5e-175) {
		tmp = -sqrt(((t_1 * (2.0 * F)) * (A + A))) / t_1;
	} else if (pow(B_m, 2.0) <= 5e-39) {
		tmp = t_4;
	} else if (pow(B_m, 2.0) <= 4e+46) {
		tmp = t_2;
	} else if (pow(B_m, 2.0) <= 5e+218) {
		tmp = t_4;
	} else {
		tmp = t_3 * (sqrt((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(2.0 * Float64(t_0 * F)) * Float64(2.0 * C)))) / t_0)
	t_3 = Float64(sqrt(2.0) / B_m)
	t_4 = Float64(t_3 * Float64(-sqrt(Float64(F * Float64(C + hypot(B_m, C))))))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e-273)
		tmp = t_2;
	elseif ((B_m ^ 2.0) <= 5e-175)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + A)))) / t_1);
	elseif ((B_m ^ 2.0) <= 5e-39)
		tmp = t_4;
	elseif ((B_m ^ 2.0) <= 4e+46)
		tmp = t_2;
	elseif ((B_m ^ 2.0) <= 5e+218)
		tmp = t_4;
	else
		tmp = Float64(t_3 * Float64(sqrt(Float64(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[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-273], t$95$2, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-175], 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-39], t$95$4, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+46], t$95$2, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+218], t$95$4, N[(t$95$3 * N[(N[Sqrt[N[(B$95$m + C), $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(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\
t_3 := \frac{\sqrt{2}}{B\_m}\\
t_4 := t\_3 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-273}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-175}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_1}\\

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-39}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+218}:\\
\;\;\;\;t\_4\\

\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(\sqrt{B\_m + C} \cdot \left(-\sqrt{F}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (pow.f64 B 2) < 4.99999999999999965e-273 or 4.9999999999999998e-39 < (pow.f64 B 2) < 4e46

    1. Initial program 26.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in A around -inf 35.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 4.99999999999999965e-273 < (pow.f64 B 2) < 5e-175

    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. Simplified40.0%

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

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

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

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

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

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

    if 5e-175 < (pow.f64 B 2) < 4.9999999999999998e-39 or 4e46 < (pow.f64 B 2) < 4.99999999999999983e218

    1. Initial program 40.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. Taylor expanded in A around 0 23.2%

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

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

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

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

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

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

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

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

    if 4.99999999999999983e218 < (pow.f64 B 2)

    1. Initial program 6.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 A around 0 9.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 44.4% 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)\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\ t_3 := \frac{\sqrt{2}}{B\_m}\\ \mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-273}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-175}:\\ \;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-39}:\\ \;\;\;\;t\_3 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}\right)\\ \mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+46}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \sqrt{F}\right) \cdot \left(-t\_3\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 (* (* 2.0 (* t_0 F)) (* 2.0 C)))) t_0))
        (t_3 (/ (sqrt 2.0) B_m)))
   (if (<= (pow B_m 2.0) 5e-273)
     t_2
     (if (<= (pow B_m 2.0) 5e-175)
       (/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A A)))) t_1)
       (if (<= (pow B_m 2.0) 5e-39)
         (* t_3 (- (sqrt (* F (+ C (hypot B_m C))))))
         (if (<= (pow B_m 2.0) 4e+46)
           t_2
           (* (* (sqrt (+ A (hypot B_m A))) (sqrt F)) (- t_3))))))))
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(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
	double t_3 = sqrt(2.0) / B_m;
	double tmp;
	if (pow(B_m, 2.0) <= 5e-273) {
		tmp = t_2;
	} else if (pow(B_m, 2.0) <= 5e-175) {
		tmp = -sqrt(((t_1 * (2.0 * F)) * (A + A))) / t_1;
	} else if (pow(B_m, 2.0) <= 5e-39) {
		tmp = t_3 * -sqrt((F * (C + hypot(B_m, C))));
	} else if (pow(B_m, 2.0) <= 4e+46) {
		tmp = t_2;
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * -t_3;
	}
	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(2.0 * Float64(t_0 * F)) * Float64(2.0 * C)))) / t_0)
	t_3 = Float64(sqrt(2.0) / B_m)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e-273)
		tmp = t_2;
	elseif ((B_m ^ 2.0) <= 5e-175)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + A)))) / t_1);
	elseif ((B_m ^ 2.0) <= 5e-39)
		tmp = Float64(t_3 * Float64(-sqrt(Float64(F * Float64(C + hypot(B_m, C))))));
	elseif ((B_m ^ 2.0) <= 4e+46)
		tmp = t_2;
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * sqrt(F)) * Float64(-t_3));
	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[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-273], t$95$2, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-175], 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-39], N[(t$95$3 * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e+46], t$95$2, N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * (-t$95$3)), $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(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\
t_3 := \frac{\sqrt{2}}{B\_m}\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-273}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-175}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_1}\\

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-39}:\\
\;\;\;\;t\_3 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}\right)\\

\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \sqrt{F}\right) \cdot \left(-t\_3\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (pow.f64 B 2) < 4.99999999999999965e-273 or 4.9999999999999998e-39 < (pow.f64 B 2) < 4e46

    1. Initial program 26.9%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in A around -inf 35.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 4.99999999999999965e-273 < (pow.f64 B 2) < 5e-175

    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. Simplified40.0%

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

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

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

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

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

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

    if 5e-175 < (pow.f64 B 2) < 4.9999999999999998e-39

    1. Initial program 48.4%

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

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

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

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

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

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

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

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

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

    if 4e46 < (pow.f64 B 2)

    1. Initial program 17.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. Taylor expanded in C around 0 13.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 48.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, \left(A \cdot C\right) \cdot -4\right)\\
t_1 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-273}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t\_1 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_1}\\

\mathbf{elif}\;{B\_m}^{2} \leq 10^{-233}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_2 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_2}\\

\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+114}:\\
\;\;\;\;\frac{-\sqrt{t\_0 \cdot \left(\left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)\right) \cdot \left(2 \cdot F\right)\right)}}{t\_0}\\

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


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

    1. Initial program 23.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. Taylor expanded in A around -inf 32.7%

      \[\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 4.99999999999999965e-273 < (pow.f64 B 2) < 9.99999999999999958e-234

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in A around inf 43.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(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-in43.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(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-eval43.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(A + \color{blue}{0} \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. mul0-lft43.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(A + \color{blue}{0}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    6. Simplified43.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(A + 0\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]

    if 9.99999999999999958e-234 < (pow.f64 B 2) < 2e114

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-exp-log49.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 + \color{blue}{e^{\log \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. hypot-udef42.5%

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

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

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

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

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

        \[\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 + e^{\log \left(C + \sqrt{\left(A - C\right) \cdot \left(A - C\right) + \color{blue}{B \cdot B}}\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      8. hypot-def49.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 + e^{\log \left(C + \color{blue}{\mathsf{hypot}\left(A - C, B\right)}\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Applied egg-rr49.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 + \color{blue}{e^{\log \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    6. Step-by-step derivation
      1. distribute-frac-neg49.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 + e^{\log \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
      2. associate-*l*48.5%

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

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

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

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

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

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

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

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

    if 2e114 < (pow.f64 B 2)

    1. Initial program 10.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in C around 0 11.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-neg11.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 51.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\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^{+113}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B\_m, B\_m, \left(A \cdot C\right) \cdot -4\right) \cdot \left(2 \cdot F\right)} \cdot \left(-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)}\right)}{\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\

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


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

    1. Initial program 24.3%

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

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

    if 0.0 < (pow.f64 B 2) < 2e113

    1. Initial program 38.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. Simplified45.8%

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-exp-log43.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}{e^{\log \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. hypot-udef37.5%

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

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

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

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

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

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

        \[\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 + e^{\log \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}\right)\right)}^{0.5}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. *-commutative43.3%

        \[\leadsto \frac{-{\color{blue}{\left(\left(A + e^{\log \left(C + \mathsf{hypot}\left(A - C, B\right)\right)}\right) \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right)\right)}}^{0.5}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. rem-exp-log45.8%

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

        \[\leadsto \frac{-\color{blue}{{\left(A + \left(C + \mathsf{hypot}\left(A - C, B\right)\right)\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)} \]
      5. pow1/251.8%

        \[\leadsto \frac{-\color{blue}{\sqrt{A + \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. associate-+r+51.1%

        \[\leadsto \frac{-\sqrt{\color{blue}{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\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)} \]
      7. pow1/251.1%

        \[\leadsto \frac{-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\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)} \]
      8. associate-*r*51.1%

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

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

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

    if 2e113 < (pow.f64 B 2)

    1. Initial program 11.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 C around 0 12.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 48.8% accurate, 1.0× 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 5 \cdot 10^{-273}:\\ \;\;\;\;\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^{+113}:\\ \;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \sqrt{F}\right) \cdot \left(-\frac{\sqrt{2}}{B\_m}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (- (pow B_m 2.0) (* (* 4.0 A) C)))
        (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 5e-273)
     (/ (- (sqrt (* (* 2.0 (* t_0 F)) (* 2.0 C)))) t_0)
     (if (<= (pow B_m 2.0) 2e+113)
       (/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A (+ C (hypot B_m (- A C))))))) t_1)
       (* (* (sqrt (+ A (hypot B_m A))) (sqrt F)) (- (/ (sqrt 2.0) B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 5e-273) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
	} else if (pow(B_m, 2.0) <= 2e+113) {
		tmp = -sqrt(((t_1 * (2.0 * F)) * (A + (C + hypot(B_m, (A - C)))))) / t_1;
	} else {
		tmp = (sqrt((A + hypot(B_m, A))) * sqrt(F)) * -(sqrt(2.0) / B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64((B_m ^ 2.0) - Float64(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) <= 5e-273)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(2.0 * C)))) / t_0);
	elseif ((B_m ^ 2.0) <= 2e+113)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_1);
	else
		tmp = Float64(Float64(sqrt(Float64(A + hypot(B_m, A))) * sqrt(F)) * Float64(-Float64(sqrt(2.0) / B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(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], 5e-273], 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+113], N[((-N[Sqrt[N[(N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * (-N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := {B\_m}^{2} - \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 5 \cdot 10^{-273}:\\
\;\;\;\;\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^{+113}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_1}\\

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


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

    1. Initial program 23.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. Taylor expanded in A around -inf 32.7%

      \[\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 4.99999999999999965e-273 < (pow.f64 B 2) < 2e113

    1. Initial program 41.2%

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

    if 2e113 < (pow.f64 B 2)

    1. Initial program 11.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 C around 0 12.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 45.1% accurate, 1.0× 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 := 2 \cdot \left(t\_0 \cdot F\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-273}:\\ \;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(2 \cdot C\right)}}{t\_0}\\ \mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-105}:\\ \;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\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 (* 2.0 (* t_0 F))))
   (if (<= (pow B_m 2.0) 5e-273)
     (/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
     (if (<= (pow B_m 2.0) 5e-105)
       (/ (- (sqrt (* t_1 (+ A (hypot B_m A))))) t_0)
       (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ C (hypot B_m C))))))))))
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 = 2.0 * (t_0 * F);
	double tmp;
	if (pow(B_m, 2.0) <= 5e-273) {
		tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
	} else if (pow(B_m, 2.0) <= 5e-105) {
		tmp = -sqrt((t_1 * (A + hypot(B_m, A)))) / t_0;
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = Math.pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_1 = 2.0 * (t_0 * F);
	double tmp;
	if (Math.pow(B_m, 2.0) <= 5e-273) {
		tmp = -Math.sqrt((t_1 * (2.0 * C))) / t_0;
	} else if (Math.pow(B_m, 2.0) <= 5e-105) {
		tmp = -Math.sqrt((t_1 * (A + Math.hypot(B_m, A)))) / t_0;
	} else {
		tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * -Math.sqrt((C + Math.hypot(B_m, C))));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.pow(B_m, 2.0) - ((4.0 * A) * C)
	t_1 = 2.0 * (t_0 * F)
	tmp = 0
	if math.pow(B_m, 2.0) <= 5e-273:
		tmp = -math.sqrt((t_1 * (2.0 * C))) / t_0
	elif math.pow(B_m, 2.0) <= 5e-105:
		tmp = -math.sqrt((t_1 * (A + math.hypot(B_m, A)))) / t_0
	else:
		tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(F) * -math.sqrt((C + math.hypot(B_m, C))))
	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 = Float64(2.0 * Float64(t_0 * F))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e-273)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0);
	elseif ((B_m ^ 2.0) <= 5e-105)
		tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + hypot(B_m, A))))) / t_0);
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C))))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (B_m ^ 2.0) - ((4.0 * A) * C);
	t_1 = 2.0 * (t_0 * F);
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 5e-273)
		tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
	elseif ((B_m ^ 2.0) <= 5e-105)
		tmp = -sqrt((t_1 * (A + hypot(B_m, A)))) / t_0;
	else
		tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-273], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-105], N[((-N[Sqrt[N[(t$95$1 * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $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 := 2 \cdot \left(t\_0 \cdot F\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-273}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(2 \cdot C\right)}}{t\_0}\\

\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-105}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{t\_0}\\

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


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

    1. Initial program 23.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. Taylor expanded in A around -inf 32.7%

      \[\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 4.99999999999999965e-273 < (pow.f64 B 2) < 4.99999999999999963e-105

    1. Initial program 41.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. Taylor expanded in C around 0 44.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(A + \sqrt{{A}^{2} + {B}^{2}}\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    4. Step-by-step derivation
      1. +-commutative44.1%

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

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

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

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

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

    if 4.99999999999999963e-105 < (pow.f64 B 2)

    1. Initial program 21.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 A around 0 13.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 44.9% accurate, 1.0× 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 5 \cdot 10^{-273}:\\ \;\;\;\;\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^{-175}:\\ \;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)}\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) 5e-273)
     (/ (- (sqrt (* (* 2.0 (* t_0 F)) (* 2.0 C)))) t_0)
     (if (<= (pow B_m 2.0) 5e-175)
       (/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A A)))) t_1)
       (* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ C (hypot B_m C))))))))))
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) <= 5e-273) {
		tmp = -sqrt(((2.0 * (t_0 * F)) * (2.0 * C))) / t_0;
	} else if (pow(B_m, 2.0) <= 5e-175) {
		tmp = -sqrt(((t_1 * (2.0 * F)) * (A + A))) / t_1;
	} else {
		tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
	}
	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) <= 5e-273)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(2.0 * C)))) / t_0);
	elseif ((B_m ^ 2.0) <= 5e-175)
		tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + A)))) / t_1);
	else
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C))))));
	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], 5e-273], 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-175], N[((-N[Sqrt[N[(N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $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 5 \cdot 10^{-273}:\\
\;\;\;\;\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^{-175}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_1}\\

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


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

    1. Initial program 23.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. Taylor expanded in A around -inf 32.7%

      \[\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 4.99999999999999965e-273 < (pow.f64 B 2) < 5e-175

    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. Simplified40.0%

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

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

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

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

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

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

    if 5e-175 < (pow.f64 B 2)

    1. Initial program 26.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 15.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-273}:\\ \;\;\;\;\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^{-175}:\\ \;\;\;\;\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{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B, C\right)}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 39.9% accurate, 1.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \frac{\sqrt{2}}{B\_m}\\ t_1 := t\_0 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}\right)\\ t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t\_2 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_2}\\ \mathbf{if}\;B\_m \leq 1.65 \cdot 10^{-200}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;B\_m \leq 7.8 \cdot 10^{-88}:\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \mathbf{elif}\;B\_m \leq 7.7 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{+23}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;B\_m \leq 7.2 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{B\_m + C} \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 (/ (sqrt 2.0) B_m))
        (t_1 (* t_0 (- (sqrt (* F (+ C (hypot B_m C)))))))
        (t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
        (t_3 (/ (- (sqrt (* (* 2.0 (* t_2 F)) (* 2.0 C)))) t_2)))
   (if (<= B_m 1.65e-200)
     t_3
     (if (<= B_m 7.8e-88)
       (sqrt (/ (- F) C))
       (if (<= B_m 7.7e-19)
         t_1
         (if (<= B_m 1.5e+23)
           t_3
           (if (<= B_m 7.2e+112)
             t_1
             (* t_0 (* (sqrt (+ B_m C)) (- (sqrt F)))))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt(2.0) / B_m;
	double t_1 = t_0 * -sqrt((F * (C + hypot(B_m, C))));
	double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_3 = -sqrt(((2.0 * (t_2 * F)) * (2.0 * C))) / t_2;
	double tmp;
	if (B_m <= 1.65e-200) {
		tmp = t_3;
	} else if (B_m <= 7.8e-88) {
		tmp = sqrt((-F / C));
	} else if (B_m <= 7.7e-19) {
		tmp = t_1;
	} else if (B_m <= 1.5e+23) {
		tmp = t_3;
	} else if (B_m <= 7.2e+112) {
		tmp = t_1;
	} else {
		tmp = t_0 * (sqrt((B_m + C)) * -sqrt(F));
	}
	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) / B_m;
	double t_1 = t_0 * -Math.sqrt((F * (C + Math.hypot(B_m, C))));
	double t_2 = Math.pow(B_m, 2.0) - ((4.0 * A) * C);
	double t_3 = -Math.sqrt(((2.0 * (t_2 * F)) * (2.0 * C))) / t_2;
	double tmp;
	if (B_m <= 1.65e-200) {
		tmp = t_3;
	} else if (B_m <= 7.8e-88) {
		tmp = Math.sqrt((-F / C));
	} else if (B_m <= 7.7e-19) {
		tmp = t_1;
	} else if (B_m <= 1.5e+23) {
		tmp = t_3;
	} else if (B_m <= 7.2e+112) {
		tmp = t_1;
	} else {
		tmp = t_0 * (Math.sqrt((B_m + C)) * -Math.sqrt(F));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.sqrt(2.0) / B_m
	t_1 = t_0 * -math.sqrt((F * (C + math.hypot(B_m, C))))
	t_2 = math.pow(B_m, 2.0) - ((4.0 * A) * C)
	t_3 = -math.sqrt(((2.0 * (t_2 * F)) * (2.0 * C))) / t_2
	tmp = 0
	if B_m <= 1.65e-200:
		tmp = t_3
	elif B_m <= 7.8e-88:
		tmp = math.sqrt((-F / C))
	elif B_m <= 7.7e-19:
		tmp = t_1
	elif B_m <= 1.5e+23:
		tmp = t_3
	elif B_m <= 7.2e+112:
		tmp = t_1
	else:
		tmp = t_0 * (math.sqrt((B_m + C)) * -math.sqrt(F))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(sqrt(2.0) / B_m)
	t_1 = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(C + hypot(B_m, C))))))
	t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(2.0 * C)))) / t_2)
	tmp = 0.0
	if (B_m <= 1.65e-200)
		tmp = t_3;
	elseif (B_m <= 7.8e-88)
		tmp = sqrt(Float64(Float64(-F) / C));
	elseif (B_m <= 7.7e-19)
		tmp = t_1;
	elseif (B_m <= 1.5e+23)
		tmp = t_3;
	elseif (B_m <= 7.2e+112)
		tmp = t_1;
	else
		tmp = Float64(t_0 * Float64(sqrt(Float64(B_m + C)) * Float64(-sqrt(F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = sqrt(2.0) / B_m;
	t_1 = t_0 * -sqrt((F * (C + hypot(B_m, C))));
	t_2 = (B_m ^ 2.0) - ((4.0 * A) * C);
	t_3 = -sqrt(((2.0 * (t_2 * F)) * (2.0 * C))) / t_2;
	tmp = 0.0;
	if (B_m <= 1.65e-200)
		tmp = t_3;
	elseif (B_m <= 7.8e-88)
		tmp = sqrt((-F / C));
	elseif (B_m <= 7.7e-19)
		tmp = t_1;
	elseif (B_m <= 1.5e+23)
		tmp = t_3;
	elseif (B_m <= 7.2e+112)
		tmp = t_1;
	else
		tmp = t_0 * (sqrt((B_m + C)) * -sqrt(F));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[B$95$m, 1.65e-200], t$95$3, If[LessEqual[B$95$m, 7.8e-88], N[Sqrt[N[((-F) / C), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 7.7e-19], t$95$1, If[LessEqual[B$95$m, 1.5e+23], t$95$3, If[LessEqual[B$95$m, 7.2e+112], t$95$1, N[(t$95$0 * N[(N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B\_m}\\
t_1 := t\_0 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}\right)\\
t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t\_2 \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_2}\\
\mathbf{if}\;B\_m \leq 1.65 \cdot 10^{-200}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;B\_m \leq 7.8 \cdot 10^{-88}:\\
\;\;\;\;\sqrt{\frac{-F}{C}}\\

\mathbf{elif}\;B\_m \leq 7.7 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;B\_m \leq 1.5 \cdot 10^{+23}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;B\_m \leq 7.2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{B\_m + C} \cdot \left(-\sqrt{F}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 1.6499999999999999e-200 or 7.70000000000000044e-19 < B < 1.5e23

    1. Initial program 26.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 20.9%

      \[\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.6499999999999999e-200 < B < 7.79999999999999985e-88

    1. Initial program 23.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. Simplified32.3%

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

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

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

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

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

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

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

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

    if 7.79999999999999985e-88 < B < 7.70000000000000044e-19 or 1.5e23 < B < 7.20000000000000001e112

    1. Initial program 41.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 51.6%

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

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

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

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

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

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

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

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

    if 7.20000000000000001e112 < B

    1. Initial program 10.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 0 16.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.65 \cdot 10^{-200}:\\ \;\;\;\;\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 \leq 7.8 \cdot 10^{-88}:\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \mathbf{elif}\;B \leq 7.7 \cdot 10^{-19}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\ \mathbf{elif}\;B \leq 1.5 \cdot 10^{+23}:\\ \;\;\;\;\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 \leq 7.2 \cdot 10^{+112}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B, C\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(\sqrt{B + C} \cdot \left(-\sqrt{F}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 40.5% accurate, 1.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \frac{\sqrt{2}}{B\_m}\\ \mathbf{if}\;B\_m \leq 2 \cdot 10^{-159}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;B\_m \leq 1.05 \cdot 10^{-87}:\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \mathbf{elif}\;B\_m \leq 6.5 \cdot 10^{+115}:\\ \;\;\;\;t\_0 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{B\_m + C} \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 (/ (sqrt 2.0) B_m)))
   (if (<= B_m 2e-159)
     (sqrt (- (/ F A)))
     (if (<= B_m 1.05e-87)
       (sqrt (/ (- F) C))
       (if (<= B_m 6.5e+115)
         (* t_0 (- (sqrt (* F (+ C (hypot B_m C))))))
         (* t_0 (* (sqrt (+ B_m C)) (- (sqrt F)))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = sqrt(2.0) / B_m;
	double tmp;
	if (B_m <= 2e-159) {
		tmp = sqrt(-(F / A));
	} else if (B_m <= 1.05e-87) {
		tmp = sqrt((-F / C));
	} else if (B_m <= 6.5e+115) {
		tmp = t_0 * -sqrt((F * (C + hypot(B_m, C))));
	} else {
		tmp = t_0 * (sqrt((B_m + C)) * -sqrt(F));
	}
	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) / B_m;
	double tmp;
	if (B_m <= 2e-159) {
		tmp = Math.sqrt(-(F / A));
	} else if (B_m <= 1.05e-87) {
		tmp = Math.sqrt((-F / C));
	} else if (B_m <= 6.5e+115) {
		tmp = t_0 * -Math.sqrt((F * (C + Math.hypot(B_m, C))));
	} else {
		tmp = t_0 * (Math.sqrt((B_m + C)) * -Math.sqrt(F));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = math.sqrt(2.0) / B_m
	tmp = 0
	if B_m <= 2e-159:
		tmp = math.sqrt(-(F / A))
	elif B_m <= 1.05e-87:
		tmp = math.sqrt((-F / C))
	elif B_m <= 6.5e+115:
		tmp = t_0 * -math.sqrt((F * (C + math.hypot(B_m, C))))
	else:
		tmp = t_0 * (math.sqrt((B_m + C)) * -math.sqrt(F))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(sqrt(2.0) / B_m)
	tmp = 0.0
	if (B_m <= 2e-159)
		tmp = sqrt(Float64(-Float64(F / A)));
	elseif (B_m <= 1.05e-87)
		tmp = sqrt(Float64(Float64(-F) / C));
	elseif (B_m <= 6.5e+115)
		tmp = Float64(t_0 * Float64(-sqrt(Float64(F * Float64(C + hypot(B_m, C))))));
	else
		tmp = Float64(t_0 * Float64(sqrt(Float64(B_m + C)) * Float64(-sqrt(F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = sqrt(2.0) / B_m;
	tmp = 0.0;
	if (B_m <= 2e-159)
		tmp = sqrt(-(F / A));
	elseif (B_m <= 1.05e-87)
		tmp = sqrt((-F / C));
	elseif (B_m <= 6.5e+115)
		tmp = t_0 * -sqrt((F * (C + hypot(B_m, C))));
	else
		tmp = t_0 * (sqrt((B_m + C)) * -sqrt(F));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, If[LessEqual[B$95$m, 2e-159], N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision], If[LessEqual[B$95$m, 1.05e-87], N[Sqrt[N[((-F) / C), $MachinePrecision]], $MachinePrecision], If[LessEqual[B$95$m, 6.5e+115], N[(t$95$0 * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$0 * N[(N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

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

\mathbf{elif}\;B\_m \leq 1.05 \cdot 10^{-87}:\\
\;\;\;\;\sqrt{\frac{-F}{C}}\\

\mathbf{elif}\;B\_m \leq 6.5 \cdot 10^{+115}:\\
\;\;\;\;t\_0 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{B\_m + C} \cdot \left(-\sqrt{F}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 1.99999999999999998e-159

    1. Initial program 25.9%

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

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

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

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

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

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

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

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

    if 1.99999999999999998e-159 < B < 1.05000000000000004e-87

    1. Initial program 25.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. Simplified36.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-sqr-sqrt17.2%

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

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

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

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

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

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

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

    if 1.05000000000000004e-87 < B < 6.49999999999999966e115

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

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

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

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

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

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

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

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

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

    if 6.49999999999999966e115 < B

    1. Initial program 10.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 0 16.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 39.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 9.8 \cdot 10^{-160}:\\
\;\;\;\;\sqrt{-\frac{F}{A}}\\

\mathbf{elif}\;B\_m \leq 6.5 \cdot 10^{-88}:\\
\;\;\;\;\sqrt{\frac{-F}{C}}\\

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


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

    1. Initial program 25.9%

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

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

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

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

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

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

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

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

    if 9.7999999999999998e-160 < B < 6.50000000000000006e-88

    1. Initial program 25.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. Simplified36.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-sqr-sqrt17.2%

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

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

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

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

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

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

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

    if 6.50000000000000006e-88 < B

    1. Initial program 24.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 A around 0 30.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-neg30.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 42.8% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\ \;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-45}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{-B\_m}\\ \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 -1e-309)
   (/ (sqrt (- F)) (sqrt A))
   (if (<= F 2.2e-45)
     (/ (sqrt (* (* 2.0 F) (+ A (hypot B_m A)))) (- B_m))
     (* (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 <= -1e-309) {
		tmp = sqrt(-F) / sqrt(A);
	} else if (F <= 2.2e-45) {
		tmp = sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / -B_m;
	} else {
		tmp = sqrt((F / B_m)) * -sqrt(2.0);
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -1e-309) {
		tmp = Math.sqrt(-F) / Math.sqrt(A);
	} else if (F <= 2.2e-45) {
		tmp = Math.sqrt(((2.0 * F) * (A + Math.hypot(B_m, A)))) / -B_m;
	} 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 <= -1e-309:
		tmp = math.sqrt(-F) / math.sqrt(A)
	elif F <= 2.2e-45:
		tmp = math.sqrt(((2.0 * F) * (A + math.hypot(B_m, A)))) / -B_m
	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 <= -1e-309)
		tmp = Float64(sqrt(Float64(-F)) / sqrt(A));
	elseif (F <= 2.2e-45)
		tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A + hypot(B_m, A)))) / Float64(-B_m));
	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 <= -1e-309)
		tmp = sqrt(-F) / sqrt(A);
	elseif (F <= 2.2e-45)
		tmp = sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / -B_m;
	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, -1e-309], N[(N[Sqrt[(-F)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.2e-45], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $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 -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\

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

\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 < -1.000000000000002e-309

    1. Initial program 44.3%

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < F < 2.19999999999999993e-45

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.19999999999999993e-45 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 40.8% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-309}:\\ \;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-18}:\\ \;\;\;\;\left(-\frac{\sqrt{2}}{B\_m}\right) \cdot \sqrt{B\_m \cdot F}\\ \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 -1e-309)
   (/ (sqrt (- F)) (sqrt A))
   (if (<= F 4e-18)
     (* (- (/ (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 <= -1e-309) {
		tmp = sqrt(-F) / sqrt(A);
	} else if (F <= 4e-18) {
		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 <= (-1d-309)) then
        tmp = sqrt(-f) / sqrt(a)
    else if (f <= 4d-18) 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 <= -1e-309) {
		tmp = Math.sqrt(-F) / Math.sqrt(A);
	} else if (F <= 4e-18) {
		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 <= -1e-309:
		tmp = math.sqrt(-F) / math.sqrt(A)
	elif F <= 4e-18:
		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 <= -1e-309)
		tmp = Float64(sqrt(Float64(-F)) / sqrt(A));
	elseif (F <= 4e-18)
		tmp = Float64(Float64(-Float64(sqrt(2.0) / B_m)) * 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 <= -1e-309)
		tmp = sqrt(-F) / sqrt(A);
	elseif (F <= 4e-18)
		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, -1e-309], N[(N[Sqrt[(-F)], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-18], 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 -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\

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

\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 < -1.000000000000002e-309

    1. Initial program 44.3%

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < F < 4.0000000000000003e-18

    1. Initial program 21.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000003e-18 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 -1 \cdot 10^{-309}:\\ \;\;\;\;\frac{\sqrt{-F}}{\sqrt{A}}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-18}:\\ \;\;\;\;\left(-\frac{\sqrt{2}}{B}\right) \cdot \sqrt{B \cdot F}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 31.8% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 4.1 \cdot 10^{-160}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;B\_m \leq 8.2 \cdot 10^{-84}:\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \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 (<= B_m 4.1e-160)
   (sqrt (- (/ F A)))
   (if (<= B_m 8.2e-84)
     (sqrt (/ (- F) C))
     (* (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 (B_m <= 4.1e-160) {
		tmp = sqrt(-(F / A));
	} else if (B_m <= 8.2e-84) {
		tmp = sqrt((-F / C));
	} 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 (b_m <= 4.1d-160) then
        tmp = sqrt(-(f / a))
    else if (b_m <= 8.2d-84) then
        tmp = sqrt((-f / c))
    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 (B_m <= 4.1e-160) {
		tmp = Math.sqrt(-(F / A));
	} else if (B_m <= 8.2e-84) {
		tmp = Math.sqrt((-F / C));
	} 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 B_m <= 4.1e-160:
		tmp = math.sqrt(-(F / A))
	elif B_m <= 8.2e-84:
		tmp = math.sqrt((-F / C))
	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 (B_m <= 4.1e-160)
		tmp = sqrt(Float64(-Float64(F / A)));
	elseif (B_m <= 8.2e-84)
		tmp = sqrt(Float64(Float64(-F) / C));
	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 (B_m <= 4.1e-160)
		tmp = sqrt(-(F / A));
	elseif (B_m <= 8.2e-84)
		tmp = sqrt((-F / C));
	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[B$95$m, 4.1e-160], N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision], If[LessEqual[B$95$m, 8.2e-84], N[Sqrt[N[((-F) / C), $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}\;B\_m \leq 4.1 \cdot 10^{-160}:\\
\;\;\;\;\sqrt{-\frac{F}{A}}\\

\mathbf{elif}\;B\_m \leq 8.2 \cdot 10^{-84}:\\
\;\;\;\;\sqrt{\frac{-F}{C}}\\

\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 B < 4.10000000000000002e-160

    1. Initial program 25.9%

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

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

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

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

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

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

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

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

    if 4.10000000000000002e-160 < B < 8.2000000000000001e-84

    1. Initial program 25.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. Simplified36.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-sqr-sqrt17.2%

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

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

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

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

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

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

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

    if 8.2000000000000001e-84 < B

    1. Initial program 24.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 27.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-neg27.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 15.0% accurate, 5.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -6.5 \cdot 10^{-30} \lor \neg \left(C \leq 2.5 \cdot 10^{-299}\right) \land C \leq 2.5 \cdot 10^{-82}:\\ \;\;\;\;\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 -6.5e-30) (and (not (<= C 2.5e-299)) (<= C 2.5e-82)))
   (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 <= -6.5e-30) || (!(C <= 2.5e-299) && (C <= 2.5e-82))) {
		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 <= (-6.5d-30)) .or. (.not. (c <= 2.5d-299)) .and. (c <= 2.5d-82)) 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 <= -6.5e-30) || (!(C <= 2.5e-299) && (C <= 2.5e-82))) {
		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 <= -6.5e-30) or (not (C <= 2.5e-299) and (C <= 2.5e-82)):
		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 <= -6.5e-30) || (!(C <= 2.5e-299) && (C <= 2.5e-82)))
		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 <= -6.5e-30) || (~((C <= 2.5e-299)) && (C <= 2.5e-82)))
		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, -6.5e-30], And[N[Not[LessEqual[C, 2.5e-299]], $MachinePrecision], LessEqual[C, 2.5e-82]]], 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 -6.5 \cdot 10^{-30} \lor \neg \left(C \leq 2.5 \cdot 10^{-299}\right) \land C \leq 2.5 \cdot 10^{-82}:\\
\;\;\;\;\sqrt{\frac{-F}{C}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -6.5000000000000005e-30 or 2.49999999999999978e-299 < C < 2.4999999999999999e-82

    1. Initial program 21.0%

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

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

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

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

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

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

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

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

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

    if -6.5000000000000005e-30 < C < 2.49999999999999978e-299 or 2.4999999999999999e-82 < C

    1. Initial program 28.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -6.5 \cdot 10^{-30} \lor \neg \left(C \leq 2.5 \cdot 10^{-299}\right) \land C \leq 2.5 \cdot 10^{-82}:\\ \;\;\;\;\sqrt{\frac{-F}{C}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-\frac{F}{A}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 11.1% 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 25.4%

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

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

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

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

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

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

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

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

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

Alternative 17: 1.2% accurate, 6.2× speedup?

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

\\
\sqrt{\frac{F}{A}}
\end{array}
Derivation
  1. Initial program 25.4%

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

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

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

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

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

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

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

    \[\leadsto \sqrt{\color{blue}{-\frac{F}{A}}} \]
  9. Applied egg-rr1.3%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{F}{A}}} \]
  11. Simplified1.1%

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

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

Reproduce

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