ABCF->ab-angle a

Percentage Accurate: 19.5% → 53.9%
Time: 35.0s
Alternatives: 25
Speedup: 6.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 25 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.5% 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: 53.9% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t_5 \leq -5 \cdot 10^{-173}:\\
\;\;\;\;t_6\\

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

\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;t_6\\

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


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

    1. Initial program 9.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999979e124 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -5.0000000000000002e-173 or -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 81.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. Simplified91.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. pow1/291.0%

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

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

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

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

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

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

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

    if -5.0000000000000002e-173 < (/.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.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. Simplified7.6%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 45.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{-39}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot t_2}}{t_0}\\

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

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


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

    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. Simplified31.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. Taylor expanded in C around -inf 28.3%

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

    if 1.99999999999999985e-207 < (pow.f64 B 2) < 1.99999999999999986e-39

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

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in A around 0 27.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 \color{blue}{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
    5. Step-by-step derivation
      1. unpow227.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(C + \sqrt{\color{blue}{B \cdot B} + {C}^{2}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      2. unpow227.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(C + \sqrt{B \cdot B + \color{blue}{C \cdot C}}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \]
      3. hypot-def36.3%

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

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

    if 1.99999999999999986e-39 < (pow.f64 B 2) < 1e4

    1. Initial program 12.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. Simplified15.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e4 < (pow.f64 B 2)

    1. Initial program 18.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 52.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 24.8%

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

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

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

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

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

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

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

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

    if 9.99999999999999946e33 < (pow.f64 B 2)

    1. Initial program 18.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. Simplified21.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 46.8% accurate, 1.2× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. clear-num24.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999969e-65 < (pow.f64 B 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 49.2% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 24.8%

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

    if 9.99999999999999946e33 < (pow.f64 B 2)

    1. Initial program 18.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. Simplified21.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 45.5% accurate, 1.2× speedup?

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

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

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


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

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

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

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

    if 4.99999999999999969e-99 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 45.7% accurate, 1.2× speedup?

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

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


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

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

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

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

    if 4.99999999999999969e-99 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 45.7% accurate, 1.2× speedup?

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

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

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


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

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

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

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

    if 4.99999999999999969e-99 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 39.9% accurate, 1.9× speedup?

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

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

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

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

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


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

    1. Initial program 22.0%

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

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

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

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

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

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

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

    if 6.9999999999999999e-190 < B < 2.6999999999999999e-59

    1. Initial program 28.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. Simplified46.2%

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

    if 2.6999999999999999e-59 < B < 8e17

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8e17 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \sqrt{F}}\right) \]
    9. Taylor expanded in C around 0 59.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 simplification29.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 7 \cdot 10^{-190}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}}\\ \mathbf{elif}\;B \leq 2.7 \cdot 10^{-59}:\\ \;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right) \cdot \left(2 \cdot C\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 8 \cdot 10^{+17}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{{B}^{2}}{\frac{C}{F}}}\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F} \cdot \sqrt{B + C}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 40.7% accurate, 1.9× speedup?

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

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

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

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

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


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

    1. Initial program 22.0%

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

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

    if 1.90000000000000011e-189 < B < 2.2e-55

    1. Initial program 28.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. Simplified46.2%

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

    if 2.2e-55 < B < 1.15e17

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e17 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \sqrt{F}}\right) \]
    9. Taylor expanded in C around 0 59.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 simplification30.3%

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

Alternative 11: 39.4% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;B_m \leq 7.4 \cdot 10^{-61}:\\
\;\;\;\;\frac{1}{\frac{t_2}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot t_0\right)}}}\\

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

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


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

    1. Initial program 22.0%

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

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

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

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

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

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

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

    if 3.9999999999999998e-188 < B < 7.3999999999999999e-61

    1. Initial program 28.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. Step-by-step derivation
      1. clear-num28.3%

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

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

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

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

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

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

    if 7.3999999999999999e-61 < B < 1.3e18

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e18 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \sqrt{F}}\right) \]
    9. Taylor expanded in C around 0 59.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 simplification29.3%

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

Alternative 12: 39.3% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;B_m \leq 2.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot t_0\right)}}}\\

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

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


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

    1. Initial program 22.0%

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

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

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

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

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

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

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

    if 2.80000000000000011e-194 < B < 2.20000000000000009e-61

    1. Initial program 28.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. Step-by-step derivation
      1. clear-num28.3%

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

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

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

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

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

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

    if 2.20000000000000009e-61 < B < 2.4e19

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4e19 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{B} \cdot \left(-\color{blue}{\sqrt{C + \mathsf{hypot}\left(B, C\right)} \cdot \sqrt{F}}\right) \]
    9. Taylor expanded in C around 0 59.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 simplification29.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.8 \cdot 10^{-194}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}}\\ \mathbf{elif}\;B \leq 2.2 \cdot 10^{-61}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+19}:\\ \;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{{B}^{2}}{\frac{C}{F}}}\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F} \cdot \sqrt{B + C}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 40.6% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;B_m \leq 9.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot t_0\right)}}}\\

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


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

    1. Initial program 22.0%

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

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

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

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

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

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

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

    if 8.0000000000000004e-193 < B < 9.20000000000000078e-50

    1. Initial program 28.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. Step-by-step derivation
      1. clear-num28.3%

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

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

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

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

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

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

    if 9.20000000000000078e-50 < B

    1. Initial program 18.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. Simplified23.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 40.5% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;B_m \leq 2.8 \cdot 10^{-49}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot t_0\right)}}}\\

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


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

    1. Initial program 22.0%

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

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

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

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

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

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

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

    if 3.6e-194 < B < 2.79999999999999997e-49

    1. Initial program 28.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. Step-by-step derivation
      1. clear-num28.3%

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

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

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

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

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

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

    if 2.79999999999999997e-49 < B

    1. Initial program 18.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. Simplified23.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    10. Step-by-step derivation
      1. sqrt-div54.3%

        \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    11. Applied egg-rr54.3%

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

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

Alternative 15: 39.2% accurate, 2.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\


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

    1. Initial program 29.9%

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

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

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

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

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

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

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

    if -7.6e-293 < F < 1.95e32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def27.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)\right)} \]
      2. expm1-log1p27.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}\right)}{-1 \cdot B}} \]
      6. neg-mul-127.6%

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

        \[\leadsto \frac{-\left(-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}\right)}{\color{blue}{-B}} \]
      8. remove-double-neg27.6%

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

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

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

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

    if 1.95e32 < F

    1. Initial program 13.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\color{blue}{\frac{\frac{1}{F}}{C + \sqrt{{B}^{2} + {C}^{2}}}}}} \]
      3. +-commutative8.2%

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}}}} \]
    8. Simplified8.2%

      \[\leadsto \frac{1}{\color{blue}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{{C}^{2} + {B}^{2}}}}}} \]
    9. Taylor expanded in C around 0 21.8%

      \[\leadsto \frac{1}{-\color{blue}{\sqrt{\frac{B}{F}} \cdot \frac{1}{\sqrt{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/21.8%

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

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

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

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

Alternative 16: 38.8% accurate, 2.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\


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

    1. Initial program 29.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. Step-by-step derivation
      1. clear-num29.0%

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

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

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

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

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

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

    if -1.49999999999999992e-299 < F < 8.8000000000000009e34

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def27.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)\right)} \]
      2. expm1-log1p27.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}\right)}{-1 \cdot B}} \]
      6. neg-mul-127.9%

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

        \[\leadsto \frac{-\left(-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}\right)}{\color{blue}{-B}} \]
      8. remove-double-neg27.9%

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

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

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

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

    if 8.8000000000000009e34 < F

    1. Initial program 13.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\color{blue}{\frac{\frac{1}{F}}{C + \sqrt{{B}^{2} + {C}^{2}}}}}} \]
      3. +-commutative8.2%

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}}}} \]
    8. Simplified8.2%

      \[\leadsto \frac{1}{\color{blue}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{{C}^{2} + {B}^{2}}}}}} \]
    9. Taylor expanded in C around 0 21.8%

      \[\leadsto \frac{1}{-\color{blue}{\sqrt{\frac{B}{F}} \cdot \frac{1}{\sqrt{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/21.8%

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

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

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

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

Alternative 17: 36.3% accurate, 3.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.39999999999999987e34

    1. Initial program 26.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def21.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}\right)}{-1 \cdot B}} \]
      6. neg-mul-122.2%

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

        \[\leadsto \frac{-\left(-{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}\right)}{\color{blue}{-B}} \]
      8. remove-double-neg22.2%

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

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

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

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

    if 2.39999999999999987e34 < F

    1. Initial program 13.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\color{blue}{\frac{\frac{1}{F}}{C + \sqrt{{B}^{2} + {C}^{2}}}}}} \]
      3. +-commutative8.2%

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}}}} \]
    8. Simplified8.2%

      \[\leadsto \frac{1}{\color{blue}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{{C}^{2} + {B}^{2}}}}}} \]
    9. Taylor expanded in C around 0 21.8%

      \[\leadsto \frac{1}{-\color{blue}{\sqrt{\frac{B}{F}} \cdot \frac{1}{\sqrt{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/21.8%

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

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

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

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

Alternative 18: 33.8% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 8 \cdot 10^{-33}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(B_m + C\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\


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

    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. Simplified38.1%

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

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

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

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

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

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

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

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

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

    if 8.0000000000000004e-33 < F

    1. Initial program 13.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. Step-by-step derivation
      1. clear-num13.1%

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

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

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

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

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

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

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\color{blue}{\frac{\frac{1}{F}}{C + \sqrt{{B}^{2} + {C}^{2}}}}}} \]
      3. +-commutative7.5%

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}}}} \]
    8. Simplified7.5%

      \[\leadsto \frac{1}{\color{blue}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{{C}^{2} + {B}^{2}}}}}} \]
    9. Taylor expanded in C around 0 20.5%

      \[\leadsto \frac{1}{-\color{blue}{\sqrt{\frac{B}{F}} \cdot \frac{1}{\sqrt{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/20.5%

        \[\leadsto \frac{1}{-\color{blue}{\frac{\sqrt{\frac{B}{F}} \cdot 1}{\sqrt{2}}}} \]
      2. *-rgt-identity20.5%

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

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

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

Alternative 19: 33.8% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 10^{-32}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(B_m + C\right)}\right)}{B_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\


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

    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. Simplified38.1%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000006e-32 < F

    1. Initial program 13.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. Step-by-step derivation
      1. clear-num13.1%

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

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

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

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

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

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

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\color{blue}{\frac{\frac{1}{F}}{C + \sqrt{{B}^{2} + {C}^{2}}}}}} \]
      3. +-commutative7.5%

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}}}} \]
    8. Simplified7.5%

      \[\leadsto \frac{1}{\color{blue}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{{C}^{2} + {B}^{2}}}}}} \]
    9. Taylor expanded in C around 0 20.5%

      \[\leadsto \frac{1}{-\color{blue}{\sqrt{\frac{B}{F}} \cdot \frac{1}{\sqrt{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/20.5%

        \[\leadsto \frac{1}{-\color{blue}{\frac{\sqrt{\frac{B}{F}} \cdot 1}{\sqrt{2}}}} \]
      2. *-rgt-identity20.5%

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

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

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

Alternative 20: 34.2% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{B_m \cdot F}\right)\\

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


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

    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. Simplified38.1%

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

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

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

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

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

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

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

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

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

    if 4.40000000000000011e-33 < F

    1. Initial program 13.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. Simplified16.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    10. Step-by-step derivation
      1. sqrt-unprod20.1%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      2. pow1/220.3%

        \[\leadsto -\color{blue}{{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]
    11. Applied egg-rr20.3%

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

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

Alternative 21: 34.1% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 6 \cdot 10^{-33}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{B_m \cdot F}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\


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

    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. Simplified38.1%

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

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

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

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

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

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

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

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

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

    if 6.0000000000000003e-33 < F

    1. Initial program 13.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. Step-by-step derivation
      1. clear-num13.1%

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

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

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

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

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

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

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\color{blue}{\frac{\frac{1}{F}}{C + \sqrt{{B}^{2} + {C}^{2}}}}}} \]
      3. +-commutative7.5%

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}}}} \]
    8. Simplified7.5%

      \[\leadsto \frac{1}{\color{blue}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{{C}^{2} + {B}^{2}}}}}} \]
    9. Taylor expanded in C around 0 20.5%

      \[\leadsto \frac{1}{-\color{blue}{\sqrt{\frac{B}{F}} \cdot \frac{1}{\sqrt{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/20.5%

        \[\leadsto \frac{1}{-\color{blue}{\frac{\sqrt{\frac{B}{F}} \cdot 1}{\sqrt{2}}}} \]
      2. *-rgt-identity20.5%

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

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

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

Alternative 22: 34.1% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 5 \cdot 10^{-33}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{B_m \cdot F}\right)}{B_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\


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

    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. Simplified38.1%

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000028e-33 < F

    1. Initial program 13.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. Step-by-step derivation
      1. clear-num13.1%

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

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

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

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

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

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

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\color{blue}{\frac{\frac{1}{F}}{C + \sqrt{{B}^{2} + {C}^{2}}}}}} \]
      3. +-commutative7.5%

        \[\leadsto \frac{1}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}}}} \]
    8. Simplified7.5%

      \[\leadsto \frac{1}{\color{blue}{-\frac{B}{\sqrt{2}} \cdot \sqrt{\frac{\frac{1}{F}}{C + \sqrt{{C}^{2} + {B}^{2}}}}}} \]
    9. Taylor expanded in C around 0 20.5%

      \[\leadsto \frac{1}{-\color{blue}{\sqrt{\frac{B}{F}} \cdot \frac{1}{\sqrt{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/20.5%

        \[\leadsto \frac{1}{-\color{blue}{\frac{\sqrt{\frac{B}{F}} \cdot 1}{\sqrt{2}}}} \]
      2. *-rgt-identity20.5%

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

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

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

Alternative 23: 27.4% accurate, 5.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq 8.6 \cdot 10^{+145}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B_m}\right)}^{0.5}\\

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


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

    1. Initial program 23.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. Simplified26.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    10. Step-by-step derivation
      1. sqrt-unprod16.7%

        \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
      2. pow1/216.8%

        \[\leadsto -\color{blue}{{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]
    11. Applied egg-rr16.8%

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

    if 8.59999999999999996e145 < C

    1. Initial program 7.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 24: 26.9% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ -{\left(2 \cdot \frac{F}{B_m}\right)}^{0.5} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (- (pow (* 2.0 (/ F B_m)) 0.5)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return -pow((2.0 * (F / B_m)), 0.5);
}
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 = -((2.0d0 * (f / b_m)) ** 0.5d0)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return -Math.pow((2.0 * (F / B_m)), 0.5);
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return -math.pow((2.0 * (F / B_m)), 0.5)
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = -((2.0 * (F / B_m)) ^ 0.5);
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|

\\
-{\left(2 \cdot \frac{F}{B_m}\right)}^{0.5}
\end{array}
Derivation
  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. Simplified27.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  10. Step-by-step derivation
    1. sqrt-unprod14.9%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    2. pow1/215.0%

      \[\leadsto -\color{blue}{{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]
  11. Applied egg-rr15.0%

    \[\leadsto -\color{blue}{{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]
  12. Final simplification15.0%

    \[\leadsto -{\left(2 \cdot \frac{F}{B}\right)}^{0.5} \]
  13. Add Preprocessing

Alternative 25: 26.9% accurate, 6.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ -\sqrt{2 \cdot \frac{F}{B_m}} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (- (sqrt (* 2.0 (/ F B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return -sqrt((2.0 * (F / B_m)));
}
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((2.0d0 * (f / b_m)))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return -Math.sqrt((2.0 * (F / B_m)));
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return -math.sqrt((2.0 * (F / B_m)))
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(-sqrt(Float64(2.0 * Float64(F / B_m))))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = -sqrt((2.0 * (F / B_m)));
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|

\\
-\sqrt{2 \cdot \frac{F}{B_m}}
\end{array}
Derivation
  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. Simplified27.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  10. Step-by-step derivation
    1. sqrt-unprod14.9%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  11. Applied egg-rr14.9%

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

    \[\leadsto -\sqrt{2 \cdot \frac{F}{B}} \]
  13. Add Preprocessing

Reproduce

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